From: David Henningsson <david.henningsson@canonical.com>
To: tiwai@suse.de, alsa-devel@alsa-project.org
Cc: stable@kernel.org,
David Henningsson <david.henningsson@canonical.com>,
tim.howe@cirrus.com
Subject: [PATCH 2/3] ALSA: HDA: Fix automute for Cirrus Logic 421x
Date: Mon, 2 Jan 2012 12:40:16 +0100 [thread overview]
Message-ID: <1325504417-7283-2-git-send-email-david.henningsson@canonical.com> (raw)
In-Reply-To: <1325504417-7283-1-git-send-email-david.henningsson@canonical.com>
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>
---
sound/pci/hda/patch_cirrus.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 9139558..bde3a94 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -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 ?
--
1.7.5.4
next prev parent reply other threads:[~2012-01-02 11:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-02 11:40 [PATCH 1/3] ALSA: HDA: Fix master control for Cirrus Logic 421X David Henningsson
2012-01-02 11:40 ` David Henningsson [this message]
2012-01-02 11:40 ` [PATCH 3/3] ALSA: HDA: Add support for Cirrus Logic 4213 David Henningsson
2012-01-08 8:59 ` [PATCH 1/3] ALSA: HDA: Fix master control for Cirrus Logic 421X Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1325504417-7283-2-git-send-email-david.henningsson@canonical.com \
--to=david.henningsson@canonical.com \
--cc=alsa-devel@alsa-project.org \
--cc=stable@kernel.org \
--cc=tim.howe@cirrus.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).