diff mbox

[v6,00/13] OMAP: GPIO: Implement GPIO in hwmod way

Message ID 87r5goq7ro.fsf@deeprootsystems.com (mailing list archive)
State Not Applicable
Delegated to: Kevin Hilman
Headers show

Commit Message

Kevin Hilman Sept. 21, 2010, 12:07 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 2f5c1eb..3b60418 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -170,6 +170,7 @@  struct gpio_bank {
 	struct omap_gpio_regs gpio_context;
 	struct powerdomain *pwrdm;
 	bool dbck_flag;
+	int workaround_enabled;
 };
 
 static void omap_gpio_save_context(struct device *dev);
@@ -1830,8 +1831,6 @@  static int omap_gpio_resume(struct device *dev)
 	return 0;
 }
 
-static int workaround_enabled;
-
 static int gpio_bank_runtime_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -1887,7 +1886,7 @@  static int gpio_bank_runtime_suspend(struct device *dev)
 		__raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
 	}
 
-	workaround_enabled = 1;
+	bank->workaround_enabled = 1;
 
 	return 0;
 }
@@ -1900,7 +1899,7 @@  static int gpio_bank_runtime_resume(struct device *dev)
 	if (bank->dbck_enable_mask)
 		clk_enable(bank->dbck);
 
-	if ((!workaround_enabled) || (!(bank->enabled_non_wakeup_gpios)))
+	if ((!bank->workaround_enabled) || (!(bank->enabled_non_wakeup_gpios)))
 		return 0;
 
 	if (bank->method == METHOD_GPIO_24XX) {
@@ -2110,11 +2109,11 @@  void omap2_gpio_prepare_for_idle(void)
 {
 	int i;
 
-	workaround_enabled = 0;
-
 	for (i = 0; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
 
+		bank->workaround_enabled = 0;
+
 		/* If the gpio bank is not used, do nothing */
 		if ((!bank->pwrdm) || !(bank->mod_usage))
 			continue;


[2]
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index e759311..ae7487f 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -54,6 +54,8 @@  static int omap2_init_gpio(struct omap_hwmod *oh, void *user)
 	pdata->virtual_irq_start = IH_GPIO_BASE + 32 * gpio_bank_count;
 	pdata->pwrdm = omap_hwmod_get_pwrdm(oh);
 
+	omap_hwmod_enable_wakeup(oh);
+
 	switch (oh->class->rev) {
 	case 0:
 	case 1: