diff mbox series

[thermal:,thermal/next] thermal/drivers/tsens: register thermal zones as hwmon sensors

Message ID 164677163007.16921.12143354781302766435.tip-bot2@tip-bot2
State New
Headers show
Series [thermal:,thermal/next] thermal/drivers/tsens: register thermal zones as hwmon sensors | expand

Commit Message

thermal-bot for Julien Panis March 8, 2022, 8:33 p.m. UTC
The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     8556e19d4939fbdb15aee9391f035453c5b2255a
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//8556e19d4939fbdb15aee9391f035453c5b2255a
Author:        Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
AuthorDate:    Sat, 29 Jan 2022 21:07:50 +03:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Tue, 08 Mar 2022 21:26:08 +01:00

thermal/drivers/tsens: register thermal zones as hwmon sensors

Register thermal zones as hwmon sensors to let userspace read
CPU temperatures using standard hwmon interface.

Acked-by: Amit Kucheria <amitk@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220129180750.1882310-1-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/qcom/tsens.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 99a8d9f..154d3cb 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -18,6 +18,7 @@ 
 #include <linux/regmap.h>
 #include <linux/slab.h>
 #include <linux/thermal.h>
+#include "../thermal_hwmon.h"
 #include "tsens.h"
 
 /**
@@ -1060,6 +1061,10 @@  static int tsens_register(struct tsens_priv *priv)
 		priv->sensor[i].tzd = tzd;
 		if (priv->ops->enable)
 			priv->ops->enable(priv, i);
+
+		if (devm_thermal_add_hwmon_sysfs(tzd))
+			dev_warn(priv->dev,
+				 "Failed to add hwmon sysfs attributes\n");
 	}
 
 	/* VER_0 require to set MIN and MAX THRESH