[PATCH 1/4] thermal/drivers/mediatek/lvts_thermal: write LVTS_CALSCALE in lvts_ctrl_configure()

Ilia Snezhkov via B4 Relay devnull+iasnezhkov.gmail.com at kernel.org
Wed Nov 25 16:53:22 PST 2026


From: Ilia Snezhkov <iasnezhkov at gmail.com>

lvts_ctrl_configure() assigns 0x300 and LVTS_CALSCALE_CONF (0x300) to
the local variable `value`, then immediately overwrites `value` with the
LVTS_MSRCTL0 filter setting without ever writing LVTS_CALSCALE (0x0048).

Remove the dead duplicate assignment and write LVTS_CALSCALE_CONF to
LVTS_CALSCALE(lvts_ctrl->base), matching the comment above it and
MediaTek's downstream soc_temp_lvts initialization sequence.

Found and drafted with an AI coding assistant.

Fixes: f5f633b18234 ("thermal/drivers/mediatek: Add the Low Voltage Thermal Sensor driver")
Signed-off-by: Ilia Snezhkov <iasnezhkov at gmail.com>
---
 drivers/thermal/mediatek/lvts_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index 350fffd..e034c6c 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -1197,8 +1197,8 @@ static int lvts_ctrl_configure(struct device *dev, struct lvts_ctrl *lvts_ctrl)
 	/*
 	 * LVTS_CALSCALE : ADC voltage round
 	 */
-	value = 0x300;
 	value = LVTS_CALSCALE_CONF;
+	writel(value, LVTS_CALSCALE(lvts_ctrl->base));
 
 	/*
 	 * LVTS_MSRCTL0 : Sensor filtering strategy
-- 
2.54.0 (Apple Git-157)






More information about the linux-arm-kernel mailing list