Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Acknowledge WM8994 IRQs before reporting

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>

authored by

Mark Brown and committed by
Samuel Ortiz
ccd80c71 88c93977

+6 -6
+6 -6
drivers/mfd/wm8994-irq.c
··· 231 231 status[i] &= ~wm8994->irq_masks_cur[i]; 232 232 } 233 233 234 - /* Report */ 235 - for (i = 0; i < ARRAY_SIZE(wm8994_irqs); i++) { 236 - if (status[wm8994_irqs[i].reg - 1] & wm8994_irqs[i].mask) 237 - handle_nested_irq(wm8994->irq_base + i); 238 - } 239 - 240 234 /* Ack any unmasked IRQs */ 241 235 for (i = 0; i < ARRAY_SIZE(status); i++) { 242 236 if (status[i]) 243 237 wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1 + i, 244 238 status[i]); 239 + } 240 + 241 + /* Report */ 242 + for (i = 0; i < ARRAY_SIZE(wm8994_irqs); i++) { 243 + if (status[wm8994_irqs[i].reg - 1] & wm8994_irqs[i].mask) 244 + handle_nested_irq(wm8994->irq_base + i); 245 245 } 246 246 247 247 return IRQ_HANDLED;