aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2011-12-13 22:39:31 -0800
committerArve Hjønnevåg <arve@android.com>2011-12-14 17:58:32 -0800
commitaa7b27cb96dbadf29308f87d5e189e46d5ca39ce (patch)
tree43a9beff30365f26264ccc81a003f42311dc8f26 /drivers/gpio
parenta2b7ca02797c5b9b39025705a3db8fa48db2e865 (diff)
downloadkernel_samsung_tuna-aa7b27cb96dbadf29308f87d5e189e46d5ca39ce.zip
kernel_samsung_tuna-aa7b27cb96dbadf29308f87d5e189e46d5ca39ce.tar.gz
kernel_samsung_tuna-aa7b27cb96dbadf29308f87d5e189e46d5ca39ce.tar.bz2
ARM: omap4: gpio: Fix omap2_gpio_set_wakeupenables to have an effect
The wakeupenable bits set by this function do not take effect unless omap4_trigger_ioctrl is called. This function cannot be safely called after any gpio bank is disabled however, so enable the pad wakeup for all the gpio banks, call omap4_trigger_ioctrl, then disable the gpio banks. Change-Id: I4dd5aac70ebfebe9187fc4058d6470e03f89035b Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-omap.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 197e4db..6a9bca6 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -29,6 +29,7 @@
#include <mach/gpio.h>
#include <asm/mach/irq.h>
#include <plat/omap-pm.h>
+#include <plat/usb.h> /* for omap4_trigger_ioctrl */
#include "../mux.h"
@@ -1320,6 +1321,19 @@ static void omap2_gpio_set_wakeupenables(struct gpio_bank *bank)
pad_wakeup = __raw_readl(bank->base + bank->regs->irqenable);
+ /*
+ * HACK: Ignore gpios that have multiple sources.
+ * Gpio 0-3 and 86 are special and may be used as gpio
+ * interrupts without being connected to the pad that
+ * mux points to.
+ */
+ if (cpu_is_omap44xx()) {
+ if (bank->id == 0)
+ pad_wakeup &= ~0xf;
+ if (bank->id == 2)
+ pad_wakeup &= ~BIT(22);
+ }
+
for_each_set_bit(i, &pad_wakeup, bank->width) {
if (!omap_mux_get_wakeupenable(bank->mux[i])) {
bank->context.pad_set_wakeupenable |= BIT(i);
@@ -1561,6 +1575,14 @@ int omap2_gpio_prepare_for_idle(int off_mode, bool suspend)
if (omap2_gpio_set_edge_wakeup(bank, suspend))
ret = -EBUSY;
+ }
+
+ if (cpu_is_omap44xx())
+ omap4_trigger_ioctrl();
+
+ list_for_each_entry(bank, &omap_gpio_list, node) {
+ if (!bank->mod_usage)
+ continue;
if (bank->loses_context)
if (pm_runtime_put_sync_suspend(bank->dev) < 0)