From 010bb0cf42fe2fa0a00753e0c11a3e8bfefb37a3 Mon Sep 17 00:00:00 2001 From: Vivek Kutal Date: Tue, 11 Dec 2007 21:46:31 +0530 Subject: 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 Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/pm.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'arch/arm/mach-omap1/pm.c') 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]; static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; +#ifdef CONFIG_OMAP_32K_TIMER + static unsigned short enable_dyn_sleep = 1; static 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, static struct kobj_attribute sleep_while_idle_attr = __ATTR(sleep_while_idle, 0644, idle_show, idle_store); +#endif + static void (*omap_sram_idle)(void) = NULL; static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; @@ -104,9 +108,7 @@ void omap_pm_idle(void) { extern __u32 arm_idlect1_mask; __u32 use_idlect1 = arm_idlect1_mask; -#ifndef CONFIG_OMAP_MPU_TIMER - int do_sleep; -#endif + int do_sleep = 0; local_irq_disable(); local_fiq_disable(); @@ -128,7 +130,6 @@ void omap_pm_idle(void) use_idlect1 = use_idlect1 & ~(1 << 9); #else - do_sleep = 0; while (enable_dyn_sleep) { #ifdef CONFIG_CBUS_TAHVO_USB @@ -141,6 +142,8 @@ void omap_pm_idle(void) break; } +#endif + #ifdef CONFIG_OMAP_DM_TIMER use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); #endif @@ -168,7 +171,6 @@ void omap_pm_idle(void) } omap_sram_suspend(omap_readl(ARM_IDLECT1), omap_readl(ARM_IDLECT2)); -#endif local_fiq_enable(); local_irq_enable(); @@ -661,7 +663,10 @@ static struct platform_suspend_ops omap_pm_ops ={ static int __init omap_pm_init(void) { + +#ifdef CONFIG_OMAP_32K_TIMER int error; +#endif printk("Power Management for TI OMAP.\n"); @@ -719,9 +724,11 @@ static int __init omap_pm_init(void) omap_pm_init_proc(); #endif +#ifdef CONFIG_OMAP_32K_TIMER error = sysfs_create_file(power_kobj, &sleep_while_idle_attr); if (error) printk(KERN_ERR "sysfs_create_file failed: %d\n", error); +#endif if (cpu_is_omap16xx()) { /* configure LOW_PWR pin */ -- cgit v1.2.2 From feb72f3b313e1f068b707773e9231af4f87d9580 Mon Sep 17 00:00:00 2001 From: Vivek Kutal Date: Mon, 17 Dec 2007 01:56:33 -0800 Subject: ARM: OMAP1: Remove omap_sram_idle() This patch removes omap_sram_idle() that is no longer used. The function called in pm_idle is omap_sram_suspend, omap_sram_idle() is not used anywhere in omap1. Signed-off-by: Vivek Kutal Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/pm.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'arch/arm/mach-omap1/pm.c') diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 64adb24ffb7f..1a2a37158576 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -95,7 +95,6 @@ static struct kobj_attribute sleep_while_idle_attr = #endif -static void (*omap_sram_idle)(void) = NULL; static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; /* @@ -676,23 +675,17 @@ static int __init omap_pm_init(void) * memory the MPU can see when it wakes up. */ if (cpu_is_omap730()) { - omap_sram_idle = omap_sram_push(omap730_idle_loop_suspend, - omap730_idle_loop_suspend_sz); omap_sram_suspend = omap_sram_push(omap730_cpu_suspend, omap730_cpu_suspend_sz); } else if (cpu_is_omap15xx()) { - omap_sram_idle = omap_sram_push(omap1510_idle_loop_suspend, - omap1510_idle_loop_suspend_sz); omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend, omap1510_cpu_suspend_sz); } else if (cpu_is_omap16xx()) { - omap_sram_idle = omap_sram_push(omap1610_idle_loop_suspend, - omap1610_idle_loop_suspend_sz); omap_sram_suspend = omap_sram_push(omap1610_cpu_suspend, omap1610_cpu_suspend_sz); } - if (omap_sram_idle == NULL || omap_sram_suspend == NULL) { + if (omap_sram_suspend == NULL) { printk(KERN_ERR "PM not initialized: Missing SRAM support\n"); return -ENODEV; } -- cgit v1.2.2 From e27a93a944a5ba6a0112750c8243abba86d56e94 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Tue, 18 Dec 2007 20:58:32 -0800 Subject: ARM: OMAP1: Misc clean-up This patch cleans up omap1 files to sync up with linux-omap tree: - Remove omap-generic MMC config as it should be defined in board-*.c files instead of using board-generic.c - New style I2C board_info from David Brownell - Init section fixes from Dirk Behme Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/pm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-omap1/pm.c') diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 1a2a37158576..8eb5dcdaead2 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -57,7 +57,6 @@ #include #include #include -#include #include static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; -- cgit v1.2.2