Commit ba31a60d0fd8a3976d44d32f2b82491c62646b2a

Authored by Lydia Wang
Committed by Takashi Iwai
1 parent 42467b32ce

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>

Showing 1 changed file with 12 additions and 1 deletions Side-by-side Diff

sound/pci/hda/patch_via.c
... ... @@ -745,12 +745,23 @@
745 745 struct via_spec *spec = codec->spec;
746 746 hda_nid_t nid = kcontrol->private_value;
747 747 unsigned int pinsel = ucontrol->value.enumerated.item[0];
  748 + unsigned int parm0, parm1;
748 749 /* Get Independent Mode index of headphone pin widget */
749 750 spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
750 751 ? 1 : 0;
751   - if (spec->codec_type == VT1718S)
  752 + if (spec->codec_type == VT1718S) {
752 753 snd_hda_codec_write(codec, nid, 0,
753 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 765 else
755 766 snd_hda_codec_write(codec, nid, 0,
756 767 AC_VERB_SET_CONNECT_SEL, pinsel);