summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/pm-t3.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2011-11-19 17:28:31 -0800
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-15 12:06:15 +0530
commit051a0b2e40779eee1125308bac32e1957570ccd6 (patch)
tree543f5ff68118d020092e3b6c88d178810027a5b3 /arch/arm/mach-tegra/pm-t3.c
parent7b6ad0c9924f567c8bd4dd7c2fbadf6ee8a960a8 (diff)
ARM: tegra: dvfs: Add DVFS rails statistic
On Tegra3: complete account of in- and out-of-bound rails control. On Tegra2: out-of-bound vdd_cpu control in LP2 state is not accounted. Change-Id: Ib68cbbfe3e4f965e758aca17a0ba30277d530347 Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/67340 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/pm-t3.c')
-rw-r--r--arch/arm/mach-tegra/pm-t3.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/arch/arm/mach-tegra/pm-t3.c b/arch/arm/mach-tegra/pm-t3.c
index df20340ed508..23ff0fe4c97c 100644
--- a/arch/arm/mach-tegra/pm-t3.c
+++ b/arch/arm/mach-tegra/pm-t3.c
@@ -38,6 +38,7 @@
#include "pm.h"
#include "sleep.h"
#include "tegra3_emc.h"
+#include "dvfs.h"
#ifdef CONFIG_TEGRA_CLUSTER_CONTROL
#define CAR_CCLK_BURST_POLICY \
@@ -322,26 +323,32 @@ int tegra_cluster_control(unsigned int us, unsigned int flags)
if (flags & TEGRA_POWER_CLUSTER_IMMEDIATE)
us = 0;
- if (current_cluster != target_cluster && !timekeeping_suspended) {
- if (target_cluster == TEGRA_POWER_CLUSTER_G) {
- s64 t = ktime_to_us(ktime_sub(ktime_get(), last_g2lp));
- s64 t_off = tegra_cpu_power_off_time();
- if (t_off > t)
- udelay((unsigned int)(t_off - t));
- }
- else
- last_g2lp = ktime_get();
- }
-
DEBUG_CLUSTER(("%s(LP%d): %s->%s %s %s %d\r\n", __func__,
(flags & TEGRA_POWER_SDRAM_SELFREFRESH) ? 1 : 2,
is_lp_cluster() ? "LP" : "G",
(target_cluster == TEGRA_POWER_CLUSTER_G) ? "G" : "LP",
(flags & TEGRA_POWER_CLUSTER_IMMEDIATE) ? "immediate" : "",
(flags & TEGRA_POWER_CLUSTER_FORCE) ? "force" : "",
- us));
+ us));
local_irq_save(irq_flags);
+
+ if (current_cluster != target_cluster && !timekeeping_suspended) {
+ ktime_t now = ktime_get();
+ if (target_cluster == TEGRA_POWER_CLUSTER_G) {
+ s64 t = ktime_to_us(ktime_sub(now, last_g2lp));
+ s64 t_off = tegra_cpu_power_off_time();
+ if (t_off > t)
+ udelay((unsigned int)(t_off - t));
+
+ tegra_dvfs_rail_on(tegra_cpu_rail, now);
+
+ } else {
+ last_g2lp = now;
+ tegra_dvfs_rail_off(tegra_cpu_rail, now);
+ }
+ }
+
if (flags & TEGRA_POWER_SDRAM_SELFREFRESH) {
if (us)
tegra_lp2_set_trigger(us);