]> git.hungrycats.org Git - linux/commit
thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode
authorNícolas F. R. A. Prado <nfraprado@collabora.com>
Thu, 6 Jul 2023 15:37:33 +0000 (11:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:35 +0000 (09:48 +0200)
commitba01e46105dfd090a3bf58ac2370fce37accf1d5
treea19170dbbc18bffa16ba9d1e5b5fd8e96abb34de
parent436b4b33e048db2c2ff862ed29f6c5aa7e52420a
thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode

[ Upstream commit 64de162e34e4cb2982a1d96e492f018026a61c1d ]

Each controller can be configured to operate on immediate or filtered
mode. On filtered mode, the sensors are enabled by setting the
corresponding bits in MONCTL0, while on immediate mode, by setting
MSRCTL1.

Previously, the code would set MSRCTL1 for all four sensors when
configured to immediate mode, but given that the controller might not
have all four sensors connected, this would cause interrupts to trigger
for non-existent sensors. Fix this by handling the MSRCTL1 register
analogously to the MONCTL0: only enable the sensors that were declared.

Fixes: f5f633b18234 ("thermal/drivers/mediatek: Add the Low Voltage Thermal Sensor driver")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230706153823.201943-3-nfraprado@collabora.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/mediatek/lvts_thermal.c