Skip to contentSkip to conversation

thermal: k3_j72xx_bandgap: register sensors with hwmon

PATCH Applied Michael Walle 3 participants 3 messages Aug 28, 2025 – Sep 19, 2025 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: k3_j72xx_bandgap: register sensors with hwmon

Make the sensors available in the hwmon subsystem (if CONFIG_THERMAL_HWMON is enabled).

---
 drivers/thermal/k3_j72xx_bandgap.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/thermal/k3_j72xx_bandgap.c +4 -0
index a36289e61315..d9ec3bf19496 100644
@@ -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);
Signature · 1 line
2.39.5
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Michael Walle

Make the sensors available in the hwmon subsystem (if CONFIG_THERMAL_HWMON is enabled).

---
  drivers/thermal/k3_j72xx_bandgap.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/thermal/k3_j72xx_bandgap.c +2 -0
index a36289e61315..d9ec3bf19496 100644
@@ -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

drivers/thermal/k3_j72xx_bandgap.c static int k3_j72xx_bandgap_probe(struct platform_device *pdev) · line 522

Quoted 8 lines
drivers/thermal/k3_j72xx_bandgap.c +2 -0
@@ -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);

LGTM,

#2 lore raw
In reply to Michael Walle
Quoted 5 lines · Michael Walle

Make the sensors available in the hwmon subsystem (if CONFIG_THERMAL_HWMON is enabled).

---

Applied, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog