[PATCH 2/4] reset: ma35d1: Register auxiliary device for the temperature sensor

From: Zi-Yu Chen

Date: Tue Nov 17 2026 - 01:06:14 EST


The on-chip temperature sensor is controlled through a register of the
SYS block, which is already bound to this driver. Create an auxiliary
device so that a thermal driver can bind to it without a separate
devicetree node.

Failing to create the auxiliary device only affects temperature
reporting, so warn and continue.

Signed-off-by: Zi-Yu Chen <zychennvt@xxxxxxxxx>
---
drivers/reset/Kconfig | 1 +
drivers/reset/reset-ma35d1.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index eda9c698a95f..cf42fd6f7a3c 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -220,6 +220,7 @@ config RESET_NUVOTON_MA35D1
bool "Nuvoton MA35D1 Reset Driver"
depends on ARCH_MA35 || COMPILE_TEST
default ARCH_MA35
+ select AUXILIARY_BUS
help
This enables the reset controller driver for Nuvoton MA35D1 SoC.

diff --git a/drivers/reset/reset-ma35d1.c b/drivers/reset/reset-ma35d1.c
index d2962c0c80be..8c82175d7466 100644
--- a/drivers/reset/reset-ma35d1.c
+++ b/drivers/reset/reset-ma35d1.c
@@ -4,6 +4,7 @@
* Author: Chi-Fang Li <cfli0@xxxxxxxxxxx>
*/

+#include <linux/auxiliary_bus.h>
#include <linux/bits.h>
#include <linux/container_of.h>
#include <linux/device.h>
@@ -218,7 +219,15 @@ static int ma35d1_reset_probe(struct platform_device *pdev)
if (err)
dev_warn(&pdev->dev, "failed to register restart handler\n");

- return devm_reset_controller_register(dev, &reset_data->rcdev);
+ err = devm_reset_controller_register(dev, &reset_data->rcdev);
+ if (err)
+ return err;
+
+ /* The temperature sensor is also controlled through the SYS block */
+ if (!devm_auxiliary_device_create(dev, "thermal", NULL))
+ dev_warn(dev, "failed to create thermal auxiliary device\n");
+
+ return 0;
}

static struct platform_driver ma35d1_reset_driver = {
--
2.34.1