Skip to contentSkip to conversation

thermal: bcm2835: enable hwmon explicitly

PATCH In review [email protected] 3 participants 4 messages Oct 21, 2018 – Nov 7, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: bcm2835: enable hwmon explicitly

From: Matthias Brugger <[email protected]>

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.

---
 drivers/thermal/broadcom/bcm2835_thermal.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/thermal/broadcom/bcm2835_thermal.c +11 -0
index 23ad4f9f2143..24b006a95142 100644
@@ -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;
Signature · 1 line
2.19.1
Acked-by on v1 1/1
#1 lore raw

Hi Matthias,

Quoted 10 lines

matthias.bgg at kernel.org hat am 21. Oktober 2018 um 23:58 geschrieben:

From: Matthias Brugger <[email protected]>

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.

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

Regards
Stefan

#2 lore raw

Hi Stefan,

Quoted 11 lines · Stefan Wahren

Hi Matthias,

Quoted 9 lines

matthias.bgg at kernel.org hat am 21. Oktober 2018 um 23:58 geschrieben:

From: Matthias Brugger <[email protected]>

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.

Quoted 6 lines
Quoted 1 line

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

#3 lore raw
In reply to [email protected]

Hi Rui,
hi Eduardo,
hi Daniel,

Quoted 11 lines

matthias.bgg at kernel.org hat am 21. Oktober 2018 um 23:58 geschrieben:

From: Matthias Brugger <[email protected]>

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.

---

any objections except of the missing t in default?

Stefan