diff options
Diffstat (limited to 'sound/pci/echoaudio/layla24_dsp.c')
-rw-r--r-- | sound/pci/echoaudio/layla24_dsp.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/sound/pci/echoaudio/layla24_dsp.c b/sound/pci/echoaudio/layla24_dsp.c index d61b5cbcccad..8c041647f285 100644 --- a/sound/pci/echoaudio/layla24_dsp.c +++ b/sound/pci/echoaudio/layla24_dsp.c | |||
@@ -32,8 +32,7 @@ static int write_control_reg(struct echoaudio *chip, u32 value, char force); | |||
32 | static int set_input_clock(struct echoaudio *chip, u16 clock); | 32 | static int set_input_clock(struct echoaudio *chip, u16 clock); |
33 | static int set_professional_spdif(struct echoaudio *chip, char prof); | 33 | static int set_professional_spdif(struct echoaudio *chip, char prof); |
34 | static int set_digital_mode(struct echoaudio *chip, u8 mode); | 34 | static int set_digital_mode(struct echoaudio *chip, u8 mode); |
35 | static int load_asic_generic(struct echoaudio *chip, u32 cmd, | 35 | static int load_asic_generic(struct echoaudio *chip, u32 cmd, short asic); |
36 | const struct firmware *asic); | ||
37 | static int check_asic_status(struct echoaudio *chip); | 36 | static int check_asic_status(struct echoaudio *chip); |
38 | 37 | ||
39 | 38 | ||
@@ -54,7 +53,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
54 | chip->subdevice_id = subdevice_id; | 53 | chip->subdevice_id = subdevice_id; |
55 | chip->bad_board = TRUE; | 54 | chip->bad_board = TRUE; |
56 | chip->has_midi = TRUE; | 55 | chip->has_midi = TRUE; |
57 | chip->dsp_code_to_load = &card_fw[FW_LAYLA24_DSP]; | 56 | chip->dsp_code_to_load = FW_LAYLA24_DSP; |
58 | chip->input_clock_types = | 57 | chip->input_clock_types = |
59 | ECHO_CLOCK_BIT_INTERNAL | ECHO_CLOCK_BIT_SPDIF | | 58 | ECHO_CLOCK_BIT_INTERNAL | ECHO_CLOCK_BIT_SPDIF | |
60 | ECHO_CLOCK_BIT_WORD | ECHO_CLOCK_BIT_ADAT; | 59 | ECHO_CLOCK_BIT_WORD | ECHO_CLOCK_BIT_ADAT; |
@@ -62,9 +61,6 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
62 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA | | 61 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA | |
63 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL | | 62 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL | |
64 | ECHOCAPS_HAS_DIGITAL_MODE_ADAT; | 63 | ECHOCAPS_HAS_DIGITAL_MODE_ADAT; |
65 | chip->digital_mode = DIGITAL_MODE_SPDIF_RCA; | ||
66 | chip->professional_spdif = FALSE; | ||
67 | chip->digital_in_automute = TRUE; | ||
68 | 64 | ||
69 | if ((err = load_firmware(chip)) < 0) | 65 | if ((err = load_firmware(chip)) < 0) |
70 | return err; | 66 | return err; |
@@ -73,17 +69,22 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
73 | if ((err = init_line_levels(chip)) < 0) | 69 | if ((err = init_line_levels(chip)) < 0) |
74 | return err; | 70 | return err; |
75 | 71 | ||
76 | err = set_digital_mode(chip, DIGITAL_MODE_SPDIF_RCA); | ||
77 | if (err < 0) | ||
78 | return err; | ||
79 | err = set_professional_spdif(chip, TRUE); | ||
80 | |||
81 | DE_INIT(("init_hw done\n")); | 72 | DE_INIT(("init_hw done\n")); |
82 | return err; | 73 | return err; |
83 | } | 74 | } |
84 | 75 | ||
85 | 76 | ||
86 | 77 | ||
78 | static int set_mixer_defaults(struct echoaudio *chip) | ||
79 | { | ||
80 | chip->digital_mode = DIGITAL_MODE_SPDIF_RCA; | ||
81 | chip->professional_spdif = FALSE; | ||
82 | chip->digital_in_automute = TRUE; | ||
83 | return init_line_levels(chip); | ||
84 | } | ||
85 | |||
86 | |||
87 | |||
87 | static u32 detect_input_clocks(const struct echoaudio *chip) | 88 | static u32 detect_input_clocks(const struct echoaudio *chip) |
88 | { | 89 | { |
89 | u32 clocks_from_dsp, clock_bits; | 90 | u32 clocks_from_dsp, clock_bits; |
@@ -123,18 +124,18 @@ static int load_asic(struct echoaudio *chip) | |||
123 | 124 | ||
124 | /* Load the ASIC for the PCI card */ | 125 | /* Load the ASIC for the PCI card */ |
125 | err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA24_PCI_CARD_ASIC, | 126 | err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA24_PCI_CARD_ASIC, |
126 | &card_fw[FW_LAYLA24_1_ASIC]); | 127 | FW_LAYLA24_1_ASIC); |
127 | if (err < 0) | 128 | if (err < 0) |
128 | return err; | 129 | return err; |
129 | 130 | ||
130 | chip->asic_code = &card_fw[FW_LAYLA24_2S_ASIC]; | 131 | chip->asic_code = FW_LAYLA24_2S_ASIC; |
131 | 132 | ||
132 | /* Now give the new ASIC a little time to set up */ | 133 | /* Now give the new ASIC a little time to set up */ |
133 | mdelay(10); | 134 | mdelay(10); |
134 | 135 | ||
135 | /* Do the external one */ | 136 | /* Do the external one */ |
136 | err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA24_EXTERNAL_ASIC, | 137 | err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA24_EXTERNAL_ASIC, |
137 | &card_fw[FW_LAYLA24_2S_ASIC]); | 138 | FW_LAYLA24_2S_ASIC); |
138 | if (err < 0) | 139 | if (err < 0) |
139 | return FALSE; | 140 | return FALSE; |
140 | 141 | ||
@@ -299,7 +300,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
299 | /* Depending on what digital mode you want, Layla24 needs different ASICs | 300 | /* Depending on what digital mode you want, Layla24 needs different ASICs |
300 | loaded. This function checks the ASIC needed for the new mode and sees | 301 | loaded. This function checks the ASIC needed for the new mode and sees |
301 | if it matches the one already loaded. */ | 302 | if it matches the one already loaded. */ |
302 | static int switch_asic(struct echoaudio *chip, const struct firmware *asic) | 303 | static int switch_asic(struct echoaudio *chip, short asic) |
303 | { | 304 | { |
304 | s8 *monitors; | 305 | s8 *monitors; |
305 | 306 | ||
@@ -335,7 +336,7 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
335 | { | 336 | { |
336 | u32 control_reg; | 337 | u32 control_reg; |
337 | int err, incompatible_clock; | 338 | int err, incompatible_clock; |
338 | const struct firmware *asic; | 339 | short asic; |
339 | 340 | ||
340 | /* Set clock to "internal" if it's not compatible with the new mode */ | 341 | /* Set clock to "internal" if it's not compatible with the new mode */ |
341 | incompatible_clock = FALSE; | 342 | incompatible_clock = FALSE; |
@@ -344,12 +345,12 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
344 | case DIGITAL_MODE_SPDIF_RCA: | 345 | case DIGITAL_MODE_SPDIF_RCA: |
345 | if (chip->input_clock == ECHO_CLOCK_ADAT) | 346 | if (chip->input_clock == ECHO_CLOCK_ADAT) |
346 | incompatible_clock = TRUE; | 347 | incompatible_clock = TRUE; |
347 | asic = &card_fw[FW_LAYLA24_2S_ASIC]; | 348 | asic = FW_LAYLA24_2S_ASIC; |
348 | break; | 349 | break; |
349 | case DIGITAL_MODE_ADAT: | 350 | case DIGITAL_MODE_ADAT: |
350 | if (chip->input_clock == ECHO_CLOCK_SPDIF) | 351 | if (chip->input_clock == ECHO_CLOCK_SPDIF) |
351 | incompatible_clock = TRUE; | 352 | incompatible_clock = TRUE; |
352 | asic = &card_fw[FW_LAYLA24_2A_ASIC]; | 353 | asic = FW_LAYLA24_2A_ASIC; |
353 | break; | 354 | break; |
354 | default: | 355 | default: |
355 | DE_ACT(("Digital mode not supported: %d\n", mode)); | 356 | DE_ACT(("Digital mode not supported: %d\n", mode)); |