From 8144175c1371bf2f218b20c101522b5b82fe7e79 Mon Sep 17 00:00:00 2001 From: Alex Frid Date: Thu, 12 May 2011 21:08:34 -0700 Subject: ARM: tegra: power: Idle Tegra3 auto-hoplug on suspend entry Original-Change-Id: I7f4fb6447c882a54d95ee3fb4c6149f4e0357d69 Reviewed-on: http://git-master/r/31457 Reviewed-by: Aleksandr Frid Tested-by: Aleksandr Frid Reviewed-by: Scott Williams Reviewed-by: Narendra Damahe Reviewed-by: Yu-Huan Hsu Reviewed-by: Diwakar Tundlam Tested-by: Diwakar Tundlam Tested-by: Gerrit_Virtual_Submit Rebase-Id: Rbe2ac5f11065109d34a04793f93c873441e261be --- arch/arm/mach-tegra/cpu-tegra.c | 4 +++- arch/arm/mach-tegra/cpu-tegra3.c | 7 ++++++- arch/arm/mach-tegra/pm.h | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index 2680a304f079..8280d7e9e76b 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -480,7 +480,7 @@ static int tegra_target(struct cpufreq_policy *policy, target_cpu_speed[policy->cpu] = freq; ret = tegra_cpu_cap_highest_speed(&new_speed); if (ret == 0) - tegra_auto_hotplug_governor(new_speed); + tegra_auto_hotplug_governor(new_speed, false); out: mutex_unlock(&tegra_cpu_lock); @@ -497,6 +497,8 @@ static int tegra_pm_notify(struct notifier_block *nb, unsigned long event, pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n", freq_table[suspend_index].frequency); tegra_update_cpu_speed(freq_table[suspend_index].frequency); + tegra_auto_hotplug_governor( + freq_table[suspend_index].frequency, true); } else if (event == PM_POST_SUSPEND) { is_suspended = false; tegra_cpu_edp_init(true); diff --git a/arch/arm/mach-tegra/cpu-tegra3.c b/arch/arm/mach-tegra/cpu-tegra3.c index 84ddc4ffb626..2ec00511ccbc 100644 --- a/arch/arm/mach-tegra/cpu-tegra3.c +++ b/arch/arm/mach-tegra/cpu-tegra3.c @@ -271,13 +271,18 @@ static void tegra_auto_hotplug_work_func(struct work_struct *work) } } -void tegra_auto_hotplug_governor(unsigned int cpu_freq) +void tegra_auto_hotplug_governor(unsigned int cpu_freq, bool suspend) { unsigned long up_delay; if (!is_g_cluster_present()) return; + if (suspend && (hp_state != TEGRA_HP_DISABLED)) { + hp_state = TEGRA_HP_IDLE; + return; + } + up_delay = is_lp_cluster() ? up2g0_delay : up2gn_delay; switch (hp_state) { diff --git a/arch/arm/mach-tegra/pm.h b/arch/arm/mach-tegra/pm.h index f730e8aa95b6..87f248efa3ea 100644 --- a/arch/arm/mach-tegra/pm.h +++ b/arch/arm/mach-tegra/pm.h @@ -76,13 +76,14 @@ int tegra_cpu_cap_highest_speed(unsigned int *speed_cap); #if defined(CONFIG_TEGRA_AUTO_HOTPLUG) && !defined(CONFIG_ARCH_TEGRA_2x_SOC) int tegra_auto_hotplug_init(struct mutex *cpu_lock); void tegra_auto_hotplug_exit(void); -void tegra_auto_hotplug_governor(unsigned int cpu_freq); +void tegra_auto_hotplug_governor(unsigned int cpu_freq, bool suspend); #else static inline int tegra_auto_hotplug_init(struct mutex *cpu_lock) { return 0; } static inline void tegra_auto_hotplug_exit(void) { } -static inline void tegra_auto_hotplug_governor(unsigned int cpu_freq) +static inline void tegra_auto_hotplug_governor(unsigned int cpu_freq, + bool suspend) { } #endif -- cgit v1.2.3