aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/pm.c')
-rw-r--r--arch/arm/mach-omap1/pm.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 06b7e54a0128..8eb5dcdaead2 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -57,7 +57,6 @@
57#include <asm/arch/pm.h> 57#include <asm/arch/pm.h>
58#include <asm/arch/mux.h> 58#include <asm/arch/mux.h>
59#include <asm/arch/dma.h> 59#include <asm/arch/dma.h>
60#include <asm/arch/dsp_common.h>
61#include <asm/arch/dmtimer.h> 60#include <asm/arch/dmtimer.h>
62 61
63static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 62static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
@@ -67,6 +66,8 @@ static unsigned int mpui730_sleep_save[MPUI730_SLEEP_SAVE_SIZE];
67static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 66static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE];
68static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 67static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
69 68
69#ifdef CONFIG_OMAP_32K_TIMER
70
70static unsigned short enable_dyn_sleep = 1; 71static unsigned short enable_dyn_sleep = 1;
71 72
72static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr, 73static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr,
@@ -91,7 +92,8 @@ static ssize_t idle_store(struct kobject *kobj, struct kobj_attribute *attr,
91static struct kobj_attribute sleep_while_idle_attr = 92static struct kobj_attribute sleep_while_idle_attr =
92 __ATTR(sleep_while_idle, 0644, idle_show, idle_store); 93 __ATTR(sleep_while_idle, 0644, idle_show, idle_store);
93 94
94static void (*omap_sram_idle)(void) = NULL; 95#endif
96
95static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; 97static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL;
96 98
97/* 99/*
@@ -104,9 +106,7 @@ void omap_pm_idle(void)
104{ 106{
105 extern __u32 arm_idlect1_mask; 107 extern __u32 arm_idlect1_mask;
106 __u32 use_idlect1 = arm_idlect1_mask; 108 __u32 use_idlect1 = arm_idlect1_mask;
107#ifndef CONFIG_OMAP_MPU_TIMER 109 int do_sleep = 0;
108 int do_sleep;
109#endif
110 110
111 local_irq_disable(); 111 local_irq_disable();
112 local_fiq_disable(); 112 local_fiq_disable();
@@ -128,7 +128,6 @@ void omap_pm_idle(void)
128 use_idlect1 = use_idlect1 & ~(1 << 9); 128 use_idlect1 = use_idlect1 & ~(1 << 9);
129#else 129#else
130 130
131 do_sleep = 0;
132 while (enable_dyn_sleep) { 131 while (enable_dyn_sleep) {
133 132
134#ifdef CONFIG_CBUS_TAHVO_USB 133#ifdef CONFIG_CBUS_TAHVO_USB
@@ -141,6 +140,8 @@ void omap_pm_idle(void)
141 break; 140 break;
142 } 141 }
143 142
143#endif
144
144#ifdef CONFIG_OMAP_DM_TIMER 145#ifdef CONFIG_OMAP_DM_TIMER
145 use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); 146 use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1);
146#endif 147#endif
@@ -168,7 +169,6 @@ void omap_pm_idle(void)
168 } 169 }
169 omap_sram_suspend(omap_readl(ARM_IDLECT1), 170 omap_sram_suspend(omap_readl(ARM_IDLECT1),
170 omap_readl(ARM_IDLECT2)); 171 omap_readl(ARM_IDLECT2));
171#endif
172 172
173 local_fiq_enable(); 173 local_fiq_enable();
174 local_irq_enable(); 174 local_irq_enable();
@@ -661,7 +661,10 @@ static struct platform_suspend_ops omap_pm_ops ={
661 661
662static int __init omap_pm_init(void) 662static int __init omap_pm_init(void)
663{ 663{
664
665#ifdef CONFIG_OMAP_32K_TIMER
664 int error; 666 int error;
667#endif
665 668
666 printk("Power Management for TI OMAP.\n"); 669 printk("Power Management for TI OMAP.\n");
667 670
@@ -671,23 +674,17 @@ static int __init omap_pm_init(void)
671 * memory the MPU can see when it wakes up. 674 * memory the MPU can see when it wakes up.
672 */ 675 */
673 if (cpu_is_omap730()) { 676 if (cpu_is_omap730()) {
674 omap_sram_idle = omap_sram_push(omap730_idle_loop_suspend,
675 omap730_idle_loop_suspend_sz);
676 omap_sram_suspend = omap_sram_push(omap730_cpu_suspend, 677 omap_sram_suspend = omap_sram_push(omap730_cpu_suspend,
677 omap730_cpu_suspend_sz); 678 omap730_cpu_suspend_sz);
678 } else if (cpu_is_omap15xx()) { 679 } else if (cpu_is_omap15xx()) {
679 omap_sram_idle = omap_sram_push(omap1510_idle_loop_suspend,
680 omap1510_idle_loop_suspend_sz);
681 omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend, 680 omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend,
682 omap1510_cpu_suspend_sz); 681 omap1510_cpu_suspend_sz);
683 } else if (cpu_is_omap16xx()) { 682 } else if (cpu_is_omap16xx()) {
684 omap_sram_idle = omap_sram_push(omap1610_idle_loop_suspend,
685 omap1610_idle_loop_suspend_sz);
686 omap_sram_suspend = omap_sram_push(omap1610_cpu_suspend, 683 omap_sram_suspend = omap_sram_push(omap1610_cpu_suspend,
687 omap1610_cpu_suspend_sz); 684 omap1610_cpu_suspend_sz);
688 } 685 }
689 686
690 if (omap_sram_idle == NULL || omap_sram_suspend == NULL) { 687 if (omap_sram_suspend == NULL) {
691 printk(KERN_ERR "PM not initialized: Missing SRAM support\n"); 688 printk(KERN_ERR "PM not initialized: Missing SRAM support\n");
692 return -ENODEV; 689 return -ENODEV;
693 } 690 }
@@ -719,9 +716,11 @@ static int __init omap_pm_init(void)
719 omap_pm_init_proc(); 716 omap_pm_init_proc();
720#endif 717#endif
721 718
719#ifdef CONFIG_OMAP_32K_TIMER
722 error = sysfs_create_file(power_kobj, &sleep_while_idle_attr); 720 error = sysfs_create_file(power_kobj, &sleep_while_idle_attr);
723 if (error) 721 if (error)
724 printk(KERN_ERR "sysfs_create_file failed: %d\n", error); 722 printk(KERN_ERR "sysfs_create_file failed: %d\n", error);
723#endif
725 724
726 if (cpu_is_omap16xx()) { 725 if (cpu_is_omap16xx()) {
727 /* configure LOW_PWR pin */ 726 /* configure LOW_PWR pin */