summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Nihalani <bnihalani@nvidia.com>2011-10-19 18:54:11 +0530
committerRyan Wong <ryanw@nvidia.com>2011-10-20 13:38:12 -0700
commit79fa0356c68094475d5aad2e0c1bae84ff3a0e7c (patch)
tree402e080241b93ae63e3f546b9e54ede93ec2b4e6
parenta9e089738aea5e14848af25880c454b893ddd6a0 (diff)
Revert "ARM: tegra: power: Update Tegra3 LP2 time prediction"
This reverts commit 47450edc2d22b5561c9aebcf09ea7179d8162c18. Change-Id: If84baf4b3f1776006ffacdb1c0275c1fc9bc21ba Reviewed-on: http://git-master/r/59402 Reviewed-by: Ryan Wong <ryanw@nvidia.com> Tested-by: Ryan Wong <ryanw@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/cpuidle-t3.c12
-rw-r--r--arch/arm/mach-tegra/localtimer.c4
-rw-r--r--arch/arm/mach-tegra/power.h1
3 files changed, 2 insertions, 15 deletions
diff --git a/arch/arm/mach-tegra/cpuidle-t3.c b/arch/arm/mach-tegra/cpuidle-t3.c
index 5d8bb1903aa5..f45ae3e7fc9d 100644
--- a/arch/arm/mach-tegra/cpuidle-t3.c
+++ b/arch/arm/mach-tegra/cpuidle-t3.c
@@ -267,8 +267,6 @@ void tegra_idle_enter_lp2_cpu_0(struct cpuidle_device *dev,
void tegra_idle_enter_lp2_cpu_n(struct cpuidle_device *dev,
struct cpuidle_state *state)
{
- u32 twd_ctrl;
- u32 twd_cnt;
s64 request;
s64 sleep_time;
ktime_t enter;
@@ -277,15 +275,7 @@ void tegra_idle_enter_lp2_cpu_n(struct cpuidle_device *dev,
if (need_resched())
return;
- request = 0;
- twd_ctrl = readl(twd_base + TWD_TIMER_CONTROL);
-
- if ((twd_ctrl & TWD_TIMER_CONTROL_ENABLE) &&
- (twd_ctrl & TWD_TIMER_CONTROL_IT_ENABLE)) {
- twd_cnt = readl(twd_base + TWD_TIMER_COUNTER);
- request = twd_cnt / TWD_MHZ;
- }
-
+ request = ktime_to_us(tick_nohz_get_sleep_length());
if (request < tegra_lp2_exit_latency) {
/*
* Not enough time left to enter LP2
diff --git a/arch/arm/mach-tegra/localtimer.c b/arch/arm/mach-tegra/localtimer.c
index 09d63343eddf..ead217b90eea 100644
--- a/arch/arm/mach-tegra/localtimer.c
+++ b/arch/arm/mach-tegra/localtimer.c
@@ -15,8 +15,6 @@
#include <asm/smp_twd.h>
#include <asm/localtimer.h>
-#include "power.h"
-
/*
* Setup the local clock events for a CPU.
*/
@@ -26,6 +24,6 @@ void __cpuinit local_timer_setup(struct clock_event_device *evt)
#ifdef CONFIG_ARCH_TEGRA_2x_SOC
twd_timer_setup_scalable(evt, 2500000, 4);
#else
- twd_timer_setup_scalable(evt, TWD_MHZ * 1000000, 2);
+ twd_timer_setup_scalable(evt, 4000000, 2);
#endif
}
diff --git a/arch/arm/mach-tegra/power.h b/arch/arm/mach-tegra/power.h
index 3b1b9dcc1a67..5e462aceef50 100644
--- a/arch/arm/mach-tegra/power.h
+++ b/arch/arm/mach-tegra/power.h
@@ -167,7 +167,6 @@ static inline bool tegra_lp2_is_allowed(struct cpuidle_device *dev,
#define INSTRUMENT_CLUSTER_SWITCH 1 /* Should be zero for shipping code */
#define DEBUG_CLUSTER_SWITCH 1 /* Should be zero for shipping code */
#define PARAMETERIZE_CLUSTER_SWITCH 1 /* Should be zero for shipping code */
-#define TWD_MHZ 4 /* Local TWD timers rate */
int tegra_cluster_control(unsigned int us, unsigned int flags);
void tegra_cluster_switch_prolog(unsigned int flags);
void tegra_cluster_switch_epilog(unsigned int flags);