summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/cpuidle.c
diff options
context:
space:
mode:
authorScott Williams <scwilliams@nvidia.com>2011-06-29 14:57:29 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:42:50 -0800
commitde45645f64b8ab4d84e6cba7ad37514629baeb13 (patch)
treea71974bfecad899fa69c6e449d927511b450498a /arch/arm/mach-tegra/cpuidle.c
parent9d63ba29502b2fade968d9ae00e3d328d758eb41 (diff)
ARM: tegra: power: Restore LP2 in idle protections
Restore the code that was dropped in the port to Linux 2.6.39 that protects against using LP2 mode for idle when the platform suspend mode has disallowed the use of LP2 mode. Also cleans up some warning messages. Change-Id: I357210b8a272c10bf7c1e773342dc864bbddb74e Reviewed-on: http://git-master/r/40463 Tested-by: Daniel Willemsen <dwillemsen@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Rebase-Id: R6a60e3f0f2ebf06ec9701475af41679c24ef80ab
Diffstat (limited to 'arch/arm/mach-tegra/cpuidle.c')
-rw-r--r--arch/arm/mach-tegra/cpuidle.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index 3ac61373e186..91f5fc236a04 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -68,6 +68,11 @@ struct cpuidle_driver tegra_idle = {
static DEFINE_PER_CPU(struct cpuidle_device *, idle_devices);
+void tegra_lp2_in_idle(bool enable)
+{
+ lp2_in_idle = enable;
+}
+
static inline unsigned int time_to_bin(unsigned int time)
{
return fls(time);
@@ -100,7 +105,7 @@ static int tegra_idle_enter_lp2(struct cpuidle_device *dev,
ktime_t enter, exit;
s64 us;
- if (lp2_disabled_by_suspend)
+ if (!lp2_in_idle || lp2_disabled_by_suspend)
return tegra_idle_enter_lp3(dev, state);
local_irq_disable();
@@ -151,8 +156,6 @@ static int tegra_cpuidle_register_device(unsigned int cpu)
dev->state_count = 0;
dev->cpu = cpu;
- tegra_lp2_min_residency = tegra_cpu_lp2_min_residency();
-
state = &dev->states[0];
snprintf(state->name, CPUIDLE_NAME_LEN, "LP3");
snprintf(state->desc, CPUIDLE_DESC_LEN, "CPU flow-controlled");
@@ -215,6 +218,9 @@ static int __init tegra_cpuidle_init(void)
if (ret)
return ret;
+ /* !!!FIXME!!! Add tegra_lp2_power_off_time */
+ tegra_lp2_min_residency = tegra_cpu_lp2_min_residency();
+
for_each_possible_cpu(cpu) {
if (tegra_cpuidle_register_device(cpu))
pr_err("CPU%u: error initializing idle loop\n", cpu);