[ALSA] hda: stac9202 mixer fix
authorMatthew Ranostay <mranostay@embeddedalley.com>
Thu, 12 Jul 2007 13:17:34 +0000 (15:17 +0200)
committerJaroslav Kysela <perex@suse.cz>
Fri, 20 Jul 2007 09:11:51 +0000 (11:11 +0200)
Added support for line out controls for STAC9202 cards, and fixed issue
where master mixer control was being created twice for headphone and
speaker outs.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/pci/hda/patch_sigmatel.c

index 0dccba231e8b237843893c9a6de56e29f9137cbf..be53e9685bc0c52eacdc82257375ca5335db6bde 100644 (file)
@@ -334,8 +334,6 @@ static struct snd_kcontrol_new stac9200_mixer[] = {
 };
 
 static struct snd_kcontrol_new stac925x_mixer[] = {
-       HDA_CODEC_VOLUME("Master Playback Volume", 0xe, 0, HDA_OUTPUT),
-       HDA_CODEC_MUTE("Master Playback Switch", 0xe, 0, HDA_OUTPUT),
        {
                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
                .name = "Input Source",
@@ -1401,7 +1399,15 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
                        continue;
                add_spec_dacs(spec, nid);
        }
-
+       for (i = 0; i < cfg->line_outs; i++) {
+               nid = snd_hda_codec_read(codec, cfg->line_out_pins[i], 0,
+                                       AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
+               if (check_in_dac_nids(spec, nid))
+                       nid = 0;
+               if (! nid)
+                       continue;
+               add_spec_dacs(spec, nid);
+       }
        for (i = old_num_dacs; i < spec->multiout.num_dacs; i++) {
                static const char *pfxs[] = {
                        "Speaker", "External Speaker", "Speaker2",