ARM: tegra: power: Idle Tegra3 auto-hoplug on suspend entry
Alex Frid [Fri, 13 May 2011 04:08:34 +0000 (21:08 -0700)]
Original-Change-Id: I7f4fb6447c882a54d95ee3fb4c6149f4e0357d69
Reviewed-on: http://git-master/r/31457
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Narendra Damahe <ndamahe@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Gerrit_Virtual_Submit

Rebase-Id: Rbe2ac5f11065109d34a04793f93c873441e261be

arch/arm/mach-tegra/cpu-tegra.c
arch/arm/mach-tegra/cpu-tegra3.c
arch/arm/mach-tegra/pm.h

index 25e0981..9cdfee5 100644 (file)
@@ -477,7 +477,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);
 
@@ -494,6 +494,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);
index dd576cd..0af0dbe 100644 (file)
@@ -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) {
index 44478f7..e888538 100644 (file)
@@ -74,13 +74,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