From 29944d7b0128700fa369f0a3ab5cd6c24896f974 Mon Sep 17 00:00:00 2001 From: Alex Frid Date: Tue, 28 Feb 2012 11:33:07 -0800 Subject: ARM: tegra: power: Use CPU G mode in suspend prepare Switch to CPU G mode in Tegra3 suspend prepare if CPU suspend rate is high enough. By symmetry, it guarantees that device resume will be happening in G mode as well. Bug 946301 Signed-off-by: Alex Frid (cherry picked from commit 082be3604056c39442e1b42f5cfceeb089ffdaae) Change-Id: I42e37ce8847e4916dd0fca9e4bd44096b65f7032 Reviewed-on: http://git-master/r/89352 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Colbert Tested-by: Varun Colbert --- arch/arm/mach-tegra/cpu-tegra3.c | 8 ++++++++ arch/arm/mach-tegra/pm-t3.c | 1 + 2 files changed, 9 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-tegra/cpu-tegra3.c b/arch/arm/mach-tegra/cpu-tegra3.c index 4cb9b6f34600..76ff94435a13 100644 --- a/arch/arm/mach-tegra/cpu-tegra3.c +++ b/arch/arm/mach-tegra/cpu-tegra3.c @@ -317,6 +317,14 @@ void tegra_auto_hotplug_governor(unsigned int cpu_freq, bool suspend) if (suspend && (hp_state != TEGRA_HP_DISABLED)) { hp_state = TEGRA_HP_IDLE; + + /* Switch to G-mode if suspend rate is high enough */ + if (is_lp_cluster() && (cpu_freq >= idle_bottom_freq)) { + if (!clk_set_parent(cpu_clk, cpu_g_clk)) { + hp_stats_update(CONFIG_NR_CPUS, false); + hp_stats_update(0, true); + } + } return; } diff --git a/arch/arm/mach-tegra/pm-t3.c b/arch/arm/mach-tegra/pm-t3.c index 49a4c8951119..a83174224498 100644 --- a/arch/arm/mach-tegra/pm-t3.c +++ b/arch/arm/mach-tegra/pm-t3.c @@ -429,6 +429,7 @@ void tegra_lp0_cpu_mode(bool enter) flags = enter ? TEGRA_POWER_CLUSTER_LP : TEGRA_POWER_CLUSTER_G; flags |= TEGRA_POWER_CLUSTER_IMMEDIATE; tegra_cluster_control(0, flags); + pr_info("Tegra: switched to %s cluster\n", enter ? "LP" : "G"); } } #endif -- cgit v1.2.3