diff options
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 1672cace1ae..2fa281cbef9 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -88,6 +88,8 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," | |||
88 | "{ATI, SB600}," | 88 | "{ATI, SB600}," |
89 | "{ATI, RS600}," | 89 | "{ATI, RS600}," |
90 | "{ATI, RS690}," | 90 | "{ATI, RS690}," |
91 | "{ATI, RS780}," | ||
92 | "{ATI, R600}," | ||
91 | "{VIA, VT8251}," | 93 | "{VIA, VT8251}," |
92 | "{VIA, VT8237A}," | 94 | "{VIA, VT8237A}," |
93 | "{SiS, SIS966}," | 95 | "{SiS, SIS966}," |
@@ -198,6 +200,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; | |||
198 | #define RIRB_INT_MASK 0x05 | 200 | #define RIRB_INT_MASK 0x05 |
199 | 201 | ||
200 | /* STATESTS int mask: SD2,SD1,SD0 */ | 202 | /* STATESTS int mask: SD2,SD1,SD0 */ |
203 | #define AZX_MAX_CODECS 3 | ||
201 | #define STATESTS_INT_MASK 0x07 | 204 | #define STATESTS_INT_MASK 0x07 |
202 | 205 | ||
203 | /* SD_CTL bits */ | 206 | /* SD_CTL bits */ |
@@ -978,7 +981,7 @@ static unsigned int azx_max_codecs[] __devinitdata = { | |||
978 | static int __devinit azx_codec_create(struct azx *chip, const char *model) | 981 | static int __devinit azx_codec_create(struct azx *chip, const char *model) |
979 | { | 982 | { |
980 | struct hda_bus_template bus_temp; | 983 | struct hda_bus_template bus_temp; |
981 | int c, codecs, err; | 984 | int c, codecs, audio_codecs, err; |
982 | 985 | ||
983 | memset(&bus_temp, 0, sizeof(bus_temp)); | 986 | memset(&bus_temp, 0, sizeof(bus_temp)); |
984 | bus_temp.private_data = chip; | 987 | bus_temp.private_data = chip; |
@@ -990,16 +993,30 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) | |||
990 | if ((err = snd_hda_bus_new(chip->card, &bus_temp, &chip->bus)) < 0) | 993 | if ((err = snd_hda_bus_new(chip->card, &bus_temp, &chip->bus)) < 0) |
991 | return err; | 994 | return err; |
992 | 995 | ||
993 | codecs = 0; | 996 | codecs = audio_codecs = 0; |
994 | for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) { | 997 | for (c = 0; c < AZX_MAX_CODECS; c++) { |
995 | if ((chip->codec_mask & (1 << c)) & probe_mask) { | 998 | if ((chip->codec_mask & (1 << c)) & probe_mask) { |
996 | err = snd_hda_codec_new(chip->bus, c, NULL); | 999 | struct hda_codec *codec; |
1000 | err = snd_hda_codec_new(chip->bus, c, &codec); | ||
997 | if (err < 0) | 1001 | if (err < 0) |
998 | continue; | 1002 | continue; |
999 | codecs++; | 1003 | codecs++; |
1004 | if (codec->afg) | ||
1005 | audio_codecs++; | ||
1000 | } | 1006 | } |
1001 | } | 1007 | } |
1002 | if (! codecs) { | 1008 | if (!audio_codecs) { |
1009 | /* probe additional slots if no codec is found */ | ||
1010 | for (; c < azx_max_codecs[chip->driver_type]; c++) { | ||
1011 | if ((chip->codec_mask & (1 << c)) & probe_mask) { | ||
1012 | err = snd_hda_codec_new(chip->bus, c, NULL); | ||
1013 | if (err < 0) | ||
1014 | continue; | ||
1015 | codecs++; | ||
1016 | } | ||
1017 | } | ||
1018 | } | ||
1019 | if (!codecs) { | ||
1003 | snd_printk(KERN_ERR SFX "no codecs initialized\n"); | 1020 | snd_printk(KERN_ERR SFX "no codecs initialized\n"); |
1004 | return -ENXIO; | 1021 | return -ENXIO; |
1005 | } | 1022 | } |
@@ -1518,7 +1535,7 @@ static int azx_dev_free(struct snd_device *device) | |||
1518 | /* | 1535 | /* |
1519 | * white/black-listing for position_fix | 1536 | * white/black-listing for position_fix |
1520 | */ | 1537 | */ |
1521 | static const struct snd_pci_quirk position_fix_list[] __devinitdata = { | 1538 | static struct snd_pci_quirk position_fix_list[] __devinitdata = { |
1522 | SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_NONE), | 1539 | SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_NONE), |
1523 | {} | 1540 | {} |
1524 | }; | 1541 | }; |
@@ -1758,6 +1775,8 @@ static struct pci_device_id azx_ids[] = { | |||
1758 | { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ | 1775 | { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ |
1759 | { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */ | 1776 | { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */ |
1760 | { 0x1002, 0x7919, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS690 HDMI */ | 1777 | { 0x1002, 0x7919, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS690 HDMI */ |
1778 | { 0x1002, 0x960c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS780 HDMI */ | ||
1779 | { 0x1002, 0xaa00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI R600 HDMI */ | ||
1761 | { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ | 1780 | { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ |
1762 | { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ | 1781 | { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ |
1763 | { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ | 1782 | { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ |