/* These functions are common for Gina24, Layla24 and Mona cards */
/* ASIC status check - some cards have one or two ASICs that need to be loaded.Oncethatloadiscomplete,thisfunctioniscalledtoseeif theloadwassuccessful. Ifthisloadfails,itdoesnotnecessarilymeanthatthehardwareis
defective - the external box may be disconnected or turned off. */ staticint check_asic_status(struct echoaudio *chip)
{
u32 asic_status;
send_vector(chip, DSP_VC_TEST_ASIC);
/* The DSP will return a value to indicate whether or not the
ASIC is currently loaded */ if (read_dsp(chip, &asic_status) < 0) {
dev_err(chip->card->dev, "check_asic_status: failed on read_dsp\n");
chip->asic_loaded = false; return -EIO;
}
/* Most configuration of Gina24, Layla24, or Mona is accomplished by writing thecontrolregister.write_control_regsendsthenewcontrolregister
value to the DSP. */ staticint write_control_reg(struct echoaudio *chip, u32 value, char force)
{
__le32 reg_value;
/* Handle the digital input auto-mute */ if (chip->digital_in_automute)
value |= GML_DIGITAL_IN_AUTO_MUTE; else
value &= ~GML_DIGITAL_IN_AUTO_MUTE;
/* Write the control register */
reg_value = cpu_to_le32(value); if (reg_value != chip->comm_page->control_register || force) { if (wait_handshake(chip)) return -EIO;
chip->comm_page->control_register = reg_value;
clear_handshake(chip); return send_vector(chip, DSP_VC_WRITE_CONTROL_REG);
} return0;
}
/* Gina24, Layla24, and Mona support digital input auto-mute. If the digital inputauto-muteisenabled,theDSPwillonlyenablethedigitalinputsif thecardissyncingtoavalidclockontheADATorS/PDIFinputs. Iftheauto-muteisdisabled,thedigitalinputsareenabledregardlessof
what the input clock is set or what is connected. */ staticint set_input_auto_mute(struct echoaudio *chip, int automute)
{
dev_dbg(chip->card->dev, "set_input_auto_mute %d\n", automute);
chip->digital_in_automute = automute;
/* Re-set the input clock to the current value - indirectly causes
the auto-mute flag to be sent to the DSP */ return set_input_clock(chip, chip->input_clock);
}
/* If we successfully changed the digital mode from or to ADAT, thenmakesurealloutput,inputandmonitorlevelsare
updated by the DSP comm object. */ if (err >= 0 && previous_mode != mode &&
(previous_mode == DIGITAL_MODE_ADAT || mode == DIGITAL_MODE_ADAT)) {
spin_lock_irq(&chip->lock); for (o = 0; o < num_busses_out(chip); o++) for (i = 0; i < num_busses_in(chip); i++)
set_monitor_gain(chip, o, i,
chip->monitor_gain[o][i]);
#ifdef ECHOCARD_HAS_INPUT_GAIN for (i = 0; i < num_busses_in(chip); i++)
set_input_gain(chip, i, chip->input_gain[i]);
update_input_line_level(chip); #endif
for (o = 0; o < num_busses_out(chip); o++)
set_output_gain(chip, o, chip->output_gain[o]);
update_output_line_level(chip);
spin_unlock_irq(&chip->lock);
}
return err;
}
/* Set the S/PDIF output format */ staticint set_professional_spdif(struct echoaudio *chip, char prof)
{
u32 control_reg; int err;
/* Clear the current S/PDIF flags */
control_reg = le32_to_cpu(chip->comm_page->control_register);
control_reg &= GML_SPDIF_FORMAT_CLEAR_MASK;
/* Set the new S/PDIF flags depending on the mode */
control_reg |= GML_SPDIF_TWO_CHANNEL | GML_SPDIF_24_BIT |
GML_SPDIF_COPY_PERMIT; if (prof) { /* Professional mode */
control_reg |= GML_SPDIF_PRO_MODE;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.