Skip to content

Commit

Permalink
Merge tag 'thermal-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/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
  ...
  • Loading branch information
torvalds committed Apr 8, 2020
2 parents 8645f09 + 11700fc commit 34183dd
Show file tree
Hide file tree
Showing 34 changed files with 1,598 additions and 241 deletions.
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ Required properties:
followed by "fsl,imx-sc-key";
- linux,keycodes: See Documentation/devicetree/bindings/input/input.yaml

Thermal bindings based on SCU Message Protocol
------------------------------------------------------------

Required properties:
- compatible: Should be :
"fsl,imx8qxp-sc-thermal"
followed by "fsl,imx-sc-thermal";

- #thermal-sensor-cells: See Documentation/devicetree/bindings/thermal/thermal.txt
for a description.

Example (imx8qxp):
-------------
aliases {
Expand Down Expand Up @@ -238,6 +249,11 @@ firmware {
compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
timeout-sec = <60>;
};

tsens: thermal-sensor {
compatible = "fsl,imx8qxp-sc-thermal", "fsl,imx-sc-thermal";
#thermal-sensor-cells = <1>;
};
};
};

Expand Down
15 changes: 15 additions & 0 deletions Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* Thermal Monitoring Unit (TMU) on Freescale i.MX8MM SoC

Required properties:
- compatible : Must be "fsl,imx8mm-tmu" or "fsl,imx8mp-tmu".
- reg : Address range of TMU registers.
- clocks : TMU's clock source.
- #thermal-sensor-cells : Should be 0 or 1. See ./thermal.txt for a description.

Example:
tmu: tmu@30260000 {
compatible = "fsl,imx8mm-tmu";
reg = <0x30260000 0x10000>;
clocks = <&clk IMX8MM_CLK_TMU_ROOT>;
#thermal-sensor-cells = <0>;
};
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ properties:
- enum:
- qcom,msm8996-tsens
- qcom,msm8998-tsens
- qcom,sc7180-tsens
- qcom,sdm845-tsens
- const: qcom,tsens-v2

reg:
maxItems: 2
items:
- description: TM registers
- description: SROT registers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Required properties:
- "renesas,r8a774b1-thermal" (RZ/G2N)
- "renesas,r8a7795-thermal" (R-Car H3)
- "renesas,r8a7796-thermal" (R-Car M3-W)
- "renesas,r8a77961-thermal" (R-Car M3-W+)
- "renesas,r8a77965-thermal" (R-Car M3-N)
- "renesas,r8a77980-thermal" (R-Car V3H)
- reg : Address ranges of the thermal registers. Each sensor
Expand Down
107 changes: 107 additions & 0 deletions Documentation/devicetree/bindings/thermal/sprd-thermal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/sprd-thermal.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Spreadtrum thermal sensor controller bindings

maintainers:
- Orson Zhai <[email protected]>
- Baolin Wang <[email protected]>
- Chunyan Zhang <[email protected]>

properties:
compatible:
const: sprd,ums512-thermal

reg:
maxItems: 1

clocks:
maxItems: 1

clock-names:
items:
- const: enable

nvmem-cells:
maxItems: 2
description:
Reference to nvmem nodes for the calibration data.

nvmem-cell-names:
items:
- const: thm_sign_cal
- const: thm_ratio_cal

"#thermal-sensor-cells":
const: 1

"#address-cells":
const: 1

"#size-cells":
const: 0

patternProperties:
"^([a-z]*-)?sensor(-section)?@[0-9]+$":
type: object
description:
Represent one thermal sensor.

properties:
reg:
description: Specify the sensor id.
maxItems: 1

nvmem-cells:
maxItems: 1
description:
Reference to an nvmem node for the calibration data.

nvmem-cell-names:
const: sen_delta_cal

required:
- reg
- nvmem-cells
- nvmem-cell-names

required:
- compatible
- reg
- clocks
- clock-names
- nvmem-cells
- nvmem-cell-names
- "#thermal-sensor-cells"
- "#address-cells"
- "#size-cells"

examples:
- |
ap_thm0: thermal@32200000 {
compatible = "sprd,ums512-thermal";
reg = <0 0x32200000 0 0x10000>;
clock-names = "enable";
clocks = <&aonapb_gate 32>;
#thermal-sensor-cells = <1>;
nvmem-cells = <&thm0_sign>, <&thm0_ratio>;
nvmem-cell-names = "thm_sign_cal", "thm_ratio_cal";
#address-cells = <1>;
#size-cells = <0>;
prometheus-sensor@0 {
reg = <0>;
nvmem-cells = <&thm0_sen0>;
nvmem-cell-names = "sen_delta_cal";
};
ank-sensor@1 {
reg = <1>;
nvmem-cells = <&thm0_sen1>;
nvmem-cell-names = "sen_delta_cal";
};
};
...
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/thermal/thermal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ Required properties:
- trips: A sub-node which is a container of only trip point nodes
Type: sub-node required to describe the thermal zone.

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

Optional property:
- coefficients: An array of integers (one signed cell) containing
Type: array coefficients to compose a linear relation between
Elem size: one cell the sensors listed in the thermal-sensors property.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/driver-api/thermal/cpu-idle-cooling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ and this variation will modulate the cooling effect.
idle <-------------->
running

<----------------------------->
duty cycle 33%
<--------------------->
duty cycle 33%


^
Expand Down
42 changes: 36 additions & 6 deletions drivers/thermal/Kconfig
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Generic thermal sysfs drivers configuration
# Generic thermal drivers configuration
#

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

if THERMAL
Expand Down Expand Up @@ -251,6 +252,27 @@ config IMX_THERMAL
cpufreq is used as the cooling device to throttle CPUs when the
passive trip is crossed.

config IMX_SC_THERMAL
tristate "Temperature sensor driver for NXP i.MX SoCs with System Controller"
depends on IMX_SCU
depends on OF
help
Support for Temperature Monitor (TEMPMON) found on NXP i.MX SoCs with
system controller inside, Linux kernel has to communicate with system
controller via MU (message unit) IPC to get temperature from thermal
sensor. It supports one critical trip point and one
passive trip point for each thermal sensor.

config IMX8MM_THERMAL
tristate "Temperature sensor driver for Freescale i.MX8MM SoC"
depends on ARCH_MXC || COMPILE_TEST
depends on OF
help
Support for Thermal Monitoring Unit (TMU) found on Freescale i.MX8MM SoC.
It supports one critical trip point and one passive trip point. The
cpufreq is used as the cooling device to throttle CPUs when the passive
trip is crossed.

config MAX77620_THERMAL
tristate "Temperature sensor driver for Maxim MAX77620 PMIC"
depends on MFD_MAX77620
Expand All @@ -265,6 +287,7 @@ config QORIQ_THERMAL
tristate "QorIQ Thermal Monitoring Unit"
depends on THERMAL_OF
depends on HAS_IOMEM
select REGMAP_MMIO
help
Support for Thermal Monitoring Unit (TMU) found on QorIQ platforms.
It supports one critical trip point and one passive trip point. The
Expand Down Expand Up @@ -460,4 +483,11 @@ config UNIPHIER_THERMAL
Enable this to plug in UniPhier on-chip PVT thermal driver into the
thermal framework. The driver supports CPU thermal zone temperature
reporting and a couple of trip points.

config SPRD_THERMAL
tristate "Temperature sensor on Spreadtrum SoCs"
depends on ARCH_SPRD || COMPILE_TEST
help
Support for the Spreadtrum thermal sensor driver in the Linux thermal
framework.
endif
3 changes: 3 additions & 0 deletions drivers/thermal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ obj-$(CONFIG_DB8500_THERMAL) += db8500_thermal.o
obj-$(CONFIG_ARMADA_THERMAL) += armada_thermal.o
obj-$(CONFIG_TANGO_THERMAL) += tango_thermal.o
obj-$(CONFIG_IMX_THERMAL) += imx_thermal.o
obj-$(CONFIG_IMX_SC_THERMAL) += imx_sc_thermal.o
obj-$(CONFIG_IMX8MM_THERMAL) += imx8mm_thermal.o
obj-$(CONFIG_MAX77620_THERMAL) += max77620_thermal.o
obj-$(CONFIG_QORIQ_THERMAL) += qoriq_thermal.o
obj-$(CONFIG_DA9062_THERMAL) += da9062-thermal.o
Expand All @@ -57,3 +59,4 @@ obj-$(CONFIG_GENERIC_ADC_THERMAL) += thermal-generic-adc.o
obj-$(CONFIG_ZX2967_THERMAL) += zx2967_thermal.o
obj-$(CONFIG_UNIPHIER_THERMAL) += uniphier_thermal.o
obj-$(CONFIG_AMLOGIC_THERMAL) += amlogic_thermal.o
obj-$(CONFIG_SPRD_THERMAL) += sprd_thermal.o
5 changes: 3 additions & 2 deletions drivers/thermal/cpufreq_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static int cpufreq_state2power(struct thermal_cooling_device *cdev,
struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata;

/* Request state should be less than max_level */
if (WARN_ON(state > cpufreq_cdev->max_level))
if (state > cpufreq_cdev->max_level)
return -EINVAL;

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

/* Request state should be less than max_level */
if (WARN_ON(state > cpufreq_cdev->max_level))
if (state > cpufreq_cdev->max_level)
return -EINVAL;

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

return ret;
Expand Down
Loading

0 comments on commit 34183dd

Please sign in to comment.