diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-03-21 10:14:35 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-05-11 10:55:52 -0400 |
commit | 19a982b69442d39b3bb6e710677320182480576b (patch) | |
tree | 00e968d4e90dcb49ea3477badc2e1e01408742b9 /sound/pci | |
parent | 4505179c73197c39272e8e66a172ab788009e07e (diff) |
[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>
Diffstat (limited to 'sound/pci')
-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 517a8d7bf337..5e478b917aab 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 }; | |||
198 | #define RIRB_INT_MASK 0x05 | 198 | #define RIRB_INT_MASK 0x05 |
199 | 199 | ||
200 | /* STATESTS int mask: SD2,SD1,SD0 */ | 200 | /* STATESTS int mask: SD2,SD1,SD0 */ |
201 | #define AZX_MAX_CODECS 3 | ||
201 | #define STATESTS_INT_MASK 0x07 | 202 | #define STATESTS_INT_MASK 0x07 |
202 | 203 | ||
203 | /* SD_CTL bits */ | 204 | /* SD_CTL bits */ |
@@ -991,7 +992,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) | |||
991 | return err; | 992 | return err; |
992 | 993 | ||
993 | codecs = 0; | 994 | codecs = 0; |
994 | for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) { | 995 | for (c = 0; c < AZX_MAX_CODECS; c++) { |
995 | if ((chip->codec_mask & (1 << c)) & probe_mask) { | 996 | if ((chip->codec_mask & (1 << c)) & probe_mask) { |
996 | err = snd_hda_codec_new(chip->bus, c, NULL); | 997 | err = snd_hda_codec_new(chip->bus, c, NULL); |
997 | if (err < 0) | 998 | if (err < 0) |
@@ -999,7 +1000,18 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) | |||
999 | codecs++; | 1000 | codecs++; |
1000 | } | 1001 | } |
1001 | } | 1002 | } |
1002 | if (! codecs) { | 1003 | if (!codecs) { |
1004 | /* probe additional slots if no codec is found */ | ||
1005 | for (; c < azx_max_codecs[chip->driver_type]; c++) { | ||
1006 | if ((chip->codec_mask & (1 << c)) & probe_mask) { | ||
1007 | err = snd_hda_codec_new(chip->bus, c, NULL); | ||
1008 | if (err < 0) | ||
1009 | continue; | ||
1010 | codecs++; | ||
1011 | } | ||
1012 | } | ||
1013 | } | ||
1014 | if (!codecs) { | ||
1003 | snd_printk(KERN_ERR SFX "no codecs initialized\n"); | 1015 | snd_printk(KERN_ERR SFX "no codecs initialized\n"); |
1004 | return -ENXIO; | 1016 | return -ENXIO; |
1005 | } | 1017 | } |