Expose thermal readings as a HWMON device, so that it could be
accessed using lm-sensors.

Signed-off-by: Andrey Smirnov <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Zhang Rui <[email protected]>
Cc: Eduardo Valentin <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
 drivers/thermal/qoriq_thermal.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 472594fca03b..90af4c4caa52 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -11,6 +11,7 @@
 #include <linux/thermal.h>
 
 #include "thermal_core.h"
+#include "thermal_hwmon.h"
 
 #define SITES_MAX      16
 
@@ -232,6 +233,10 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
                return ret;
        }
 
+       ret = devm_thermal_add_hwmon_sysfs(data->tz);
+       if (ret)
+               return ret;
+
        platform_set_drvdata(pdev, data);
 
        /* Enable monitoring */
-- 
2.20.1

Reply via email to