aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-06-06 16:38:17 -0400
committerKevin Hilman <khilman@ti.com>2011-06-06 19:12:23 -0400
commit0622b25bf071fd83c6eef6b61fb5f3f12a418528 (patch)
treeb94745ded735e4347ee37b51e5e382e3a6d81432
parentd52b31deffe1956ac62d0b81b915c9b52cffb814 (diff)
GPIO: OMAP: fix setting IRQWAKEN bits for OMAP4
Setting the IRQWAKEN bit was overwriting previous IRQWAKEN bits, causing only the last bit set to take effect, resulting in lost wakeups when the GPIO controller is in idle. Replace direct writes to IRQWAKEN with MOD_REG_BIT calls to perform a read-modify-write on the register. Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r--drivers/gpio/gpio-omap.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 76709b03572e..5ad827a1a3e8 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -432,7 +432,6 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
432{ 432{
433 void __iomem *base = bank->base; 433 void __iomem *base = bank->base;
434 u32 gpio_bit = 1 << gpio; 434 u32 gpio_bit = 1 << gpio;
435 u32 val;
436 435
437 if (cpu_is_omap44xx()) { 436 if (cpu_is_omap44xx()) {
438 MOD_REG_BIT(OMAP4_GPIO_LEVELDETECT0, gpio_bit, 437 MOD_REG_BIT(OMAP4_GPIO_LEVELDETECT0, gpio_bit,
@@ -455,15 +454,8 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
455 } 454 }
456 if (likely(!(bank->non_wakeup_gpios & gpio_bit))) { 455 if (likely(!(bank->non_wakeup_gpios & gpio_bit))) {
457 if (cpu_is_omap44xx()) { 456 if (cpu_is_omap44xx()) {
458 if (trigger != 0) 457 MOD_REG_BIT(OMAP4_GPIO_IRQWAKEN0, gpio_bit,
459 __raw_writel(1 << gpio, bank->base+ 458 trigger != 0);
460 OMAP4_GPIO_IRQWAKEN0);
461 else {
462 val = __raw_readl(bank->base +
463 OMAP4_GPIO_IRQWAKEN0);
464 __raw_writel(val & (~(1 << gpio)), bank->base +
465 OMAP4_GPIO_IRQWAKEN0);
466 }
467 } else { 459 } else {
468 /* 460 /*
469 * GPIO wakeup request can only be generated on edge 461 * GPIO wakeup request can only be generated on edge