Skip to content

Commit

Permalink
ALSA: HDA: Fix automute for Cirrus Logic 421x
Browse files Browse the repository at this point in the history
There was a bug in the automute logic causing speakers not to
mute when headphones were plugged in.

Cc: stable@kernel.org
Tested-by: Hsin-Yi Chen <hychen@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
David Henningsson authored and Takashi Iwai committed Jan 8, 2012
1 parent 40d03e6 commit 78e2a92
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,16 +922,14 @@ static void cs_automute(struct hda_codec *codec)

/* mute speakers if spdif or hp jack is plugged in */
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];
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
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);
}
AC_VERB_SET_PIN_WIDGET_CONTROL, pin_ctl);
}
if (spec->gpio_eapd_hp) {
unsigned int gpio = hp_present ?
Expand Down

0 comments on commit 78e2a92

Please sign in to comment.