From: Chen-Yu Tsai <wens@kernel•org>
To: Markus Mayer <mmayer@broadcom•com>,
Florian Fainelli <f.fainelli@gmail•com>,
Zhang Rui <rui.zhang@intel•com>,
Eduardo Valentin <edubezval@gmail•com>,
Daniel Lezcano <daniel.lezcano@linaro•org>,
Amit Kucheria <amit.kucheria@verdurent•com>
Cc: Chen-Yu Tsai <wens@csie•org>,
bcm-kernel-feedback-list@broadcom•com,
linux-kernel@vger•kernel.org,
linux-arm-kernel@lists•infradead.org, linux-pm@vger•kernel.org
Subject: [PATCH] thermal: brcmstb: enable hwmon
Date: Thu, 31 Oct 2019 00:38:07 +0800 [thread overview]
Message-ID: <20191030163807.17817-1-wens@kernel.org> (raw)
From: Chen-Yu Tsai <wens@csie•org>
By defaul of-based thermal driver do not have hwmon entries registered.
Do this explicitly so users can use standard hwmon interfaces and tools
to read the temperature.
This is based on similar changes for bcm2835_thermal in commit
d56c19d07e0b ("thermal: bcm2835: enable hwmon explicitly").
Signed-off-by: Chen-Yu Tsai <wens@csie•org>
---
This patch was only compile tested. A similar patch [1] was submitted to
the downstream kernel, which I did build and actually run on a Raspberry
Pi 4.
This one for mainline is much simpler, as it does not need to deal with
the error path or device removal, due to the use of devres.
[1] https://github.com/raspberrypi/linux/pull/3307
---
drivers/thermal/broadcom/brcmstb_thermal.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
index 5825ac581f56..8353aaa4d624 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -21,6 +21,8 @@
#include <linux/of_device.h>
#include <linux/thermal.h>
+#include "../thermal_hwmon.h"
+
#define AVS_TMON_STATUS 0x00
#define AVS_TMON_STATUS_valid_msk BIT(11)
#define AVS_TMON_STATUS_data_msk GENMASK(10, 1)
@@ -343,6 +345,12 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
return ret;
}
+ /* hwmon not enabled by default. Enable it here. */
+ thermal->tzp->no_hwmon = false;
+ ret = thermal_add_hwmon_sysfs(thermal);
+ if (ret)
+ return ret;
+
dev_info(&pdev->dev, "registered AVS TMON of-sensor driver\n");
return 0;
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-10-30 16:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 16:38 Chen-Yu Tsai [this message]
2019-10-30 16:57 ` [PATCH] thermal: brcmstb: enable hwmon Florian Fainelli
2019-10-30 17:15 ` Florian Fainelli
2019-10-31 13:08 ` Stefan Wahren
2019-11-01 3:01 ` Florian Fainelli
2019-11-01 3:04 ` Chen-Yu Tsai
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=20191030163807.17817-1-wens@kernel.org \
--to=wens@kernel$(echo .)org \
--cc=amit.kucheria@verdurent$(echo .)com \
--cc=bcm-kernel-feedback-list@broadcom$(echo .)com \
--cc=daniel.lezcano@linaro$(echo .)org \
--cc=edubezval@gmail$(echo .)com \
--cc=f.fainelli@gmail$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-pm@vger$(echo .)kernel.org \
--cc=mmayer@broadcom$(echo .)com \
--cc=rui.zhang@intel$(echo .)com \
--cc=wens@csie$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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