mfd: Apply irq_mask_cur before handling max77686 interrupts
authorYadwinder Singh Brar <yadi.brar01@gmail.com>
Thu, 5 Jul 2012 03:58:21 +0000 (09:28 +0530)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 9 Jul 2012 13:13:42 +0000 (15:13 +0200)
According to TRM, though we mask the interrupts in interrupt-mask register,
interrupt source-register still provide the status of the masked interrupts.
So we should apply irq_mask_cur to read interrupt source-register value before
handling.

Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/max77686-irq.c

index 09e593ad07b5aaaf1339c247d7e42ab5da629fa8..0758fac0c447c17e625ef54b484e2c1acd3b2cd3 100644 (file)
@@ -208,6 +208,9 @@ static irqreturn_t max77686_irq_thread(int irq, void *data)
 
        }
 
+       for (i = 0; i < MAX77686_IRQ_GROUP_NR; i++)
+               irq_reg[i] &= ~max77686->irq_masks_cur[i];
+
        for (i = 0; i < MAX77686_IRQ_NR; i++) {
                if (irq_reg[max77686_irqs[i].group] & max77686_irqs[i].mask) {
                        cur_irq = irq_find_mapping(max77686->irq_domain, i);