aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap-wakeupgen.c
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@ti.com>2010-06-16 12:49:48 -0400
committerKevin Hilman <khilman@ti.com>2011-12-08 14:29:00 -0500
commitb5b4f2881f619460fdb165111bac10a3dd8eebee (patch)
tree2f41f00e91f11ef77ff47dd0f65fc31b67aeb9c7 /arch/arm/mach-omap2/omap-wakeupgen.c
parenta6e48358d15fec2f3f9e86a6d6fc62422141a3a9 (diff)
ARM: OMAP4: PM: Program CPU1 to hit OFF when off-lined
Program non-boot CPUs to hit lowest supported power state when it is off-lined using cpu hotplug framework. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Jean Pihet <j-pihet@ti.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Tested-by: Vishwanath BS <vishwanath.bs@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap-wakeupgen.c')
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index a8a8d0efe350..701dfecad64b 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -180,6 +180,36 @@ static void wakeupgen_irqmask_all(unsigned int cpu, unsigned int set)
180 spin_unlock_irqrestore(&wakeupgen_lock, flags); 180 spin_unlock_irqrestore(&wakeupgen_lock, flags);
181} 181}
182 182
183#ifdef CONFIG_HOTPLUG_CPU
184static int __cpuinit irq_cpu_hotplug_notify(struct notifier_block *self,
185 unsigned long action, void *hcpu)
186{
187 unsigned int cpu = (unsigned int)hcpu;
188
189 switch (action) {
190 case CPU_ONLINE:
191 wakeupgen_irqmask_all(cpu, 0);
192 break;
193 case CPU_DEAD:
194 wakeupgen_irqmask_all(cpu, 1);
195 break;
196 }
197 return NOTIFY_OK;
198}
199
200static struct notifier_block __refdata irq_hotplug_notifier = {
201 .notifier_call = irq_cpu_hotplug_notify,
202};
203
204static void __init irq_hotplug_init(void)
205{
206 register_hotcpu_notifier(&irq_hotplug_notifier);
207}
208#else
209static void __init irq_hotplug_init(void)
210{}
211#endif
212
183/* 213/*
184 * Initialise the wakeupgen module. 214 * Initialise the wakeupgen module.
185 */ 215 */
@@ -222,5 +252,7 @@ int __init omap_wakeupgen_init(void)
222 for (i = 0; i < NR_IRQS; i++) 252 for (i = 0; i < NR_IRQS; i++)
223 irq_target_cpu[i] = boot_cpu; 253 irq_target_cpu[i] = boot_cpu;
224 254
255 irq_hotplug_init();
256
225 return 0; 257 return 0;
226} 258}