Commit 78e2a928 authored by David Henningsson's avatar David Henningsson Committed by Takashi Iwai

ALSA: HDA: Fix automute for Cirrus Logic 421x

There was a bug in the automute logic causing speakers not to
mute when headphones were plugged in.

Cc: stable@kernel.org
Tested-by: default avatarHsin-Yi Chen <hychen@canonical.com>
Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 40d03e63
...@@ -922,16 +922,14 @@ static void cs_automute(struct hda_codec *codec) ...@@ -922,16 +922,14 @@ static void cs_automute(struct hda_codec *codec)
/* mute speakers if spdif or hp jack is plugged in */ /* mute speakers if spdif or hp jack is plugged in */
for (i = 0; i < cfg->speaker_outs; i++) { for (i = 0; i < cfg->speaker_outs; i++) {
int pin_ctl = hp_present ? 0 : PIN_OUT;
/* detect on spdif is specific to CS421x */
if (spdif_present && (spec->vendor_nid == CS421X_VENDOR_NID))
pin_ctl = 0;
nid = cfg->speaker_pins[i]; nid = cfg->speaker_pins[i];
snd_hda_codec_write(codec, nid, 0, snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, AC_VERB_SET_PIN_WIDGET_CONTROL, pin_ctl);
hp_present ? 0 : PIN_OUT);
/* detect on spdif is specific to CS421x */
if (spec->vendor_nid == CS421X_VENDOR_NID) {
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
spdif_present ? 0 : PIN_OUT);
}
} }
if (spec->gpio_eapd_hp) { if (spec->gpio_eapd_hp) {
unsigned int gpio = hp_present ? unsigned int gpio = hp_present ?
......
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