33 static int set_professional_spdif(
struct echoaudio *
chip,
char prof);
43 DE_INIT((
"init_hw() - Layla20\n"));
47 if ((err = init_dsp_comm_page(chip))) {
48 DE_INIT((
"init_hw - could not initialize DSP comm page\n"));
63 if ((err = load_firmware(chip)) < 0)
73 static int set_mixer_defaults(
struct echoaudio *chip)
76 return init_line_levels(chip);
81 static u32 detect_input_clocks(
const struct echoaudio *chip)
83 u32 clocks_from_dsp, clock_bits;
112 static int check_asic_status(
struct echoaudio *chip)
118 for (i = goodcnt = 0; i < 5; i++) {
123 if (read_dsp(chip, &asic_status) < 0) {
124 DE_ACT((
"check_asic_status: failed on read_dsp\n"));
129 if (++goodcnt == 3) {
141 static int load_asic(
struct echoaudio *chip)
154 return check_asic_status(chip);
167 DE_ACT((
"set_sample_rate: Cannot set sample rate - "
168 "clock not set to CLK_CLOCKININTERNAL\n"));
174 if (wait_handshake(chip))
177 DE_ACT((
"set_sample_rate(%d)\n", rate));
180 clear_handshake(chip);
186 static int set_input_clock(
struct echoaudio *chip,
u16 clock_source)
191 DE_ACT((
"set_input_clock:\n"));
193 switch (clock_source) {
195 DE_ACT((
"Set Layla20 clock to INTERNAL\n"));
200 DE_ACT((
"Set Layla20 clock to SPDIF\n"));
204 DE_ACT((
"Set Layla20 clock to WORD\n"));
208 DE_ACT((
"Set Layla20 clock to SUPER\n"));
212 DE_ACT((
"Input clock 0x%x not supported for Layla24\n",
219 clear_handshake(chip);
223 set_sample_rate(chip, rate);
230 static int set_output_clock(
struct echoaudio *chip,
u16 clock)
232 DE_ACT((
"set_output_clock: %d\n", clock));
241 DE_ACT((
"set_output_clock wrong clock\n"));
245 if (wait_handshake(chip))
250 clear_handshake(chip);
262 if (wait_handshake(chip))
274 static int update_flags(
struct echoaudio *chip)
276 if (wait_handshake(chip))
278 clear_handshake(chip);
284 static int set_professional_spdif(
struct echoaudio *chip,
char prof)
286 DE_ACT((
"set_professional_spdif %d\n", prof));
294 return update_flags(chip);