diff options
Diffstat (limited to 'sound')
-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 | } |