diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-07-11 05:36:44 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-11 05:36:44 -0400 |
commit | 9499473463628a1af4be5aea1ad8d35d3fd341b0 (patch) | |
tree | ed321e5cd6719ab928410f8940d1fc3058629161 /sound | |
parent | 6e969d9155a4ee7bce800dfbee02099105ca5b97 (diff) |
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, | |||
1509 | hda_nid_t *pins, bool mute) | 1509 | hda_nid_t *pins, bool mute) |
1510 | { | 1510 | { |
1511 | int i; | 1511 | int i; |
1512 | for (i = 0; i < num_pins; i++) | 1512 | for (i = 0; i < num_pins; i++) { |
1513 | unsigned int parm = snd_hda_codec_read(codec, pins[i], 0, | ||
1514 | AC_VERB_GET_PIN_WIDGET_CONTROL, 0); | ||
1515 | if (parm & AC_PINCTL_IN_EN) | ||
1516 | continue; | ||
1517 | if (mute) | ||
1518 | parm &= ~AC_PINCTL_OUT_EN; | ||
1519 | else | ||
1520 | parm |= AC_PINCTL_OUT_EN; | ||
1513 | snd_hda_codec_write(codec, pins[i], 0, | 1521 | snd_hda_codec_write(codec, pins[i], 0, |
1514 | AC_VERB_SET_PIN_WIDGET_CONTROL, | 1522 | AC_VERB_SET_PIN_WIDGET_CONTROL, parm); |
1515 | mute ? 0 : PIN_OUT); | 1523 | } |
1516 | } | 1524 | } |
1517 | 1525 | ||
1518 | /* mute internal speaker if line-out is plugged */ | 1526 | /* mute internal speaker if line-out is plugged */ |