This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
So I noticed that when I configure gpio pins to be keys in the device tree my board never go down in sleep.
turns out that for some reason when a gpio is used as an interrupt source(edge detect) it is automatically also set as a wakeup source so its not possible to select what key is a wakeup source in the device tree anymore.
Now since this is highly unlikely to be a coding error I'm not sure what is intended or what is breaking when I remove this. but on the system I run the following patch has so far had no bad side effects and I can now control what pin to wake up on.
From 2520d12f501b22de54dfe4800b0f6c7ae28014b3 Mon Sep 17 00:00:00 2001 From: kenneth johansson <kenneth@southpole.se> Date: Wed, 9 Jul 2014 19:47:04 +0200 Subject: [PATCH] Don't register gpio_interrupts as wakeup source. If a pin is wakeup source or not should be defined in the device tree. If we remove this unconditional assignment things works as expected otherwise every pin that is assigned to be a gpio-key gets to be a wakeup source. --- drivers/gpio/gpio-omap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index f319c9f..bbfbc65 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -320,7 +320,7 @@ static inline void set_gpio_trigger(struct gpio_bank *bank, int gpio, __raw_readl(bank->base + bank->regs->fallingdetect); if (likely(!(bank->non_wakeup_gpios & gpio_bit))) { - _gpio_rmw(base, bank->regs->wkup_en, gpio_bit, trigger != 0); +// _gpio_rmw(base, bank->regs->wkup_en, gpio_bit, trigger != 0); bank->context.wake_en = __raw_readl(bank->base + bank->regs->wkup_en); } @@ -416,7 +416,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, l |= 1 << (gpio << 1); /* Enable wake-up during idle for dynamic tick */ - _gpio_rmw(base, bank->regs->wkup_en, 1 << gpio, trigger); +// _gpio_rmw(base, bank->regs->wkup_en, 1 << gpio, trigger); bank->context.wake_en = __raw_readl(bank->base + bank->regs->wkup_en); __raw_writel(l, reg); -- 1.9.1
Hi Kenneth,
Thanks for this information. It will be forwarded to the Linux team.
Kernel 4.4 is not supported by TI. Latest Processor SDK kernel version is v4.1.18.