ARM: tegra: dvfs: Rename rail cooling device
Alex Frid [Sun, 21 Apr 2013 00:12:54 +0000 (17:12 -0700)]
Renamed rail cooling device from "pll_mode_cdev" to "vmin_cdev" to
clearly show association with rail Vmin control.

Change-Id: I9173305824fed13a2c10f7c20f4c1c2ba8186a79
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/221348
(cherry picked from commit c444cb0f8aa3d243e1cc4b93b0dca03037cb2d5b)
Reviewed-on: http://git-master/r/221866
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

arch/arm/mach-tegra/board-common.c
arch/arm/mach-tegra/dvfs.c
arch/arm/mach-tegra/dvfs.h
arch/arm/mach-tegra/tegra11_dvfs.c
arch/arm/mach-tegra/tegra_cl_dvfs.c

index 54d0414..113fe53 100644 (file)
@@ -166,8 +166,9 @@ static void tegra_add_trip_points(struct thermal_trip_info *trips,
 
 void tegra_add_cdev_trips(struct thermal_trip_info *trips, int *num_trips)
 {
-       tegra_add_trip_points(trips, num_trips, tegra_dvfs_get_cpu_pll_cdev());
-       tegra_add_trip_points(trips, num_trips, tegra_dvfs_get_core_cdev());
+       tegra_add_trip_points(trips, num_trips, tegra_dvfs_get_cpu_vmin_cdev());
+       tegra_add_trip_points(trips, num_trips,
+                             tegra_dvfs_get_core_vmin_cdev());
 }
 
 void tegra_add_tj_trips(struct thermal_trip_info *trips, int *num_trips)
index 1f37a4c..26d6b3f 100644 (file)
@@ -74,17 +74,17 @@ static void dvfs_validate_cdevs(struct dvfs_rail *rail)
                WARN(1, "%s: not matching thermal floors/num\n", rail->reg_id);
        }
 
-       if (rail->pll_mode_cdev) {
-               if (rail->pll_mode_cdev->trip_temperatures_num !=
+       if (rail->vmin_cdev) {
+               if (rail->vmin_cdev->trip_temperatures_num !=
                    rail->therm_mv_floors_num) {
-                       rail->pll_mode_cdev = NULL;
+                       rail->vmin_cdev = NULL;
                        WARN(1, "%s: not matching thermal floors/trips\n",
                             rail->reg_id);
                }
        }
 
-       if (rail->therm_mv_floors && !rail->pll_mode_cdev)
-               WARN(1, "%s: missing pll mode cooling device\n", rail->reg_id);
+       if (rail->therm_mv_floors && !rail->vmin_cdev)
+               WARN(1, "%s: missing vmin cooling device\n", rail->reg_id);
 }
 
 int tegra_dvfs_init_rails(struct dvfs_rail *rails[], int n)
@@ -866,17 +866,17 @@ int tegra_dvfs_dfll_mode_clear(struct dvfs *d, unsigned long rate)
        return ret;
 }
 
-struct tegra_cooling_device *tegra_dvfs_get_cpu_pll_cdev(void)
+struct tegra_cooling_device *tegra_dvfs_get_cpu_vmin_cdev(void)
 {
        if (tegra_cpu_rail)
-               return tegra_cpu_rail->pll_mode_cdev;
+               return tegra_cpu_rail->vmin_cdev;
        return NULL;
 }
 
-struct tegra_cooling_device *tegra_dvfs_get_core_cdev(void)
+struct tegra_cooling_device *tegra_dvfs_get_core_vmin_cdev(void)
 {
        if (tegra_core_rail)
-               return tegra_core_rail->pll_mode_cdev;
+               return tegra_core_rail->vmin_cdev;
        return NULL;
 }
 
@@ -886,7 +886,7 @@ static int tegra_dvfs_rail_get_cdev_max_state(
        struct thermal_cooling_device *cdev, unsigned long *max_state)
 {
        struct dvfs_rail *rail = (struct dvfs_rail *)cdev->devdata;
-       *max_state = rail->pll_mode_cdev->trip_temperatures_num;
+       *max_state = rail->vmin_cdev->trip_temperatures_num;
        return 0;
 }
 
@@ -918,20 +918,20 @@ static struct thermal_cooling_device_ops tegra_dvfs_rail_cooling_ops = {
        .set_cur_state = tegra_dvfs_rail_set_cdev_state,
 };
 
-static void tegra_dvfs_rail_register_pll_mode_cdev(struct dvfs_rail *rail)
+static void tegra_dvfs_rail_register_vmin_cdev(struct dvfs_rail *rail)
 {
-       if (!rail->pll_mode_cdev)
+       if (!rail->vmin_cdev)
                return;
 
        /* just report error - initialized for cold temperature, anyway */
        if (IS_ERR_OR_NULL(thermal_cooling_device_register(
-               rail->pll_mode_cdev->cdev_type, (void *)rail,
+               rail->vmin_cdev->cdev_type, (void *)rail,
                &tegra_dvfs_rail_cooling_ops)))
                pr_err("tegra cooling device %s failed to register\n",
-                      rail->pll_mode_cdev->cdev_type);
+                      rail->vmin_cdev->cdev_type);
 }
 #else
-#define tegra_dvfs_rail_register_pll_mode_cdev(rail)
+#define tegra_dvfs_rail_register_vmin_cdev(rail)
 #endif
 
 /* Directly set cold temperature limit in dfll mode */
@@ -991,7 +991,7 @@ int __init tegra_dvfs_late_init(void)
        register_reboot_notifier(&tegra_dvfs_reboot_nb);
 
        list_for_each_entry(rail, &dvfs_rail_list, node)
-               tegra_dvfs_rail_register_pll_mode_cdev(rail);
+               tegra_dvfs_rail_register_vmin_cdev(rail);
 
        return 0;
 }
index d38f8a8..4e8adf5 100644 (file)
@@ -84,7 +84,7 @@ struct dvfs_rail {
        bool dfll_mode;
        bool dfll_mode_updating;
        int thermal_idx;
-       struct tegra_cooling_device *pll_mode_cdev;
+       struct tegra_cooling_device *vmin_cdev;
        struct rail_stats stats;
 };
 
@@ -219,8 +219,8 @@ int tegra_cpu_dvfs_alter(int edp_thermal_index, const cpumask_t *cpus,
                         bool before_clk_update, int cpu_event);
 int tegra_dvfs_dfll_mode_set(struct dvfs *d, unsigned long rate);
 int tegra_dvfs_dfll_mode_clear(struct dvfs *d, unsigned long rate);
-struct tegra_cooling_device *tegra_dvfs_get_cpu_pll_cdev(void);
-struct tegra_cooling_device *tegra_dvfs_get_core_cdev(void);
+struct tegra_cooling_device *tegra_dvfs_get_cpu_vmin_cdev(void);
+struct tegra_cooling_device *tegra_dvfs_get_core_vmin_cdev(void);
 int tegra_dvfs_rail_dfll_mode_set_cold(struct dvfs_rail *rail);
 
 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
index b123801..dc2367a 100644 (file)
@@ -40,11 +40,11 @@ static bool tegra_dvfs_core_disabled;
 static int vdd_core_therm_trips_table[MAX_THERMAL_FLOORS] = { 20, };
 static int vdd_core_therm_floors_table[MAX_THERMAL_FLOORS] = { 950, };
 
-static struct tegra_cooling_device cpu_cdev = {
+static struct tegra_cooling_device cpu_vmin_cdev = {
        .cdev_type = "cpu_cold",
 };
 
-static struct tegra_cooling_device core_cdev = {
+static struct tegra_cooling_device core_vmin_cdev = {
        .cdev_type = "core_cold",
 };
 
@@ -54,7 +54,7 @@ static struct dvfs_rail tegra11_dvfs_rail_vdd_cpu = {
        .min_millivolts = 800,
        .step = VDD_SAFE_STEP,
        .jmp_to_zero = true,
-       .pll_mode_cdev = &cpu_cdev,
+       .vmin_cdev = &cpu_vmin_cdev,
 };
 
 static struct dvfs_rail tegra11_dvfs_rail_vdd_core = {
@@ -62,7 +62,7 @@ static struct dvfs_rail tegra11_dvfs_rail_vdd_core = {
        .max_millivolts = 1400,
        .min_millivolts = 800,
        .step = VDD_SAFE_STEP,
-       .pll_mode_cdev = &core_cdev,
+       .vmin_cdev = &core_vmin_cdev,
 };
 
 static struct dvfs_rail *tegra11_dvfs_rails[] = {
@@ -415,7 +415,7 @@ module_param_cb(disable_cpu, &tegra_dvfs_disable_cpu_ops,
  * - and the lowest floor is above rail minimum voltage in pll and
  *   in dfll mode (if applicable)
  */
-static void __init init_rail_thermal_profile(
+static void __init init_rail_vmin_thermal_profile(
        int *therm_trips_table, int *therm_floors_table,
        struct dvfs_rail *rail, struct dvfs_dfll_data *d)
 {
@@ -442,10 +442,10 @@ static void __init init_rail_thermal_profile(
        rail->therm_mv_floors = therm_floors_table;
        rail->therm_mv_floors_num = i + 1;
 
-       /* Setup trip-points, use the same trips in dfll mode (if applicable) */
-       if (rail->pll_mode_cdev) {
-               rail->pll_mode_cdev->trip_temperatures_num = i + 1;
-               rail->pll_mode_cdev->trip_temperatures = therm_trips_table;
+       /* Setup trip-points if applicable */
+       if (rail->vmin_cdev) {
+               rail->vmin_cdev->trip_temperatures_num = i + 1;
+               rail->vmin_cdev->trip_temperatures = therm_trips_table;
        }
 }
 
@@ -757,10 +757,10 @@ void __init tegra11x_init_dvfs(void)
        BUG_ON((i == ARRAY_SIZE(cpu_cvb_dvfs_table)) || ret);
 
        /* Init thermal floors */
-       init_rail_thermal_profile(cpu_cvb_dvfs_table[i].therm_trips_table,
+       init_rail_vmin_thermal_profile(cpu_cvb_dvfs_table[i].therm_trips_table,
                cpu_cvb_dvfs_table[i].therm_floors_table,
                &tegra11_dvfs_rail_vdd_cpu, &cpu_dvfs.dfll_data);
-       init_rail_thermal_profile(vdd_core_therm_trips_table,
+       init_rail_vmin_thermal_profile(vdd_core_therm_trips_table,
                vdd_core_therm_floors_table, &tegra11_dvfs_rail_vdd_core, NULL);
 
        /* Init rail structures and dependencies */
index 90e363e..0fd2c0a 100644 (file)
@@ -167,7 +167,7 @@ struct tegra_cl_dvfs {
        struct tegra_cl_dvfs_platform_data      *p_data;
 
        struct dvfs                     *safe_dvfs;
-       struct tegra_cooling_device     *cdev;
+       struct tegra_cooling_device     *vmin_cdev;
        struct work_struct              init_cdev_work;
 
        struct clk                      *soc_clk;
@@ -797,8 +797,8 @@ static void cl_dvfs_init_cold_output_floor(struct tegra_cl_dvfs *cld)
            !cld->safe_dvfs->dvfs_rail->therm_mv_floors_num)
                return;
 
-       if (!cld->cdev)
-               WARN(1, "%s: missing dfll mode cooling device\n",
+       if (!cld->vmin_cdev)
+               WARN(1, "%s: missing dfll floor cooling device\n",
                     cld->safe_dvfs->dvfs_rail->reg_id);
        /*
         * Convert monotonically decreasing thermal floors at low temperature
@@ -1073,7 +1073,7 @@ static int tegra_cl_dvfs_get_cdev_max_state(struct thermal_cooling_device *cdev,
                                            unsigned long *max_state)
 {
        struct tegra_cl_dvfs *cld = (struct tegra_cl_dvfs *)cdev->devdata;
-       *max_state = cld->cdev->trip_temperatures_num;
+       *max_state = cld->vmin_cdev->trip_temperatures_num;
        return 0;
 }
 
@@ -1116,18 +1116,18 @@ static void tegra_cl_dvfs_init_cdev(struct work_struct *work)
        struct tegra_cl_dvfs *cld = container_of(
                work, struct tegra_cl_dvfs, init_cdev_work);
 
-       if (!cld->cdev)
+       if (!cld->vmin_cdev)
                return;
 
        /* just report error - initialized at WC temperature, anyway */
        if (IS_ERR_OR_NULL(thermal_cooling_device_register(
-               cld->cdev->cdev_type, (void *)cld,
+               cld->vmin_cdev->cdev_type, (void *)cld,
                &tegra_cl_dvfs_cooling_ops))) {
                pr_err("tegra cooling device %s failed to register\n",
-                      cld->cdev->cdev_type);
+                      cld->vmin_cdev->cdev_type);
                return;
        }
-       pr_info("%s cooling device is registered\n", cld->cdev->cdev_type);
+       pr_info("%s cooling device is registered\n", cld->vmin_cdev->cdev_type);
 }
 #endif
 
@@ -1220,7 +1220,7 @@ static int __init tegra_cl_dvfs_probe(struct platform_device *pdev)
        cld->dfll_clk = dfll_clk;
        cld->safe_dvfs = safe_dvfs_clk->dvfs;
 #ifdef CONFIG_THERMAL
-       cld->cdev = cld->safe_dvfs->dvfs_rail->pll_mode_cdev;
+       cld->vmin_cdev = cld->safe_dvfs->dvfs_rail->vmin_cdev;
        INIT_WORK(&cld->init_cdev_work, tegra_cl_dvfs_init_cdev);
 #endif
        /* Initialize cl_dvfs */
@@ -1239,7 +1239,7 @@ static int __init tegra_cl_dvfs_probe(struct platform_device *pdev)
         * registration will update the entire thermal zone, and may trigger
         * rate change of the target clock
         */
-       if (cld->cdev)
+       if (cld->vmin_cdev)
                schedule_work(&cld->init_cdev_work);
        return 0;
 }