Commit 94994734 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Preserve input pin-ctl bits in HP-automute for VIA codec

For smart51 pins, we need to preserve the input pin-control bits at
auto-mute controls instead of overwriting zero or pin-out-only.
Otherwise the VREF won't be set properly when smart51 is disabled
again.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6e969d91
...@@ -1509,10 +1509,18 @@ static void toggle_output_mutes(struct hda_codec *codec, int num_pins, ...@@ -1509,10 +1509,18 @@ static void toggle_output_mutes(struct hda_codec *codec, int num_pins,
hda_nid_t *pins, bool mute) hda_nid_t *pins, bool mute)
{ {
int i; int i;
for (i = 0; i < num_pins; i++) for (i = 0; i < num_pins; i++) {
unsigned int parm = snd_hda_codec_read(codec, pins[i], 0,
AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
if (parm & AC_PINCTL_IN_EN)
continue;
if (mute)
parm &= ~AC_PINCTL_OUT_EN;
else
parm |= AC_PINCTL_OUT_EN;
snd_hda_codec_write(codec, pins[i], 0, snd_hda_codec_write(codec, pins[i], 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, AC_VERB_SET_PIN_WIDGET_CONTROL, parm);
mute ? 0 : PIN_OUT); }
} }
/* mute internal speaker if line-out is plugged */ /* mute internal speaker if line-out is plugged */
......
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