[PATCH 06/12] thermal: qoriq: Add hwmon support

From: Andrey Smirnov
Date: Mon Feb 18 2019 - 14:12:49 EST


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

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
Cc: Chris Healy <cphealy@xxxxxxxxx>
Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
Cc: Zhang Rui <rui.zhang@xxxxxxxxx>
Cc: Eduardo Valentin <edubezval@xxxxxxxxx>
Cc: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
Cc: linux-imx@xxxxxxx
Cc: linux-pm@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
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