diff mbox series

thermal: bcm2835: enable hwmon explicitly

Message ID 20181021215848.5827-1-matthias.bgg@kernel.org (mailing list archive)
State New, archived
Headers show
Series thermal: bcm2835: enable hwmon explicitly | expand

Commit Message

Matthias Brugger Oct. 21, 2018, 9:58 p.m. UTC
From: Matthias Brugger <mbrugger@suse.com>

By defaul of-based thermal driver do not enable hwmon.
This patch does this explicitly, so that the temperature can be read
through the common hwmon sysfs.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/thermal/broadcom/bcm2835_thermal.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Stefan Wahren Oct. 23, 2018, 12:01 p.m. UTC | #1
Hi Matthias,

> matthias.bgg@kernel.org hat am 21. Oktober 2018 um 23:58 geschrieben:
> 
> 
> From: Matthias Brugger <mbrugger@suse.com>
> 
> By defaul of-based thermal driver do not enable hwmon.
> This patch does this explicitly, so that the temperature can be read
> through the common hwmon sysfs.
> 
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>

Acked-by: Stefan Wahren <stefan.wahren@i2se.com>

I'm just curious which board and config did you use for your tests?

Regards
Stefan
Matthias Brugger Oct. 23, 2018, 9:20 p.m. UTC | #2
Hi Stefan,

On 23/10/2018 14:01, Stefan Wahren wrote:
> Hi Matthias,
> 
>> matthias.bgg@kernel.org hat am 21. Oktober 2018 um 23:58 geschrieben:
>>
>>
>> From: Matthias Brugger <mbrugger@suse.com>
>>
>> By defaul of-based thermal driver do not enable hwmon.
>> This patch does this explicitly, so that the temperature can be read
>> through the common hwmon sysfs.
>>
>> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> 
> Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
> 
> I'm just curious which board and config did you use for your tests?
> 

I use the RPi3 B+. I suppose when asking about the config, you want to know if I
also enable the RASPBERRYPI_HWMON, yes I enable that as well. Actually this
patch is for openSUSE Leap. You can find the whole config (if you are
interested) here:
https://kernel.suse.com/cgit/kernel-source/tree/config/arm64/default?h=SLE15

Regards,
Matthias
Stefan Wahren Nov. 7, 2018, 7:04 p.m. UTC | #3
Hi Rui,
hi Eduardo,
hi Daniel,

> matthias.bgg@kernel.org hat am 21. Oktober 2018 um 23:58 geschrieben:
> 
> 
> From: Matthias Brugger <mbrugger@suse.com>
> 
> By defaul of-based thermal driver do not enable hwmon.
> This patch does this explicitly, so that the temperature can be read
> through the common hwmon sysfs.
> 
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> ---

any objections except of the missing t in default?

Stefan
diff mbox series

Patch

diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
index 23ad4f9f2143..24b006a95142 100644
--- a/drivers/thermal/broadcom/bcm2835_thermal.c
+++ b/drivers/thermal/broadcom/bcm2835_thermal.c
@@ -27,6 +27,8 @@ 
 #include <linux/platform_device.h>
 #include <linux/thermal.h>
 
+#include "../thermal_hwmon.h"
+
 #define BCM2835_TS_TSENSCTL			0x00
 #define BCM2835_TS_TSENSSTAT			0x04
 
@@ -275,6 +277,15 @@  static int bcm2835_thermal_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, tz);
 
+	/*
+	 * Thermal_zone doesn't enable hwmon as default,
+	 * enable it here
+	 */
+	tz->tzp->no_hwmon = false;
+	err = thermal_add_hwmon_sysfs(tz);
+	if (err)
+		goto err_tz;
+
 	bcm2835_thermal_debugfs(pdev);
 
 	return 0;