[alsa-devel] [PATCH 1/2] ASoC: wm8994: fix the codec state machine
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@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;
return maybe EINVAL and needs to be checked
Signed-off-by: Vinod Koul vinod.koul@intel.com --- sound/soc/codecs/wm8994.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 43f82d2..cc3119d 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -384,6 +384,8 @@ static int wm8994_get_drc_enum(struct snd_kcontrol *kcontrol, struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); int drc = wm8994_get_drc(kcontrol->id.name);
+ if (drc < 0) + return drc; ucontrol->value.enumerated.item[0] = wm8994->drc_cfg[drc];
return 0; @@ -489,6 +491,8 @@ static int wm8994_get_retune_mobile_enum(struct snd_kcontrol *kcontrol, struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); int block = wm8994_get_retune_mobile_block(kcontrol->id.name);
+ if (block < 0) + return block; ucontrol->value.enumerated.item[0] = wm8994->retune_mobile_cfg[block];
return 0;
On Thu, May 30, 2013 at 09:52:11PM +0530, Vinod Koul wrote:
return maybe EINVAL and needs to be checked
This is already applied...
Please also remember to CC maintainers on patches
On Thu, May 30, 2013 at 09:52:10PM +0530, Vinod Koul wrote:
few places the mic_detecting is not updated correctly when state changes, causing jack detection to go wrong
This doesn't apply against current code.
@@ -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;
This doesn't look right, as the comment says the report there isn't a real report it's just a kick to the core. We only want to start looking for a mic if something changed to make that a good idea or on init.
participants (2)
-
Mark Brown
-
Vinod Koul