Re: [PATCH v8 3/6] thermal: mediatek: Add LVTS drivers for SoC theraml zones for mt8192
From: Nícolas F. R. A. Prado <hidden>
Date: 2022-07-29 20:30:47
Also in:
linux-arm-kernel, linux-mediatek, linux-pm, lkml
On Tue, Jul 26, 2022 at 03:55:03PM +0200, Balsam CHIHI wrote:
quoted hunk ↗ jump to hunk
Add a LVTS (Low voltage thermal sensor) driver to report junction temperatures in Mediatek SoC mt8192 and register the maximum temperature of sensors and each sensor as a thermal zone. Signed-off-by: Yu-Chia Chang <redacted> Signed-off-by: Michael Kao <redacted> Signed-off-by: Ben Tseng <redacted> Signed-off-by: Alexandre Bailon <redacted> Signed-off-by: Balsam CHIHI <redacted> --- drivers/thermal/mediatek/Kconfig | 27 + drivers/thermal/mediatek/Makefile | 2 + drivers/thermal/mediatek/lvts_mt8192.c | 241 ++++++ drivers/thermal/mediatek/soc_temp.c | 2 +- drivers/thermal/mediatek/soc_temp_lvts.c | 928 +++++++++++++++++++++++ drivers/thermal/mediatek/soc_temp_lvts.h | 365 +++++++++ 6 files changed, 1564 insertions(+), 1 deletion(-) create mode 100644 drivers/thermal/mediatek/lvts_mt8192.c create mode 100644 drivers/thermal/mediatek/soc_temp_lvts.c create mode 100644 drivers/thermal/mediatek/soc_temp_lvts.hdiff --git a/drivers/thermal/mediatek/Kconfig b/drivers/thermal/mediatek/Kconfig index 9c41e9079fc3..7fc04237dd50 100644 --- a/drivers/thermal/mediatek/Kconfig +++ b/drivers/thermal/mediatek/Kconfig@@ -20,4 +20,31 @@ config MTK_SOC_THERMAL configures thermal controllers to collect temperature via AUXADC interface. +config MTK_SOC_THERMAL_LVTS + tristate "LVTS (Low voltage thermal sensor) driver for Mediatek SoCs" + depends on HAS_IOMEM + depends on NVMEM + depends on RESET_TI_SYSCON
Both mt8192 and mt8195 use the reset controller provided by infracfg [1], so there's no need to depend on RESET_TI_SYSCON. (Same thing below) [1] https://lore.kernel.org/all/20220523093346.28493-1-rex-bc.chen@mediatek.com/ (local) Thanks, Nícolas
+ help + Enable this option if you want to get SoC temperature + information for MediaTek platforms. This driver + configures LVTS thermal controllers to collect temperatures + via Analog Serial Interface(ASIF). + +endif + +if MTK_SOC_THERMAL_LVTS + +config LVTS_MT8192 + tristate "LVTS driver for MediaTek MT8192 SoC" + depends on HAS_IOMEM + depends on NVMEM + depends on RESET_TI_SYSCON + depends on MTK_SOC_THERMAL_LVTS + help + Enable this option if you want to get SoC temperature + information for MT8192. This driver + configures LVTS thermal controllers to collect temperatures + via ASIF. + endif
[..]