ASoC: wm8994: Fix reporting of accessory removal on WM8958
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 28 May 2013 11:52:08 +0000 (12:52 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 28 May 2013 14:22:36 +0000 (10:22 -0400)
During recent refactoring the code to report removal when MICDET reports
an absent microphone was removed, causing problems for systems which rely
solely on the MICDET for this functionality. Restore it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8994.c

index 62dc305..b38382c 100644 (file)
@@ -3833,6 +3833,11 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
                        dev_dbg(codec->dev, "Ignoring removed jack\n");
                        return IRQ_HANDLED;
                }
+       } else if (!(reg & WM8958_MICD_STS)) {
+               snd_soc_jack_report(wm8994->micdet[0].jack, 0,
+                                   SND_JACK_MECHANICAL | SND_JACK_HEADSET |
+                                   wm8994->btn_mask);
+               goto out;
        }
 
        if (wm8994->mic_detecting)