Revert "ARM: tegra: cpuidle: remove redundant parameters for powered-down mode"
Dan Willemsen [Tue, 20 Aug 2013 04:42:22 +0000 (21:42 -0700)]
This reverts commit 4d82d0587b4a964ea3a7c73aa044b433000527dd.

Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>

arch/arm/mach-tegra/cpuidle-tegra20.c
arch/arm/mach-tegra/cpuidle-tegra30.c
arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/pm.h

index c6d9de3..9d3d54c 100644 (file)
@@ -129,6 +129,10 @@ static bool tegra20_cpu_cluster_power_down(struct cpuidle_device *dev,
                                           struct cpuidle_driver *drv,
                                           int index)
 {
+       struct cpuidle_state *state = &drv->states[index];
+       u32 cpu_on_time = state->exit_latency;
+       u32 cpu_off_time = state->target_residency - state->exit_latency;
+
        while (tegra20_cpu_is_resettable_soon())
                cpu_relax();
 
@@ -137,7 +141,7 @@ static bool tegra20_cpu_cluster_power_down(struct cpuidle_device *dev,
 
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
 
-       tegra_idle_lp2_last();
+       tegra_idle_lp2_last(cpu_on_time, cpu_off_time);
 
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
 
index b3e0d3d..9299684 100644 (file)
@@ -71,6 +71,10 @@ static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev,
                                           struct cpuidle_driver *drv,
                                           int index)
 {
+       struct cpuidle_state *state = &drv->states[index];
+       u32 cpu_on_time = state->exit_latency;
+       u32 cpu_off_time = state->target_residency - state->exit_latency;
+
        /* All CPUs entering LP2 is not working.
         * Don't let CPU0 enter LP2 when any secondary CPU is online.
         */
@@ -81,7 +85,7 @@ static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev,
 
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
 
-       tegra_idle_lp2_last();
+       tegra_idle_lp2_last(cpu_on_time, cpu_off_time);
 
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
 
index 6ce6beb..14957ff 100644 (file)
@@ -135,7 +135,7 @@ static int tegra_sleep_cpu(unsigned long v2p)
        return 0;
 }
 
-void tegra_idle_lp2_last(void)
+void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time)
 {
        tegra_pmc_pm_set(TEGRA_SUSPEND_LP2);
 
index 9d2d038..73a45f1 100644 (file)
@@ -31,7 +31,7 @@ void restore_cpu_arch_register(void);
 void tegra_clear_cpu_in_lp2(int phy_cpu_id);
 bool tegra_set_cpu_in_lp2(int phy_cpu_id);
 
-void tegra_idle_lp2_last(void);
+void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time);
 extern void (*tegra_tear_down_cpu)(void);
 
 #ifdef CONFIG_PM_SLEEP