diff options
author | Giuliano Pochini <pochini@shiny.it> | 2010-02-14 18:15:59 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-02-15 10:39:22 +0100 |
commit | ad3499f4668f684ef6e5d0222ae14d5e4ade1fdd (patch) | |
tree | 6c4599e78d3f29df5cd17b8d2006f69f006acea3 /sound/pci/echoaudio/layla24_dsp.c | |
parent | 4f8ada444cc7a7ea70cdc81f098b34c5f1f2df41 (diff) | |
download | blackbird-op-linux-ad3499f4668f684ef6e5d0222ae14d5e4ade1fdd.tar.gz blackbird-op-linux-ad3499f4668f684ef6e5d0222ae14d5e4ade1fdd.zip |
ALSA: Echoaudio - Add suspend support #1
Move the controls init code outside the init_hw() function because is must
not be called during resume.
This patch moves the code that initializes the card's controls with
default valued from the init_hw() function into a separated
set_mixer_defaults() function (one for each of the 16 supported
cards). This change is necessary because during resume we must
resurrect the hardware without losing the previous
settings. set_mixer_defaults() must be called only once when the
module is loaded.
Signed-off-by: Giuliano Pochini <pochini@shiny.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/echoaudio/layla24_dsp.c')
-rw-r--r-- | sound/pci/echoaudio/layla24_dsp.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/pci/echoaudio/layla24_dsp.c b/sound/pci/echoaudio/layla24_dsp.c index 12dc00adca9f..8c041647f285 100644 --- a/sound/pci/echoaudio/layla24_dsp.c +++ b/sound/pci/echoaudio/layla24_dsp.c @@ -61,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; @@ -72,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; |