/* Map the DSP clock detect bits to the generic driver clock detect bits */
clocks_from_dsp = le32_to_cpu(chip->comm_page->status_clocks);
clock_bits = ECHO_CLOCK_BIT_INTERNAL;
if (clocks_from_dsp & GLDM_CLOCK_DETECT_BIT_SPDIF)
clock_bits |= ECHO_CLOCK_BIT_SPDIF;
if (clocks_from_dsp & GLDM_CLOCK_DETECT_BIT_WORD) { if (clocks_from_dsp & GLDM_CLOCK_DETECT_BIT_SUPER)
clock_bits |= ECHO_CLOCK_BIT_SUPER; else
clock_bits |= ECHO_CLOCK_BIT_WORD;
}
return clock_bits;
}
/* ASIC status check - some cards have one or two ASICs that need to be loaded.Oncethatloadiscomplete,thisfunctioniscalledtoseeif theloadwassuccessful. Ifthisloadfails,itdoesnotnecessarilymeanthatthehardwareis defective-theexternalboxmaybedisconnectedorturnedoff. ThisroutinesometimesfailsforLayla20;forLayla20,theloopruns
5 times and succeeds if it wins on three of the loops. */ staticint check_asic_status(struct echoaudio *chip)
{
u32 asic_status; int goodcnt, i;
chip->asic_loaded = false; for (i = goodcnt = 0; i < 5; i++) {
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"); return -EIO;
}
if (asic_status == ASIC_ALREADY_LOADED) { if (++goodcnt == 3) {
chip->asic_loaded = true; return0;
}
}
} return -EIO;
}
/* Layla20 has an ASIC in the external box */ staticint load_asic(struct echoaudio *chip)
{ int err;
/* Only set the clock for internal mode. Do not return failure,
simply treat it as a non-event. */ if (chip->input_clock != ECHO_CLOCK_INTERNAL) {
dev_warn(chip->card->dev, "Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n");
chip->comm_page->sample_rate = cpu_to_le32(rate);
chip->sample_rate = rate; return0;
}
/* Set input bus gain (one unit is 0.5dB !) */ staticint set_input_gain(struct echoaudio *chip, u16 input, int gain)
{ if (snd_BUG_ON(input >= num_busses_in(chip))) return -EINVAL;
/* Tell the DSP to reread the flags from the comm page */ staticint update_flags(struct echoaudio *chip)
{ if (wait_handshake(chip)) return -EIO;
clear_handshake(chip); return send_vector(chip, DSP_VC_UPDATE_FLAGS);
}
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.