On Tue, Jul 26, 2022 at 03:55:03PM +0200, Balsam CHIHI wrote: > 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 <ethan.chang@xxxxxxxxxxxx> > Signed-off-by: Michael Kao <michael.kao@xxxxxxxxxxxx> > Signed-off-by: Ben Tseng <ben.tseng@xxxxxxxxxxxx> > Signed-off-by: Alexandre Bailon <abailon@xxxxxxxxxxxx> > Signed-off-by: Balsam CHIHI <bchihi@xxxxxxxxxxxx> > --- > 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.h > > diff --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@xxxxxxxxxxxx/ 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 [..]