mfd: Acknowledge WM8994 IRQs before reporting
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 21 Jul 2011 09:09:24 +0000 (10:09 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 31 Jul 2011 21:28:27 +0000 (23:28 +0200)
This ensures we never have a window where we've handled an interrupt but
not told the hardware about it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/wm8994-irq.c

index 71c6e8f9aedb47af0fb1ab5d72a48bca872ad6ef..d682f7bd112cecf45519ceb178404c958c0f4747 100644 (file)
@@ -231,12 +231,6 @@ static irqreturn_t wm8994_irq_thread(int irq, void *data)
                status[i] &= ~wm8994->irq_masks_cur[i];
        }
 
-       /* Report */
-       for (i = 0; i < ARRAY_SIZE(wm8994_irqs); i++) {
-               if (status[wm8994_irqs[i].reg - 1] & wm8994_irqs[i].mask)
-                       handle_nested_irq(wm8994->irq_base + i);
-       }
-
        /* Ack any unmasked IRQs */
        for (i = 0; i < ARRAY_SIZE(status); i++) {
                if (status[i])
@@ -244,6 +238,12 @@ static irqreturn_t wm8994_irq_thread(int irq, void *data)
                                         status[i]);
        }
 
+       /* Report */
+       for (i = 0; i < ARRAY_SIZE(wm8994_irqs); i++) {
+               if (status[wm8994_irqs[i].reg - 1] & wm8994_irqs[i].mask)
+                       handle_nested_irq(wm8994->irq_base + i);
+       }
+
        return IRQ_HANDLED;
 }