summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/pm-t3.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2011-05-12 22:51:34 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:13 -0800
commit188b7b80bb150669f0437755daa4ea9c42a4371a (patch)
tree856ce8fc4f9a2d5d4b8f39fb884a61a32c3b7a4a /arch/arm/mach-tegra/pm-t3.c
parent8144175c1371bf2f218b20c101522b5b82fe7e79 (diff)
ARM: tegra: power: Use CPU LP mode for Tegra3 deep sleep
Original-Change-Id: If23b48fb414332f5dd25307a098569a5474283c6 Reviewed-on: http://git-master/r/31471 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R6ba9ce7c7b355da4148ce0ebc9bc357bf5fc0b13
Diffstat (limited to 'arch/arm/mach-tegra/pm-t3.c')
-rw-r--r--arch/arm/mach-tegra/pm-t3.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/pm-t3.c b/arch/arm/mach-tegra/pm-t3.c
index 93b5e0081e8b..ad129a49d59f 100644
--- a/arch/arm/mach-tegra/pm-t3.c
+++ b/arch/arm/mach-tegra/pm-t3.c
@@ -279,6 +279,7 @@ int tegra_cluster_control(unsigned int us, unsigned int flags)
unsigned int current_cluster = is_lp_cluster()
? TEGRA_POWER_CLUSTER_LP
: TEGRA_POWER_CLUSTER_G;
+ unsigned long irq_flags;
if ((target_cluster == TEGRA_POWER_CLUSTER_MASK) || !target_cluster)
return -EINVAL;
@@ -305,7 +306,7 @@ int tegra_cluster_control(unsigned int us, unsigned int flags)
(flags & TEGRA_POWER_CLUSTER_FORCE) ? "force" : "",
us));
- local_irq_disable();
+ local_irq_save(irq_flags);
if (flags & TEGRA_POWER_SDRAM_SELFREFRESH) {
if (us)
tegra_lp2_set_trigger(us);
@@ -321,7 +322,7 @@ int tegra_cluster_control(unsigned int us, unsigned int flags)
cpu_pm_exit();
tegra_clear_cpu_in_lp2(0);
}
- local_irq_enable();
+ local_irq_restore(irq_flags);
DEBUG_CLUSTER(("%s: %s\r\n", __func__, is_lp_cluster() ? "LP" : "G"));
@@ -347,4 +348,19 @@ void tegra_lp0_resume_mc(void)
writel(mc_reserved_rsv, mc + MC_RESERVED_RSV);
writel(mc_emem_arb_override, mc + MC_EMEM_ARB_OVERRIDE);
}
+
+void tegra_lp0_cpu_mode(bool enter)
+{
+ static bool entered_on_g = false;
+ unsigned int flags;
+
+ if (enter)
+ entered_on_g = !is_lp_cluster();
+
+ if (entered_on_g) {
+ flags = enter ? TEGRA_POWER_CLUSTER_LP : TEGRA_POWER_CLUSTER_G;
+ flags |= TEGRA_POWER_CLUSTER_IMMEDIATE;
+ tegra_cluster_control(0, flags);
+ }
+}
#endif