Skip to content

Commit f7ea4be

Browse files
committed
Merge tag 'thermal-v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal updates from Daniel Lezcano: - Add rk3568 sensor support (Finley Xiao) - Add missing MODULE_DEVICE_TABLE for the Spreadtrum sensor (Chunyan Zhang) - Export additionnal attributes for the int340x thermal processor (Srinivas Pandruvada) - Add SC7280 compatible for the tsens driver (Rajeshwari Ravindra Kamble) - Fix kernel documentation for thermal_zone_device_unregister() and use devm_platform_get_and_ioremap_resource() (Yang Yingliang) - Fix coefficient calculations for the rcar_gen3 sensor driver (Niklas Söderlund) - Fix shadowing variable rcar_gen3_ths_tj_1 (Geert Uytterhoeven) - Add missing of_node_put() for the iMX and Spreadtrum sensors (Krzysztof Kozlowski) - Add tegra3 thermal sensor DT bindings (Dmitry Osipenko) - Stop the thermal zone monitoring when unregistering it to prevent a temperature update without the 'get_temp' callback (Dmitry Osipenko) - Add rk3568 DT bindings, convert bindings to yaml schemas and add the corresponding compatible in the Rockchip sensor (Ezequiel Garcia) - Add the sc8180x compatible for the Qualcomm tsensor (Bjorn Andersson) - Use the find_first_zero_bit() function instead of custom code (Andy Shevchenko) - Fix the kernel doc for the device cooling device (Yang Li) - Reorg the processor thermal int340x to set the scene for the PCI mmio driver (Srinivas Pandruvada) - Add PCI MMIO driver for the int340x processor thermal driver (Srinivas Pandruvada) - Add hwmon sensors for the mediatek sensor (Frank Wunderlich) - Fix warning for return value reported by Smatch for the int340x thermal processor (Srinivas Pandruvada) - Fix wrong register access and decoding for the int340x thermal processor (Srinivas Pandruvada) * tag 'thermal-v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (23 commits) thermal/drivers/int340x/processor_thermal: Fix tcc setting thermal/drivers/int340x/processor_thermal: Fix warning for return value thermal/drivers/mediatek: Add sensors-support thermal/drivers/int340x/processor_thermal: Add PCI MMIO based thermal driver thermal/drivers/int340x/processor_thermal: Split enumeration and processing part thermal: devfreq_cooling: Fix kernel-doc thermal/drivers/intel/intel_soc_dts_iosf: Switch to use find_first_zero_bit() dt-bindings: thermal: tsens: Add sc8180x compatible dt-bindings: rockchip-thermal: Support the RK3568 SoC compatible dt-bindings: thermal: convert rockchip-thermal to json-schema thermal/core/thermal_of: Stop zone device before unregistering it dt-bindings: thermal: Add binding for Tegra30 thermal sensor thermal/drivers/sprd: Add missing of_node_put for loop iteration thermal/drivers/imx_sc: Add missing of_node_put for loop iteration thermal/drivers/rcar_gen3_thermal: Do not shadow rcar_gen3_ths_tj_1 thermal/drivers/rcar_gen3_thermal: Fix coefficient calculations thermal/drivers/st: Use devm_platform_get_and_ioremap_resource() thermal/core: Correct function name thermal_zone_device_unregister() dt-bindings: thermal: tsens: Add compatible string to TSENS binding for SC7280 thermal/drivers/int340x: processor_thermal: Export additional attributes ...
2 parents 81361b8 + fe6a6de commit f7ea4be

22 files changed

Lines changed: 1066 additions & 384 deletions
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/nvidia,tegra30-tsensor.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NVIDIA Tegra30 Thermal Sensor
8+
9+
maintainers:
10+
- Dmitry Osipenko <digetx@gmail.com>
11+
- Jon Hunter <jonathanh@nvidia.com>
12+
- Thierry Reding <thierry.reding@gmail.com>
13+
14+
description: |
15+
TSENSOR provides thermal and voltage sensors which monitor temperature
16+
and voltage of the chip. Sensors are placed across the die to gauge the
17+
temperature of the whole chip. The TSENSOR module:
18+
19+
Generates an interrupt to SW to lower temperature via DVFS on reaching
20+
a certain thermal/voltage threshold.
21+
22+
Generates a signal to the CAR to reduce CPU frequency by half on reaching
23+
a certain thermal/voltage threshold.
24+
25+
Generates a signal to the PMC when the temperature reaches dangerously high
26+
levels to reset the chip and sets a flag in the PMC.
27+
28+
TSENSOR has two channels which monitor two different spots of the SoC.
29+
30+
properties:
31+
compatible:
32+
const: nvidia,tegra30-tsensor
33+
34+
reg:
35+
maxItems: 1
36+
37+
clocks:
38+
maxItems: 1
39+
40+
resets:
41+
maxItems: 1
42+
43+
interrupts:
44+
maxItems: 1
45+
46+
"#thermal-sensor-cells":
47+
const: 1
48+
49+
assigned-clock-parents: true
50+
assigned-clock-rates: true
51+
assigned-clocks: true
52+
53+
required:
54+
- compatible
55+
- reg
56+
- clocks
57+
- resets
58+
- interrupts
59+
- "#thermal-sensor-cells"
60+
61+
additionalProperties: false
62+
63+
examples:
64+
- |
65+
thermal-sensor@70014000 {
66+
compatible = "nvidia,tegra30-tsensor";
67+
reg = <0x70014000 0x500>;
68+
interrupts = <0 102 4>;
69+
clocks = <&clk 100>;
70+
resets = <&rst 100>;
71+
72+
#thermal-sensor-cells = <1>;
73+
};

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ properties:
4646
- qcom,msm8996-tsens
4747
- qcom,msm8998-tsens
4848
- qcom,sc7180-tsens
49+
- qcom,sc7280-tsens
50+
- qcom,sc8180x-tsens
4951
- qcom,sdm845-tsens
5052
- qcom,sm8150-tsens
5153
- qcom,sm8250-tsens

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

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/rockchip-thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Temperature Sensor ADC (TSADC) on Rockchip SoCs
8+
9+
maintainers:
10+
- Heiko Stuebner <heiko@sntech.de>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- rockchip,px30-tsadc # PX30 SoCs
16+
- rockchip,rv1108-tsadc # RV1108 SoCs
17+
- rockchip,rk3228-tsadc # RK3228 SoCs
18+
- rockchip,rk3288-tsadc # RK3288 SoCs
19+
- rockchip,rk3328-tsadc # RK3328 SoCs
20+
- rockchip,rk3368-tsadc # RK3368 SoCs
21+
- rockchip,rk3399-tsadc # RK3399 SoCs
22+
- rockchip,rk3568-tsadc # RK3568 SoCs
23+
24+
reg:
25+
maxItems: 1
26+
27+
interrupts:
28+
maxItems: 1
29+
30+
clocks:
31+
minItems: 2
32+
maxItems: 2
33+
34+
clock-names:
35+
items:
36+
- const: tsadc
37+
- const: apb_pclk
38+
39+
resets:
40+
maxItems: 1
41+
42+
reset-names:
43+
items:
44+
- const: tsadc-apb
45+
46+
"#thermal-sensor-cells":
47+
const: 1
48+
49+
rockchip,grf:
50+
description: The phandle of the syscon node for the general register file.
51+
$ref: /schemas/types.yaml#/definitions/phandle
52+
53+
rockchip,hw-tshut-temp:
54+
description: The hardware-controlled shutdown temperature value.
55+
$ref: /schemas/types.yaml#/definitions/uint32
56+
57+
rockchip,hw-tshut-mode:
58+
description: The hardware-controlled shutdown mode 0:CRU 1:GPIO.
59+
$ref: /schemas/types.yaml#/definitions/uint32
60+
enum: [0, 1]
61+
62+
rockchip,hw-tshut-polarity:
63+
description: The hardware-controlled active polarity 0:LOW 1:HIGH.
64+
$ref: /schemas/types.yaml#/definitions/uint32
65+
enum: [0, 1]
66+
67+
required:
68+
- compatible
69+
- reg
70+
- interrupts
71+
- clocks
72+
- clock-names
73+
- resets
74+
- reset-names
75+
- "#thermal-sensor-cells"
76+
77+
additionalProperties: false
78+
79+
examples:
80+
- |
81+
#include <dt-bindings/interrupt-controller/arm-gic.h>
82+
#include <dt-bindings/clock/rk3288-cru.h>
83+
84+
tsadc: tsadc@ff280000 {
85+
compatible = "rockchip,rk3288-tsadc";
86+
reg = <0xff280000 0x100>;
87+
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
88+
clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
89+
clock-names = "tsadc", "apb_pclk";
90+
resets = <&cru SRST_TSADC>;
91+
reset-names = "tsadc-apb";
92+
#thermal-sensor-cells = <1>;
93+
rockchip,hw-tshut-temp = <95000>;
94+
rockchip,hw-tshut-mode = <0>;
95+
rockchip,hw-tshut-polarity = <0>;
96+
};

drivers/thermal/devfreq_cooling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df)
458458
EXPORT_SYMBOL_GPL(devfreq_cooling_register);
459459

460460
/**
461-
* devfreq_cooling_em_register_power() - Register devfreq cooling device with
461+
* devfreq_cooling_em_register() - Register devfreq cooling device with
462462
* power information and automatically register Energy Model (EM)
463463
* @df: Pointer to devfreq device.
464464
* @dfc_power: Pointer to devfreq_cooling_power.

drivers/thermal/imx_sc_thermal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
9393
for_each_available_child_of_node(np, child) {
9494
sensor = devm_kzalloc(&pdev->dev, sizeof(*sensor), GFP_KERNEL);
9595
if (!sensor) {
96+
of_node_put(child);
9697
of_node_put(sensor_np);
9798
return -ENOMEM;
9899
}
@@ -104,6 +105,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
104105
dev_err(&pdev->dev,
105106
"failed to get valid sensor resource id: %d\n",
106107
ret);
108+
of_node_put(child);
107109
break;
108110
}
109111

@@ -114,6 +116,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
114116
if (IS_ERR(sensor->tzd)) {
115117
dev_err(&pdev->dev, "failed to register thermal zone\n");
116118
ret = PTR_ERR(sensor->tzd);
119+
of_node_put(child);
117120
break;
118121
}
119122

drivers/thermal/intel/int340x_thermal/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ obj-$(CONFIG_INT340X_THERMAL) += int340x_thermal_zone.o
44
obj-$(CONFIG_INT340X_THERMAL) += int3402_thermal.o
55
obj-$(CONFIG_INT340X_THERMAL) += int3403_thermal.o
66
obj-$(CONFIG_INT340X_THERMAL) += processor_thermal_device.o
7+
obj-$(CONFIG_INT340X_THERMAL) += int3401_thermal.o
8+
obj-$(CONFIG_INT340X_THERMAL) += processor_thermal_device_pci_legacy.o
9+
obj-$(CONFIG_INT340X_THERMAL) += processor_thermal_device_pci.o
710
obj-$(CONFIG_PROC_THERMAL_MMIO_RAPL) += processor_thermal_rapl.o
811
obj-$(CONFIG_INT340X_THERMAL) += processor_thermal_rfim.o
912
obj-$(CONFIG_INT340X_THERMAL) += processor_thermal_mbox.o
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/*
3+
* INT3401 processor thermal device
4+
* Copyright (c) 2020, Intel Corporation.
5+
*/
6+
#include <linux/acpi.h>
7+
#include <linux/kernel.h>
8+
#include <linux/module.h>
9+
#include <linux/platform_device.h>
10+
#include <linux/thermal.h>
11+
12+
#include "int340x_thermal_zone.h"
13+
#include "processor_thermal_device.h"
14+
15+
static const struct acpi_device_id int3401_device_ids[] = {
16+
{"INT3401", 0},
17+
{"", 0},
18+
};
19+
MODULE_DEVICE_TABLE(acpi, int3401_device_ids);
20+
21+
static int int3401_add(struct platform_device *pdev)
22+
{
23+
struct proc_thermal_device *proc_priv;
24+
int ret;
25+
26+
proc_priv = devm_kzalloc(&pdev->dev, sizeof(*proc_priv), GFP_KERNEL);
27+
if (!proc_priv)
28+
return -ENOMEM;
29+
30+
ret = proc_thermal_add(&pdev->dev, proc_priv);
31+
if (ret)
32+
return ret;
33+
34+
platform_set_drvdata(pdev, proc_priv);
35+
36+
return ret;
37+
}
38+
39+
static int int3401_remove(struct platform_device *pdev)
40+
{
41+
proc_thermal_remove(platform_get_drvdata(pdev));
42+
43+
return 0;
44+
}
45+
46+
#ifdef CONFIG_PM_SLEEP
47+
static int int3401_thermal_resume(struct device *dev)
48+
{
49+
return proc_thermal_resume(dev);
50+
}
51+
#else
52+
#define int3401_thermal_resume NULL
53+
#endif
54+
55+
static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, NULL, int3401_thermal_resume);
56+
57+
static struct platform_driver int3401_driver = {
58+
.probe = int3401_add,
59+
.remove = int3401_remove,
60+
.driver = {
61+
.name = "int3401 thermal",
62+
.acpi_match_table = int3401_device_ids,
63+
.pm = &int3401_proc_thermal_pm,
64+
},
65+
};
66+
67+
static int __init proc_thermal_init(void)
68+
{
69+
return platform_driver_register(&int3401_driver);
70+
}
71+
72+
static void __exit proc_thermal_exit(void)
73+
{
74+
platform_driver_unregister(&int3401_driver);
75+
}
76+
77+
module_init(proc_thermal_init);
78+
module_exit(proc_thermal_exit);
79+
80+
MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
81+
MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");
82+
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)