Skip to content

Commit 79b2027

Browse files
committed
Merge back thermal control material for 6.3.
2 parents acd7e9e + 02be605 commit 79b2027

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1392
-1879
lines changed

Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ properties:
1313
enum:
1414
- qcom,spmi-adc-tm5
1515
- qcom,spmi-adc-tm5-gen2
16+
- qcom,adc-tm7 # Incomplete / subject to change
1617

1718
reg:
1819
maxItems: 1

Documentation/devicetree/bindings/thermal/qcom-tsens.yaml

Lines changed: 143 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ properties:
3737
- description: v1 of TSENS
3838
items:
3939
- enum:
40+
- qcom,msm8956-tsens
4041
- qcom,msm8976-tsens
4142
- qcom,qcs404-tsens
4243
- const: qcom,tsens-v1
@@ -80,18 +81,120 @@ properties:
8081
maxItems: 2
8182

8283
nvmem-cells:
83-
minItems: 1
84-
maxItems: 2
85-
description:
86-
Reference to an nvmem node for the calibration data
84+
oneOf:
85+
- minItems: 1
86+
maxItems: 2
87+
description:
88+
Reference to an nvmem node for the calibration data
89+
- minItems: 5
90+
maxItems: 35
91+
description: |
92+
Reference to nvmem cells for the calibration mode, two calibration
93+
bases and two cells per each sensor
94+
# special case for msm8974 / apq8084
95+
- maxItems: 51
96+
description: |
97+
Reference to nvmem cells for the calibration mode, two calibration
98+
bases and two cells per each sensor, main and backup copies, plus use_backup cell
8799
88100
nvmem-cell-names:
89-
minItems: 1
90-
items:
91-
- const: calib
92-
- enum:
93-
- calib_backup
94-
- calib_sel
101+
oneOf:
102+
- minItems: 1
103+
items:
104+
- const: calib
105+
- enum:
106+
- calib_backup
107+
- calib_sel
108+
- minItems: 5
109+
items:
110+
- const: mode
111+
- const: base1
112+
- const: base2
113+
- pattern: '^s[0-9]+_p1$'
114+
- pattern: '^s[0-9]+_p2$'
115+
- pattern: '^s[0-9]+_p1$'
116+
- pattern: '^s[0-9]+_p2$'
117+
- pattern: '^s[0-9]+_p1$'
118+
- pattern: '^s[0-9]+_p2$'
119+
- pattern: '^s[0-9]+_p1$'
120+
- pattern: '^s[0-9]+_p2$'
121+
- pattern: '^s[0-9]+_p1$'
122+
- pattern: '^s[0-9]+_p2$'
123+
- pattern: '^s[0-9]+_p1$'
124+
- pattern: '^s[0-9]+_p2$'
125+
- pattern: '^s[0-9]+_p1$'
126+
- pattern: '^s[0-9]+_p2$'
127+
- pattern: '^s[0-9]+_p1$'
128+
- pattern: '^s[0-9]+_p2$'
129+
- pattern: '^s[0-9]+_p1$'
130+
- pattern: '^s[0-9]+_p2$'
131+
- pattern: '^s[0-9]+_p1$'
132+
- pattern: '^s[0-9]+_p2$'
133+
- pattern: '^s[0-9]+_p1$'
134+
- pattern: '^s[0-9]+_p2$'
135+
- pattern: '^s[0-9]+_p1$'
136+
- pattern: '^s[0-9]+_p2$'
137+
- pattern: '^s[0-9]+_p1$'
138+
- pattern: '^s[0-9]+_p2$'
139+
- pattern: '^s[0-9]+_p1$'
140+
- pattern: '^s[0-9]+_p2$'
141+
- pattern: '^s[0-9]+_p1$'
142+
- pattern: '^s[0-9]+_p2$'
143+
- pattern: '^s[0-9]+_p1$'
144+
- pattern: '^s[0-9]+_p2$'
145+
# special case for msm8974 / apq8084
146+
- items:
147+
- const: mode
148+
- const: base1
149+
- const: base2
150+
- const: use_backup
151+
- const: mode_backup
152+
- const: base1_backup
153+
- const: base2_backup
154+
- const: s0_p1
155+
- const: s0_p2
156+
- const: s1_p1
157+
- const: s1_p2
158+
- const: s2_p1
159+
- const: s2_p2
160+
- const: s3_p1
161+
- const: s3_p2
162+
- const: s4_p1
163+
- const: s4_p2
164+
- const: s5_p1
165+
- const: s5_p2
166+
- const: s6_p1
167+
- const: s6_p2
168+
- const: s7_p1
169+
- const: s7_p2
170+
- const: s8_p1
171+
- const: s8_p2
172+
- const: s9_p1
173+
- const: s9_p2
174+
- const: s10_p1
175+
- const: s10_p2
176+
- const: s0_p1_backup
177+
- const: s0_p2_backup
178+
- const: s1_p1_backup
179+
- const: s1_p2_backup
180+
- const: s2_p1_backup
181+
- const: s2_p2_backup
182+
- const: s3_p1_backup
183+
- const: s3_p2_backup
184+
- const: s4_p1_backup
185+
- const: s4_p2_backup
186+
- const: s5_p1_backup
187+
- const: s5_p2_backup
188+
- const: s6_p1_backup
189+
- const: s6_p2_backup
190+
- const: s7_p1_backup
191+
- const: s7_p2_backup
192+
- const: s8_p1_backup
193+
- const: s8_p2_backup
194+
- const: s9_p1_backup
195+
- const: s9_p2_backup
196+
- const: s10_p1_backup
197+
- const: s10_p2_backup
95198

96199
"#qcom,sensors":
97200
description:
@@ -220,6 +323,36 @@ examples:
220323
};
221324
};
222325
326+
- |
327+
#include <dt-bindings/interrupt-controller/arm-gic.h>
328+
// Example 1 (new calbiration data: for pre v1 IP):
329+
thermal-sensor@900000 {
330+
compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
331+
reg = <0x4a9000 0x1000>, /* TM */
332+
<0x4a8000 0x1000>; /* SROT */
333+
334+
nvmem-cells = <&tsens_mode>,
335+
<&tsens_base1>, <&tsens_base2>,
336+
<&tsens_s0_p1>, <&tsens_s0_p2>,
337+
<&tsens_s1_p1>, <&tsens_s1_p2>,
338+
<&tsens_s2_p1>, <&tsens_s2_p2>,
339+
<&tsens_s4_p1>, <&tsens_s4_p2>,
340+
<&tsens_s5_p1>, <&tsens_s5_p2>;
341+
nvmem-cell-names = "mode",
342+
"base1", "base2",
343+
"s0_p1", "s0_p2",
344+
"s1_p1", "s1_p2",
345+
"s2_p1", "s2_p2",
346+
"s4_p1", "s4_p2",
347+
"s5_p1", "s5_p2";
348+
349+
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
350+
interrupt-names = "uplow";
351+
352+
#qcom,sensors = <5>;
353+
#thermal-sensor-cells = <1>;
354+
};
355+
223356
- |
224357
#include <dt-bindings/interrupt-controller/arm-gic.h>
225358
// Example 1 (legacy: for pre v1 IP):

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,8 +1079,6 @@ struct mbox_list {
10791079
#if IS_ENABLED(CONFIG_THERMAL)
10801080
struct ch_thermal {
10811081
struct thermal_zone_device *tzdev;
1082-
int trip_temp;
1083-
int trip_type;
10841082
};
10851083
#endif
10861084

drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,12 @@ static int cxgb4_thermal_get_temp(struct thermal_zone_device *tzdev,
2929
return 0;
3030
}
3131

32-
static int cxgb4_thermal_get_trip_type(struct thermal_zone_device *tzdev,
33-
int trip, enum thermal_trip_type *type)
34-
{
35-
struct adapter *adap = tzdev->devdata;
36-
37-
if (!adap->ch_thermal.trip_temp)
38-
return -EINVAL;
39-
40-
*type = adap->ch_thermal.trip_type;
41-
return 0;
42-
}
43-
44-
static int cxgb4_thermal_get_trip_temp(struct thermal_zone_device *tzdev,
45-
int trip, int *temp)
46-
{
47-
struct adapter *adap = tzdev->devdata;
48-
49-
if (!adap->ch_thermal.trip_temp)
50-
return -EINVAL;
51-
52-
*temp = adap->ch_thermal.trip_temp;
53-
return 0;
54-
}
55-
5632
static struct thermal_zone_device_ops cxgb4_thermal_ops = {
5733
.get_temp = cxgb4_thermal_get_temp,
58-
.get_trip_type = cxgb4_thermal_get_trip_type,
59-
.get_trip_temp = cxgb4_thermal_get_trip_temp,
6034
};
6135

36+
static struct thermal_trip trip = { .type = THERMAL_TRIP_CRITICAL } ;
37+
6238
int cxgb4_thermal_init(struct adapter *adap)
6339
{
6440
struct ch_thermal *ch_thermal = &adap->ch_thermal;
@@ -79,15 +55,14 @@ int cxgb4_thermal_init(struct adapter *adap)
7955
if (ret < 0) {
8056
num_trip = 0; /* could not get trip temperature */
8157
} else {
82-
ch_thermal->trip_temp = val * 1000;
83-
ch_thermal->trip_type = THERMAL_TRIP_CRITICAL;
58+
trip.temperature = val * 1000;
8459
}
8560

8661
snprintf(ch_tz_name, sizeof(ch_tz_name), "cxgb4_%s", adap->name);
87-
ch_thermal->tzdev = thermal_zone_device_register(ch_tz_name, num_trip,
88-
0, adap,
89-
&cxgb4_thermal_ops,
90-
NULL, 0, 0);
62+
ch_thermal->tzdev = thermal_zone_device_register_with_trips(ch_tz_name, &trip, num_trip,
63+
0, adap,
64+
&cxgb4_thermal_ops,
65+
NULL, 0, 0);
9166
if (IS_ERR(ch_thermal->tzdev)) {
9267
ret = PTR_ERR(ch_thermal->tzdev);
9368
dev_err(adap->pdev_dev, "Failed to register thermal zone\n");

0 commit comments

Comments
 (0)