gpio: omap: Restore power_mode configuration at resume time
authorDave Gerlach <d-gerlach@ti.com>
Fri, 2 Nov 2018 10:28:08 +0000 (15:58 +0530)
committerTero Kristo <t-kristo@ti.com>
Tue, 6 Nov 2018 13:03:47 +0000 (15:03 +0200)
Commit ("gpio/omap: cleanup prepare_for_idle and
resume_after_idle") introduces omap2_gpio_prepare_for_idle and
omap2_gpio_resume_after_idle to properly configure gpios that are used
as wake sources. When entering off mode, omap2_gpio_prepare_for_idle
can set a flag indicating off-mode entry is desired, however once this
flag is set it is never cleared, so any additional calls to this
function, regardless of the mode, have this flag set.

This patch restores the pwr_mode flag to 0 in
omap2_gpio_resume_after_idle to ensure the flag is not misconfigured
during non off-mode operation.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
drivers/gpio/gpio-omap.c

index e81008678a38f5c36987b37a83bac80ccaccae8a..e44366661e1dd3a1b832729d5e8a899d1dcc73ea 100644 (file)
@@ -1570,6 +1570,8 @@ void omap2_gpio_resume_after_idle(void)
                        continue;
 
                pm_runtime_get_sync(bank->chip.parent);
+
+               bank->power_mode = 0;
        }
 }
 #endif