ARM: mach-h720x: move special idle code out of line
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 3 Aug 2011 10:55:31 +0000 (06:55 -0400)
committerNicolas Pitre <nico@fluxnic.net>
Fri, 20 Jan 2012 23:55:12 +0000 (18:55 -0500)
... and hook it to arm_pm_idle.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
arch/arm/mach-h720x/common.c
arch/arm/mach-h720x/include/mach/system.h

index f8a2f6bb548358a08bce3596beaf83eb0bffa37f..e756d1ac00c22b06c9cb278ffeb0e3a8b19664ac 100644 (file)
@@ -247,3 +247,21 @@ void h720x_restart(char mode, const char *cmd)
 {
        CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
 }
+
+static void h720x__idle(void)
+{
+       CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE;
+       nop();
+       nop();
+       CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_RUN;
+       nop();
+       nop();
+}
+
+static int __init h720x_idle_init(void)
+{
+       arm_pm_idle = h720x__idle;
+       return 0;
+}
+
+arch_initcall(h720x_idle_init);
index 16ac46e239aa270820f9f535fe0ec1bdefd98536..008ed164b253088b85709f37db519057ec2b7fbd 100644 (file)
 
 static void arch_idle(void)
 {
-       CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE;
-       nop();
-       nop();
-       CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_RUN;
-       nop();
-       nop();
+       cpu_do_idle();
 }
 
 #endif