lkml.org 
[lkml]   [2020]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] thermal: imx_sc_thermal: Add hwmon support
Date
Expose i.MX SC thermal sensors as HWMON devices.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
drivers/thermal/imx_sc_thermal.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
index a8723b1..b2b68c9 100644
--- a/drivers/thermal/imx_sc_thermal.c
+++ b/drivers/thermal/imx_sc_thermal.c
@@ -14,6 +14,7 @@
#include <linux/thermal.h>

#include "thermal_core.h"
+#include "thermal_hwmon.h"

#define IMX_SC_MISC_FUNC_GET_TEMP 13

@@ -115,6 +116,9 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
ret = PTR_ERR(sensor->tzd);
break;
}
+
+ if (devm_thermal_add_hwmon_sysfs(sensor->tzd))
+ dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
}

of_node_put(sensor_np);
--
2.7.4
\
 
 \ /
  Last update: 2020-03-26 04:21    [W:2.617 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site