[PATCH] gpio: omap: Add level wakeup handling for omap4 based SoCs
From: tony@atomide.com (Tony Lindgren)
Date: 2018-09-12 17:09:15
Also in:
linux-gpio, linux-omap
From: tony@atomide.com (Tony Lindgren)
Date: 2018-09-12 17:09:15
Also in:
linux-gpio, linux-omap
* Tony Lindgren [off-list ref] [180910 20:10]:
+static void __maybe_unused
+omap4_gpio_disable_level_quirk(struct gpio_bank *bank)
+{
+ /* Restore level registers after idle */
+ writel_relaxed(bank->context.leveldetect0,
+ bank->base + bank->regs->leveldetect0);
+ writel_relaxed(bank->context.leveldetect1,
+ bank->base + bank->regs->leveldetect1);
+
+ /* Clear wake after idle */
+ writel_relaxed(0, bank->base + bank->regs->wkup_en);/* Reset saved wkup_en, it will be set for next idle again */ bank->context.wake_en = 0;
+}
Clearing the saved wkup_en is needed above I noticed testing again with gpio4 which has pdata->loses_context set. Otherwise runtime_resume will write to wkup_en enabling it for runtime which will the next idle fail. Regards, Tony