ARM: tegra: power: Rename CPU idle rate control APIs
[linux-3.10.git] / arch / arm / mach-tegra / cpuidle-t11x.c
index 5592aa0..3c11573 100644 (file)
@@ -3,7 +3,7 @@
  *
  * CPU idle driver for Tegra11x CPUs
  *
- * Copyright (c) 2012-2013, NVIDIA Corporation.
+ * Copyright (c) 2012-2013, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #define ARCH_TIMER_CTRL_ENABLE          (1 << 0)
 #define ARCH_TIMER_CTRL_IT_MASK         (1 << 1)
 
-#define TEGRA_MIN_RESIDENCY_CLKGT_VMIN 2000
-#define TEGRA_MIN_RESIDENCY_NCPU_SLOW  2000
-#define TEGRA_MIN_RESIDENCY_NCPU_FAST  13000
-
 #ifdef CONFIG_SMP
 static s64 tegra_cpu_wake_by_time[4] = {
        LLONG_MAX, LLONG_MAX, LLONG_MAX, LLONG_MAX };
@@ -478,7 +474,7 @@ bool tegra11x_idle_power_down(struct cpuidle_device *dev,
 
        if (is_lp_cluster()) {
                if (slow_cluster_power_gating_noncpu &&
-                       (request > TEGRA_MIN_RESIDENCY_NCPU_SLOW))
+                       (request > tegra_min_residency_ncpu()))
                                power_gating_cpu_only = false;
                else
                        power_gating_cpu_only = true;
@@ -492,8 +488,8 @@ bool tegra11x_idle_power_down(struct cpuidle_device *dev,
                        else if (tegra_force_clkgt_at_vmin ==
                                        TEGRA_CPUIDLE_FORCE_NO_CLKGT_VMIN)
                                clkgt_at_vmin = false;
-                       else if ((request >= TEGRA_MIN_RESIDENCY_CLKGT_VMIN) &&
-                                (request < TEGRA_MIN_RESIDENCY_NCPU_FAST))
+                       else if ((request >= tegra_min_residency_vmin_fmin()) &&
+                                (request < tegra_min_residency_ncpu()))
                                clkgt_at_vmin = true;
 
                        if (!cpu_gating_only && tegra_rail_off_is_allowed()) {
@@ -501,7 +497,7 @@ bool tegra11x_idle_power_down(struct cpuidle_device *dev,
                                                TEGRA_POWER_CLUSTER_FORCE_MASK)
                                        power_gating_cpu_only = false;
                                else if (request >
-                                               TEGRA_MIN_RESIDENCY_NCPU_FAST)
+                                               tegra_min_residency_ncpu())
                                        power_gating_cpu_only = false;
                                else
                                        power_gating_cpu_only = true;
@@ -512,26 +508,26 @@ bool tegra11x_idle_power_down(struct cpuidle_device *dev,
 
        if (clkgt_at_vmin) {
                rate = 0;
-               status = tegra11_cpu_dfll_rate_exchange(&rate);
+               status = tegra_cpu_g_idle_rate_exchange(&rate);
                if (!status) {
                        idle_stats.clk_gating_vmin++;
                        cpu_do_idle();
-                       tegra11_cpu_dfll_rate_exchange(&rate);
-                       power_down = false;
+                       tegra_cpu_g_idle_rate_exchange(&rate);
+                       power_down = true;
                } else
                        power_down = tegra_cpu_core_power_down(dev, state,
                                                                request);
        } else if (!power_gating_cpu_only) {
                if (is_lp_cluster()) {
                        rate = ULONG_MAX;
-                       status = tegra_cpu_backup_rate_exchange(&rate);
+                       status = tegra_cpu_lp_idle_rate_exchange(&rate);
                }
 
                power_down = tegra_cpu_cluster_power_down(dev, state, request);
 
                /* restore cpu clock after cluster power ungating */
                if (status == 0)
-                       tegra_cpu_backup_rate_exchange(&rate);
+                       tegra_cpu_lp_idle_rate_exchange(&rate);
        } else
                power_down = tegra_cpu_core_power_down(dev, state, request);