[alsa-devel] [PATCH 1/2] ASoC: wm8994: fix the codec state machine

Vinod Koul vinod.koul at intel.com
Thu May 30 18:22:10 CEST 2013


few places the mic_detecting is not updated correctly when state changes,
causing jack detection to go wrong

Signed-off-by: Vinod Koul <vinod.koul at intel.com>
---
 sound/soc/codecs/wm8994.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 49b2b00..43f82d2 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3547,6 +3547,7 @@ static void wm8958_mic_id(void *data, u16 status)
 		snd_soc_jack_report(wm8994->micdet[0].jack, 0,
 				    wm8994->btn_mask |
 				    SND_JACK_HEADSET);
+		wm8994->mic_detecting = true;
 		return;
 	}
 
@@ -3672,7 +3673,7 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
 		snd_soc_update_bits(codec, WM1811_JACKDET_CTRL,
 				    WM1811_JACKDET_DB, WM1811_JACKDET_DB);
 
-		wm8994->mic_detecting = false;
+		wm8994->mic_detecting = true;
 		wm8994->jack_mic = false;
 		snd_soc_update_bits(codec, WM8958_MIC_DETECT_1,
 				    WM8958_MICD_ENA, 0);
@@ -3696,6 +3697,7 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
 	/* Since we only report deltas force an update, ensures we
 	 * avoid bootstrapping issues with the core. */
 	snd_soc_jack_report(wm8994->micdet[0].jack, 0, 0);
+	wm8994->mic_detecting = true;
 
 	pm_runtime_put(codec->dev);
 	return IRQ_HANDLED;
-- 
1.7.0.4



More information about the Alsa-devel mailing list