aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorLydia Wang <lydiawang@viatech.com.cn>2011-06-20 02:16:33 -0400
committerTakashi Iwai <tiwai@suse.de>2011-06-21 01:23:19 -0400
commitba31a60d0fd8a3976d44d32f2b82491c62646b2a (patch)
treec78c367167886abaca05cc7a8a08a31a9bb6c59b /sound/pci/hda
parent42467b32ce4f1ba933673b396f807110e3618ff5 (diff)
ALSA: VIA HDA: Mute/unmute mixer conncted to Headphone for VT1718S.
When switch HP independent mode, mute/unmute connctions of mixer which is connected to headphone for VT1718S. Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/patch_via.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index abee9ac15902..f1a80cd6afe4 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -745,12 +745,23 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol,
745 struct via_spec *spec = codec->spec; 745 struct via_spec *spec = codec->spec;
746 hda_nid_t nid = kcontrol->private_value; 746 hda_nid_t nid = kcontrol->private_value;
747 unsigned int pinsel = ucontrol->value.enumerated.item[0]; 747 unsigned int pinsel = ucontrol->value.enumerated.item[0];
748 unsigned int parm0, parm1;
748 /* Get Independent Mode index of headphone pin widget */ 749 /* Get Independent Mode index of headphone pin widget */
749 spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel 750 spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
750 ? 1 : 0; 751 ? 1 : 0;
751 if (spec->codec_type == VT1718S) 752 if (spec->codec_type == VT1718S) {
752 snd_hda_codec_write(codec, nid, 0, 753 snd_hda_codec_write(codec, nid, 0,
753 AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0); 754 AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0);
755 /* Set correct mute switch for MW3 */
756 parm0 = spec->hp_independent_mode ?
757 AMP_IN_UNMUTE(0) : AMP_IN_MUTE(0);
758 parm1 = spec->hp_independent_mode ?
759 AMP_IN_MUTE(1) : AMP_IN_UNMUTE(1);
760 snd_hda_codec_write(codec, 0x1b, 0,
761 AC_VERB_SET_AMP_GAIN_MUTE, parm0);
762 snd_hda_codec_write(codec, 0x1b, 0,
763 AC_VERB_SET_AMP_GAIN_MUTE, parm1);
764 }
754 else 765 else
755 snd_hda_codec_write(codec, nid, 0, 766 snd_hda_codec_write(codec, nid, 0,
756 AC_VERB_SET_CONNECT_SEL, pinsel); 767 AC_VERB_SET_CONNECT_SEL, pinsel);