diff options
author | Ambresh K <ambresh@ti.com> | 2012-01-23 16:46:07 +0530 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:55:44 +0200 |
commit | 44bccf860052ed78c3c9c1e4aa6fbce8b58470eb (patch) | |
tree | 0b39d5f9310b4449270cd293af4825ee3faa9460 /drivers/gpio | |
parent | b0a25502d21caabcacdb47261d6bc71db52c5795 (diff) | |
download | kernel_samsung_tuna-44bccf860052ed78c3c9c1e4aa6fbce8b58470eb.zip kernel_samsung_tuna-44bccf860052ed78c3c9c1e4aa6fbce8b58470eb.tar.gz kernel_samsung_tuna-44bccf860052ed78c3c9c1e4aa6fbce8b58470eb.tar.bz2 |
GPIO: OMAP2+: On suspend don't wakeup on non-wakeupable interrupts.
While in suspend, device should only be woken-up from those gpio
pins, who has explicitly marked itself has wakeup capable through
enable_irq_wake() functions from respective drivers.
In current implementation, it address the issue where interrupts
were lost when system had entered deeper c-state. So in CpuIdle
path all the pins with interrupts enabled where marked has wakeup
capable to get the system out of deeper c-states.
With this approach, it is observed that lots of spurious
interrupts are waking system from suspend, even though they not
suppose wake the device.
So based on, whether prepare idle is called from CpuIdle or
suspend mark gpio wakeup capable.
Change-Id: Ib3f9be6e56c0656f4b8736861740ed0b4394384f
Signed-off-by: Ambresh K <ambresh@ti.com>
Signed-off-by: Hema Kalliguddi <hemahk@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 484e7a8..203a813 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1312,7 +1312,7 @@ static int omap_gpio_resume(struct device *dev) static void omap_gpio_save_context(struct gpio_bank *bank); static void omap_gpio_restore_context(struct gpio_bank *bank); -static void omap2_gpio_set_wakeupenables(struct gpio_bank *bank) +static void omap2_gpio_set_wakeupenables(struct gpio_bank *bank, bool suspend) { unsigned long pad_wakeup; int i; @@ -1324,8 +1324,10 @@ static void omap2_gpio_set_wakeupenables(struct gpio_bank *bank) "failed\n", __func__, bank->id); return; } - - pad_wakeup = __raw_readl(bank->base + bank->regs->irqenable); + if (suspend) + pad_wakeup = bank->suspend_wakeup; + else + pad_wakeup = __raw_readl(bank->base + bank->regs->irqenable); /* * HACK: Ignore gpios that have multiple sources. @@ -1590,7 +1592,7 @@ int omap2_gpio_prepare_for_idle(int off_mode, bool suspend) if (!bank->mod_usage) continue; - omap2_gpio_set_wakeupenables(bank); + omap2_gpio_set_wakeupenables(bank, suspend); if (omap2_gpio_set_edge_wakeup(bank, suspend)) ret = -EBUSY; |