Skip to content

Commit d7a5b43

Browse files
metiulekmdlezcano
authored andcommitted
thermal/drivers/exynos: Stop using the threshold mechanism on Exynos 4210
Exynos 4210 supports setting a base threshold value, which is added to all trip points. This might be useful, but is not really necessary in our usecase, so we always set it to 0 to simplify the code a bit. Additionally, this change makes it so that we convert the value to the calibrated one in a slightly different place. This is more correct morally, though it does not make any change when single-point calibration is being used (which is the case currently). Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20231201095625.301884-7-m.majewski2@samsung.com
1 parent 5d6976d commit d7a5b43

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

drivers/thermal/samsung/exynos_tmu.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -343,20 +343,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
343343
static void exynos4210_tmu_set_trip_temp(struct exynos_tmu_data *data,
344344
int trip_id, u8 temp)
345345
{
346-
struct thermal_trip trip;
347-
u8 ref, th_code;
348-
349-
if (thermal_zone_get_trip(data->tzd, 0, &trip))
350-
return;
351-
352-
ref = trip.temperature / MCELSIUS;
353-
354-
if (trip_id == 0) {
355-
th_code = temp_to_code(data, ref);
356-
writeb(th_code, data->base + EXYNOS4210_TMU_REG_THRESHOLD_TEMP);
357-
}
358-
359-
temp -= ref;
346+
temp = temp_to_code(data, temp);
360347
writeb(temp, data->base + EXYNOS4210_TMU_REG_TRIG_LEVEL0 + trip_id * 4);
361348
}
362349

@@ -371,6 +358,8 @@ static void exynos4210_tmu_initialize(struct platform_device *pdev)
371358
struct exynos_tmu_data *data = platform_get_drvdata(pdev);
372359

373360
sanitize_temp_error(data, readl(data->base + EXYNOS_TMU_REG_TRIMINFO));
361+
362+
writeb(0, data->base + EXYNOS4210_TMU_REG_THRESHOLD_TEMP);
374363
}
375364

376365
static void exynos4412_tmu_set_trip_temp(struct exynos_tmu_data *data,

0 commit comments

Comments
 (0)