aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorSundar R Iyer <sundar.iyer@stericsson.com>2010-05-25 17:52:41 +0530
committerJohn Rigby <john.rigby@linaro.org>2010-09-02 22:45:27 -0600
commitd37b6a5d9c33769b88080e9a53e3c13e158588ce (patch)
tree37f7a81760679d7a5a74cc3dc050644c228078d4 /arch/arm/mach-ux500
parenta373f692453f46dd11f1e2cbf9c57804237b645a (diff)
ux500: add system shutdown support
This implementation is derived from Linus Walleij's similar support for mach-u300 platforms. We write to the Ab8500 reset register to shut off the board. An ideal way is to request the PRCMU for a system reset, which would be available only later on! ST-Ericsson Change ID: ER254471 Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Change-Id: I1571f5506aadac0ad55fa6db61246587de57fbcb Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/2360 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500')
-rwxr-xr-xarch/arm/mach-ux500/pm.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c
index 509c2c59c02..96f040a8eda 100755
--- a/arch/arm/mach-ux500/pm.c
+++ b/arch/arm/mach-ux500/pm.c
@@ -32,6 +32,29 @@ static int u8500_pm_prepare(void)
return 0;
}
+/* poweroff support */
+#include <linux/signal.h>
+#include <mach/ab8500.h>
+/*
+ * This function is used from pm.h to shut down the u8500 system by
+ * turning off the ab8500
+ */
+void u8500_pm_poweroff(void)
+{
+ sigset_t old, all;
+ int val;
+
+ sigfillset(&all);
+ if (!sigprocmask(SIG_BLOCK, &all, &old)) {
+ val = ab8500_read(AB8500_SYS_CTRL1_BLOCK, AB8500_CTRL1_REG);
+ val |= 0x1;
+ ab8500_write(AB8500_SYS_CTRL1_BLOCK, AB8500_CTRL1_REG, val);
+ (void) sigprocmask(SIG_SETMASK, &old, NULL);
+ }
+ return;
+}
+
+
/* GPIO context */
static struct ux500_gpio_regs gpio_context[UX500_NR_GPIO_BANKS];
@@ -827,6 +850,9 @@ static int __init u8500_pm_init(void)
return -ENOMEM;
}
+ /* register the global power off hook */
+ pm_power_off = u8500_pm_poweroff;
+
suspend_set_ops(&u8500_pm_ops);
return 0;