aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivek Kutal <vivek.kutal@celunite.com>2007-12-11 11:16:31 -0500
committerTony Lindgren <tony@atomide.com>2008-02-08 13:38:01 -0500
commit010bb0cf42fe2fa0a00753e0c11a3e8bfefb37a3 (patch)
tree2bfa2f5e6d4925344630573922bbb8982727f0ac
parent087c50302fbd608118e7c0f27a95dc552ad2f53b (diff)
ARM: OMAP1: PM fixes for OMAP1
This patch does the following: - Fixes the omap_pm_idle() code so that we enter WFI mode in idle. - /sys/power/sleep_while_idle is created only when 32k timer is used Signed-off-by: Vivek Kutal <vivek.kutal@celunite.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap1/pm.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 06b7e54a0128..64adb24ffb7f 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -67,6 +67,8 @@ static unsigned int mpui730_sleep_save[MPUI730_SLEEP_SAVE_SIZE];
67static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 67static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE];
68static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 68static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
69 69
70#ifdef CONFIG_OMAP_32K_TIMER
71
70static unsigned short enable_dyn_sleep = 1; 72static unsigned short enable_dyn_sleep = 1;
71 73
72static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr, 74static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr,
@@ -91,6 +93,8 @@ static ssize_t idle_store(struct kobject *kobj, struct kobj_attribute *attr,
91static struct kobj_attribute sleep_while_idle_attr = 93static struct kobj_attribute sleep_while_idle_attr =
92 __ATTR(sleep_while_idle, 0644, idle_show, idle_store); 94 __ATTR(sleep_while_idle, 0644, idle_show, idle_store);
93 95
96#endif
97
94static void (*omap_sram_idle)(void) = NULL; 98static void (*omap_sram_idle)(void) = NULL;
95static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; 99static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL;
96 100
@@ -104,9 +108,7 @@ void omap_pm_idle(void)
104{ 108{
105 extern __u32 arm_idlect1_mask; 109 extern __u32 arm_idlect1_mask;
106 __u32 use_idlect1 = arm_idlect1_mask; 110 __u32 use_idlect1 = arm_idlect1_mask;
107#ifndef CONFIG_OMAP_MPU_TIMER 111 int do_sleep = 0;
108 int do_sleep;
109#endif
110 112
111 local_irq_disable(); 113 local_irq_disable();
112 local_fiq_disable(); 114 local_fiq_disable();
@@ -128,7 +130,6 @@ void omap_pm_idle(void)
128 use_idlect1 = use_idlect1 & ~(1 << 9); 130 use_idlect1 = use_idlect1 & ~(1 << 9);
129#else 131#else
130 132
131 do_sleep = 0;
132 while (enable_dyn_sleep) { 133 while (enable_dyn_sleep) {
133 134
134#ifdef CONFIG_CBUS_TAHVO_USB 135#ifdef CONFIG_CBUS_TAHVO_USB
@@ -141,6 +142,8 @@ void omap_pm_idle(void)
141 break; 142 break;
142 } 143 }
143 144
145#endif
146
144#ifdef CONFIG_OMAP_DM_TIMER 147#ifdef CONFIG_OMAP_DM_TIMER
145 use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); 148 use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1);
146#endif 149#endif
@@ -168,7 +171,6 @@ void omap_pm_idle(void)
168 } 171 }
169 omap_sram_suspend(omap_readl(ARM_IDLECT1), 172 omap_sram_suspend(omap_readl(ARM_IDLECT1),
170 omap_readl(ARM_IDLECT2)); 173 omap_readl(ARM_IDLECT2));
171#endif
172 174
173 local_fiq_enable(); 175 local_fiq_enable();
174 local_irq_enable(); 176 local_irq_enable();
@@ -661,7 +663,10 @@ static struct platform_suspend_ops omap_pm_ops ={
661 663
662static int __init omap_pm_init(void) 664static int __init omap_pm_init(void)
663{ 665{
666
667#ifdef CONFIG_OMAP_32K_TIMER
664 int error; 668 int error;
669#endif
665 670
666 printk("Power Management for TI OMAP.\n"); 671 printk("Power Management for TI OMAP.\n");
667 672
@@ -719,9 +724,11 @@ static int __init omap_pm_init(void)
719 omap_pm_init_proc(); 724 omap_pm_init_proc();
720#endif 725#endif
721 726
727#ifdef CONFIG_OMAP_32K_TIMER
722 error = sysfs_create_file(power_kobj, &sleep_while_idle_attr); 728 error = sysfs_create_file(power_kobj, &sleep_while_idle_attr);
723 if (error) 729 if (error)
724 printk(KERN_ERR "sysfs_create_file failed: %d\n", error); 730 printk(KERN_ERR "sysfs_create_file failed: %d\n", error);
731#endif
725 732
726 if (cpu_is_omap16xx()) { 733 if (cpu_is_omap16xx()) {
727 /* configure LOW_PWR pin */ 734 /* configure LOW_PWR pin */