From: "thermal-bot for Dmitry Baryshkov" <tip-bot2@linutronix.de>
To: linux-pm@vger.kernel.org
Cc: Amit Kucheria <amitk@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
rui.zhang@intel.com
Subject: [thermal: thermal/next] thermal/drivers/tsens: register thermal zones as hwmon sensors
Date: Tue, 08 Mar 2022 20:33:50 -0000 [thread overview]
Message-ID: <164677163007.16921.12143354781302766435.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220129180750.1882310-1-dmitry.baryshkov@linaro.org>
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
prev parent reply other threads:[~2022-03-08 20:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=164677163007.16921.12143354781302766435.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).