summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2011-09-20 11:52:51 +0200
committerJonas ABERG <jonas.aberg@stericsson.com>2011-09-29 08:49:10 +0200
commit2deda24045d4253ee36f656bb037896133021404 (patch)
treefd012c7525b83b4ab03b5f4e88a6af28f2771711
parent64432d24107f2169566aa1670a54f5f316aec4f4 (diff)
ARM: ux500: suspend: Handle gpio
Change-Id: Ie1f4482ebe71a1c3629591428e73abc0d27f4366 Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32076
-rw-r--r--arch/arm/mach-ux500/pm/suspend.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/pm/suspend.c b/arch/arm/mach-ux500/pm/suspend.c
index ba8d0d6ff05..8da91c3fbf0 100644
--- a/arch/arm/mach-ux500/pm/suspend.c
+++ b/arch/arm/mach-ux500/pm/suspend.c
@@ -11,6 +11,7 @@
#include <linux/suspend.h>
#include <linux/mfd/dbx500-prcmu.h>
+#include <linux/gpio/nomadik.h>
#include <mach/context.h>
#include <mach/pm.h>
@@ -19,6 +20,10 @@ static int suspend(bool do_deepsleep)
{
int ret = 0;
+ nmk_gpio_clocks_enable();
+
+ nmk_gpio_wakeups_suspend();
+
/* configure the prcm for a sleep wakeup */
prcmu_enable_wakeups(PRCMU_WAKEUP(ABB));
@@ -70,6 +75,9 @@ static int suspend(bool do_deepsleep)
context_vape_restore();
+ /* If GPIO woke us up then save the pins that caused the wake up */
+ ux500_pm_gpio_save_wake_up_status();
+
/* APE was turned off, restore IO ring */
ux500_pm_prcmu_set_ioforce(false);
@@ -77,6 +85,11 @@ exit:
/* This is what cpuidle wants */
prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) |
PRCMU_WAKEUP(ABB));
+
+ nmk_gpio_wakeups_resume();
+
+ nmk_gpio_clocks_disable();
+
return ret;
}