]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: mach-gemini: move special idle code out of line
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 3 Aug 2011 10:29:42 +0000 (06:29 -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-gemini/Makefile
arch/arm/mach-gemini/idle.c [new file with mode: 0644]
arch/arm/mach-gemini/include/mach/system.h
arch/arm/mach-gemini/irq.c

index c5b24b95a76ed78552b4fb0c679c6d62e71b0f52..7355c0bbcb5ec5c2072e0ab6e7ddf277a580467c 100644 (file)
@@ -4,7 +4,7 @@
 
 # Object file lists.
 
-obj-y                  := irq.o mm.o time.o devices.o gpio.o
+obj-y                  := irq.o mm.o time.o devices.o gpio.o idle.o
 
 # Board-specific support
 obj-$(CONFIG_MACH_NAS4220B)    += board-nas4220b.o
diff --git a/arch/arm/mach-gemini/idle.c b/arch/arm/mach-gemini/idle.c
new file mode 100644 (file)
index 0000000..92bbd6b
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * arch/arm/mach-gemini/idle.c
+ */
+
+#include <linux/init.h>
+#include <asm/system.h>
+#include <asm/proc-fns.h>
+
+static void gemini_idle(void)
+{
+       /*
+        * Because of broken hardware we have to enable interrupts or the CPU
+        * will never wakeup... Acctualy it is not very good to enable
+        * interrupts first since scheduler can miss a tick, but there is
+        * no other way around this. Platforms that needs it for power saving
+        * should call enable_hlt() in init code, since by default it is
+        * disabled.
+        */
+       local_irq_enable();
+       cpu_do_idle();
+}
+
+static int __init gemini_idle_init(void)
+{
+       arm_pm_idle = gemini_idle;
+       return 0;
+}
+
+arch_initcall(gemini_idle_init);
index 4d9c1f872472a8e89abf73e8f1633990598d95ee..2eb341c63c96efc8767aa7c6e0d65291f91afd10 100644 (file)
 
 static inline void arch_idle(void)
 {
-       /*
-        * Because of broken hardware we have to enable interrupts or the CPU
-        * will never wakeup... Acctualy it is not very good to enable
-        * interrupts here since scheduler can miss a tick, but there is
-        * no other way around this. Platforms that needs it for power saving
-        * should call enable_hlt() in init code, since by default it is
-        * disabled.
-        */
-       local_irq_enable();
        cpu_do_idle();
 }
 
index 9485a8fdf851cf2a6c50f7530dd9d3c8b330fc16..ca70e5fcc7ac12cbd519d9d8a1b246253fe7f12a 100644 (file)
@@ -73,8 +73,8 @@ void __init gemini_init_irq(void)
        unsigned int i, mode = 0, level = 0;
 
        /*
-        * Disable arch_idle() by default since it is buggy
-        * For more info see arch/arm/mach-gemini/include/mach/system.h
+        * Disable the idle handler by default since it is buggy
+        * For more info see arch/arm/mach-gemini/idle.c
         */
        disable_hlt();