34 static int set_professional_spdif(
struct echoaudio *
chip,
char prof);
44 DE_INIT((
"init_hw() - Mona\n"));
48 if ((err = init_dsp_comm_page(chip))) {
49 DE_INIT((
"init_hw - could not initialize DSP comm page\n"));
70 if ((err = load_firmware(chip)) < 0)
80 static int set_mixer_defaults(
struct echoaudio *chip)
85 return init_line_levels(chip);
90 static u32 detect_input_clocks(
const struct echoaudio *chip)
92 u32 clocks_from_dsp, clock_bits;
116 static int load_asic(
struct echoaudio *chip)
146 err = check_asic_status(chip);
152 err = write_control_reg(chip, control_reg,
TRUE);
163 static int switch_asic(
struct echoaudio *chip,
char double_speed)
205 DE_ACT((
"set_sample_rate: Cannot set sample rate - "
206 "clock not set to CLK_CLOCKININTERNAL\n"));
232 spin_unlock_irq(&chip->
lock);
235 spin_lock_irq(&chip->
lock);
282 DE_ACT((
"set_sample_rate: %d invalid!\n", rate));
286 control_reg |=
clock;
290 DE_ACT((
"set_sample_rate: %d clock %d\n", rate, clock));
292 return write_control_reg(chip, control_reg, force_write);
297 static int set_input_clock(
struct echoaudio *chip,
u16 clock)
299 u32 control_reg, clocks_from_dsp;
302 DE_ACT((
"set_input_clock:\n"));
315 DE_ACT((
"Set Mona clock to INTERNAL\n"));
321 spin_unlock_irq(&chip->
lock);
322 err = switch_asic(chip, clocks_from_dsp &
324 spin_lock_irq(&chip->
lock);
327 DE_ACT((
"Set Mona clock to SPDIF\n"));
335 DE_ACT((
"Set Mona clock to WORD\n"));
336 spin_unlock_irq(&chip->
lock);
337 err = switch_asic(chip, clocks_from_dsp &
339 spin_lock_irq(&chip->
lock);
349 DE_ACT((
"Set Mona clock to ADAT\n"));
356 DE_ACT((
"Input clock 0x%x not supported for Mona\n", clock));
361 return write_control_reg(chip, control_reg,
TRUE);
369 int err, incompatible_clock;
372 incompatible_clock =
FALSE;
377 incompatible_clock =
TRUE;
381 incompatible_clock =
TRUE;
384 DE_ACT((
"Digital mode not supported: %d\n", mode));
388 spin_lock_irq(&chip->
lock);
390 if (incompatible_clock) {
412 set_sample_rate(chip, 48000);
419 err = write_control_reg(chip, control_reg,
FALSE);
420 spin_unlock_irq(&chip->
lock);
425 DE_ACT((
"set_digital_mode to %d\n", mode));
426 return incompatible_clock;