aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2012-01-31 16:04:41 -0500
committerTakashi Iwai <tiwai@suse.de>2012-02-01 03:43:46 -0500
commitf70eecde3bca92630d3886496e73316ff353f185 (patch)
tree3b2a1574c8951eba1b8ece7cb277b1db19200778 /sound
parentea51e5040e24eefe44d70bc654a237ca1f0225b0 (diff)
ALSA: hda - Fix calling cs_automic twice for Cirrus codecs.
If cs_automic is called twice (like it is during init) while the mic is present, it will over-write the last_input with the new one, causing it to switch back to the automic input when the mic is unplugged. This leaves the driver in a state (cur_input, last_input, and automix_idx the same) where the internal mic can not be selected until it is rebooted without the mic attached. Check that the mic hasn't already been switched to before setting last_input. Signed-off-by: Dylan Reid <dgreid@chromium.org> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_cirrus.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 0e99357e822c..bc5a993d1146 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -988,8 +988,10 @@ static void cs_automic(struct hda_codec *codec)
988 change_cur_input(codec, !spec->automic_idx, 0); 988 change_cur_input(codec, !spec->automic_idx, 0);
989 } else { 989 } else {
990 if (present) { 990 if (present) {
991 spec->last_input = spec->cur_input; 991 if (spec->cur_input != spec->automic_idx) {
992 spec->cur_input = spec->automic_idx; 992 spec->last_input = spec->cur_input;
993 spec->cur_input = spec->automic_idx;
994 }
993 } else { 995 } else {
994 spec->cur_input = spec->last_input; 996 spec->cur_input = spec->last_input;
995 } 997 }