[PATCH v8 3/6] thermal: mediatek: Add LVTS drivers for SoC theraml zones for mt8192

Nícolas F. R. A. Prado nfraprado at collabora.com
Fri Jul 29 13:30:30 PDT 2022


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 at mediatek.com>
> Signed-off-by: Michael Kao <michael.kao at mediatek.com>
> Signed-off-by: Ben Tseng <ben.tseng at mediatek.com>
> Signed-off-by: Alexandre Bailon <abailon at baylibre.com>
> Signed-off-by: Balsam CHIHI <bchihi at baylibre.com>
> ---
>  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@mediatek.com/

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
[..]



More information about the Linux-mediatek mailing list