Re: [PATCH 3/3] thermal/drivers/mediatek: Add GPUEB thermal driver

From: Uwe Kleine-König

Date: Mon Nov 30 2026 - 10:31:51 EST


On Mon, Nov 30, 2026 at 02:19:33PM +0000, Alexandre Mergnat wrote:
> Add a driver for the auxiliary device that the mtk-mfg power domain
> driver creates on MT8196. It registers the GPU temperature that the
> GPUEB reports as a thermal sensor, so that a thermal zone can monitor
> the GPU.
>
> The auxiliary device shares the device tree node of the gpufreq device,
> so a thermal zone selects this sensor by referring to that node.
>
> Signed-off-by: Alexandre Mergnat <amergnat@xxxxxxxxxxxx>
> ---
> drivers/thermal/mediatek/Kconfig | 9 ++++++
> drivers/thermal/mediatek/Makefile | 1 +
> drivers/thermal/mediatek/gpueb_thermal.c | 52 ++++++++++++++++++++++++++++++++
> 3 files changed, 62 insertions(+)
>
> diff --git a/drivers/thermal/mediatek/Kconfig b/drivers/thermal/mediatek/Kconfig
> index d82c86d9be56..a721b75d0790 100644
> --- a/drivers/thermal/mediatek/Kconfig
> +++ b/drivers/thermal/mediatek/Kconfig
> @@ -34,4 +34,13 @@ config MTK_LVTS_THERMAL_DEBUGFS
> help
> Enable this option to debug the internals of the device driver.
>
> +config MTK_GPUEB_THERMAL
> + tristate "GPUEB GPU temperature driver for MediaTek SoCs"
> + depends on MTK_MFG_PM_DOMAIN
> + help
> + Enable this option if you want to get GPU temperature
> + information for MediaTek SoCs such as the MT8196.
> + The temperature is reported by the GPUEB, the microcontroller
> + that manages the GPU power and frequency.
> +
> endif
> diff --git a/drivers/thermal/mediatek/Makefile b/drivers/thermal/mediatek/Makefile
> index 1c6daa1e644b..3ec5295e8514 100644
> --- a/drivers/thermal/mediatek/Makefile
> +++ b/drivers/thermal/mediatek/Makefile
> @@ -1,2 +1,3 @@
> obj-$(CONFIG_MTK_SOC_THERMAL) += auxadc_thermal.o
> obj-$(CONFIG_MTK_LVTS_THERMAL) += lvts_thermal.o
> +obj-$(CONFIG_MTK_GPUEB_THERMAL) += gpueb_thermal.o
> diff --git a/drivers/thermal/mediatek/gpueb_thermal.c b/drivers/thermal/mediatek/gpueb_thermal.c
> new file mode 100644
> index 000000000000..f63b5751a0c0
> --- /dev/null
> +++ b/drivers/thermal/mediatek/gpueb_thermal.c
> @@ -0,0 +1,52 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2026 BayLibre, SAS
> + */
> +
> +#include <linux/auxiliary_bus.h>
> +#include <linux/err.h>
> +#include <linux/mod_devicetable.h>

<linux/auxiliary_bus.h> already provides auxiliary_device_id with much
less overhead than <linux/mod_devicetable.h>.

So to reduce build time (a tiny bit) and build dependencies and not
fight against my quest to remove <linux/mod_devicetable.h>, please drop
the #include for <linux/mod_devicetable.h>.

Thanks
Uwe

Attachment: signature.asc
Description: PGP signature