aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/echoaudio/layla24_dsp.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-03-16 07:50:49 +0100
committerTakashi Iwai <tiwai@suse.de>2010-03-16 07:50:49 +0100
commita9104f989916aac5d92bfa2c51915d5985fb2e6c (patch)
tree17bef4eac561e3ac90d98d68190978e686712b67 /sound/pci/echoaudio/layla24_dsp.c
parentMerge remote branch 'alsa/fixes' into fix/misc (diff)
parentsound: fix opti92x-ad1848 build (diff)
downloadlinux-dev-a9104f989916aac5d92bfa2c51915d5985fb2e6c.tar.xz
linux-dev-a9104f989916aac5d92bfa2c51915d5985fb2e6c.zip
Merge branch 'topic/misc' into fix/misc
Diffstat (limited to 'sound/pci/echoaudio/layla24_dsp.c')
-rw-r--r--sound/pci/echoaudio/layla24_dsp.c37
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);
static int set_input_clock(struct echoaudio *chip, u16 clock);
static int set_professional_spdif(struct echoaudio *chip, char prof);
static int set_digital_mode(struct echoaudio *chip, u8 mode);
-static int load_asic_generic(struct echoaudio *chip, u32 cmd,
- const struct firmware *asic);
+static int load_asic_generic(struct echoaudio *chip, u32 cmd, short asic);
static int check_asic_status(struct echoaudio *chip);
@@ -54,7 +53,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
chip->subdevice_id = subdevice_id;
chip->bad_board = TRUE;
chip->has_midi = TRUE;
- chip->dsp_code_to_load = &card_fw[FW_LAYLA24_DSP];
+ chip->dsp_code_to_load = FW_LAYLA24_DSP;
chip->input_clock_types =
ECHO_CLOCK_BIT_INTERNAL | ECHO_CLOCK_BIT_SPDIF |
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)
ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA |
ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL |
ECHOCAPS_HAS_DIGITAL_MODE_ADAT;
- chip->digital_mode = DIGITAL_MODE_SPDIF_RCA;
- chip->professional_spdif = FALSE;
- chip->digital_in_automute = TRUE;
if ((err = load_firmware(chip)) < 0)
return err;
@@ -73,17 +69,22 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
if ((err = init_line_levels(chip)) < 0)
return err;
- err = set_digital_mode(chip, DIGITAL_MODE_SPDIF_RCA);
- if (err < 0)
- return err;
- err = set_professional_spdif(chip, TRUE);
-
DE_INIT(("init_hw done\n"));
return err;
}
+static int set_mixer_defaults(struct echoaudio *chip)
+{
+ chip->digital_mode = DIGITAL_MODE_SPDIF_RCA;
+ chip->professional_spdif = FALSE;
+ chip->digital_in_automute = TRUE;
+ return init_line_levels(chip);
+}
+
+
+
static u32 detect_input_clocks(const struct echoaudio *chip)
{
u32 clocks_from_dsp, clock_bits;
@@ -123,18 +124,18 @@ static int load_asic(struct echoaudio *chip)
/* Load the ASIC for the PCI card */
err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA24_PCI_CARD_ASIC,
- &card_fw[FW_LAYLA24_1_ASIC]);
+ FW_LAYLA24_1_ASIC);
if (err < 0)
return err;
- chip->asic_code = &card_fw[FW_LAYLA24_2S_ASIC];
+ chip->asic_code = FW_LAYLA24_2S_ASIC;
/* Now give the new ASIC a little time to set up */
mdelay(10);
/* Do the external one */
err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA24_EXTERNAL_ASIC,
- &card_fw[FW_LAYLA24_2S_ASIC]);
+ FW_LAYLA24_2S_ASIC);
if (err < 0)
return FALSE;
@@ -299,7 +300,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
/* Depending on what digital mode you want, Layla24 needs different ASICs
loaded. This function checks the ASIC needed for the new mode and sees
if it matches the one already loaded. */
-static int switch_asic(struct echoaudio *chip, const struct firmware *asic)
+static int switch_asic(struct echoaudio *chip, short asic)
{
s8 *monitors;
@@ -335,7 +336,7 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
{
u32 control_reg;
int err, incompatible_clock;
- const struct firmware *asic;
+ short asic;
/* Set clock to "internal" if it's not compatible with the new mode */
incompatible_clock = FALSE;
@@ -344,12 +345,12 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
case DIGITAL_MODE_SPDIF_RCA:
if (chip->input_clock == ECHO_CLOCK_ADAT)
incompatible_clock = TRUE;
- asic = &card_fw[FW_LAYLA24_2S_ASIC];
+ asic = FW_LAYLA24_2S_ASIC;
break;
case DIGITAL_MODE_ADAT:
if (chip->input_clock == ECHO_CLOCK_SPDIF)
incompatible_clock = TRUE;
- asic = &card_fw[FW_LAYLA24_2A_ASIC];
+ asic = FW_LAYLA24_2A_ASIC;
break;
default:
DE_ACT(("Digital mode not supported: %d\n", mode));