[PATCH V4 03/18] gpio: tegra: use resume_noirq for tegra gpio resume

From: Sowjanya Komatineni
Date: Sun Jun 23 2019 - 23:03:18 EST


During SC7 resume, PARKED bit clear from the pinmux registers may
cause a glitch on the GPIO lines.

So, Tegra GPIOs restore should happen prior to restoring Tegra pinmux
to keep the GPIO lines in a known good state prior to clearing PARKED
bit.

This patch has fix for this by moving Tegra GPIOs restore to happen
very early than pinctrl resume.

Signed-off-by: Sowjanya Komatineni <skomatineni@xxxxxxxxxx>
---
drivers/gpio/gpio-tegra.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index f57bfc07ae22..f427540568f9 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -410,7 +410,7 @@ static void tegra_gpio_irq_handler(struct irq_desc *desc)
}

#ifdef CONFIG_PM_SLEEP
-static int tegra_gpio_resume(struct device *dev)
+static int tegra_gpio_resume_noirq(struct device *dev)
{
struct tegra_gpio_info *tgi = dev_get_drvdata(dev);
unsigned long flags;
@@ -554,7 +554,8 @@ static inline void tegra_gpio_debuginit(struct tegra_gpio_info *tgi)
#endif

static const struct dev_pm_ops tegra_gpio_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume)
+ .suspend = tegra_gpio_suspend,
+ .resume_noirq = tegra_gpio_resume_noirq
};

static int tegra_gpio_probe(struct platform_device *pdev)
--
2.7.4