From 49534b73e497457ec6720bcac9608dee2d13910a Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Mon, 13 Feb 2017 15:14:17 +0800 Subject: [PATCH] MLK-13912-2 gpio: gpio-vf610: mask interrupt on suspend for imx7ulp 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 --- drivers/gpio/gpio-vf610.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index f409c0257b68..68567cabcdee 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -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) { -- 2.17.1