MLK-13912-2 gpio: gpio-vf610: mask interrupt on suspend for imx7ulp
authorPeter Chen <peter.chen@nxp.com>
Mon, 13 Feb 2017 07:14:17 +0000 (15:14 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:10:41 +0000 (15:10 -0500)
At imx7ulp, any interrupts can wake system up from suspend at "standby"
mode, so we mask interrupt for gpio by default. The user can still
enable wakeup through /sys entry.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/gpio/gpio-vf610.c

index f409c02..68567ca 100644 (file)
@@ -280,6 +280,14 @@ static int vf610_gpio_probe(struct platform_device *pdev)
        /* Clear the interrupt status register for all GPIO's */
        vf610_gpio_writel(~0, port->base + PORT_ISFR);
 
+       /*
+        * At imx7ulp, any interrupts can wake system up from "standby" mode,
+        * so, mask interrupt at suspend mode by default, and the user
+        * can still enable wakeup through /sys entry.
+        */
+       if (of_machine_is_compatible("fsl,imx7ulp"))
+               vf610_gpio_irq_chip.flags = IRQCHIP_MASK_ON_SUSPEND;
+
        ret = gpiochip_irqchip_add(gc, &vf610_gpio_irq_chip, 0,
                                   handle_edge_irq, IRQ_TYPE_NONE);
        if (ret) {