]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
thermal/drivers/imx91: Add hwmon support
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Fri, 6 Mar 2026 13:30:16 +0000 (14:30 +0100)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Mon, 9 Mar 2026 23:12:19 +0000 (00:12 +0100)
Expose thermal readings as a HWMON device, so that it could be
accessed using lm-sensors.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://patch.msgid.link/20260306133017.3189979-1-alexander.stein@ew.tq-group.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
drivers/thermal/imx91_thermal.c

index 9b20be03d6dec18553967548d0ca31d1c1fb387c..25915bb702bea3212f4f69554456efbf3b2109e7 100644 (file)
@@ -17,6 +17,8 @@
 #include <linux/thermal.h>
 #include <linux/units.h>
 
+#include "thermal_hwmon.h"
+
 #define REG_SET                                        0x4
 #define REG_CLR                                        0x8
 #define REG_TOG                                        0xc
@@ -318,6 +320,8 @@ static int imx91_tmu_probe(struct platform_device *pdev)
                return dev_err_probe(dev, PTR_ERR(tmu->tzd),
                                     "failed to register thermal zone sensor\n");
 
+       devm_thermal_add_hwmon_sysfs(dev, tmu->tzd);
+
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
                return irq;