Skip to content

Commit a8460ba

Browse files
committed
Merge tag 'thermal-v6.5-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux into thermal
Pull thermal control updates for 6.5-rc1 from Daniel Lezcano: "- Add DT bindings for SM6375, MSM8226 and QCM2290 Qcom platforms (Konrad Dybcio) - Add DT bindings and support for QCom MSM8226 (Matti Lehtimäki) - Add DT bindings for QCom ipq9574 (Praveenkumar I) - Convert bcm2835 DT bindings to the yaml schema (Stefan Wahren) - Allow selecting the bang-bang governor as default (Thierry Reding) - Refactor and prepare the code to set the scene for RCar Gen4 (Wolfram Sang) - Cleanup and fixes for the QCom tsens drivers. Add DT bindings and calibration for the MSM8909 platform (Stephan Gerhold) - Revert a patch introducing a wrong usage of devm_of_iomap() on the Mediatek platform (Ricardo Cañuelo) - Fix the clock vs reset ordering in order to conform to the documentation on the sun8i (Christophe JAILLET) - Prevent setting up undocumented registers, enable the only described sensors and add the version 2.1 on the Qoriq sensor (Peng Fan) - Add DT bindings and support for the Armada AP807 (Alex Leibovich) - Update the mlx5 driver with the recent thermal changes (Daniel Lezcano) - Convert to platform remove callback returning void on STM32 (Uwe Kleine-König) - Add an error information printing for devm_thermal_add_hwmon_sysfs() and remove the error from the Sun8i, Amlogic, i.MX, TI, K3, Tegra, Qoriq, Mediateka and QCom (Yangtao Li) - Register as hwmon sensor for the Generic ADC (Chen-Yu Tsai) - Use the dev_err_probe() function in the QCom tsens alarm driver (Luca Weiss)" * tag 'thermal-v6.5-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (38 commits) thermal/drivers/qcom/temp-alarm: Use dev_err_probe thermal/drivers/generic-adc: Register thermal zones as hwmon sensors thermal/drivers/mediatek/lvts_thermal: Remove redundant msg in lvts_ctrl_start() thermal/drivers/qcom: Remove redundant msg at probe time thermal/drivers/ti-soc: Remove redundant msg in ti_thermal_expose_sensor() thermal/drivers/qoriq: Remove redundant msg in qoriq_tmu_register_tmu_zone() thermal/drivers/tegra: Remove redundant msg in tegra_tsensor_register_channel() drivers/thermal/k3: Remove redundant msg in k3_bandgap_probe() thermal/drivers/imx: Remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe() thermal/drivers/amlogic: Remove redundant msg in amlogic_thermal_probe() thermal/drivers/sun8i: Remove redundant msg in sun8i_ths_register() thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() thermal/drivers/stm32: Convert to platform remove callback returning void net/mlx5: Update the driver with the recent thermal changes thermal/drivers/armada: Add support for AP807 thermal data dt-bindings: armada-thermal: Add armada-ap807-thermal compatible thermal/drivers/qoriq: Support version 2.1 thermal/drivers/qoriq: Only enable supported sensors thermal/drivers/qoriq: No need to program site adjustment register thermal/drivers/mediatek/lvts_thermal: Register thermal zones as hwmon sensors ...
2 parents f46117b + 57c9eaa commit a8460ba

30 files changed

+415
-295
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required properties:
88
* marvell,armada380-thermal
99
* marvell,armadaxp-thermal
1010
* marvell,armada-ap806-thermal
11+
* marvell,armada-ap807-thermal
1112
* marvell,armada-cp110-thermal
1213

1314
Note: these bindings are deprecated for AP806/CP110 and should instead

Documentation/devicetree/bindings/thermal/brcm,bcm2835-thermal.txt

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/brcm,bcm2835-thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Broadcom BCM2835 thermal sensor
8+
9+
maintainers:
10+
- Stefan Wahren <[email protected]>
11+
12+
allOf:
13+
- $ref: thermal-sensor.yaml#
14+
15+
properties:
16+
compatible:
17+
enum:
18+
- brcm,bcm2835-thermal
19+
- brcm,bcm2836-thermal
20+
- brcm,bcm2837-thermal
21+
22+
reg:
23+
maxItems: 1
24+
25+
clocks:
26+
maxItems: 1
27+
28+
"#thermal-sensor-cells":
29+
const: 0
30+
31+
unevaluatedProperties: false
32+
33+
required:
34+
- compatible
35+
- reg
36+
- clocks
37+
- '#thermal-sensor-cells'
38+
39+
examples:
40+
- |
41+
#include <dt-bindings/clock/bcm2835.h>
42+
43+
thermal@7e212000 {
44+
compatible = "brcm,bcm2835-thermal";
45+
reg = <0x7e212000 0x8>;
46+
clocks = <&clocks BCM2835_CLOCK_TSENS>;
47+
#thermal-sensor-cells = <0>;
48+
};

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

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ properties:
2929
items:
3030
- enum:
3131
- qcom,mdm9607-tsens
32+
- qcom,msm8226-tsens
33+
- qcom,msm8909-tsens
3234
- qcom,msm8916-tsens
3335
- qcom,msm8939-tsens
3436
- qcom,msm8974-tsens
@@ -48,6 +50,7 @@ properties:
4850
- qcom,msm8953-tsens
4951
- qcom,msm8996-tsens
5052
- qcom,msm8998-tsens
53+
- qcom,qcm2290-tsens
5154
- qcom,sc7180-tsens
5255
- qcom,sc7280-tsens
5356
- qcom,sc8180x-tsens
@@ -56,6 +59,7 @@ properties:
5659
- qcom,sdm845-tsens
5760
- qcom,sm6115-tsens
5861
- qcom,sm6350-tsens
62+
- qcom,sm6375-tsens
5963
- qcom,sm8150-tsens
6064
- qcom,sm8250-tsens
6165
- qcom,sm8350-tsens
@@ -67,6 +71,12 @@ properties:
6771
enum:
6872
- qcom,ipq8074-tsens
6973

74+
- description: v2 of TSENS with combined interrupt
75+
items:
76+
- enum:
77+
- qcom,ipq9574-tsens
78+
- const: qcom,ipq8074-tsens
79+
7080
reg:
7181
items:
7282
- description: TM registers
@@ -223,12 +233,7 @@ allOf:
223233
contains:
224234
enum:
225235
- qcom,ipq8064-tsens
226-
- qcom,mdm9607-tsens
227-
- qcom,msm8916-tsens
228236
- qcom,msm8960-tsens
229-
- qcom,msm8974-tsens
230-
- qcom,msm8976-tsens
231-
- qcom,qcs404-tsens
232237
- qcom,tsens-v0_1
233238
- qcom,tsens-v1
234239
then:
@@ -244,22 +249,7 @@ allOf:
244249
properties:
245250
compatible:
246251
contains:
247-
enum:
248-
- qcom,msm8953-tsens
249-
- qcom,msm8996-tsens
250-
- qcom,msm8998-tsens
251-
- qcom,sc7180-tsens
252-
- qcom,sc7280-tsens
253-
- qcom,sc8180x-tsens
254-
- qcom,sc8280xp-tsens
255-
- qcom,sdm630-tsens
256-
- qcom,sdm845-tsens
257-
- qcom,sm6350-tsens
258-
- qcom,sm8150-tsens
259-
- qcom,sm8250-tsens
260-
- qcom,sm8350-tsens
261-
- qcom,sm8450-tsens
262-
- qcom,tsens-v2
252+
const: qcom,tsens-v2
263253
then:
264254
properties:
265255
interrupts:

drivers/net/ethernet/mellanox/mlx5/core/thermal.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int mlx5_thermal_get_mtmp_temp(struct mlx5_core_dev *mdev, u32 id, int *p
4545
static int mlx5_thermal_get_temp(struct thermal_zone_device *tzdev,
4646
int *p_temp)
4747
{
48-
struct mlx5_thermal *thermal = tzdev->devdata;
48+
struct mlx5_thermal *thermal = thermal_zone_device_priv(tzdev);
4949
struct mlx5_core_dev *mdev = thermal->mdev;
5050
int err;
5151

@@ -81,12 +81,13 @@ int mlx5_thermal_init(struct mlx5_core_dev *mdev)
8181
return -ENOMEM;
8282

8383
thermal->mdev = mdev;
84-
thermal->tzdev = thermal_zone_device_register(data,
85-
MLX5_THERMAL_NUM_TRIPS,
86-
MLX5_THERMAL_TRIP_MASK,
87-
thermal,
88-
&mlx5_thermal_ops,
89-
NULL, 0, MLX5_THERMAL_POLL_INT_MSEC);
84+
thermal->tzdev = thermal_zone_device_register_with_trips(data,
85+
NULL,
86+
MLX5_THERMAL_NUM_TRIPS,
87+
MLX5_THERMAL_TRIP_MASK,
88+
thermal,
89+
&mlx5_thermal_ops,
90+
NULL, 0, MLX5_THERMAL_POLL_INT_MSEC);
9091
if (IS_ERR(thermal->tzdev)) {
9192
dev_err(mdev->device, "Failed to register thermal zone device (%s) %ld\n",
9293
data, PTR_ERR(thermal->tzdev));

drivers/thermal/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ config THERMAL_DEFAULT_GOV_POWER_ALLOCATOR
130130
system and device power allocation. This governor can only
131131
operate on cooling devices that implement the power API.
132132

133+
config THERMAL_DEFAULT_GOV_BANG_BANG
134+
bool "bang_bang"
135+
depends on THERMAL_GOV_BANG_BANG
136+
help
137+
Use the bang_bang governor as default. This throttles the
138+
devices one step at the time, taking into account the trip
139+
point hysteresis.
140+
133141
endchoice
134142

135143
config THERMAL_GOV_FAIR_SHARE

drivers/thermal/amlogic_thermal.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
282282
return ret;
283283
}
284284

285-
if (devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd))
286-
dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
285+
devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd);
287286

288287
ret = amlogic_thermal_initialize(pdata);
289288
if (ret)

drivers/thermal/armada_thermal.c

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static void armada380_init(struct platform_device *pdev,
231231
regmap_write(priv->syscon, data->syscon_control0_off, reg);
232232
}
233233

234-
static void armada_ap806_init(struct platform_device *pdev,
234+
static void armada_ap80x_init(struct platform_device *pdev,
235235
struct armada_thermal_priv *priv)
236236
{
237237
struct armada_thermal_data *data = priv->data;
@@ -614,7 +614,7 @@ static const struct armada_thermal_data armada380_data = {
614614
};
615615

616616
static const struct armada_thermal_data armada_ap806_data = {
617-
.init = armada_ap806_init,
617+
.init = armada_ap80x_init,
618618
.is_valid_bit = BIT(16),
619619
.temp_shift = 0,
620620
.temp_mask = 0x3ff,
@@ -637,6 +637,30 @@ static const struct armada_thermal_data armada_ap806_data = {
637637
.cpu_nr = 4,
638638
};
639639

640+
static const struct armada_thermal_data armada_ap807_data = {
641+
.init = armada_ap80x_init,
642+
.is_valid_bit = BIT(16),
643+
.temp_shift = 0,
644+
.temp_mask = 0x3ff,
645+
.thresh_shift = 3,
646+
.hyst_shift = 19,
647+
.hyst_mask = 0x3,
648+
.coef_b = -128900LL,
649+
.coef_m = 394ULL,
650+
.coef_div = 1,
651+
.inverted = true,
652+
.signed_sample = true,
653+
.syscon_control0_off = 0x84,
654+
.syscon_control1_off = 0x88,
655+
.syscon_status_off = 0x8C,
656+
.dfx_irq_cause_off = 0x108,
657+
.dfx_irq_mask_off = 0x10C,
658+
.dfx_overheat_irq = BIT(22),
659+
.dfx_server_irq_mask_off = 0x104,
660+
.dfx_server_irq_en = BIT(1),
661+
.cpu_nr = 4,
662+
};
663+
640664
static const struct armada_thermal_data armada_cp110_data = {
641665
.init = armada_cp110_init,
642666
.is_valid_bit = BIT(10),
@@ -680,6 +704,10 @@ static const struct of_device_id armada_thermal_id_table[] = {
680704
.compatible = "marvell,armada-ap806-thermal",
681705
.data = &armada_ap806_data,
682706
},
707+
{
708+
.compatible = "marvell,armada-ap807-thermal",
709+
.data = &armada_ap807_data,
710+
},
683711
{
684712
.compatible = "marvell,armada-cp110-thermal",
685713
.data = &armada_cp110_data,

drivers/thermal/imx8mm_thermal.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
343343
}
344344
tmu->sensors[i].hw_id = i;
345345

346-
if (devm_thermal_add_hwmon_sysfs(&pdev->dev, tmu->sensors[i].tzd))
347-
dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
346+
devm_thermal_add_hwmon_sysfs(&pdev->dev, tmu->sensors[i].tzd);
348347
}
349348

350349
platform_set_drvdata(pdev, tmu);

drivers/thermal/imx_sc_thermal.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
116116
return ret;
117117
}
118118

119-
if (devm_thermal_add_hwmon_sysfs(&pdev->dev, sensor->tzd))
120-
dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
119+
devm_thermal_add_hwmon_sysfs(&pdev->dev, sensor->tzd);
121120
}
122121

123122
return 0;

0 commit comments

Comments
 (0)