diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-05-23 16:43:17 -0400 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2007-06-11 11:36:45 -0700 |
commit | e2e00b9892ecaa42030a13d06a72f0b0904745fb (patch) | |
tree | b25be39059b60460ef6fed110061a8940b3275b7 | |
parent | f7b901ae5dbcacf8808c98e5104e56567600918d (diff) | |
download | linux-stable-e2e00b9892ecaa42030a13d06a72f0b0904745fb.tar.gz linux-stable-e2e00b9892ecaa42030a13d06a72f0b0904745fb.tar.bz2 linux-stable-e2e00b9892ecaa42030a13d06a72f0b0904745fb.zip |
[PATCH] ALSA: hda-intel - Probe additional slots only if necessary
Probing the codec slots on ATI controller causes problems on some
devices like Acer laptops. On these devices, reading from codec
slot 3 results in the communication failure with the codec chip.
Meanwhile, some laptops (e.g. Gateway) have the codec connection
only on slot 3, and probing this slot is mandatory for them.
The patch improves the probing robustness. The additional slots
are now checked only when no codecs are found in the primary three
slots.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | sound/pci/hda/hda_intel.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 1672cace1ae7..cfa10ce1b056 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -198,6 +198,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; #define RIRB_INT_MASK 0x05 /* STATESTS int mask: SD2,SD1,SD0 */ +#define AZX_MAX_CODECS 3 #define STATESTS_INT_MASK 0x07 /* SD_CTL bits */ @@ -991,7 +992,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) return err; codecs = 0; - for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) { + for (c = 0; c < AZX_MAX_CODECS; c++) { if ((chip->codec_mask & (1 << c)) & probe_mask) { err = snd_hda_codec_new(chip->bus, c, NULL); if (err < 0) @@ -999,7 +1000,18 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) codecs++; } } - if (! codecs) { + if (!codecs) { + /* probe additional slots if no codec is found */ + for (; c < azx_max_codecs[chip->driver_type]; c++) { + if ((chip->codec_mask & (1 << c)) & probe_mask) { + err = snd_hda_codec_new(chip->bus, c, NULL); + if (err < 0) + continue; + codecs++; + } + } + } + if (!codecs) { snd_printk(KERN_ERR SFX "no codecs initialized\n"); return -ENXIO; } |