ARM: tegra: dvfs: Rename rail thermal state index
Alex Frid [Sun, 21 Apr 2013 00:54:23 +0000 (17:54 -0700)]
Renamed rail thermal state index from "thermal_idx" to
"therm_floor_idx", since it is used as index to thermal floors array.

Change-Id: Id59850ec483e90d101e10c4de0ffb8b915203dff
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/221356
(cherry picked from commit 5b157b98eca2fe25b111b8e850f482c96bb00a2b)
Reviewed-on: http://git-master/r/221867
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

arch/arm/mach-tegra/dvfs.c
arch/arm/mach-tegra/dvfs.h
arch/arm/mach-tegra/tegra_cl_dvfs.c

index 26d6b3f..bb625fb 100644 (file)
@@ -308,7 +308,7 @@ static inline int dvfs_rail_apply_limits(struct dvfs_rail *rail, int millivolts)
        int min_mv = rail->min_millivolts;
 
        if (rail->therm_mv_floors) {
-               int i = rail->thermal_idx;
+               int i = rail->therm_floor_idx;
                if (i < rail->therm_mv_floors_num)
                        min_mv = rail->therm_mv_floors[i];
        }
@@ -894,7 +894,7 @@ static int tegra_dvfs_rail_get_cdev_cur_state(
        struct thermal_cooling_device *cdev, unsigned long *cur_state)
 {
        struct dvfs_rail *rail = (struct dvfs_rail *)cdev->devdata;
-       *cur_state = rail->thermal_idx;
+       *cur_state = rail->therm_floor_idx;
        return 0;
 }
 
@@ -904,8 +904,8 @@ static int tegra_dvfs_rail_set_cdev_state(
        struct dvfs_rail *rail = (struct dvfs_rail *)cdev->devdata;
 
        mutex_lock(&dvfs_lock);
-       if (rail->thermal_idx != cur_state) {
-               rail->thermal_idx = cur_state;
+       if (rail->therm_floor_idx != cur_state) {
+               rail->therm_floor_idx = cur_state;
                dvfs_rail_update(rail);
        }
        mutex_unlock(&dvfs_lock);
@@ -950,8 +950,8 @@ int tegra_dvfs_rail_dfll_mode_set_cold(struct dvfs_rail *rail)
         */
        mutex_lock(&dvfs_lock);
        if (rail->dfll_mode &&
-           (rail->thermal_idx < rail->therm_mv_floors_num)) {
-                       int mv = rail->therm_mv_floors[rail->thermal_idx];
+           (rail->therm_floor_idx < rail->therm_mv_floors_num)) {
+                       int mv = rail->therm_mv_floors[rail->therm_floor_idx];
                        ret = dvfs_rail_set_voltage_reg(rail, mv);
        }
        mutex_unlock(&dvfs_lock);
@@ -1079,7 +1079,7 @@ static int dvfs_tree_show(struct seq_file *s, void *data)
                seq_printf(s, "   offset     %-7d mV\n", rail->offs_millivolts);
 
                if (rail->therm_mv_floors) {
-                       int i = rail->thermal_idx;
+                       int i = rail->therm_floor_idx;
                        if (i < rail->therm_mv_floors_num)
                                thermal_mv_floor = rail->therm_mv_floors[i];
                }
index 4e8adf5..30e8ad9 100644 (file)
@@ -83,7 +83,7 @@ struct dvfs_rail {
        bool suspended;
        bool dfll_mode;
        bool dfll_mode_updating;
-       int thermal_idx;
+       int therm_floor_idx;
        struct tegra_cooling_device *vmin_cdev;
        struct rail_stats stats;
 };
@@ -298,8 +298,8 @@ static inline int tegra_dvfs_rail_get_nominal_millivolts(struct dvfs_rail *rail)
 static inline int tegra_dvfs_rail_get_thermal_floor(struct dvfs_rail *rail)
 {
        if (rail && rail->therm_mv_floors &&
-           (rail->thermal_idx < rail->therm_mv_floors_num))
-               return rail->therm_mv_floors[rail->thermal_idx];
+           (rail->therm_floor_idx < rail->therm_mv_floors_num))
+               return rail->therm_mv_floors[rail->therm_floor_idx];
        return 0;
 }
 
index 0fd2c0a..5499a64 100644 (file)
@@ -194,7 +194,7 @@ struct tegra_cl_dvfs {
 
        u8                              lut_min;
        u8                              lut_max;
-       int                             thermal_idx;
+       int                             therm_floor_idx;
        struct dfll_rate_req            last_req;
        enum tegra_cl_dvfs_tune_state   tune_state;
        enum tegra_cl_dvfs_ctrl_mode    mode;
@@ -364,8 +364,8 @@ static inline u8 get_output_min(struct tegra_cl_dvfs *cld)
        tune_min = cld->tune_state == TEGRA_CL_DVFS_TUNE_LOW ?
                0 : cld->tune_high_out_min;
        thermal_min = 0;
-       if (cld->thermal_idx < cld->therm_floors_num)
-               thermal_min = cld->thermal_out_floors[cld->thermal_idx];
+       if (cld->therm_floor_idx < cld->therm_floors_num)
+               thermal_min = cld->thermal_out_floors[cld->therm_floor_idx];
 
        return max(tune_min, thermal_min);
 }
@@ -689,9 +689,9 @@ static unsigned long find_dvco_rate_min(struct tegra_cl_dvfs *cld, u8 out_min)
 static void cl_dvfs_set_dvco_rate_min(struct tegra_cl_dvfs *cld)
 {
        unsigned long rate = cld->safe_dvfs->dfll_data.out_rate_min;
-       if (cld->thermal_idx < cld->therm_floors_num)
+       if (cld->therm_floor_idx < cld->therm_floors_num)
                rate = find_dvco_rate_min(
-                               cld, cld->thermal_out_floors[cld->thermal_idx]);
+                       cld, cld->thermal_out_floors[cld->therm_floor_idx]);
 
        /* round minimum rate to request unit (ref_rate/2) boundary */
        cld->dvco_rate_min = ROUND_MIN_RATE(rate, cld->ref_rate);
@@ -876,7 +876,7 @@ static void cl_dvfs_init_out_if(struct tegra_cl_dvfs *cld)
         * disable and clear limit interrupts.
         */
        cld->tune_state = TEGRA_CL_DVFS_TUNE_LOW;
-       cld->thermal_idx = 0;
+       cld->therm_floor_idx = 0;
        cl_dvfs_set_dvco_rate_min(cld);
 #if CL_DVFS_DYNAMIC_OUTPUT_CFG
        val = get_output_min(cld);
@@ -1081,7 +1081,7 @@ static int tegra_cl_dvfs_get_cdev_cur_state(struct thermal_cooling_device *cdev,
                                            unsigned long *cur_state)
 {
        struct tegra_cl_dvfs *cld = (struct tegra_cl_dvfs *)cdev->devdata;
-       *cur_state = cld->thermal_idx;
+       *cur_state = cld->therm_floor_idx;
        return 0;
 }
 
@@ -1093,8 +1093,8 @@ static int tegra_cl_dvfs_set_cdev_state(struct thermal_cooling_device *cdev,
 
        clk_lock_save(cld->dfll_clk, &flags);
 
-       if (cld->thermal_idx != cur_state) {
-               cld->thermal_idx = cur_state;
+       if (cld->therm_floor_idx != cur_state) {
+               cld->therm_floor_idx = cur_state;
                cl_dvfs_set_dvco_rate_min(cld);
                if (cld->mode == TEGRA_CL_DVFS_CLOSED_LOOP) {
                        tegra_cl_dvfs_request_rate(cld,
@@ -1146,7 +1146,7 @@ static int tegra_cl_dvfs_suspend_cl(struct device *dev)
        struct tegra_cl_dvfs *cld = dev_get_drvdata(dev);
 
        clk_lock_save(cld->dfll_clk, &flags);
-       cld->thermal_idx = 0;
+       cld->therm_floor_idx = 0;
        cl_dvfs_set_dvco_rate_min(cld);
        if (cld->mode == TEGRA_CL_DVFS_CLOSED_LOOP) {
                set_cl_config(cld, &cld->last_req);