gpio: tegra: bypass pinctrl on gpio request, free on suspend
Laxman Dewangan [Tue, 18 Aug 2015 11:57:32 +0000 (16:57 +0530)]
Bypass the pinctrl APIs from GPIO driver  on gpio request
and gpio free if it is called from suspend.

bug 1650903

Change-Id: Ic5e70015d6d99d976191d67a7ff62b0955993432
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
(cherry picked from commit 578e235224a81026d6027eba357fc651dde5705c)
Reviewed-on: http://git-master/r/787794
GVS: Gerrit_Virtual_Submit

drivers/gpio/gpio-tegra.c

index 16e4b09..2d9ef01 100644 (file)
@@ -157,12 +157,15 @@ static void tegra_gpio_disable(int gpio)
 
 static int tegra_gpio_request(struct gpio_chip *chip, unsigned offset)
 {
-       return pinctrl_request_gpio(chip->base + offset);
+       if (!bypass_pinconfig)
+               return pinctrl_request_gpio(chip->base + offset);
+       return 0;
 }
 
 static void tegra_gpio_free(struct gpio_chip *chip, unsigned offset)
 {
-       pinctrl_free_gpio(chip->base + offset);
+       if (!bypass_pinconfig)
+               pinctrl_free_gpio(chip->base + offset);
        tegra_gpio_disable(offset);
 }