summaryrefslogtreecommitdiff
path: root/arch/arm/mach-pxa/z2.c
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2011-03-15 23:11:17 +0300
committerEric Miao <eric.y.miao@gmail.com>2011-07-12 15:50:34 +0400
commit41646b24993590c49d21e6cc0f4378505e1f94a6 (patch)
tree9d3d205217dbb04c2f474ac7b7a39a961c6b1fb6 /arch/arm/mach-pxa/z2.c
parent8a97ae2f554d762a4bc67b5d13b52ef39c8d6baa (diff)
downloadlinux-41646b24993590c49d21e6cc0f4378505e1f94a6.tar.xz
ARM: pxa/z2: add poweroff function
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/z2.c')
-rw-r--r--arch/arm/mach-pxa/z2.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index e9b38cdc9269..6c9275a20c91 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -40,6 +40,7 @@
#include <mach/pxafb.h>
#include <mach/mmc.h>
#include <plat/pxa27x_keypad.h>
+#include <mach/pm.h>
#include "generic.h"
#include "devices.h"
@@ -677,6 +678,20 @@ static void __init z2_pmic_init(void)
static inline void z2_pmic_init(void) {}
#endif
+#ifdef CONFIG_PM
+static void z2_power_off(void)
+{
+ /* We're using deep sleep as poweroff, so clear PSPR to ensure that
+ * bootloader will jump to its entry point in resume handler
+ */
+ PSPR = 0x0;
+ local_irq_disable();
+ pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP, PLAT_PHYS_OFFSET - PAGE_OFFSET);
+}
+#else
+#define z2_power_off NULL
+#endif
+
/******************************************************************************
* Machine init
******************************************************************************/
@@ -698,6 +713,8 @@ static void __init z2_init(void)
z2_leds_init();
z2_keys_init();
z2_pmic_init();
+
+ pm_power_off = z2_power_off;
}
MACHINE_START(ZIPIT2, "Zipit Z2")