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