Skip to content

Commit d654362

Browse files
committed
Merge tag 'thermal-v6.8-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux into thermal
Merge thermal control material for 6.8-rc1 from Daniel Lezcano: "- Converted Mediatek Thermal to the json-schema (Rafał Miłecki) - Fixed DT bindings issue on Loongson (Binbin Zhou) - Fixed returning NULL instead of -ENODEV on Loogsoo (Binbin Zhou) - Added the DT binding for the tsens on SM8650 platform (Neil Armstrong) - Added a reboot on critical option feature (Fabio Estevam) - Made usage of DEFINE_SIMPLE_DEV_PM_OPS on AmLogic (Uwe Kleine-König) - Added the D1/T113s THS controller support on Sun8i (Maxim Kiselev) - Fixed example in the DT binding for QCom SPMI (Johan Hovold) - Fixed compilation warning for the tmon utility (Florian Eckert) - Added interrupt based configuration on Exynos along with a set of related cleanups (Mateusz Majewski)" * tag 'thermal-v6.8-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (24 commits) thermal/drivers/exynos: Use set_trips ops thermal/drivers/exynos: Use BIT wherever possible thermal/drivers/exynos: Split initialization of TMU and the thermal zone thermal/drivers/exynos: Stop using the threshold mechanism on Exynos 4210 thermal/drivers/exynos: Simplify regulator (de)initialization thermal/drivers/exynos: Handle devm_regulator_get_optional return value correctly thermal/drivers/exynos: Wwitch from workqueue-driven interrupt handling to threaded interrupts thermal/drivers/exynos: Drop id field thermal/drivers/exynos: Remove an unnecessary field description tools/thermal/tmon: Fix compilation warning for wrong format dt-bindings: thermal: qcom-spmi-adc-tm5/hc: Clean up examples dt-bindings: thermal: qcom-spmi-adc-tm5/hc: Fix example node names thermal/drivers/sun8i: Add D1/T113s THS controller support dt-bindings: thermal: sun8i: Add binding for D1/T113s THS controller thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions thermal: amlogic: Make amlogic_thermal_disable() return void thermal/thermal_of: Allow rebooting after critical temp reboot: Introduce thermal_zone_device_critical_reboot() thermal/core: Prepare for introduction of thermal reboot dt-bindings: thermal-zones: Document critical-action ...
2 parents a3cd6db + 5314b15 commit d654362

18 files changed

+491
-357
lines changed

Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ properties:
1616
- allwinner,sun8i-a83t-ths
1717
- allwinner,sun8i-h3-ths
1818
- allwinner,sun8i-r40-ths
19+
- allwinner,sun20i-d1-ths
1920
- allwinner,sun50i-a64-ths
2021
- allwinner,sun50i-a100-ths
2122
- allwinner,sun50i-h5-ths
@@ -61,6 +62,7 @@ allOf:
6162
compatible:
6263
contains:
6364
enum:
65+
- allwinner,sun20i-d1-ths
6466
- allwinner,sun50i-a100-ths
6567
- allwinner,sun50i-h6-ths
6668

@@ -84,7 +86,9 @@ allOf:
8486
properties:
8587
compatible:
8688
contains:
87-
const: allwinner,sun8i-h3-ths
89+
enum:
90+
- allwinner,sun8i-h3-ths
91+
- allwinner,sun20i-d1-ths
8892

8993
then:
9094
properties:
@@ -103,6 +107,7 @@ allOf:
103107
enum:
104108
- allwinner,sun8i-h3-ths
105109
- allwinner,sun8i-r40-ths
110+
- allwinner,sun20i-d1-ths
106111
- allwinner,sun50i-a64-ths
107112
- allwinner,sun50i-a100-ths
108113
- allwinner,sun50i-h5-ths

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ maintainers:
1010
- zhanghongchen <zhanghongchen@loongson.cn>
1111
- Yinbo Zhu <zhuyinbo@loongson.cn>
1212

13+
allOf:
14+
- $ref: /schemas/thermal/thermal-sensor.yaml#
15+
1316
properties:
1417
compatible:
1518
oneOf:
@@ -26,12 +29,16 @@ properties:
2629
interrupts:
2730
maxItems: 1
2831

32+
'#thermal-sensor-cells':
33+
const: 1
34+
2935
required:
3036
- compatible
3137
- reg
3238
- interrupts
39+
- '#thermal-sensor-cells'
3340

34-
additionalProperties: false
41+
unevaluatedProperties: false
3542

3643
examples:
3744
- |
@@ -41,4 +48,5 @@ examples:
4148
reg = <0x1fe01500 0x30>;
4249
interrupt-parent = <&liointc0>;
4350
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
51+
#thermal-sensor-cells = <1>;
4452
};
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Mediatek thermal controller for on-SoC temperatures
8+
9+
maintainers:
10+
- Sascha Hauer <s.hauer@pengutronix.de>
11+
12+
description:
13+
This device does not have its own ADC, instead it directly controls the AUXADC
14+
via AHB bus accesses. For this reason it needs phandles to the AUXADC. Also it
15+
controls a mux in the apmixedsys register space via AHB bus accesses, so a
16+
phandle to the APMIXEDSYS is also needed.
17+
18+
allOf:
19+
- $ref: thermal-sensor.yaml#
20+
21+
properties:
22+
compatible:
23+
enum:
24+
- mediatek,mt2701-thermal
25+
- mediatek,mt2712-thermal
26+
- mediatek,mt7622-thermal
27+
- mediatek,mt7981-thermal
28+
- mediatek,mt7986-thermal
29+
- mediatek,mt8173-thermal
30+
- mediatek,mt8183-thermal
31+
- mediatek,mt8365-thermal
32+
- mediatek,mt8516-thermal
33+
34+
reg:
35+
maxItems: 1
36+
37+
interrupts:
38+
maxItems: 1
39+
40+
clocks:
41+
items:
42+
- description: Main clock needed for register access
43+
- description: The AUXADC clock
44+
45+
clock-names:
46+
items:
47+
- const: therm
48+
- const: auxadc
49+
50+
mediatek,auxadc:
51+
$ref: /schemas/types.yaml#/definitions/phandle
52+
description: A phandle to the AUXADC which the thermal controller uses
53+
54+
mediatek,apmixedsys:
55+
$ref: /schemas/types.yaml#/definitions/phandle
56+
description: A phandle to the APMIXEDSYS controller
57+
58+
resets:
59+
description: Reset controller controlling the thermal controller
60+
61+
nvmem-cells:
62+
items:
63+
- description:
64+
NVMEM cell with EEPROMA phandle to the calibration data provided by an
65+
NVMEM device. If unspecified default values shall be used.
66+
67+
nvmem-cell-names:
68+
items:
69+
- const: calibration-data
70+
71+
required:
72+
- reg
73+
- interrupts
74+
- clocks
75+
- clock-names
76+
- mediatek,auxadc
77+
- mediatek,apmixedsys
78+
79+
unevaluatedProperties: false
80+
81+
examples:
82+
- |
83+
#include <dt-bindings/interrupt-controller/irq.h>
84+
#include <dt-bindings/clock/mt8173-clk.h>
85+
#include <dt-bindings/reset/mt8173-resets.h>
86+
87+
thermal@1100b000 {
88+
compatible = "mediatek,mt8173-thermal";
89+
reg = <0x1100b000 0x1000>;
90+
interrupts = <0 70 IRQ_TYPE_LEVEL_LOW>;
91+
clocks = <&pericfg CLK_PERI_THERM>, <&pericfg CLK_PERI_AUXADC>;
92+
clock-names = "therm", "auxadc";
93+
resets = <&pericfg MT8173_PERI_THERM_SW_RST>;
94+
mediatek,auxadc = <&auxadc>;
95+
mediatek,apmixedsys = <&apmixedsys>;
96+
nvmem-cells = <&thermal_calibration_data>;
97+
nvmem-cell-names = "calibration-data";
98+
#thermal-sensor-cells = <1>;
99+
};

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

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

Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm-hc.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,14 @@ examples:
114114
- |
115115
#include <dt-bindings/iio/qcom,spmi-vadc.h>
116116
#include <dt-bindings/interrupt-controller/irq.h>
117-
spmi_bus {
117+
118+
pmic {
118119
#address-cells = <1>;
119120
#size-cells = <0>;
121+
120122
pm8998_adc: adc@3100 {
121-
reg = <0x3100>;
122123
compatible = "qcom,spmi-adc-rev2";
124+
reg = <0x3100>;
123125
#address-cells = <1>;
124126
#size-cells = <0>;
125127
#io-channel-cells = <1>;
@@ -130,7 +132,7 @@ examples:
130132
};
131133
};
132134
133-
pm8998_adc_tm: adc-tm@3400 {
135+
adc-tm@3400 {
134136
compatible = "qcom,spmi-adc-tm-hc";
135137
reg = <0x3400>;
136138
interrupts = <0x2 0x34 0x0 IRQ_TYPE_EDGE_RISING>;

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,14 @@ examples:
167167
- |
168168
#include <dt-bindings/iio/qcom,spmi-vadc.h>
169169
#include <dt-bindings/interrupt-controller/irq.h>
170-
spmi_bus {
170+
171+
pmic {
171172
#address-cells = <1>;
172173
#size-cells = <0>;
174+
173175
pm8150b_adc: adc@3100 {
174-
reg = <0x3100>;
175176
compatible = "qcom,spmi-adc5";
177+
reg = <0x3100>;
176178
#address-cells = <1>;
177179
#size-cells = <0>;
178180
#io-channel-cells = <1>;
@@ -186,7 +188,7 @@ examples:
186188
};
187189
};
188190
189-
pm8150b_adc_tm: adc-tm@3500 {
191+
adc-tm@3500 {
190192
compatible = "qcom,spmi-adc-tm5";
191193
reg = <0x3500>;
192194
interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
@@ -207,12 +209,14 @@ examples:
207209
#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
208210
#include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>
209211
#include <dt-bindings/interrupt-controller/irq.h>
210-
spmi_bus {
212+
213+
pmic {
211214
#address-cells = <1>;
212215
#size-cells = <0>;
216+
213217
pmk8350_vadc: adc@3100 {
214-
reg = <0x3100>;
215218
compatible = "qcom,spmi-adc7";
219+
reg = <0x3100>;
216220
#address-cells = <1>;
217221
#size-cells = <0>;
218222
#io-channel-cells = <1>;
@@ -233,7 +237,7 @@ examples:
233237
};
234238
};
235239
236-
pmk8350_adc_tm: adc-tm@3400 {
240+
adc-tm@3400 {
237241
compatible = "qcom,spmi-adc-tm5-gen2";
238242
reg = <0x3400>;
239243
interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ properties:
6666
- qcom,sm8350-tsens
6767
- qcom,sm8450-tsens
6868
- qcom,sm8550-tsens
69+
- qcom,sm8650-tsens
6970
- const: qcom,tsens-v2
7071

7172
- description: v2 of TSENS with combined interrupt

Documentation/devicetree/bindings/thermal/thermal-zones.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ patternProperties:
7575
framework and assumes that the thermal sensors in this zone
7676
support interrupts.
7777

78+
critical-action:
79+
$ref: /schemas/types.yaml#/definitions/string
80+
description: |
81+
The action the OS should perform after the critical temperature is reached.
82+
By default the system will shutdown as a safe action to prevent damage
83+
to the hardware, if the property is not set.
84+
The shutdown action should be always the default and preferred one.
85+
Choose 'reboot' with care, as the hardware may be in thermal stress,
86+
thus leading to infinite reboots that may cause damage to the hardware.
87+
Make sure the firmware/bootloader will act as the last resort and take
88+
over the thermal control.
89+
90+
enum:
91+
- shutdown
92+
- reboot
93+
7894
thermal-sensors:
7995
$ref: /schemas/types.yaml#/definitions/phandle-array
8096
maxItems: 1

drivers/thermal/amlogic_thermal.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,11 @@ static int amlogic_thermal_enable(struct amlogic_thermal *data)
167167
return 0;
168168
}
169169

170-
static int amlogic_thermal_disable(struct amlogic_thermal *data)
170+
static void amlogic_thermal_disable(struct amlogic_thermal *data)
171171
{
172172
regmap_update_bits(data->regmap, TSENSOR_CFG_REG1,
173173
TSENSOR_CFG_REG1_ENABLE, 0);
174174
clk_disable_unprepare(data->clk);
175-
176-
return 0;
177175
}
178176

179177
static int amlogic_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
@@ -298,27 +296,30 @@ static void amlogic_thermal_remove(struct platform_device *pdev)
298296
amlogic_thermal_disable(data);
299297
}
300298

301-
static int __maybe_unused amlogic_thermal_suspend(struct device *dev)
299+
static int amlogic_thermal_suspend(struct device *dev)
302300
{
303301
struct amlogic_thermal *data = dev_get_drvdata(dev);
304302

305-
return amlogic_thermal_disable(data);
303+
amlogic_thermal_disable(data);
304+
305+
return 0;
306306
}
307307

308-
static int __maybe_unused amlogic_thermal_resume(struct device *dev)
308+
static int amlogic_thermal_resume(struct device *dev)
309309
{
310310
struct amlogic_thermal *data = dev_get_drvdata(dev);
311311

312312
return amlogic_thermal_enable(data);
313313
}
314314

315-
static SIMPLE_DEV_PM_OPS(amlogic_thermal_pm_ops,
316-
amlogic_thermal_suspend, amlogic_thermal_resume);
315+
static DEFINE_SIMPLE_DEV_PM_OPS(amlogic_thermal_pm_ops,
316+
amlogic_thermal_suspend,
317+
amlogic_thermal_resume);
317318

318319
static struct platform_driver amlogic_thermal_driver = {
319320
.driver = {
320321
.name = "amlogic_thermal",
321-
.pm = &amlogic_thermal_pm_ops,
322+
.pm = pm_ptr(&amlogic_thermal_pm_ops),
322323
.of_match_table = of_amlogic_thermal_match,
323324
},
324325
.probe = amlogic_thermal_probe,

drivers/thermal/loongson2_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static int loongson2_thermal_probe(struct platform_device *pdev)
127127
if (!IS_ERR(tzd))
128128
break;
129129

130-
if (PTR_ERR(tzd) != ENODEV)
130+
if (PTR_ERR(tzd) != -ENODEV)
131131
continue;
132132

133133
return dev_err_probe(dev, PTR_ERR(tzd), "failed to register");

0 commit comments

Comments
 (0)