aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-04-26 07:51:27 -0400
committerEduardo Valentin <edubezval@gmail.com>2018-05-06 19:32:59 -0400
commitab1b7ada95c61a22a125c9ee5c75d32844b37d82 (patch)
tree413ebc3be5a559fbb460aa85c0e60ce0d56924ce
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>
-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)
409{ 409{
410 struct exynos_tmu_data *data = platform_get_drvdata(pdev); 410 struct exynos_tmu_data *data = platform_get_drvdata(pdev);
411 struct thermal_zone_device *tz = data->tzd; 411 struct thermal_zone_device *tz = data->tzd;
412 const struct thermal_trip * const trips = 412 int i, temp;
413 of_thermal_get_trip_points(tz);
414 unsigned long temp;
415 int i;
416 413
417 sanitize_temp_error(data, readl(data->base + EXYNOS_TMU_REG_TRIMINFO)); 414 sanitize_temp_error(data, readl(data->base + EXYNOS_TMU_REG_TRIMINFO));
418 415
419 for (i = 0; i < of_thermal_get_ntrips(tz); i++) { 416 for (i = 0; i < of_thermal_get_ntrips(tz); i++) {
420 temp = trips[i].temperature / MCELSIUS; 417 tz->ops->get_trip_temp(tz, i, &temp);
418 temp /= MCELSIUS;
421 exynos4210_tmu_set_trip_temp(data, i, temp); 419 exynos4210_tmu_set_trip_temp(data, i, temp);
422 } 420 }
423} 421}
@@ -455,11 +453,9 @@ static void exynos4412_tmu_initialize(struct platform_device *pdev)
455{ 453{
456 struct exynos_tmu_data *data = platform_get_drvdata(pdev); 454 struct exynos_tmu_data *data = platform_get_drvdata(pdev);
457 struct thermal_zone_device *tz = data->tzd; 455 struct thermal_zone_device *tz = data->tzd;
458 const struct thermal_trip * const trips =
459 of_thermal_get_trip_points(tz);
460 unsigned long temp, hyst;
461 unsigned int trim_info, ctrl; 456 unsigned int trim_info, ctrl;
462 int i, ntrips = min_t(int, of_thermal_get_ntrips(tz), data->ntrip); 457 int i, ntrips = min_t(int, of_thermal_get_ntrips(tz), data->ntrip);
458 int temp, hyst;
463 459
464 if (data->soc == SOC_ARCH_EXYNOS3250 || 460 if (data->soc == SOC_ARCH_EXYNOS3250 ||
465 data->soc == SOC_ARCH_EXYNOS4412 || 461 data->soc == SOC_ARCH_EXYNOS4412 ||
@@ -484,10 +480,12 @@ static void exynos4412_tmu_initialize(struct platform_device *pdev)
484 480
485 /* Write temperature code for rising and falling threshold */ 481 /* Write temperature code for rising and falling threshold */
486 for (i = 0; i < ntrips; i++) { 482 for (i = 0; i < ntrips; i++) {
487 temp = trips[i].temperature / MCELSIUS; 483 tz->ops->get_trip_temp(tz, i, &temp);
484 temp /= MCELSIUS;
488 exynos4412_tmu_set_trip_temp(data, i, temp); 485 exynos4412_tmu_set_trip_temp(data, i, temp);
489 486
490 hyst = trips[i].hysteresis / MCELSIUS; 487 tz->ops->get_trip_hyst(tz, i, &hyst);
488 hyst /= MCELSIUS;
491 exynos4412_tmu_set_trip_hyst(data, i, temp, hyst); 489 exynos4412_tmu_set_trip_hyst(data, i, temp, hyst);
492 } 490 }
493} 491}