aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal/samsung
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz2018-04-26 13:51:27 +0200
committerEduardo Valentin2018-05-06 16:32:59 -0700
commitab1b7ada95c61a22a125c9ee5c75d32844b37d82 (patch)
tree413ebc3be5a559fbb460aa85c0e60ce0d56924ce /drivers/thermal/samsung
parenta503a10ff3d7b5998337693dd6f7547bf886201f (diff)
thermal: exynos: do not use trips structure directly in ->tmu_initialize
Use ->get_trip_[temp,hyst] methods instead of using trips structure directly in all ->tmu_initialize method implementations. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal/samsung')
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 91b8d12d43f7..f24215a09a02 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -409,15 +409,13 @@ static void exynos4210_tmu_initialize(struct platform_device *pdev)
{
struct exynos_tmu_data *data = platform_get_drvdata(pdev);
struct thermal_zone_device *tz = data->tzd;
- const struct thermal_trip * const trips =
- of_thermal_get_trip_points(tz);
- unsigned long temp;
- int i;
+ int i, temp;
sanitize_temp_error(data, readl(data->base + EXYNOS_TMU_REG_TRIMINFO));
for (i = 0; i < of_thermal_get_ntrips(tz); i++) {
- temp = trips[i].temperature / MCELSIUS;
+ tz->ops->get_trip_temp(tz, i, &temp);
+ temp /= MCELSIUS;
exynos4210_tmu_set_trip_temp(data, i, temp);
}
}
@@ -455,11 +453,9 @@ static void exynos4412_tmu_initialize(struct platform_device *pdev)
{
struct exynos_tmu_data *data = platform_get_drvdata(pdev);
struct thermal_zone_device *tz = data->tzd;
- const struct thermal_trip * const trips =
- of_thermal_get_trip_points(tz);
- unsigned long temp, hyst;
unsigned int trim_info, ctrl;
int i, ntrips = min_t(int, of_thermal_get_ntrips(tz), data->ntrip);
+ int temp, hyst;
if (data->soc == SOC_ARCH_EXYNOS3250 ||
data->soc == SOC_ARCH_EXYNOS4412 ||
@@ -484,10 +480,12 @@ static void exynos4412_tmu_initialize(struct platform_device *pdev)
/* Write temperature code for rising and falling threshold */
for (i = 0; i < ntrips; i++) {
- temp = trips[i].temperature / MCELSIUS;
+ tz->ops->get_trip_temp(tz, i, &temp);
+ temp /= MCELSIUS;
exynos4412_tmu_set_trip_temp(data, i, temp);
- hyst = trips[i].hysteresis / MCELSIUS;
+ tz->ops->get_trip_hyst(tz, i, &hyst);
+ hyst /= MCELSIUS;
exynos4412_tmu_set_trip_hyst(data, i, temp, hyst);
}
}