Skip to content

Commit 85b21fd

Browse files
wensdlezcano
authored andcommitted
thermal/drivers/generic-adc: Register thermal zones as hwmon sensors
Register thermal zones as hwmon sensors to let userspace read temperatures using standard hwmon interface. Signed-off-by: Chen-Yu Tsai <[email protected]> [Yangtao: only keep devm_thermal_add_hwmon_sysfs] Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 27cc5be commit 85b21fd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/thermal/thermal-generic-adc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <linux/slab.h>
1414
#include <linux/thermal.h>
1515

16+
#include "thermal_hwmon.h"
17+
1618
struct gadc_thermal_info {
1719
struct device *dev;
1820
struct thermal_zone_device *tz_dev;
@@ -153,6 +155,8 @@ static int gadc_thermal_probe(struct platform_device *pdev)
153155
return ret;
154156
}
155157

158+
devm_thermal_add_hwmon_sysfs(&pdev->dev, gti->tz_dev);
159+
156160
return 0;
157161
}
158162

0 commit comments

Comments
 (0)