Copyright Echo Digital Audio Corporation (c) 1998 - 2004 All rights reserved www.echoaudio.com
This file is part of Echo Digital Audio's generic driver library.
Echo Digital Audio's generic driver library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* 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. Once that load is complete, this function is called to see if the load was successful. If this load fails, it does not necessarily mean that the hardware is defective - the external box may be disconnected or turned off. This routine sometimes fails for Layla20; for Layla20, the loop runs
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;
}
/* 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; return 0;
}
/* 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.