From 85f0ad221317c18e6032b6735f6b36c8a6a96ea9 Mon Sep 17 00:00:00 2001 From: Yangtao Li Date: Sat, 28 Dec 2019 17:19:04 +0000 Subject: [PATCH] thermal: sun8i: Add hwmon support Expose sun8i thermal as a HWMON device. Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20191228171904.24618-1-tiny.windzz@gmail.com --- drivers/thermal/sun8i_thermal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c index bd7549f9ecba..74d73be16496 100644 --- a/drivers/thermal/sun8i_thermal.c +++ b/drivers/thermal/sun8i_thermal.c @@ -20,6 +20,8 @@ #include #include +#include "thermal_hwmon.h" + #define MAX_SENSOR_NUM 4 #define FT_TEMP_MASK GENMASK(11, 0) @@ -471,6 +473,10 @@ static int sun8i_ths_register(struct ths_device *tmdev) &ths_ops); if (IS_ERR(tmdev->sensor[i].tzd)) return PTR_ERR(tmdev->sensor[i].tzd); + + if (devm_thermal_add_hwmon_sysfs(tmdev->sensor[i].tzd)) + dev_warn(tmdev->dev, + "Failed to add hwmon sysfs attributes\n"); } return 0; -- 2.11.0