irqchip/stm32: Move the wakeup on interrupt mask
authorLudovic Barre <ludovic.barre@st.com>
Mon, 6 Nov 2017 17:03:36 +0000 (18:03 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 7 Nov 2017 11:44:43 +0000 (11:44 +0000)
Move irq_set_wake on interrupt mask, needed to wake up from
low power mode as the event mask is not able to do so.

Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-stm32-exti.c

index 477d0faf0ea29f322593af859d53f38f9928897f..31ab0dee2ce72c0685f47f679abf4ee52851ccf2 100644 (file)
@@ -156,16 +156,16 @@ static int stm32_irq_set_wake(struct irq_data *data, unsigned int on)
        struct irq_chip_generic *gc = irq_data_get_irq_chip_data(data);
        const struct stm32_exti_bank *stm32_bank = gc->private;
        int pin = data->hwirq % IRQS_PER_BANK;
-       u32 emr;
+       u32 imr;
 
        irq_gc_lock(gc);
 
-       emr = irq_reg_readl(gc, stm32_bank->emr_ofst);
+       imr = irq_reg_readl(gc, stm32_bank->imr_ofst);
        if (on)
-               emr |= BIT(pin);
+               imr |= BIT(pin);
        else
-               emr &= ~BIT(pin);
-       irq_reg_writel(gc, emr, stm32_bank->emr_ofst);
+               imr &= ~BIT(pin);
+       irq_reg_writel(gc, imr, stm32_bank->imr_ofst);
 
        irq_gc_unlock(gc);