ARM: tegra: dvfs: Use common rail thermal profile init
[linux-3.10.git] / arch / arm / mach-tegra / tegra14_dvfs.c
index ec82642..ffffdd8 100644 (file)
@@ -419,89 +419,6 @@ module_param_cb(disable_core, &tegra_dvfs_disable_core_ops,
 module_param_cb(disable_cpu, &tegra_dvfs_disable_cpu_ops,
        &tegra_dvfs_cpu_disabled, 0644);
 
-/*
- * Validate rail thermal profile, and get its size. Valid profile:
- * - voltage floors are descending with temperature increasing
- * - the lowest limit is above rail minimum voltage in pll and
- *   in dfll mode (if applicable)
- * - the highest limit is below rail nominal voltage
- */
-static int __init get_thermal_profile_size(
-       int *trips_table, int *limits_table,
-       struct dvfs_rail *rail, struct dvfs_dfll_data *d)
-{
-       int i, min_mv;
-
-       for (i = 0; i < MAX_THERMAL_LIMITS - 1; i++) {
-               if (!limits_table[i+1])
-                       break;
-
-               if ((trips_table[i] >= trips_table[i+1]) ||
-                   (limits_table[i] < limits_table[i+1])) {
-                       pr_warning("%s: not ordered profile\n", rail->reg_id);
-                       return -EINVAL;
-               }
-       }
-
-       min_mv = max(rail->min_millivolts, d ? d->min_millivolts : 0);
-       if (limits_table[i] < min_mv) {
-               pr_warning("%s: thermal profile below Vmin\n", rail->reg_id);
-               return -EINVAL;
-       }
-
-       if (limits_table[0] > rail->nominal_millivolts) {
-               pr_warning("%s: thermal profile above Vmax\n", rail->reg_id);
-               return -EINVAL;
-       }
-       return i + 1;
-}
-
-static void __init init_rail_vmax_thermal_profile(
-       int *therm_trips_table, int *therm_caps_table,
-       struct dvfs_rail *rail, struct dvfs_dfll_data *d)
-{
-       int i = get_thermal_profile_size(therm_trips_table,
-                                        therm_caps_table, rail, d);
-       if (i <= 0) {
-               rail->vmax_cdev = NULL;
-               WARN(1, "%s: invalid Vmax thermal profile\n", rail->reg_id);
-               return;
-       }
-
-       /* Install validated thermal caps */
-       rail->therm_mv_caps = therm_caps_table;
-       rail->therm_mv_caps_num = i;
-
-       /* Setup trip-points if applicable */
-       if (rail->vmax_cdev) {
-               rail->vmax_cdev->trip_temperatures_num = i;
-               rail->vmax_cdev->trip_temperatures = therm_trips_table;
-       }
-}
-
-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)
-{
-       int i = get_thermal_profile_size(therm_trips_table,
-                                        therm_floors_table, rail, d);
-       if (i <= 0) {
-               rail->vmin_cdev = NULL;
-               WARN(1, "%s: invalid Vmin thermal profile\n", rail->reg_id);
-               return;
-       }
-
-       /* Install validated thermal floors */
-       rail->therm_mv_floors = therm_floors_table;
-       rail->therm_mv_floors_num = i;
-
-       /* Setup trip-points if applicable */
-       if (rail->vmin_cdev) {
-               rail->vmin_cdev->trip_temperatures_num = i;
-               rail->vmin_cdev->trip_temperatures = therm_trips_table;
-       }
-}
-
 static bool __init can_update_max_rate(struct clk *c, struct dvfs *d)
 {
        /* Don't update manual dvfs clocks */