Skip to content

Commit 51699e4

Browse files
committed
Merge tag 'thermal-v6.4-rc1-2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull more thermal control changes for 6.4-rc1 from Daniel Lezcano: "- Do preparating cleaning and DT bindings for RK3588 support (Sebastian Reichel) - Add driver support for RK3588 (Finley Xiao) - Use devm_reset_control_array_get_exclusive() for the Rockchip driver (Ye Xingchen) - Detect power gated thermal zones and return -EAGAIN when reading the temperature (Mikko Perttunen) - Remove thermal_bind_params structure as it is unused (Zhang Rui) - Drop unneeded quotes in DT bindings allowing to run yamllint (Rob Herring) - Update the power allocator documentation according to the thermal trace relocation (Lukas Bulwahn) - Fix sensor 1 interrupt status bitmask for the Mediatek LVTS sensor (Chen-Yu Tsai) - Use the dev_err_probe() helper in the Amlogic driver (Ye Xingchen) - Add AP domain support to LVTS thermal controllers for mt8195 (Balsam CHIHI) - Remove buggy call to thermal_of_zone_unregister() (Daniel Lezcano) - Make thermal_of_zone_[un]register() private to the thermal OF code (Daniel Lezcano) - Create a private copy of the thermal zone device parameters structure when registering a thermal zone (Daniel Lezcano)" * tag 'thermal-v6.4-rc1-2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/core: Alloc-copy-free the thermal zone parameters structure thermal/of: Unexport unused OF functions thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister thermal/drivers/mediatek/lvts_thermal: Add AP domain for mt8195 dt-bindings: thermal: mediatek: Add AP domain to LVTS thermal controllers for mt8195 thermal: amlogic: Use dev_err_probe() thermal/drivers/mediatek/lvts_thermal: Fix sensor 1 interrupt status bitmask MAINTAINERS: adjust entry in THERMAL/POWER_ALLOCATOR after header movement dt-bindings: thermal: Drop unneeded quotes thermal/core: Remove thermal_bind_params structure thermal/drivers/tegra-bpmp: Handle offline zones thermal/drivers/rockchip: use devm_reset_control_array_get_exclusive() dt-bindings: rockchip-thermal: Support the RK3588 SoC compatible thermal/drivers/rockchip: Support RK3588 SoC in the thermal driver thermal/drivers/rockchip: Support dynamic sized sensor array thermal/drivers/rockchip: Simplify channel id logic thermal/drivers/rockchip: Use dev_err_probe thermal/drivers/rockchip: Simplify clock logic thermal/drivers/rockchip: Simplify getting match data
2 parents cfeeb7d + 3d439b1 commit 51699e4

15 files changed

Lines changed: 358 additions & 356 deletions

File tree

Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ properties:
3030

3131
amlogic,ao-secure:
3232
description: phandle to the ao-secure syscon
33-
$ref: '/schemas/types.yaml#/definitions/phandle'
33+
$ref: /schemas/types.yaml#/definitions/phandle
3434

3535
'#thermal-sensor-cells':
3636
const: 0

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ properties:
4040
- const: temp_grade
4141

4242
fsl,tempmon:
43-
$ref: '/schemas/types.yaml#/definitions/phandle'
43+
$ref: /schemas/types.yaml#/definitions/phandle
4444
description: Phandle to anatop system controller node.
4545

4646
fsl,tempmon-data:
47-
$ref: '/schemas/types.yaml#/definitions/phandle'
47+
$ref: /schemas/types.yaml#/definitions/phandle
4848
description: |
4949
Deprecated property, phandle pointer to fuse controller that contains
5050
TEMPMON calibration data, e.g. OCOTP on imx6q. The details about

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ properties:
2929
maxItems: 1
3030

3131
fsl,tmu-range:
32-
$ref: '/schemas/types.yaml#/definitions/uint32-array'
32+
$ref: /schemas/types.yaml#/definitions/uint32-array
3333
description: |
3434
The values to be programmed into TTRnCR, as specified by the SoC
3535
reference manual. The first cell is TTR0CR, the second is TTR1CR, etc.
3636
maxItems: 4
3737

3838
fsl,tmu-calibration:
39-
$ref: '/schemas/types.yaml#/definitions/uint32-matrix'
39+
$ref: /schemas/types.yaml#/definitions/uint32-matrix
4040
description: |
4141
A list of cell pairs containing temperature calibration data, as
4242
specified by the SoC reference manual. The first cell of each pair

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ properties:
1919
- rockchip,rk3368-tsadc
2020
- rockchip,rk3399-tsadc
2121
- rockchip,rk3568-tsadc
22+
- rockchip,rk3588-tsadc
2223
- rockchip,rv1108-tsadc
2324

2425
reg:

Documentation/driver-api/thermal/sysfs-api.rst

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -304,42 +304,6 @@ temperature) and throttle appropriate devices.
304304
1.4 Thermal Zone Parameters
305305
---------------------------
306306

307-
::
308-
309-
struct thermal_bind_params
310-
311-
This structure defines the following parameters that are used to bind
312-
a zone with a cooling device for a particular trip point.
313-
314-
.cdev:
315-
The cooling device pointer
316-
.weight:
317-
The 'influence' of a particular cooling device on this
318-
zone. This is relative to the rest of the cooling
319-
devices. For example, if all cooling devices have a
320-
weight of 1, then they all contribute the same. You can
321-
use percentages if you want, but it's not mandatory. A
322-
weight of 0 means that this cooling device doesn't
323-
contribute to the cooling of this zone unless all cooling
324-
devices have a weight of 0. If all weights are 0, then
325-
they all contribute the same.
326-
.trip_mask:
327-
This is a bit mask that gives the binding relation between
328-
this thermal zone and cdev, for a particular trip point.
329-
If nth bit is set, then the cdev and thermal zone are bound
330-
for trip point n.
331-
.binding_limits:
332-
This is an array of cooling state limits. Must have
333-
exactly 2 * thermal_zone.number_of_trip_points. It is an
334-
array consisting of tuples <lower-state upper-state> of
335-
state limits. Each trip will be associated with one state
336-
limit tuple when binding. A NULL pointer means
337-
<THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on all trips.
338-
These limits are used when binding a cdev to a trip point.
339-
.match:
340-
This call back returns success(0) if the 'tz and cdev' need to
341-
be bound, as per platform data.
342-
343307
::
344308

345309
struct thermal_zone_params
@@ -357,10 +321,6 @@ temperature) and throttle appropriate devices.
357321
will be created. when no_hwmon == true, nothing will be done.
358322
In case the thermal_zone_params is NULL, the hwmon interface
359323
will be created (for backward compatibility).
360-
.num_tbps:
361-
Number of thermal_bind_params entries for this zone
362-
.tbp:
363-
thermal_bind_params entries
364324

365325
2. sysfs attributes structure
366326
=============================

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20771,7 +20771,7 @@ L: linux-pm@vger.kernel.org
2077120771
S: Maintained
2077220772
F: Documentation/driver-api/thermal/power_allocator.rst
2077320773
F: drivers/thermal/gov_power_allocator.c
20774-
F: include/trace/events/thermal_power_allocator.h
20774+
F: drivers/thermal/thermal_trace_ipa.h
2077520775

2077620776
THINKPAD ACPI EXTRAS DRIVER
2077720777
M: Henrique de Moraes Holschuh <hmh@hmh.eng.br>

drivers/thermal/amlogic_thermal.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,8 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
262262
return PTR_ERR(pdata->regmap);
263263

264264
pdata->clk = devm_clk_get(dev, NULL);
265-
if (IS_ERR(pdata->clk)) {
266-
if (PTR_ERR(pdata->clk) != -EPROBE_DEFER)
267-
dev_err(dev, "failed to get clock\n");
268-
return PTR_ERR(pdata->clk);
269-
}
265+
if (IS_ERR(pdata->clk))
266+
return dev_err_probe(dev, PTR_ERR(pdata->clk), "failed to get clock\n");
270267

271268
pdata->sec_ao_map = syscon_regmap_lookup_by_phandle
272269
(pdev->dev.of_node, "amlogic,ao-secure");

drivers/thermal/broadcom/bcm2835_thermal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
275275

276276
return 0;
277277
err_tz:
278-
thermal_of_zone_unregister(tz);
278+
devm_thermal_of_zone_unregister(&pdev->dev, tz);
279279
err_clk:
280280
clk_disable_unprepare(data->clk);
281281

@@ -285,10 +285,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
285285
static int bcm2835_thermal_remove(struct platform_device *pdev)
286286
{
287287
struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
288-
struct thermal_zone_device *tz = data->tz;
289288

290289
debugfs_remove_recursive(data->debugfsdir);
291-
thermal_of_zone_unregister(tz);
292290
clk_disable_unprepare(data->clk);
293291

294292
return 0;

drivers/thermal/mediatek/lvts_thermal.c

Lines changed: 77 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#define LVTS_MONINT_CONF 0x9FBF7BDE
6767

6868
#define LVTS_INT_SENSOR0 0x0009001F
69-
#define LVTS_INT_SENSOR1 0X000881F0
69+
#define LVTS_INT_SENSOR1 0x001203E0
7070
#define LVTS_INT_SENSOR2 0x00247C00
7171
#define LVTS_INT_SENSOR3 0x1FC00000
7272

@@ -395,8 +395,8 @@ static irqreturn_t lvts_ctrl_irq_handler(struct lvts_ctrl *lvts_ctrl)
395395
* => 0x1FC00000
396396
* sensor 2 interrupt: 0000 0000 0010 0100 0111 1100 0000 0000
397397
* => 0x00247C00
398-
* sensor 1 interrupt: 0000 0000 0001 0001 0000 0011 1110 0000
399-
* => 0X000881F0
398+
* sensor 1 interrupt: 0000 0000 0001 0010 0000 0011 1110 0000
399+
* => 0X001203E0
400400
* sensor 0 interrupt: 0000 0000 0000 1001 0000 0000 0001 1111
401401
* => 0x0009001F
402402
*/
@@ -530,29 +530,33 @@ static int lvts_sensor_init(struct device *dev, struct lvts_ctrl *lvts_ctrl,
530530
* The efuse blob values follows the sensor enumeration per thermal
531531
* controller. The decoding of the stream is as follow:
532532
*
533-
* <--?-> <----big0 ???---> <-sensor0-> <-0->
534-
* ------------------------------------------
535-
* index in the stream: : | 0x0 | 0x1 | 0x2 | 0x3 | 0x4 | 0x5 | 0x6 |
536-
* ------------------------------------------
533+
* stream index map for MCU Domain :
537534
*
538-
* <--sensor1--><-0-> <----big1 ???---> <-sen
539-
* ------------------------------------------
540-
* | 0x7 | 0x8 | 0x9 | 0xA | 0xB | OxC | OxD |
541-
* ------------------------------------------
535+
* <-----mcu-tc#0-----> <-----sensor#0-----> <-----sensor#1----->
536+
* 0x01 | 0x02 | 0x03 | 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09
542537
*
543-
* sor0-> <-0-> <-sensor1-> <-0-> ..........
544-
* ------------------------------------------
545-
* | 0x7 | 0x8 | 0x9 | 0xA | 0xB | OxC | OxD |
546-
* ------------------------------------------
538+
* <-----mcu-tc#1-----> <-----sensor#2-----> <-----sensor#3----->
539+
* 0x0A | 0x0B | 0x0C | 0x0D | 0x0E | 0x0F | 0x10 | 0x11 | 0x12
547540
*
548-
* And so on ...
541+
* <-----mcu-tc#2-----> <-----sensor#4-----> <-----sensor#5-----> <-----sensor#6-----> <-----sensor#7----->
542+
* 0x13 | 0x14 | 0x15 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1A | 0x1B | 0x1C | 0x1D | 0x1E | 0x1F | 0x20 | 0x21
543+
*
544+
* stream index map for AP Domain :
545+
*
546+
* <-----ap--tc#0-----> <-----sensor#0-----> <-----sensor#1----->
547+
* 0x22 | 0x23 | 0x24 | 0x25 | 0x26 | 0x27 | 0x28 | 0x29 | 0x2A
548+
*
549+
* <-----ap--tc#1-----> <-----sensor#2-----> <-----sensor#3----->
550+
* 0x2B | 0x2C | 0x2D | 0x2E | 0x2F | 0x30 | 0x31 | 0x32 | 0x33
551+
*
552+
* <-----ap--tc#2-----> <-----sensor#4-----> <-----sensor#5-----> <-----sensor#6----->
553+
* 0x34 | 0x35 | 0x36 | 0x37 | 0x38 | 0x39 | 0x3A | 0x3B | 0x3C | 0x3D | 0x3E | 0x3F
554+
*
555+
* <-----ap--tc#3-----> <-----sensor#7-----> <-----sensor#8----->
556+
* 0x40 | 0x41 | 0x42 | 0x43 | 0x44 | 0x45 | 0x46 | 0x47 | 0x48
549557
*
550558
* The data description gives the offset of the calibration data in
551559
* this bytes stream for each sensor.
552-
*
553-
* Each thermal controller can handle up to 4 sensors max, we don't
554-
* care if there are less as the array of calibration is sized to 4
555-
* anyway. The unused sensor slot will be zeroed.
556560
*/
557561
static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvts_ctrl,
558562
const struct lvts_ctrl_data *lvts_ctrl_data,
@@ -1165,7 +1169,7 @@ static int lvts_remove(struct platform_device *pdev)
11651169
return 0;
11661170
}
11671171

1168-
static const struct lvts_ctrl_data mt8195_lvts_data_ctrl[] = {
1172+
static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = {
11691173
{
11701174
.cal_offset = { 0x04, 0x07 },
11711175
.lvts_sensor = {
@@ -1200,13 +1204,63 @@ static const struct lvts_ctrl_data mt8195_lvts_data_ctrl[] = {
12001204
}
12011205
};
12021206

1207+
static const struct lvts_ctrl_data mt8195_lvts_ap_data_ctrl[] = {
1208+
{
1209+
.cal_offset = { 0x25, 0x28 },
1210+
.lvts_sensor = {
1211+
{ .dt_id = MT8195_AP_VPU0 },
1212+
{ .dt_id = MT8195_AP_VPU1 }
1213+
},
1214+
.num_lvts_sensor = 2,
1215+
.offset = 0x0,
1216+
.hw_tshut_temp = LVTS_HW_SHUTDOWN_MT8195,
1217+
},
1218+
{
1219+
.cal_offset = { 0x2e, 0x31 },
1220+
.lvts_sensor = {
1221+
{ .dt_id = MT8195_AP_GPU0 },
1222+
{ .dt_id = MT8195_AP_GPU1 }
1223+
},
1224+
.num_lvts_sensor = 2,
1225+
.offset = 0x100,
1226+
.hw_tshut_temp = LVTS_HW_SHUTDOWN_MT8195,
1227+
},
1228+
{
1229+
.cal_offset = { 0x37, 0x3a, 0x3d },
1230+
.lvts_sensor = {
1231+
{ .dt_id = MT8195_AP_VDEC },
1232+
{ .dt_id = MT8195_AP_IMG },
1233+
{ .dt_id = MT8195_AP_INFRA },
1234+
},
1235+
.num_lvts_sensor = 3,
1236+
.offset = 0x200,
1237+
.hw_tshut_temp = LVTS_HW_SHUTDOWN_MT8195,
1238+
},
1239+
{
1240+
.cal_offset = { 0x43, 0x46 },
1241+
.lvts_sensor = {
1242+
{ .dt_id = MT8195_AP_CAM0 },
1243+
{ .dt_id = MT8195_AP_CAM1 }
1244+
},
1245+
.num_lvts_sensor = 2,
1246+
.offset = 0x300,
1247+
.hw_tshut_temp = LVTS_HW_SHUTDOWN_MT8195,
1248+
}
1249+
};
1250+
12031251
static const struct lvts_data mt8195_lvts_mcu_data = {
1204-
.lvts_ctrl = mt8195_lvts_data_ctrl,
1205-
.num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_data_ctrl),
1252+
.lvts_ctrl = mt8195_lvts_mcu_data_ctrl,
1253+
.num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl),
1254+
};
1255+
1256+
static const struct lvts_data mt8195_lvts_ap_data = {
1257+
.lvts_ctrl = mt8195_lvts_ap_data_ctrl,
1258+
.num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_ap_data_ctrl),
12061259
};
12071260

12081261
static const struct of_device_id lvts_of_match[] = {
12091262
{ .compatible = "mediatek,mt8195-lvts-mcu", .data = &mt8195_lvts_mcu_data },
1263+
{ .compatible = "mediatek,mt8195-lvts-ap", .data = &mt8195_lvts_ap_data },
12101264
{},
12111265
};
12121266
MODULE_DEVICE_TABLE(of, lvts_of_match);

0 commit comments

Comments
 (0)