]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/thermal-bcm2835-enable-hwmon-explicitly.patch
autosel patches for 4.14
[thirdparty/kernel/stable-queue.git] / queue-4.14 / thermal-bcm2835-enable-hwmon-explicitly.patch
1 From 0ea38d8c1385b2c3d57a60e0bc2b81c8e40c8169 Mon Sep 17 00:00:00 2001
2 From: Matthias Brugger <mbrugger@suse.com>
3 Date: Sun, 21 Oct 2018 23:58:48 +0200
4 Subject: thermal: bcm2835: enable hwmon explicitly
5
6 [ Upstream commit d56c19d07e0bc3ceff366a49b7d7a2440c967b1b ]
7
8 By defaul of-based thermal driver do not enable hwmon.
9 This patch does this explicitly, so that the temperature can be read
10 through the common hwmon sysfs.
11
12 Signed-off-by: Matthias Brugger <mbrugger@suse.com>
13 Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
14 Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
15 Signed-off-by: Sasha Levin <sashal@kernel.org>
16 ---
17 drivers/thermal/broadcom/bcm2835_thermal.c | 11 +++++++++++
18 1 file changed, 11 insertions(+)
19
20 diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
21 index 23ad4f9f2143..24b006a95142 100644
22 --- a/drivers/thermal/broadcom/bcm2835_thermal.c
23 +++ b/drivers/thermal/broadcom/bcm2835_thermal.c
24 @@ -27,6 +27,8 @@
25 #include <linux/platform_device.h>
26 #include <linux/thermal.h>
27
28 +#include "../thermal_hwmon.h"
29 +
30 #define BCM2835_TS_TSENSCTL 0x00
31 #define BCM2835_TS_TSENSSTAT 0x04
32
33 @@ -275,6 +277,15 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
34
35 platform_set_drvdata(pdev, tz);
36
37 + /*
38 + * Thermal_zone doesn't enable hwmon as default,
39 + * enable it here
40 + */
41 + tz->tzp->no_hwmon = false;
42 + err = thermal_add_hwmon_sysfs(tz);
43 + if (err)
44 + goto err_tz;
45 +
46 bcm2835_thermal_debugfs(pdev);
47
48 return 0;
49 --
50 2.19.1
51