summaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch
blob: 95ba5d653d332be78f7e8cf1fbf80ad981b57071 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From bd462524b465fc6aeed292cca8c2da19be3d9887 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 19 Apr 2016 12:57:52 +0100
Subject: [PATCH] bcm2835_thermal: Don't report unsupported trip type

---
 drivers/thermal/bcm2835-thermal.c | 34 +---------------------------------
 1 file changed, 1 insertion(+), 33 deletions(-)

--- a/drivers/thermal/bcm2835-thermal.c
+++ b/drivers/thermal/bcm2835-thermal.c
@@ -49,38 +49,8 @@ static int bcm2835_thermal_get_temp(stru
 					    RPI_FIRMWARE_GET_TEMPERATURE);
 }
 
-static int bcm2835_thermal_get_max_temp(struct thermal_zone_device *tz,
-					int trip, int *temp)
-{
-	/*
-	 * The maximum safe temperature of the SoC.
-	 * Overclock may be disabled above this temperature.
-	 */
-	return bcm2835_thermal_get_property(tz, temp,
-					    RPI_FIRMWARE_GET_MAX_TEMPERATURE);
-}
-
-static int bcm2835_thermal_get_trip_type(struct thermal_zone_device *tz,
-					 int trip, enum thermal_trip_type *type)
-{
-	*type = THERMAL_TRIP_HOT;
-
-	return 0;
-}
-
-static int bcm2835_thermal_get_mode(struct thermal_zone_device *tz,
-				    enum thermal_device_mode *mode)
-{
-	*mode = THERMAL_DEVICE_ENABLED;
-
-	return 0;
-}
-
 static struct thermal_zone_device_ops ops  = {
 	.get_temp = bcm2835_thermal_get_temp,
-	.get_trip_temp = bcm2835_thermal_get_max_temp,
-	.get_trip_type = bcm2835_thermal_get_trip_type,
-	.get_mode = bcm2835_thermal_get_mode,
 };
 
 static int bcm2835_thermal_probe(struct platform_device *pdev)
@@ -90,17 +60,15 @@ static int bcm2835_thermal_probe(struct
 	struct thermal_zone_device *tz;
 
 	fw_np = of_parse_phandle(pdev->dev.of_node, "firmware", 0);
-/* Remove comment when booting without Device Tree is no longer supported
 	if (!fw_np) {
 		dev_err(&pdev->dev, "Missing firmware node\n");
 		return -ENOENT;
 	}
-*/
 	fw = rpi_firmware_get(fw_np);
 	if (!fw)
 		return -EPROBE_DEFER;
 
-	tz = thermal_zone_device_register("bcm2835_thermal", 1, 0, fw, &ops,
+	tz = thermal_zone_device_register("bcm2835_thermal", 0, 0, fw, &ops,
 					  NULL, 0, 0);
 	if (IS_ERR(tz)) {
 		dev_err(&pdev->dev, "Failed to register the thermal device\n");