ASoC: wm8994: Demux the microphone detection IRQ
authorNikesh Oswal <nikesh@opensource.wolfsonmicro.com>
Wed, 13 Aug 2014 09:05:45 +0000 (10:05 +0100)
committerMark Brown <broonie@linaro.org>
Sat, 16 Aug 2014 22:08:13 +0000 (17:08 -0500)
Current code only allows direct routing of the WM8994 microphone
detection signal to a GPIO this change adds support to demux the
interrupt from the main interrupt line of the codec.

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

index 6cc0566dc29a42653c96b571f07c0a02397cbb7e..1fcb9f3f309762d2793b59ccd094b26a55f84111 100644 (file)
@@ -4082,17 +4082,23 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
 
        switch (control->type) {
        case WM8994:
-               if (wm8994->micdet_irq) {
+               if (wm8994->micdet_irq)
                        ret = request_threaded_irq(wm8994->micdet_irq, NULL,
                                                   wm8994_mic_irq,
                                                   IRQF_TRIGGER_RISING,
                                                   "Mic1 detect",
                                                   wm8994);
-                       if (ret != 0)
-                               dev_warn(codec->dev,
-                                        "Failed to request Mic1 detect IRQ: %d\n",
-                                        ret);
-               }
+                else
+                       ret = wm8994_request_irq(wm8994->wm8994,
+                                       WM8994_IRQ_MIC1_DET,
+                                       wm8994_mic_irq, "Mic 1 detect",
+                                       wm8994);
+
+               if (ret != 0)
+                       dev_warn(codec->dev,
+                                "Failed to request Mic1 detect IRQ: %d\n",
+                                ret);
+
 
                ret = wm8994_request_irq(wm8994->wm8994,
                                         WM8994_IRQ_MIC1_SHRT,