]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
clk: tegra: Round up the peak thermal floor voltage
authorJon Hunter <jonathanh@nvidia.com>
Fri, 13 Jan 2017 14:20:17 +0000 (14:20 +0000)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 17 Jan 2017 15:11:45 +0000 (07:11 -0800)
When comparing the peak thermal floor voltage for the CPU between
Linux v3.10 and v4.4 there is a delta of 7mV (957mV versus 950mv).
This is because the peak thermal floor voltage for CPU in Linux
v4.4 is not rounded up where as it is in Linux v3.10. Align Linux
v4.4 with v3.10 by rounding up the peak thermal floor voltage.

Also given that there is both a tegra_dfll_get_thermal_floor()
and tegra_dfll_get_thermal_floor_mv(), update the name of the
tegra_dfll_get_thermal_floor() to be
tegra_dfll_get_peak_thermal_floor_mv() so it is clear what the
difference is.

Bug 1811732

Change-Id: Icc093e88c1421be2ca55325569187e92ab733259
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1284920
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/clk/tegra/clk-dfll.c
drivers/soc/tegra/tegra-dvfs.c
include/soc/tegra/tegra-dfll.h

index 2c2c0e5713a0f26f0e17ba34ab72c8b664e256ea..036697fe22b3b88d90c37c03c341d2a350316513 100644 (file)
@@ -2197,6 +2197,17 @@ u32 tegra_dfll_get_thermal_floor_mv(void)
 }
 EXPORT_SYMBOL(tegra_dfll_get_thermal_floor_mv);
 
+/**
+ * tegra_dfll_get_peak_thermal_floor_mv - get millivolts of peak thermal floor
+ */
+u32 tegra_dfll_get_peak_thermal_floor_mv(void)
+{
+       int mv = tegra_dfll_dev->soc->thermal_floor_table[0].millivolts;
+
+       return tegra_round_voltage(mv, &tegra_dfll_dev->soc->alignment, 1);
+}
+EXPORT_SYMBOL(tegra_dfll_get_peak_thermal_floor_mv);
+
 /**
  * tegra_dfll_get_thermal_index - return millivolts of thermal cap
  */
@@ -2252,15 +2263,6 @@ u32 tegra_dfll_get_min_millivolts(void)
 }
 EXPORT_SYMBOL(tegra_dfll_get_min_millivolts);
 
-/**
- * tegra_dfll_get_thermal_floor - return millivolts for thermal floor
- */
-u32 tegra_dfll_get_thermal_floor(int index)
-{
-       return tegra_dfll_dev->soc->thermal_floor_table[index].millivolts;
-}
-EXPORT_SYMBOL(tegra_dfll_get_thermal_floor);
-
 /**
  * tegra_dfll_get_alignment - return DFLL alignment
  */
index 0cf888baeed709adfc4c4e0d7dcafda4c8bcc71c..b4969867deef6d805da047cfa608117a79131585 100644 (file)
@@ -595,7 +595,7 @@ static int dvfs_get_peak_thermal_floor(struct dvfs *d, unsigned long rate)
        if (!dfll_range && d->dvfs_rail->therm_floors)
                return d->dvfs_rail->therm_floors[0].mv;
        if (dfll_range)
-               return tegra_dfll_get_thermal_floor(0);
+               return tegra_dfll_get_peak_thermal_floor_mv();
        return 0;
 }
 
index a5483bfa860b1967308c3a7fcf8b5fbdc47e9500..ca28b1e2fa36bb44cc858cf3648885e3d20d6f14 100644 (file)
@@ -37,8 +37,8 @@ extern int tegra_dfll_get_thermal_index(struct tegra_dfll *td,
 extern int tegra_dfll_count_thermal_states(struct tegra_dfll *td,
                        enum tegra_dfll_thermal_type type);
 u32 tegra_dfll_get_thermal_floor_mv(void);
+u32 tegra_dfll_get_peak_thermal_floor_mv(void);
 u32 tegra_dfll_get_thermal_cap_mv(void);
-u32 tegra_dfll_get_thermal_floor(int index);
 u32 tegra_dfll_get_min_millivolts(void);
 struct rail_alignment *tegra_dfll_get_alignment(void);
 #endif