linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] thermal/drivers/tsens: register thermal zones as hwmon sensors
@ 2022-01-29 18:07 Dmitry Baryshkov
  2022-01-29 20:06 ` Daniel Lezcano
  2022-03-08 20:33 ` [thermal: thermal/next] " thermal-bot for Dmitry Baryshkov
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2022-01-29 18:07 UTC (permalink / raw)
  To: Amit Kucheria, Thara Gopinath, Andy Gross, Bjorn Andersson,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui
  Cc: linux-pm, linux-arm-msm

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>
---
 drivers/thermal/qcom/tsens.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 99a8d9f3e03c..154d3cb19c88 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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] thermal/drivers/tsens: register thermal zones as hwmon sensors
  2022-01-29 18:07 [PATCH v2] thermal/drivers/tsens: register thermal zones as hwmon sensors Dmitry Baryshkov
@ 2022-01-29 20:06 ` Daniel Lezcano
  2022-03-08 20:33 ` [thermal: thermal/next] " thermal-bot for Dmitry Baryshkov
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2022-01-29 20:06 UTC (permalink / raw)
  To: Dmitry Baryshkov, Amit Kucheria, Thara Gopinath, Andy Gross,
	Bjorn Andersson, Rafael J. Wysocki, Zhang Rui
  Cc: linux-pm, linux-arm-msm

On 29/01/2022 19:07, Dmitry Baryshkov wrote:
> 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>
> ---

Applied, thanks


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [thermal: thermal/next] thermal/drivers/tsens: register thermal zones as hwmon sensors
  2022-01-29 18:07 [PATCH v2] thermal/drivers/tsens: register thermal zones as hwmon sensors Dmitry Baryshkov
  2022-01-29 20:06 ` Daniel Lezcano
@ 2022-03-08 20:33 ` thermal-bot for Dmitry Baryshkov
  1 sibling, 0 replies; 3+ messages in thread
From: thermal-bot for Dmitry Baryshkov @ 2022-03-08 20:33 UTC (permalink / raw)
  To: linux-pm; +Cc: Amit Kucheria, Dmitry Baryshkov, Daniel Lezcano, rui.zhang

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 --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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-08 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-29 18:07 [PATCH v2] thermal/drivers/tsens: register thermal zones as hwmon sensors Dmitry Baryshkov
2022-01-29 20:06 ` Daniel Lezcano
2022-03-08 20:33 ` [thermal: thermal/next] " thermal-bot for Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).