Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 010bb0cf authored by Vivek Kutal's avatar Vivek Kutal Committed by Tony Lindgren
Browse files

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: default avatarVivek Kutal <vivek.kutal@celunite.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 087c5030
Loading
Loading
Loading
Loading
+12 −5
Original line number Original line Diff line number Diff line
@@ -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 mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE];
static unsigned int mpui1610_sleep_save[MPUI1610_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 unsigned short enable_dyn_sleep = 1;


static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr,
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 =
static struct kobj_attribute sleep_while_idle_attr =
	__ATTR(sleep_while_idle, 0644, idle_show, idle_store);
	__ATTR(sleep_while_idle, 0644, idle_show, idle_store);


#endif

static void (*omap_sram_idle)(void) = NULL;
static void (*omap_sram_idle)(void) = NULL;
static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = 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;
	extern __u32 arm_idlect1_mask;
	__u32 use_idlect1 = arm_idlect1_mask;
	__u32 use_idlect1 = arm_idlect1_mask;
#ifndef CONFIG_OMAP_MPU_TIMER
	int do_sleep = 0;
	int do_sleep;
#endif


	local_irq_disable();
	local_irq_disable();
	local_fiq_disable();
	local_fiq_disable();
@@ -128,7 +130,6 @@ void omap_pm_idle(void)
	use_idlect1 = use_idlect1 & ~(1 << 9);
	use_idlect1 = use_idlect1 & ~(1 << 9);
#else
#else


	do_sleep = 0;
	while (enable_dyn_sleep) {
	while (enable_dyn_sleep) {


#ifdef CONFIG_CBUS_TAHVO_USB
#ifdef CONFIG_CBUS_TAHVO_USB
@@ -141,6 +142,8 @@ void omap_pm_idle(void)
		break;
		break;
	}
	}


#endif

#ifdef CONFIG_OMAP_DM_TIMER
#ifdef CONFIG_OMAP_DM_TIMER
	use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1);
	use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1);
#endif
#endif
@@ -168,7 +171,6 @@ void omap_pm_idle(void)
	}
	}
	omap_sram_suspend(omap_readl(ARM_IDLECT1),
	omap_sram_suspend(omap_readl(ARM_IDLECT1),
			  omap_readl(ARM_IDLECT2));
			  omap_readl(ARM_IDLECT2));
#endif


	local_fiq_enable();
	local_fiq_enable();
	local_irq_enable();
	local_irq_enable();
@@ -661,7 +663,10 @@ static struct platform_suspend_ops omap_pm_ops ={


static int __init omap_pm_init(void)
static int __init omap_pm_init(void)
{
{

#ifdef CONFIG_OMAP_32K_TIMER
	int error;
	int error;
#endif


	printk("Power Management for TI OMAP.\n");
	printk("Power Management for TI OMAP.\n");


@@ -719,9 +724,11 @@ static int __init omap_pm_init(void)
	omap_pm_init_proc();
	omap_pm_init_proc();
#endif
#endif


#ifdef CONFIG_OMAP_32K_TIMER
	error = sysfs_create_file(power_kobj, &sleep_while_idle_attr);
	error = sysfs_create_file(power_kobj, &sleep_while_idle_attr);
	if (error)
	if (error)
		printk(KERN_ERR "sysfs_create_file failed: %d\n", error);
		printk(KERN_ERR "sysfs_create_file failed: %d\n", error);
#endif


	if (cpu_is_omap16xx()) {
	if (cpu_is_omap16xx()) {
		/* configure LOW_PWR pin */
		/* configure LOW_PWR pin */