Skip to content

Commit 0021102

Browse files
committed
Merge back thermal cotntrol material for v6.10.
2 parents d351eb0 + e1242ff commit 0021102

34 files changed

+1084
-517
lines changed

Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ description: Binding for Amlogic Thermal
1313

1414
properties:
1515
compatible:
16-
items:
17-
- enum:
18-
- amlogic,g12a-cpu-thermal
19-
- amlogic,g12a-ddr-thermal
20-
- const: amlogic,g12a-thermal
16+
oneOf:
17+
- items:
18+
- enum:
19+
- amlogic,g12a-cpu-thermal
20+
- amlogic,g12a-ddr-thermal
21+
- const: amlogic,g12a-thermal
22+
- const: amlogic,a1-cpu-thermal
2123

2224
reg:
2325
maxItems: 1

Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ properties:
1818
oneOf:
1919
- enum:
2020
- loongson,ls2k1000-thermal
21+
- loongson,ls2k2000-thermal
2122
- items:
2223
- enum:
23-
- loongson,ls2k2000-thermal
24+
- loongson,ls2k0500-thermal
2425
- const: loongson,ls2k1000-thermal
2526

2627
reg:
27-
maxItems: 1
28+
minItems: 1
29+
maxItems: 2
2830

2931
interrupts:
3032
maxItems: 1
@@ -38,6 +40,24 @@ required:
3840
- interrupts
3941
- '#thermal-sensor-cells'
4042

43+
if:
44+
properties:
45+
compatible:
46+
contains:
47+
enum:
48+
- loongson,ls2k2000-thermal
49+
50+
then:
51+
properties:
52+
reg:
53+
minItems: 2
54+
maxItems: 2
55+
56+
else:
57+
properties:
58+
reg:
59+
maxItems: 1
60+
4161
unevaluatedProperties: false
4262

4363
examples:

Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ properties:
1919
compatible:
2020
enum:
2121
- mediatek,mt7988-lvts-ap
22+
- mediatek,mt8186-lvts
23+
- mediatek,mt8188-lvts-ap
24+
- mediatek,mt8188-lvts-mcu
2225
- mediatek,mt8192-lvts-ap
2326
- mediatek,mt8192-lvts-mcu
2427
- mediatek,mt8195-lvts-ap
@@ -60,6 +63,8 @@ allOf:
6063
compatible:
6164
contains:
6265
enum:
66+
- mediatek,mt8188-lvts-ap
67+
- mediatek,mt8188-lvts-mcu
6368
- mediatek,mt8192-lvts-ap
6469
- mediatek,mt8192-lvts-mcu
6570
then:
@@ -75,6 +80,7 @@ allOf:
7580
compatible:
7681
contains:
7782
enum:
83+
- mediatek,mt8186-lvts
7884
- mediatek,mt8195-lvts-ap
7985
- mediatek,mt8195-lvts-mcu
8086
then:

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ description:
1717

1818
properties:
1919
compatible:
20-
enum:
21-
- qcom,sc8180x-lmh
22-
- qcom,sdm845-lmh
23-
- qcom,sm8150-lmh
20+
oneOf:
21+
- enum:
22+
- qcom,sc8180x-lmh
23+
- qcom,sdm845-lmh
24+
- qcom,sm8150-lmh
25+
- items:
26+
- const: qcom,qcm2290-lmh
27+
- const: qcom,sm8150-lmh
2428

2529
reg:
2630
items:
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/st,stih407-thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: STMicroelectronics STi digital thermal sensor (DTS)
8+
9+
maintainers:
10+
- Patrice Chotard <patrice.chotard@foss.st.com>
11+
- Lee Jones <lee@kernel.org>
12+
13+
allOf:
14+
- $ref: thermal-sensor.yaml
15+
16+
properties:
17+
compatible:
18+
const: st,stih407-thermal
19+
20+
reg:
21+
maxItems: 1
22+
23+
clocks:
24+
maxItems: 1
25+
26+
clock-names:
27+
items:
28+
- const: thermal
29+
30+
interrupts:
31+
description:
32+
For thermal sensors for which no interrupt has been defined, a polling
33+
delay of 1000ms will be used to read the temperature from device.
34+
maxItems: 1
35+
36+
'#thermal-sensor-cells':
37+
const: 0
38+
39+
required:
40+
- compatible
41+
- reg
42+
- clocks
43+
- clock-names
44+
45+
unevaluatedProperties: false
46+
47+
examples:
48+
- |
49+
#include <dt-bindings/interrupt-controller/arm-gic.h>
50+
temperature-sensor@91a0000 {
51+
compatible = "st,stih407-thermal";
52+
reg = <0x91a0000 0x28>;
53+
clock-names = "thermal";
54+
clocks = <&CLK_SYSIN>;
55+
interrupts = <GIC_SPI 205 IRQ_TYPE_EDGE_RISING>;
56+
#thermal-sensor-cells = <0>;
57+
};
58+
...

Documentation/devicetree/bindings/thermal/st-thermal.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

drivers/thermal/amlogic_thermal.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ static const struct amlogic_thermal_data amlogic_thermal_g12a_ddr_param = {
220220
.regmap_config = &amlogic_thermal_regmap_config_g12a,
221221
};
222222

223+
static const struct amlogic_thermal_data amlogic_thermal_a1_cpu_param = {
224+
.u_efuse_off = 0x114,
225+
.calibration_parameters = &amlogic_thermal_g12a,
226+
.regmap_config = &amlogic_thermal_regmap_config_g12a,
227+
};
228+
223229
static const struct of_device_id of_amlogic_thermal_match[] = {
224230
{
225231
.compatible = "amlogic,g12a-ddr-thermal",
@@ -229,6 +235,10 @@ static const struct of_device_id of_amlogic_thermal_match[] = {
229235
.compatible = "amlogic,g12a-cpu-thermal",
230236
.data = &amlogic_thermal_g12a_cpu_param,
231237
},
238+
{
239+
.compatible = "amlogic,a1-cpu-thermal",
240+
.data = &amlogic_thermal_a1_cpu_param,
241+
},
232242
{ /* sentinel */ }
233243
};
234244
MODULE_DEVICE_TABLE(of, of_amlogic_thermal_match);

drivers/thermal/armada_thermal.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,6 @@ static void armada_set_sane_name(struct platform_device *pdev,
763763
struct armada_thermal_priv *priv)
764764
{
765765
const char *name = dev_name(&pdev->dev);
766-
char *insane_char;
767766

768767
if (strlen(name) > THERMAL_NAME_LENGTH) {
769768
/*
@@ -781,12 +780,8 @@ static void armada_set_sane_name(struct platform_device *pdev,
781780
/* Save the name locally */
782781
strscpy(priv->zone_name, name, THERMAL_NAME_LENGTH);
783782

784-
/* Then check there are no '-' or hwmon core will complain */
785-
do {
786-
insane_char = strpbrk(priv->zone_name, "-");
787-
if (insane_char)
788-
*insane_char = '_';
789-
} while (insane_char);
783+
/* Then ensure there are no '-' or hwmon core will complain */
784+
strreplace(priv->zone_name, '-', '_');
790785
}
791786

792787
/*

drivers/thermal/gov_fair_share.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717

1818
static int get_trip_level(struct thermal_zone_device *tz)
1919
{
20-
const struct thermal_trip *trip, *level_trip = NULL;
20+
const struct thermal_trip *level_trip = NULL;
21+
const struct thermal_trip_desc *td;
2122
int trip_level = -1;
2223

23-
for_each_trip(tz, trip) {
24+
for_each_trip_desc(tz, td) {
25+
const struct thermal_trip *trip = &td->trip;
26+
2427
if (trip->temperature >= tz->temperature)
2528
continue;
2629

drivers/thermal/gov_power_allocator.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,11 @@ static void get_governor_trips(struct thermal_zone_device *tz,
496496
const struct thermal_trip *first_passive = NULL;
497497
const struct thermal_trip *last_passive = NULL;
498498
const struct thermal_trip *last_active = NULL;
499-
const struct thermal_trip *trip;
499+
const struct thermal_trip_desc *td;
500+
501+
for_each_trip_desc(tz, td) {
502+
const struct thermal_trip *trip = &td->trip;
500503

501-
for_each_trip(tz, trip) {
502504
switch (trip->type) {
503505
case THERMAL_TRIP_PASSIVE:
504506
if (!first_passive) {

0 commit comments

Comments
 (0)