[ALSA] hda-codec - Fix max_channels computation for STAC92xx codecs
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 Jan 2006 09:34:34 +0000 (10:34 +0100)
committerJaroslav Kysela <perex@suse.cz>
Wed, 1 Feb 2006 12:09:20 +0000 (13:09 +0100)
Modules: HDA Codec driver

Fix max_channels computation for STAC92xx codecs in the case only
HP pin without line-out pins is detected in the default pin config.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_sigmatel.c

index d5342d20bd81254f8ee6bba33b73cb36ce6a1452..f7892a5b775733fb18b89398e408f0fb3b591d23 100644 (file)
@@ -691,7 +691,13 @@ static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec, const struct aut
                                        AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
        }
 
-       spec->multiout.num_dacs = cfg->line_outs;
+       if (cfg->line_outs)
+               spec->multiout.num_dacs = cfg->line_outs;
+       else if (cfg->hp_pin) {
+               spec->multiout.dac_nids[0] = snd_hda_codec_read(codec, cfg->hp_pin, 0,
+                                       AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
+               spec->multiout.num_dacs = 1;
+       }
 
        return 0;
 }