Skip to content

Commit

Permalink
gpio/omap: (re)fix wakeups on level-triggered GPIOs
Browse files Browse the repository at this point in the history
commit 1b12870 (gpio/omap: fix missing check in *_runtime_suspend())
broke wakeups on level-triggered GPIOs by adding the enabled
non-wakeup GPIO check before the workaround that enables wakeups
on level-triggered IRQs, effectively disabling that workaround.

To fix, move the enabled non-wakeup GPIO check after the
level-triggered IRQ workaround.

Reported-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Tested-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
  • Loading branch information
Kevin Hilman committed May 18, 2012
1 parent 22770de commit b3c64bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpio/gpio-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,6 @@ static int omap_gpio_runtime_suspend(struct device *dev)

spin_lock_irqsave(&bank->lock, flags);

if (!bank->enabled_non_wakeup_gpios)
goto update_gpio_context_count;

/*
* Only edges can generate a wakeup event to the PRCM.
*
Expand All @@ -1180,6 +1177,9 @@ static int omap_gpio_runtime_suspend(struct device *dev)
__raw_writel(wake_hi | bank->context.risingdetect,
bank->base + bank->regs->risingdetect);

if (!bank->enabled_non_wakeup_gpios)
goto update_gpio_context_count;

if (bank->power_mode != OFF_MODE) {
bank->power_mode = 0;
goto update_gpio_context_count;
Expand Down

0 comments on commit b3c64bc

Please sign in to comment.