All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal/drivers/mediatek: Fix control buffer enablement on MT7896
@ 2023-09-07 11:20 ` Frank Wunderlich
  0 siblings, 0 replies; 13+ messages in thread
From: Frank Wunderlich @ 2023-09-07 11:20 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Daniel Lezcano, Rafael J. Wysocki, linux-pm, Amit Kucheria,
	Daniel Golle, stable, linux-kernel, Matthias Brugger, Zhang Rui,
	linux-arm-kernel, AngeloGioacchino Del Regno

From: Frank Wunderlich <frank-w@public-files.de>

Reading thermal sensor on mt7986 devices returns invalid temperature:

bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp
 -274000

Fix this by adding missing members in mtk_thermal_data struct which were
used in mtk_thermal_turn_on_buffer after commit 33140e668b10.

Cc: stable@vger.kernel.org
Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks")
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/thermal/mediatek/auxadc_thermal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
index 843214d30bd8..967b9a1aead4 100644
--- a/drivers/thermal/mediatek/auxadc_thermal.c
+++ b/drivers/thermal/mediatek/auxadc_thermal.c
@@ -690,6 +690,9 @@ static const struct mtk_thermal_data mt7986_thermal_data = {
 	.adcpnp = mt7986_adcpnp,
 	.sensor_mux_values = mt7986_mux_values,
 	.version = MTK_THERMAL_V3,
+	.apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1,
+	.apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3),
+	.apmixed_buffer_ctl_set = BIT(0),
 };
 
 static bool mtk_thermal_temp_is_valid(int temp)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-01-31  8:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-07 11:20 [PATCH] thermal/drivers/mediatek: Fix control buffer enablement on MT7896 Frank Wunderlich
2023-09-07 11:20 ` Frank Wunderlich
2023-09-07 11:20 ` Frank Wunderlich
2023-09-07 11:36 ` AngeloGioacchino Del Regno
2023-09-07 11:36   ` AngeloGioacchino Del Regno
2023-09-07 11:36   ` AngeloGioacchino Del Regno
2023-09-13  8:35 ` Markus Schneider-Pargmann
2023-09-13  8:35   ` Markus Schneider-Pargmann
2023-09-13  8:35   ` Markus Schneider-Pargmann
2024-01-31  5:17   ` Daniel Golle
2024-01-31  5:17     ` Daniel Golle
2024-01-31  8:08     ` Daniel Lezcano
2024-01-31  8:08       ` Daniel Lezcano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.