]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.6/0005-ALSA-hda-Fix-calling-cs_automic-twice-for-Cirrus-cod.patch
linux-ti335x-psp 3.2: update to v3.2.11
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.6 / 0005-ALSA-hda-Fix-calling-cs_automic-twice-for-Cirrus-cod.patch
1 From 8857f50ec84c8206c56754e7440064b3e382df23 Mon Sep 17 00:00:00 2001
2 From: Dylan Reid <dgreid@chromium.org>
3 Date: Tue, 31 Jan 2012 13:04:41 -0800
4 Subject: [PATCH 05/87] ALSA: hda - Fix calling cs_automic twice for Cirrus
5  codecs.
7 commit f70eecde3bca92630d3886496e73316ff353f185 upstream.
9 If cs_automic is called twice (like it is during init) while the mic
10 is present, it will over-write the last_input with the new one,
11 causing it to switch back to the automic input when the mic is
12 unplugged. This leaves the driver in a state (cur_input, last_input,
13 and automix_idx the same) where the internal mic can not be selected
14 until it is rebooted without the mic attached.
16 Check that the mic hasn't already been switched to before setting
17 last_input.
19 Signed-off-by: Dylan Reid <dgreid@chromium.org>
20 Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23  sound/pci/hda/patch_cirrus.c |    6 ++++--
24  1 file changed, 4 insertions(+), 2 deletions(-)
26 diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
27 index 5b0a9bb..ec0518e 100644
28 --- a/sound/pci/hda/patch_cirrus.c
29 +++ b/sound/pci/hda/patch_cirrus.c
30 @@ -976,8 +976,10 @@ static void cs_automic(struct hda_codec *codec)
31         /* specific to CS421x, single ADC */
32         if (spec->vendor_nid == CS421X_VENDOR_NID) {
33                 if (present) {
34 -                       spec->last_input = spec->cur_input;
35 -                       spec->cur_input = spec->automic_idx;
36 +                       if (spec->cur_input != spec->automic_idx) {
37 +                               spec->last_input = spec->cur_input;
38 +                               spec->cur_input = spec->automic_idx;
39 +                       }
40                 } else  {
41                         spec->cur_input = spec->last_input;
42                 }
43 -- 
44 1.7.9.4