aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-04-24 06:23:53 -0400
committerJaroslav Kysela <perex@suse.cz>2007-05-11 10:56:09 -0400
commitbccad14e9a931027b72f20fe7caba68fea760e7b (patch)
treebb1ddba10ec0498ad9814369b684e119afa8492f /sound
parentbaba8ee9d12d17cac1042a5c816aef7d6610a6c3 (diff)
[ALSA] hda-intel - Fix detection of audio codec on Toshiba A100
Some boards have the audio codec on slot #3 while the modem codec on slot #0. The driver should continue to probe the slots when no audio codec is found. This fixes the problem of no device on Toshiba A100 (and some other ATI SB450 devices). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 5e478b917aa..d40951527f6 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -979,7 +979,7 @@ static unsigned int azx_max_codecs[] __devinitdata = {
979static int __devinit azx_codec_create(struct azx *chip, const char *model) 979static int __devinit azx_codec_create(struct azx *chip, const char *model)
980{ 980{
981 struct hda_bus_template bus_temp; 981 struct hda_bus_template bus_temp;
982 int c, codecs, err; 982 int c, codecs, audio_codecs, err;
983 983
984 memset(&bus_temp, 0, sizeof(bus_temp)); 984 memset(&bus_temp, 0, sizeof(bus_temp));
985 bus_temp.private_data = chip; 985 bus_temp.private_data = chip;
@@ -991,16 +991,19 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model)
991 if ((err = snd_hda_bus_new(chip->card, &bus_temp, &chip->bus)) < 0) 991 if ((err = snd_hda_bus_new(chip->card, &bus_temp, &chip->bus)) < 0)
992 return err; 992 return err;
993 993
994 codecs = 0; 994 codecs = audio_codecs = 0;
995 for (c = 0; c < AZX_MAX_CODECS; c++) { 995 for (c = 0; c < AZX_MAX_CODECS; c++) {
996 if ((chip->codec_mask & (1 << c)) & probe_mask) { 996 if ((chip->codec_mask & (1 << c)) & probe_mask) {
997 err = snd_hda_codec_new(chip->bus, c, NULL); 997 struct hda_codec *codec;
998 err = snd_hda_codec_new(chip->bus, c, &codec);
998 if (err < 0) 999 if (err < 0)
999 continue; 1000 continue;
1000 codecs++; 1001 codecs++;
1002 if (codec->afg)
1003 audio_codecs++;
1001 } 1004 }
1002 } 1005 }
1003 if (!codecs) { 1006 if (!audio_codecs) {
1004 /* probe additional slots if no codec is found */ 1007 /* probe additional slots if no codec is found */
1005 for (; c < azx_max_codecs[chip->driver_type]; c++) { 1008 for (; c < azx_max_codecs[chip->driver_type]; c++) {
1006 if ((chip->codec_mask & (1 << c)) & probe_mask) { 1009 if ((chip->codec_mask & (1 << c)) & probe_mask) {