Skip to content

Commit 34183dd

Browse files
committed
Merge tag 'thermal-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal updates from Daniel Lezcano: - Convert tsens configuration DT binding to yaml (Rajeshwari) - Add interrupt support on the rcar sensor (Niklas Söderlund) - Add a new Spreadtrum thermal driver (Baolin Wang) - Add thermal binding for the fsl scu board, a new API to retrieve the sensor id bound to the thermal zone and i.MX system controller sensor (Anson Huang)) - Remove warning log when a deferred probe is requested on Exynos (Marek Szyprowski) - Add the thermal monitoring unit support for imx8mm with its DT bindings (Anson Huang) - Rephrase the Kconfig text for clarity (Linus Walleij) - Use the gpio descriptor for the ti-soc-thermal (Linus Walleij) - Align msg structure to 4 bytes for i.MX SC, fix the Kconfig dependency, add the __may_be unused annotation for PM functions and the COMPILE_TEST option for imx8mm (Anson Huang) - Fix a dependency on regmap in Kconfig for qoriq (Yuantian Tang) - Add DT binding and support for the rcar gen3 r8a77961 and improve the error path on the rcar init function (Niklas Söderlund) - Cleanup and improvements for the tsens Qcom sensor (Amit Kucheria) - Improve code by removing lock and caching values in the rcar thermal sensor (Niklas Söderlund) - Cleanup in the qoriq drivers and add a call to imx_thermal_unregister_legacy_cooling in the removal function (Anson Huang) - Remove redundant 'maxItems' in tsens and sprd DT bindings (Rob Herring) - Change the thermal DT bindings by making the cooling-maps optional (Yuantian Tang) - Add Tiger Lake support (Sumeet Pawnikar) - Use scnprintf() for avoiding potential buffer overflow (Takashi Iwai) - Make pkg_temp_lock a raw_spinlock_t(Clark Williams) - Fix incorrect data types by changing them to signed on i.MX SC (Anson Huang) - Replace zero-length array with flexible-array member (Gustavo A. R. Silva) - Add support for i.MX8MP in the driver and in the DT bindings (Anson Huang) - Fix return value of the cpufreq_set_cur_state() function (Willy Wolff) - Remove abusing and scary WARN_ON in the cpufreq cooling device (Daniel Lezcano) - Fix build warning of incorrect argument type reported by sparse on imx8mm (Anson Huang) - Fix stub for the devfreq cooling device (Martin Blumenstingl) - Fix cpu idle cooling documentation (Sergey Vidishev) * tag 'thermal-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (52 commits) Documentation: cpu-idle-cooling: Fix diagram for 33% duty cycle thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n thermal: imx8mm: Fix build warning of incorrect argument type thermal/drivers/cpufreq_cooling: Remove abusing WARN_ON thermal/drivers/cpufreq_cooling: Fix return of cpufreq_set_cur_state thermal: imx8mm: Add i.MX8MP support dt-bindings: thermal: imx8mm-thermal: Add support for i.MX8MP thermal: qcom: tsens.h: Replace zero-length array with flexible-array member thermal: imx_sc_thermal: Fix incorrect data type thermal: int340x_thermal: Use scnprintf() for avoiding potential buffer overflow thermal: int340x: processor_thermal: Add Tiger Lake support thermal/x86_pkg_temp: Make pkg_temp_lock a raw_spinlock_t dt-bindings: thermal: make cooling-maps property optional dt-bindings: thermal: qcom-tsens: Remove redundant 'maxItems' dt-bindings: thermal: sprd: Remove redundant 'maxItems' thermal: imx: Calling imx_thermal_unregister_legacy_cooling() in .remove thermal: qoriq: Sort includes alphabetically thermal: qoriq: Use devm_add_action_or_reset() to handle all cleanups thermal: rcar_thermal: Remove lock in rcar_thermal_get_current_temp() thermal: rcar_thermal: Do not store ctemp in rcar_thermal_priv ...
2 parents 8645f09 + 11700fc commit 34183dd

34 files changed

+1598
-241
lines changed

Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ Required properties:
166166
followed by "fsl,imx-sc-key";
167167
- linux,keycodes: See Documentation/devicetree/bindings/input/input.yaml
168168

169+
Thermal bindings based on SCU Message Protocol
170+
------------------------------------------------------------
171+
172+
Required properties:
173+
- compatible: Should be :
174+
"fsl,imx8qxp-sc-thermal"
175+
followed by "fsl,imx-sc-thermal";
176+
177+
- #thermal-sensor-cells: See Documentation/devicetree/bindings/thermal/thermal.txt
178+
for a description.
179+
169180
Example (imx8qxp):
170181
-------------
171182
aliases {
@@ -238,6 +249,11 @@ firmware {
238249
compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
239250
timeout-sec = <60>;
240251
};
252+
253+
tsens: thermal-sensor {
254+
compatible = "fsl,imx8qxp-sc-thermal", "fsl,imx-sc-thermal";
255+
#thermal-sensor-cells = <1>;
256+
};
241257
};
242258
};
243259

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* Thermal Monitoring Unit (TMU) on Freescale i.MX8MM SoC
2+
3+
Required properties:
4+
- compatible : Must be "fsl,imx8mm-tmu" or "fsl,imx8mp-tmu".
5+
- reg : Address range of TMU registers.
6+
- clocks : TMU's clock source.
7+
- #thermal-sensor-cells : Should be 0 or 1. See ./thermal.txt for a description.
8+
9+
Example:
10+
tmu: tmu@30260000 {
11+
compatible = "fsl,imx8mm-tmu";
12+
reg = <0x30260000 0x10000>;
13+
clocks = <&clk IMX8MM_CLK_TMU_ROOT>;
14+
#thermal-sensor-cells = <0>;
15+
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ properties:
3838
- enum:
3939
- qcom,msm8996-tsens
4040
- qcom,msm8998-tsens
41+
- qcom,sc7180-tsens
4142
- qcom,sdm845-tsens
4243
- const: qcom,tsens-v2
4344

4445
reg:
45-
maxItems: 2
4646
items:
4747
- description: TM registers
4848
- description: SROT registers

Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Required properties:
1111
- "renesas,r8a774b1-thermal" (RZ/G2N)
1212
- "renesas,r8a7795-thermal" (R-Car H3)
1313
- "renesas,r8a7796-thermal" (R-Car M3-W)
14+
- "renesas,r8a77961-thermal" (R-Car M3-W+)
1415
- "renesas,r8a77965-thermal" (R-Car M3-N)
1516
- "renesas,r8a77980-thermal" (R-Car V3H)
1617
- reg : Address ranges of the thermal registers. Each sensor
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/sprd-thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Spreadtrum thermal sensor controller bindings
8+
9+
maintainers:
10+
- Orson Zhai <[email protected]>
11+
- Baolin Wang <[email protected]>
12+
- Chunyan Zhang <[email protected]>
13+
14+
properties:
15+
compatible:
16+
const: sprd,ums512-thermal
17+
18+
reg:
19+
maxItems: 1
20+
21+
clocks:
22+
maxItems: 1
23+
24+
clock-names:
25+
items:
26+
- const: enable
27+
28+
nvmem-cells:
29+
maxItems: 2
30+
description:
31+
Reference to nvmem nodes for the calibration data.
32+
33+
nvmem-cell-names:
34+
items:
35+
- const: thm_sign_cal
36+
- const: thm_ratio_cal
37+
38+
"#thermal-sensor-cells":
39+
const: 1
40+
41+
"#address-cells":
42+
const: 1
43+
44+
"#size-cells":
45+
const: 0
46+
47+
patternProperties:
48+
"^([a-z]*-)?sensor(-section)?@[0-9]+$":
49+
type: object
50+
description:
51+
Represent one thermal sensor.
52+
53+
properties:
54+
reg:
55+
description: Specify the sensor id.
56+
maxItems: 1
57+
58+
nvmem-cells:
59+
maxItems: 1
60+
description:
61+
Reference to an nvmem node for the calibration data.
62+
63+
nvmem-cell-names:
64+
const: sen_delta_cal
65+
66+
required:
67+
- reg
68+
- nvmem-cells
69+
- nvmem-cell-names
70+
71+
required:
72+
- compatible
73+
- reg
74+
- clocks
75+
- clock-names
76+
- nvmem-cells
77+
- nvmem-cell-names
78+
- "#thermal-sensor-cells"
79+
- "#address-cells"
80+
- "#size-cells"
81+
82+
examples:
83+
- |
84+
ap_thm0: thermal@32200000 {
85+
compatible = "sprd,ums512-thermal";
86+
reg = <0 0x32200000 0 0x10000>;
87+
clock-names = "enable";
88+
clocks = <&aonapb_gate 32>;
89+
#thermal-sensor-cells = <1>;
90+
nvmem-cells = <&thm0_sign>, <&thm0_ratio>;
91+
nvmem-cell-names = "thm_sign_cal", "thm_ratio_cal";
92+
#address-cells = <1>;
93+
#size-cells = <0>;
94+
95+
prometheus-sensor@0 {
96+
reg = <0>;
97+
nvmem-cells = <&thm0_sen0>;
98+
nvmem-cell-names = "sen_delta_cal";
99+
};
100+
101+
ank-sensor@1 {
102+
reg = <1>;
103+
nvmem-cells = <&thm0_sen1>;
104+
nvmem-cell-names = "sen_delta_cal";
105+
};
106+
};
107+
...

Documentation/devicetree/bindings/thermal/thermal.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ Required properties:
142142
- trips: A sub-node which is a container of only trip point nodes
143143
Type: sub-node required to describe the thermal zone.
144144

145+
Optional property:
145146
- cooling-maps: A sub-node which is a container of only cooling device
146147
Type: sub-node map nodes, used to describe the relation between trips
147148
and cooling devices.
148149

149-
Optional property:
150150
- coefficients: An array of integers (one signed cell) containing
151151
Type: array coefficients to compose a linear relation between
152152
Elem size: one cell the sensors listed in the thermal-sensors property.

Documentation/driver-api/thermal/cpu-idle-cooling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ and this variation will modulate the cooling effect.
105105
idle <-------------->
106106
running
107107

108-
<----------------------------->
109-
duty cycle 33%
108+
<--------------------->
109+
duty cycle 33%
110110

111111

112112
^

drivers/thermal/Kconfig

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
#
3-
# Generic thermal sysfs drivers configuration
3+
# Generic thermal drivers configuration
44
#
55

66
menuconfig THERMAL
7-
bool "Generic Thermal sysfs driver"
7+
bool "Thermal drivers"
88
help
9-
Generic Thermal Sysfs driver offers a generic mechanism for
9+
Thermal drivers offer a generic mechanism for
1010
thermal management. Usually it's made up of one or more thermal
11-
zone and cooling device.
11+
zones and cooling devices.
1212
Each thermal zone contains its own temperature, trip points,
13-
cooling devices.
14-
All platforms with ACPI thermal support can use this driver.
13+
and cooling devices.
14+
All platforms with ACPI or Open Firmware thermal support can use
15+
this driver.
1516
If you want this support, you should say Y here.
1617

1718
if THERMAL
@@ -251,6 +252,27 @@ config IMX_THERMAL
251252
cpufreq is used as the cooling device to throttle CPUs when the
252253
passive trip is crossed.
253254

255+
config IMX_SC_THERMAL
256+
tristate "Temperature sensor driver for NXP i.MX SoCs with System Controller"
257+
depends on IMX_SCU
258+
depends on OF
259+
help
260+
Support for Temperature Monitor (TEMPMON) found on NXP i.MX SoCs with
261+
system controller inside, Linux kernel has to communicate with system
262+
controller via MU (message unit) IPC to get temperature from thermal
263+
sensor. It supports one critical trip point and one
264+
passive trip point for each thermal sensor.
265+
266+
config IMX8MM_THERMAL
267+
tristate "Temperature sensor driver for Freescale i.MX8MM SoC"
268+
depends on ARCH_MXC || COMPILE_TEST
269+
depends on OF
270+
help
271+
Support for Thermal Monitoring Unit (TMU) found on Freescale i.MX8MM SoC.
272+
It supports one critical trip point and one passive trip point. The
273+
cpufreq is used as the cooling device to throttle CPUs when the passive
274+
trip is crossed.
275+
254276
config MAX77620_THERMAL
255277
tristate "Temperature sensor driver for Maxim MAX77620 PMIC"
256278
depends on MFD_MAX77620
@@ -265,6 +287,7 @@ config QORIQ_THERMAL
265287
tristate "QorIQ Thermal Monitoring Unit"
266288
depends on THERMAL_OF
267289
depends on HAS_IOMEM
290+
select REGMAP_MMIO
268291
help
269292
Support for Thermal Monitoring Unit (TMU) found on QorIQ platforms.
270293
It supports one critical trip point and one passive trip point. The
@@ -460,4 +483,11 @@ config UNIPHIER_THERMAL
460483
Enable this to plug in UniPhier on-chip PVT thermal driver into the
461484
thermal framework. The driver supports CPU thermal zone temperature
462485
reporting and a couple of trip points.
486+
487+
config SPRD_THERMAL
488+
tristate "Temperature sensor on Spreadtrum SoCs"
489+
depends on ARCH_SPRD || COMPILE_TEST
490+
help
491+
Support for the Spreadtrum thermal sensor driver in the Linux thermal
492+
framework.
463493
endif

drivers/thermal/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ obj-$(CONFIG_DB8500_THERMAL) += db8500_thermal.o
4343
obj-$(CONFIG_ARMADA_THERMAL) += armada_thermal.o
4444
obj-$(CONFIG_TANGO_THERMAL) += tango_thermal.o
4545
obj-$(CONFIG_IMX_THERMAL) += imx_thermal.o
46+
obj-$(CONFIG_IMX_SC_THERMAL) += imx_sc_thermal.o
47+
obj-$(CONFIG_IMX8MM_THERMAL) += imx8mm_thermal.o
4648
obj-$(CONFIG_MAX77620_THERMAL) += max77620_thermal.o
4749
obj-$(CONFIG_QORIQ_THERMAL) += qoriq_thermal.o
4850
obj-$(CONFIG_DA9062_THERMAL) += da9062-thermal.o
@@ -57,3 +59,4 @@ obj-$(CONFIG_GENERIC_ADC_THERMAL) += thermal-generic-adc.o
5759
obj-$(CONFIG_ZX2967_THERMAL) += zx2967_thermal.o
5860
obj-$(CONFIG_UNIPHIER_THERMAL) += uniphier_thermal.o
5961
obj-$(CONFIG_AMLOGIC_THERMAL) += amlogic_thermal.o
62+
obj-$(CONFIG_SPRD_THERMAL) += sprd_thermal.o

drivers/thermal/cpufreq_cooling.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static int cpufreq_state2power(struct thermal_cooling_device *cdev,
273273
struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata;
274274

275275
/* Request state should be less than max_level */
276-
if (WARN_ON(state > cpufreq_cdev->max_level))
276+
if (state > cpufreq_cdev->max_level)
277277
return -EINVAL;
278278

279279
num_cpus = cpumask_weight(cpufreq_cdev->policy->cpus);
@@ -437,7 +437,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
437437
int ret;
438438

439439
/* Request state should be less than max_level */
440-
if (WARN_ON(state > cpufreq_cdev->max_level))
440+
if (state > cpufreq_cdev->max_level)
441441
return -EINVAL;
442442

443443
/* Check if the old cooling action is same as new cooling action */
@@ -456,6 +456,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
456456
capacity = frequency * max_capacity;
457457
capacity /= cpufreq_cdev->policy->cpuinfo.max_freq;
458458
arch_set_thermal_pressure(cpus, max_capacity - capacity);
459+
ret = 0;
459460
}
460461

461462
return ret;

0 commit comments

Comments
 (0)