ARM: LPC32xx: irq.c: Clear latched event
authorRoland Stigge <stigge@antcom.de>
Mon, 27 Feb 2012 16:28:02 +0000 (17:28 +0100)
committerRoland Stigge <stigge@antcom.de>
Mon, 27 Feb 2012 16:28:02 +0000 (17:28 +0100)
This patch fixes the wakeup disable function by clearing latched events.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Cc: stable@vger.kernel.org
arch/arm/mach-lpc32xx/irq.c

index d3bf9c11fd664d7541ba899cf3e391badc010589..c74de01ab5b61bf2cd95dbdb6559545ab85e8f96 100644 (file)
@@ -309,9 +309,18 @@ static int lpc32xx_irq_wake(struct irq_data *d, unsigned int state)
 
                if (state)
                        eventreg |= lpc32xx_events[d->irq].mask;
-               else
+               else {
                        eventreg &= ~lpc32xx_events[d->irq].mask;
 
+                       /*
+                        * When disabling the wakeup, clear the latched
+                        * event
+                        */
+                       __raw_writel(lpc32xx_events[d->irq].mask,
+                               lpc32xx_events[d->irq].
+                               event_group->rawstat_reg);
+               }
+
                __raw_writel(eventreg,
                        lpc32xx_events[d->irq].event_group->enab_reg);