33 static int set_professional_spdif(
struct echoaudio *
chip,
char prof);
43 DE_INIT((
"init_hw() - Layla24\n"));
47 if ((err = init_dsp_comm_page(chip))) {
48 DE_INIT((
"init_hw - could not initialize DSP comm page\n"));
65 if ((err = load_firmware(chip)) < 0)
69 if ((err = init_line_levels(chip)) < 0)
78 static int set_mixer_defaults(
struct echoaudio *chip)
83 return init_line_levels(chip);
88 static u32 detect_input_clocks(
const struct echoaudio *chip)
90 u32 clocks_from_dsp, clock_bits;
113 static int load_asic(
struct echoaudio *chip)
146 err = check_asic_status(chip);
154 DE_INIT((
"load_asic() done\n"));
170 DE_ACT((
"set_sample_rate: Cannot set sample rate - "
171 "clock not set to CLK_CLOCKININTERNAL\n"));
221 base_rate = rate >> 1;
227 if (base_rate < 25000)
230 if (wait_handshake(chip))
236 clear_handshake(chip);
237 send_vector(chip, DSP_VC_SET_LAYLA24_FREQUENCY_REG);
240 control_reg |=
clock;
244 DE_ACT((
"set_sample_rate: %d clock %d\n", rate, control_reg));
246 return write_control_reg(chip, control_reg,
FALSE);
251 static int set_input_clock(
struct echoaudio *chip,
u16 clock)
253 u32 control_reg, clocks_from_dsp;
263 DE_ACT((
"Set Layla24 clock to INTERNAL\n"));
272 DE_ACT((
"Set Layla24 clock to SPDIF\n"));
280 DE_ACT((
"Set Layla24 clock to WORD\n"));
287 DE_ACT((
"Set Layla24 clock to ADAT\n"));
290 DE_ACT((
"Input clock 0x%x not supported for Layla24\n", clock));
295 return write_control_reg(chip, control_reg,
TRUE);
338 int err, incompatible_clock;
342 incompatible_clock =
FALSE;
347 incompatible_clock =
TRUE;
352 incompatible_clock =
TRUE;
356 DE_ACT((
"Digital mode not supported: %d\n", mode));
360 if (incompatible_clock) {
362 spin_lock_irq(&chip->
lock);
364 spin_unlock_irq(&chip->
lock);
368 if (switch_asic(chip, asic) < 0)
371 spin_lock_irq(&chip->
lock);
390 err = write_control_reg(chip, control_reg,
TRUE);
391 spin_unlock_irq(&chip->
lock);
396 DE_ACT((
"set_digital_mode to %d\n", mode));
397 return incompatible_clock;