aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-10-28 06:38:58 -0400
committerTakashi Iwai <tiwai@suse.de>2008-10-28 06:44:34 -0400
commit34c25350acfc792747e861d1e36874abf7e73255 (patch)
treef3def49e8a7b9c6bc38981f08429ecf473230a69 /sound/pci/hda/hda_intel.c
parent42dc2378b52bb6e155dd2e4fb4ca694785bf2c1d (diff)
ALSA: hda - Remove old codec-probe limitation
Removed the old workaround to avoid the non-existing codec slot. The current code should work without that workaround. If any, we can add a quirk table. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 7b0abf08a583..a13169cc95a2 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1191,21 +1191,12 @@ static unsigned int azx_max_codecs[AZX_NUM_DRIVERS] __devinitdata = {
1191 [AZX_DRIVER_TERA] = 1, 1191 [AZX_DRIVER_TERA] = 1,
1192}; 1192};
1193 1193
1194/* number of slots to probe as default
1195 * this can be different from azx_max_codecs[] -- e.g. some boards
1196 * report wrongly the non-existing 4th slot availability
1197 */
1198static unsigned int azx_default_codecs[AZX_NUM_DRIVERS] __devinitdata = {
1199 [AZX_DRIVER_ICH] = 3,
1200 [AZX_DRIVER_ATI] = 3,
1201};
1202
1203static int __devinit azx_codec_create(struct azx *chip, const char *model, 1194static int __devinit azx_codec_create(struct azx *chip, const char *model,
1204 unsigned int codec_probe_mask) 1195 unsigned int codec_probe_mask)
1205{ 1196{
1206 struct hda_bus_template bus_temp; 1197 struct hda_bus_template bus_temp;
1207 int c, codecs, audio_codecs, err; 1198 int c, codecs, err;
1208 int def_slots, max_slots; 1199 int max_slots;
1209 1200
1210 memset(&bus_temp, 0, sizeof(bus_temp)); 1201 memset(&bus_temp, 0, sizeof(bus_temp));
1211 bus_temp.private_data = chip; 1202 bus_temp.private_data = chip;
@@ -1225,33 +1216,17 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model,
1225 if (chip->driver_type == AZX_DRIVER_NVIDIA) 1216 if (chip->driver_type == AZX_DRIVER_NVIDIA)
1226 chip->bus->needs_damn_long_delay = 1; 1217 chip->bus->needs_damn_long_delay = 1;
1227 1218
1228 codecs = audio_codecs = 0; 1219 codecs = 0;
1229 max_slots = azx_max_codecs[chip->driver_type]; 1220 max_slots = azx_max_codecs[chip->driver_type];
1230 if (!max_slots) 1221 if (!max_slots)
1231 max_slots = AZX_MAX_CODECS; 1222 max_slots = AZX_MAX_CODECS;
1232 def_slots = azx_default_codecs[chip->driver_type]; 1223 for (c = 0; c < max_slots; c++) {
1233 if (!def_slots)
1234 def_slots = max_slots;
1235 for (c = 0; c < def_slots; c++) {
1236 if ((chip->codec_mask & (1 << c)) & codec_probe_mask) { 1224 if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
1237 struct hda_codec *codec; 1225 struct hda_codec *codec;
1238 err = snd_hda_codec_new(chip->bus, c, &codec); 1226 err = snd_hda_codec_new(chip->bus, c, &codec);
1239 if (err < 0) 1227 if (err < 0)
1240 continue; 1228 continue;
1241 codecs++; 1229 codecs++;
1242 if (codec->afg)
1243 audio_codecs++;
1244 }
1245 }
1246 if (!audio_codecs) {
1247 /* probe additional slots if no codec is found */
1248 for (; c < max_slots; c++) {
1249 if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
1250 err = snd_hda_codec_new(chip->bus, c, NULL);
1251 if (err < 0)
1252 continue;
1253 codecs++;
1254 }
1255 } 1230 }
1256 } 1231 }
1257 if (!codecs) { 1232 if (!codecs) {