]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
thermal/drivers/k3_j72xx_bandgap: Register sensors with hwmon
authorMichael Walle <mwalle@kernel.org>
Thu, 28 Aug 2025 12:40:42 +0000 (14:40 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 25 Sep 2025 20:11:00 +0000 (22:11 +0200)
Make the sensors available in the hwmon subsystem (if
CONFIG_THERMAL_HWMON is enabled).

Signed-off-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://lore.kernel.org/r/20250828124042.1680853-1-mwalle@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/k3_j72xx_bandgap.c

index a36289e61315a23b5815f85df09ab260c2f31bc7..d9ec3bf194966cb5b9b30f3e6989e22ca827a1ed 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 
+#include "thermal_hwmon.h"
+
 #define K3_VTM_DEVINFO_PWR0_OFFSET             0x4
 #define K3_VTM_DEVINFO_PWR0_TEMPSENS_CT_MASK   0xf0
 #define K3_VTM_TMPSENS0_CTRL_OFFSET            0x300
@@ -513,6 +515,8 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
                        ret = PTR_ERR(ti_thermal);
                        goto err_free_ref_table;
                }
+
+               devm_thermal_add_hwmon_sysfs(bgp->dev, ti_thermal);
        }
 
        platform_set_drvdata(pdev, bgp);