ALSA: hda: use last DAC defined for hp_pin
authorMatthew Ranostay <mranostay@embeddedalley.com>
Wed, 24 Sep 2008 01:46:30 +0000 (21:46 -0400)
committerJaroslav Kysela <perex@perex.cz>
Fri, 10 Oct 2008 11:41:27 +0000 (13:41 +0200)
Patch allows the last DAC in the dac_nids for the hp_nid if there is an
available one this isn't in use by a line_out entry or if hp_nid isn't already
defined. This solves the issues with the 'Headphone Playback' mixer
controls on the 92hd73xxx branch and possibly others.

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

index bd0d6f8ab4309eb775e842550b11a2fb80d6a674..6e0a18bca23bed25c6a7b52324282708fa1a01f4 100644 (file)
@@ -2817,6 +2817,10 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec,
                }
        }
 
+       if ((spec->multiout.num_dacs - cfg->line_outs) > 0 &&
+                       cfg->hp_outs && !spec->multiout.hp_nid)
+               spec->multiout.hp_nid = nid;
+
        if (cfg->hp_outs > 1) {
                err = stac92xx_add_control(spec,
                        STAC_CTL_WIDGET_HP_SWITCH,
@@ -4083,8 +4087,6 @@ again:
        case STAC_DELL_M6:
                spec->init = dell_eq_core_init;
                spec->num_smuxes = 0;
-               spec->multiout.hp_nid =
-                       spec->multiout.dac_nids[spec->multiout.num_dacs - 1];
                spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER];
                spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP];
                spec->num_amps = 1;