[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201125162405.GA1263100@paju>
Date: Thu, 26 Nov 2020 01:24:05 +0900
From: Dongjin Kim <tobetter@...il.com>
To: Guillaume La Roque <glaroque@...libre.com>,
Zhang Rui <rui.zhang@...el.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Amit Kucheria <amitk@...nel.org>, linux-pm@...r.kernel.org,
linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] thermal: amlogic_thermal: Add hwmon support
Expose Amlogic thermal as HWMON devices.
$ sensors
cpu_thermal-virtual-0
Adapter: Virtual device
temp1: +32.2 C (crit = +110.0 C)
ddr_thermal-virtual-0
Adapter: Virtual device
temp1: +33.4 C (crit = +110.0 C)
Signed-off-by: Dongjin Kim <tobetter@...il.com>
---
drivers/thermal/amlogic_thermal.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index ccb1fe18e993..2fce96c32586 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -29,6 +29,7 @@
#include <linux/thermal.h>
#include "thermal_core.h"
+#include "thermal_hwmon.h"
#define TSENSOR_CFG_REG1 0x4
#define TSENSOR_CFG_REG1_RSET_VBG BIT(12)
@@ -291,6 +292,9 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
if (ret)
return ret;
+ if (devm_thermal_add_hwmon_sysfs(pdata->tzd))
+ dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
+
ret = amlogic_thermal_enable(pdata);
return ret;
--
2.25.1
Powered by blists - more mailing lists