Commit ba31a60d authored by Lydia Wang's avatar Lydia Wang Committed by Takashi Iwai

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: default avatarLydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 42467b32
...@@ -745,12 +745,23 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol, ...@@ -745,12 +745,23 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol,
struct via_spec *spec = codec->spec; struct via_spec *spec = codec->spec;
hda_nid_t nid = kcontrol->private_value; hda_nid_t nid = kcontrol->private_value;
unsigned int pinsel = ucontrol->value.enumerated.item[0]; unsigned int pinsel = ucontrol->value.enumerated.item[0];
unsigned int parm0, parm1;
/* Get Independent Mode index of headphone pin widget */ /* Get Independent Mode index of headphone pin widget */
spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
? 1 : 0; ? 1 : 0;
if (spec->codec_type == VT1718S) if (spec->codec_type == VT1718S) {
snd_hda_codec_write(codec, nid, 0, snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0); AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0);
/* Set correct mute switch for MW3 */
parm0 = spec->hp_independent_mode ?
AMP_IN_UNMUTE(0) : AMP_IN_MUTE(0);
parm1 = spec->hp_independent_mode ?
AMP_IN_MUTE(1) : AMP_IN_UNMUTE(1);
snd_hda_codec_write(codec, 0x1b, 0,
AC_VERB_SET_AMP_GAIN_MUTE, parm0);
snd_hda_codec_write(codec, 0x1b, 0,
AC_VERB_SET_AMP_GAIN_MUTE, parm1);
}
else else
snd_hda_codec_write(codec, nid, 0, snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_CONNECT_SEL, pinsel); AC_VERB_SET_CONNECT_SEL, pinsel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment