diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-07-11 11:36:44 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-11 11:36:44 +0200 |
commit | 9499473463628a1af4be5aea1ad8d35d3fd341b0 (patch) | |
tree | ed321e5cd6719ab928410f8940d1fc3058629161 /sound | |
parent | 6e969d9155a4ee7bce800dfbee02099105ca5b97 (diff) | |
download | blackbird-op-linux-9499473463628a1af4be5aea1ad8d35d3fd341b0.tar.gz blackbird-op-linux-9499473463628a1af4be5aea1ad8d35d3fd341b0.zip |
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_via.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 27de53fb331e..77df2bedfb81 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -1509,10 +1509,18 @@ static void toggle_output_mutes(struct hda_codec *codec, int num_pins, hda_nid_t *pins, bool mute) { 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, - AC_VERB_SET_PIN_WIDGET_CONTROL, - mute ? 0 : PIN_OUT); + AC_VERB_SET_PIN_WIDGET_CONTROL, parm); + } } /* mute internal speaker if line-out is plugged */ |