Skip to content

Commit f4fb859

Browse files
committed
Merge tag 'thermal-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control updates from Rafael Wysocki: "These add a thermal library and thermal tools to wrap the netlink interface into event-based callbacks, improve overheat condition handling during suspend-to-idle on Intel SoCs, add some new hardware support, fix bugs and clean up code. Specifics: - Add thermal library and thermal tools to encapsulate the netlink into event based callbacks (Daniel Lezcano, Jiapeng Chong). - Improve overheat condition handling during suspend-to-idle in the Intel PCH thermal driver (Zhang Rui). - Use local ops instead of global ops in devfreq_cooling (Kant Fan). - Clean up _OSC handling in int340x (Davidlohr Bueso). - Switch hisi_termal from CONFIG_PM_SLEEP guards to pm_sleep_ptr() (Hesham Almatary). - Add new k3 j72xx bangdap driver and the corresponding bindings (Keerthy). - Fix missing of_node_put() in the SC iMX driver at probe time (Miaoqian Lin). - Fix memory leak in __thermal_cooling_device_register() when device_register() fails by calling thermal_cooling_device_destroy_sysfs() (Yang Yingliang). - Add sc8180x and sc8280xp compatible string in the DT bindings and lMH support for QCom tsens driver (Bjorn Andersson). - Fix OTP Calibration Register values conforming to the documentation on RZ/G2L and bindings documentation for RZ/G2UL (Biju Das). - Fix type in kerneldoc description for __thermal_bind_params (Corentin Labbe). - Fix potential NULL dereference in sr_thermal_probe() on Broadcom platform (Zheng Yongjun). - Add change mode ops to the thermal-of sensor (Manaf Meethalavalappu Pallikunhi). - Fix non-negative value support by preventing the value to be clamp to zero (Stefan Wahren). - Add compatible string and DT bindings for MSM8960 tsens driver (Dmitry Baryshkov). - Add hwmon support for K3 driver (Massimiliano Minella). - Refactor and add multiple generations support for QCom ADC driver (Jishnu Prakash). - Use platform_get_irq_optional() to get the interrupt on RCar driver and document Document RZ/V2L bindings (Lad Prabhakar). - Remove NULL check after container_of() call from the Intel HFI thermal driver (Haowen Bai)" * tag 'thermal-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (38 commits) thermal: intel: pch: improve the cooling delay log thermal: intel: pch: enhance overheat handling thermal: intel: pch: move cooling delay to suspend_noirq phase PM: wakeup: expose pm_wakeup_pending to modules thermal: k3_j72xx_bandgap: Add the bandgap driver support dt-bindings: thermal: k3-j72xx: Add VTM bindings documentation thermal/drivers/imx_sc_thermal: Fix refcount leak in imx_sc_thermal_probe thermal/core: Fix memory leak in __thermal_cooling_device_register() dt-bindings: thermal: tsens: Add sc8280xp compatible dt-bindings: thermal: lmh: Add Qualcomm sc8180x compatible thermal/drivers/qcom/lmh: Add sc8180x compatible thermal/drivers/rz2gl: Fix OTP Calibration Register values dt-bindings: thermal: rzg2l-thermal: Document RZ/G2UL bindings thermal: thermal_of: fix typo on __thermal_bind_params tools/thermal: remove unneeded semicolon tools/lib/thermal: remove unneeded semicolon thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe tools/thermal: Add thermal daemon skeleton tools/thermal: Add a temperature capture tool tools/thermal: Add util library ...
2 parents 09583df + bbb544f commit f4fb859

Some content is hidden

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

59 files changed

+4231
-102
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ description:
1818
properties:
1919
compatible:
2020
enum:
21+
- qcom,sc8180x-lmh
2122
- qcom,sdm845-lmh
2223
- qcom,sm8150-lmh
2324

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

Lines changed: 108 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ maintainers:
1010

1111
properties:
1212
compatible:
13-
const: qcom,spmi-adc-tm5
13+
enum:
14+
- qcom,spmi-adc-tm5
15+
- qcom,spmi-adc-tm5-gen2
1416

1517
reg:
1618
maxItems: 1
@@ -33,6 +35,7 @@ properties:
3335
qcom,avg-samples:
3436
$ref: /schemas/types.yaml#/definitions/uint32
3537
description: Number of samples to be used for measurement.
38+
Not applicable for Gen2 ADC_TM peripheral.
3639
enum:
3740
- 1
3841
- 2
@@ -45,6 +48,7 @@ properties:
4548
$ref: /schemas/types.yaml#/definitions/uint32
4649
description: This parameter is used to decrease ADC sampling rate.
4750
Quicker measurements can be made by reducing decimation ratio.
51+
Not applicable for Gen2 ADC_TM peripheral.
4852
enum:
4953
- 250
5054
- 420
@@ -93,13 +97,61 @@ patternProperties:
9397
- const: 1
9498
- enum: [ 1, 3, 4, 6, 20, 8, 10 ]
9599

100+
qcom,avg-samples:
101+
$ref: /schemas/types.yaml#/definitions/uint32
102+
description: Number of samples to be used for measurement.
103+
This property in child node is applicable only for Gen2 ADC_TM peripheral.
104+
enum:
105+
- 1
106+
- 2
107+
- 4
108+
- 8
109+
- 16
110+
default: 1
111+
112+
qcom,decimation:
113+
$ref: /schemas/types.yaml#/definitions/uint32
114+
description: This parameter is used to decrease ADC sampling rate.
115+
Quicker measurements can be made by reducing decimation ratio.
116+
This property in child node is applicable only for Gen2 ADC_TM peripheral.
117+
enum:
118+
- 85
119+
- 340
120+
- 1360
121+
default: 1360
122+
96123
required:
97124
- reg
98125
- io-channels
99126

100127
additionalProperties:
101128
false
102129

130+
allOf:
131+
- if:
132+
properties:
133+
compatible:
134+
contains:
135+
const: qcom,spmi-adc-tm5
136+
137+
then:
138+
patternProperties:
139+
"^([-a-z0-9]*)@[0-7]$":
140+
properties:
141+
qcom,decimation: false
142+
qcom,avg-samples: false
143+
144+
- if:
145+
properties:
146+
compatible:
147+
contains:
148+
const: qcom,spmi-adc-tm5-gen2
149+
150+
then:
151+
properties:
152+
qcom,avg-samples: false
153+
qcom,decimation: false
154+
103155
required:
104156
- compatible
105157
- reg
@@ -124,7 +176,7 @@ examples:
124176
#size-cells = <0>;
125177
#io-channel-cells = <1>;
126178
127-
/* Other propreties are omitted */
179+
/* Other properties are omitted */
128180
conn-therm@4f {
129181
reg = <ADC5_AMUX_THM3_100K_PU>;
130182
qcom,ratiometric;
@@ -148,4 +200,58 @@ examples:
148200
};
149201
};
150202
};
203+
204+
- |
205+
#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
206+
#include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>
207+
#include <dt-bindings/interrupt-controller/irq.h>
208+
spmi_bus {
209+
#address-cells = <1>;
210+
#size-cells = <0>;
211+
pmk8350_vadc: adc@3100 {
212+
reg = <0x3100>;
213+
compatible = "qcom,spmi-adc7";
214+
#address-cells = <1>;
215+
#size-cells = <0>;
216+
#io-channel-cells = <1>;
217+
218+
/* Other properties are omitted */
219+
xo-therm@44 {
220+
reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
221+
qcom,ratiometric;
222+
qcom,hw-settle-time = <200>;
223+
};
224+
225+
conn-therm@47 {
226+
reg = <PM8350_ADC7_AMUX_THM4_100K_PU>;
227+
qcom,ratiometric;
228+
qcom,hw-settle-time = <200>;
229+
};
230+
};
231+
232+
pmk8350_adc_tm: adc-tm@3400 {
233+
compatible = "qcom,spmi-adc-tm5-gen2";
234+
reg = <0x3400>;
235+
interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
236+
#thermal-sensor-cells = <1>;
237+
#address-cells = <1>;
238+
#size-cells = <0>;
239+
240+
pmk8350-xo-therm@0 {
241+
reg = <0>;
242+
io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>;
243+
qcom,decimation = <340>;
244+
qcom,ratiometric;
245+
qcom,hw-settle-time-us = <200>;
246+
};
247+
248+
conn-therm@1 {
249+
reg = <1>;
250+
io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM4_100K_PU>;
251+
qcom,avg-samples = <2>;
252+
qcom,ratiometric;
253+
qcom,hw-settle-time-us = <200>;
254+
};
255+
};
256+
};
151257
...

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ description: |
1919
properties:
2020
compatible:
2121
oneOf:
22-
- description: msm9860 TSENS based
22+
- description: msm8960 TSENS based
2323
items:
2424
- enum:
2525
- qcom,ipq8064-tsens
26+
- qcom,msm8960-tsens
2627

2728
- description: v0.1 of TSENS
2829
items:
@@ -49,6 +50,7 @@ properties:
4950
- qcom,sc7180-tsens
5051
- qcom,sc7280-tsens
5152
- qcom,sc8180x-tsens
53+
- qcom,sc8280xp-tsens
5254
- qcom,sdm630-tsens
5355
- qcom,sdm845-tsens
5456
- qcom,sm8150-tsens
@@ -116,6 +118,7 @@ allOf:
116118
- qcom,ipq8064-tsens
117119
- qcom,mdm9607-tsens
118120
- qcom,msm8916-tsens
121+
- qcom,msm8960-tsens
119122
- qcom,msm8974-tsens
120123
- qcom,msm8976-tsens
121124
- qcom,qcs404-tsens

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ properties:
1717
compatible:
1818
items:
1919
- enum:
20+
- renesas,r9a07g043-tsu # RZ/G2UL
2021
- renesas,r9a07g044-tsu # RZ/G2{L,LC}
22+
- renesas,r9a07g054-tsu # RZ/V2L
2123
- const: renesas,rzg2l-tsu
2224

2325
reg:
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/ti,j72xx-thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Texas Instruments J72XX VTM (DTS) binding
8+
9+
maintainers:
10+
- Keerthy <[email protected]>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- ti,j721e-vtm
16+
- ti,j7200-vtm
17+
18+
reg:
19+
items:
20+
- description: VTM cfg1 register space
21+
- description: VTM cfg2 register space
22+
- description: VTM efuse register space
23+
24+
power-domains:
25+
maxItems: 1
26+
27+
"#thermal-sensor-cells":
28+
const: 1
29+
30+
required:
31+
- compatible
32+
- reg
33+
- power-domains
34+
- "#thermal-sensor-cells"
35+
36+
additionalProperties: false
37+
38+
examples:
39+
- |
40+
#include <dt-bindings/soc/ti,sci_pm_domain.h>
41+
wkup_vtm0: thermal-sensor@42040000 {
42+
compatible = "ti,j721e-vtm";
43+
reg = <0x42040000 0x350>,
44+
<0x42050000 0x350>,
45+
<0x43000300 0x10>;
46+
power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>;
47+
#thermal-sensor-cells = <1>;
48+
};
49+
50+
mpu_thermal: mpu-thermal {
51+
polling-delay-passive = <250>; /* milliseconds */
52+
polling-delay = <500>; /* milliseconds */
53+
thermal-sensors = <&wkup_vtm0 0>;
54+
55+
trips {
56+
mpu_crit: mpu-crit {
57+
temperature = <125000>; /* milliCelsius */
58+
hysteresis = <2000>; /* milliCelsius */
59+
type = "critical";
60+
};
61+
};
62+
};
63+
...

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19589,6 +19589,7 @@ F: drivers/thermal/
1958919589
F: include/linux/cpu_cooling.h
1959019590
F: include/linux/thermal.h
1959119591
F: include/uapi/linux/thermal.h
19592+
F: tools/lib/thermal/
1959219593
F: tools/thermal/
1959319594

1959419595
THERMAL DRIVER FOR AMLOGIC SOCS

drivers/base/power/wakeup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ bool pm_wakeup_pending(void)
930930

931931
return ret || atomic_read(&pm_abort_suspend) > 0;
932932
}
933+
EXPORT_SYMBOL_GPL(pm_wakeup_pending);
933934

934935
void pm_system_wakeup(void)
935936
{

drivers/iio/adc/qcom-vadc-common.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,17 @@ u16 qcom_adc_tm5_temp_volt_scale(unsigned int prescale_ratio,
677677
}
678678
EXPORT_SYMBOL(qcom_adc_tm5_temp_volt_scale);
679679

680+
u16 qcom_adc_tm5_gen2_temp_res_scale(int temp)
681+
{
682+
int64_t resistance;
683+
684+
resistance = qcom_vadc_map_temp_voltage(adcmap7_100k,
685+
ARRAY_SIZE(adcmap7_100k), temp);
686+
687+
return div64_s64(resistance * RATIO_MAX_ADC7, resistance + R_PU_100K);
688+
}
689+
EXPORT_SYMBOL(qcom_adc_tm5_gen2_temp_res_scale);
690+
680691
int qcom_adc5_hw_scale(enum vadc_scale_fn_type scaletype,
681692
unsigned int prescale_ratio,
682693
const struct adc5_data *data,

drivers/thermal/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ thermal_sys-$(CONFIG_CPU_IDLE_THERMAL) += cpuidle_cooling.o
2828
# devfreq cooling
2929
thermal_sys-$(CONFIG_DEVFREQ_THERMAL) += devfreq_cooling.o
3030

31-
obj-$(CONFIG_K3_THERMAL) += k3_bandgap.o
31+
obj-$(CONFIG_K3_THERMAL) += k3_bandgap.o k3_j72xx_bandgap.o
3232
# platform thermal drivers
3333
obj-y += broadcom/
3434
obj-$(CONFIG_THERMAL_MMIO) += thermal_mmio.o

drivers/thermal/broadcom/bcm2711_thermal.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ static int bcm2711_get_temp(void *data, int *temp)
3838
int offset = thermal_zone_get_offset(priv->thermal);
3939
u32 val;
4040
int ret;
41-
long t;
4241

4342
ret = regmap_read(priv->regmap, AVS_RO_TEMP_STATUS, &val);
4443
if (ret)
@@ -50,9 +49,7 @@ static int bcm2711_get_temp(void *data, int *temp)
5049
val &= AVS_RO_TEMP_STATUS_DATA_MSK;
5150

5251
/* Convert a HW code to a temperature reading (millidegree celsius) */
53-
t = slope * val + offset;
54-
55-
*temp = t < 0 ? 0 : t;
52+
*temp = slope * val + offset;
5653

5754
return 0;
5855
}

0 commit comments

Comments
 (0)