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>

authored by Vivek Kutal and committed by Tony Lindgren 010bb0cf 087c5030

+12 -5
+12 -5
arch/arm/mach-omap1/pm.c
··· 67 static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 68 static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 69 70 static unsigned short enable_dyn_sleep = 1; 71 72 static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr, ··· 93 static struct kobj_attribute sleep_while_idle_attr = 94 __ATTR(sleep_while_idle, 0644, idle_show, idle_store); 95 96 static void (*omap_sram_idle)(void) = NULL; 97 static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; 98 ··· 108 { 109 extern __u32 arm_idlect1_mask; 110 __u32 use_idlect1 = arm_idlect1_mask; 111 - #ifndef CONFIG_OMAP_MPU_TIMER 112 - int do_sleep; 113 - #endif 114 115 local_irq_disable(); 116 local_fiq_disable(); ··· 130 use_idlect1 = use_idlect1 & ~(1 << 9); 131 #else 132 133 - do_sleep = 0; 134 while (enable_dyn_sleep) { 135 136 #ifdef CONFIG_CBUS_TAHVO_USB ··· 141 do_sleep = 1; 142 break; 143 } 144 145 #ifdef CONFIG_OMAP_DM_TIMER 146 use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); ··· 171 } 172 omap_sram_suspend(omap_readl(ARM_IDLECT1), 173 omap_readl(ARM_IDLECT2)); 174 - #endif 175 176 local_fiq_enable(); 177 local_irq_enable(); ··· 663 664 static int __init omap_pm_init(void) 665 { 666 int error; 667 668 printk("Power Management for TI OMAP.\n"); 669 ··· 724 omap_pm_init_proc(); 725 #endif 726 727 error = sysfs_create_file(power_kobj, &sleep_while_idle_attr); 728 if (error) 729 printk(KERN_ERR "sysfs_create_file failed: %d\n", error); 730 731 if (cpu_is_omap16xx()) { 732 /* configure LOW_PWR pin */
··· 67 static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 68 static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 69 70 + #ifdef CONFIG_OMAP_32K_TIMER 71 + 72 static unsigned short enable_dyn_sleep = 1; 73 74 static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr, ··· 91 static struct kobj_attribute sleep_while_idle_attr = 92 __ATTR(sleep_while_idle, 0644, idle_show, idle_store); 93 94 + #endif 95 + 96 static void (*omap_sram_idle)(void) = NULL; 97 static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; 98 ··· 104 { 105 extern __u32 arm_idlect1_mask; 106 __u32 use_idlect1 = arm_idlect1_mask; 107 + int do_sleep = 0; 108 109 local_irq_disable(); 110 local_fiq_disable(); ··· 128 use_idlect1 = use_idlect1 & ~(1 << 9); 129 #else 130 131 while (enable_dyn_sleep) { 132 133 #ifdef CONFIG_CBUS_TAHVO_USB ··· 140 do_sleep = 1; 141 break; 142 } 143 + 144 + #endif 145 146 #ifdef CONFIG_OMAP_DM_TIMER 147 use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); ··· 168 } 169 omap_sram_suspend(omap_readl(ARM_IDLECT1), 170 omap_readl(ARM_IDLECT2)); 171 172 local_fiq_enable(); 173 local_irq_enable(); ··· 661 662 static int __init omap_pm_init(void) 663 { 664 + 665 + #ifdef CONFIG_OMAP_32K_TIMER 666 int error; 667 + #endif 668 669 printk("Power Management for TI OMAP.\n"); 670 ··· 719 omap_pm_init_proc(); 720 #endif 721 722 + #ifdef CONFIG_OMAP_32K_TIMER 723 error = sysfs_create_file(power_kobj, &sleep_while_idle_attr); 724 if (error) 725 printk(KERN_ERR "sysfs_create_file failed: %d\n", error); 726 + #endif 727 728 if (cpu_is_omap16xx()) { 729 /* configure LOW_PWR pin */