From 836f6a62ad58f7974de7ab4c7a13a73d499afadf Mon Sep 17 00:00:00 2001 From: "Avinash.H.M" Date: Mon, 2 May 2011 21:04:55 +0530 Subject: omap4: enable, disable GPIO device Enable and disable the GPIO device in the resume and prepare idle hooks for GPIO. Without this clocks won't be disabled and it won't transition to lowpower. Signed-off-by: Avinash.H.M --- drivers/gpio/gpio-omap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/gpio') diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 01f74a8..13ca564 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -73,6 +73,8 @@ struct omap3_gpio_regs { static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS]; #endif +#include + /* * TODO: Cleanup gpio_bank usage as it is having information * related to all instances of the device @@ -1748,6 +1750,7 @@ void omap2_gpio_prepare_for_idle(int off_mode) { int i, c = 0; int min = 0; + struct platform_device *pdev; if (cpu_is_omap34xx()) min = 1; @@ -1760,6 +1763,9 @@ void omap2_gpio_prepare_for_idle(int off_mode) for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++) clk_disable(bank->dbck); + pdev = to_platform_device(bank->dev); + omap_device_idle(pdev); + if (!off_mode) continue; @@ -1817,6 +1823,7 @@ void omap2_gpio_resume_after_idle(void) { int i; int min = 0; + struct platform_device *pdev; if (cpu_is_omap34xx()) min = 1; @@ -1825,6 +1832,9 @@ void omap2_gpio_resume_after_idle(void) u32 l = 0, gen, gen0, gen1; int j; + pdev = to_platform_device(bank->dev); + omap_device_enable(pdev); + for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++) clk_enable(bank->dbck); -- cgit v1.1