blob: ddf8ec9d203bd8fe6bc660db66ba5a1009a6b249 [file] [log] [blame]
Nicolas Pitre8925b0f2011-08-03 06:29:42 -04001/*
2 * arch/arm/mach-gemini/idle.c
3 */
4
5#include <linux/init.h>
David Howells74c41372014-02-24 16:48:26 +01006#include <asm/system_misc.h>
Nicolas Pitre8925b0f2011-08-03 06:29:42 -04007#include <asm/proc-fns.h>
8
9static void gemini_idle(void)
10{
11 /*
12 * Because of broken hardware we have to enable interrupts or the CPU
13 * will never wakeup... Acctualy it is not very good to enable
14 * interrupts first since scheduler can miss a tick, but there is
15 * no other way around this. Platforms that needs it for power saving
Thomas Gleixnerf7b861b2013-03-21 22:49:38 +010016 * should enable it in init code, since by default it is
Nicolas Pitre8925b0f2011-08-03 06:29:42 -040017 * disabled.
18 */
Thomas Gleixnerf7b861b2013-03-21 22:49:38 +010019
20 /* FIXME: Enabling interrupts here is racy! */
Nicolas Pitre8925b0f2011-08-03 06:29:42 -040021 local_irq_enable();
22 cpu_do_idle();
23}
24
25static int __init gemini_idle_init(void)
26{
27 arm_pm_idle = gemini_idle;
28 return 0;
29}
30
31arch_initcall(gemini_idle_init);