Skip to content

Commit 5e0ca0b

Browse files
committed
Merge tag 'thermal-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control updates from Rafael Wysocki: "These mostly continue to prepare the thermal control subsystem for using unified representation of trip points, which includes cleanups, code refactoring and similar and update several drivers (for other reasons), which includes new hardware support. Specifics: - Add a thermal zone 'devdata' accessor and modify several drivers to use it (Daniel Lezcano) - Prevent drivers from using the 'device' internal thermal zone structure field directly (Daniel Lezcano) - Clean up the hwmon thermal driver (Daniel Lezcano) - Add thermal zone id accessor and thermal zone type accessor and prevent drivers from using thermal zone fields directly (Daniel Lezcano) - Clean up the acerhdf and tegra thermal drivers (Daniel Lezcano) - Add lower bound check for sysfs input to the x86_pkg_temp_thermal Intel thermal driver (Zhang Rui) - Add more thermal zone device encapsulation: prevent setting structure field directly, access the sensor device instead the thermal zone's device for trace, relocate the traces in drivers/thermal (Daniel Lezcano) - Use the generic trip point for the i.MX and remove the get_trip_temp ops (Daniel Lezcano) - Use the devm_platform_ioremap_resource() in the Hisilicon driver (Yang Li) - Remove R-Car H3 ES1.* handling as public has only access to the ES2 version and the upstream support for the ES1 has been shutdown (Wolfram Sang) - Add a delay after initializing the bank in order to let the time to the hardware to initialze itself before reading the temperature (Amjad Ouled-Ameur) - Add MT8365 support (Amjad Ouled-Ameur) - Preparational cleanup 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) - Fix a kernel NULL pointer dereference in thermal_hwmon (Zhang Rui) - Revert recent message adjustment in thermal_hwmon (Rafael Wysocki) - Use of_property_present() for testing DT property presence in thermal control code (Rob Herring) - Clean up thermal_list_lock locking in the thermal core (Rafael Wysocki) - Add DLVR support for RFIM control in the int340x Intel thermal driver (Srinivas Pandruvada)" * tag 'thermal-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (55 commits) thermal: intel: int340x: Add DLVR support for RFIM control 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 4173cf6 + 5bc6b1d commit 5e0ca0b

88 files changed

Lines changed: 852 additions & 721 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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/mediatek-thermal.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Required properties:
1616
- "mediatek,mt7981-thermal", "mediatek,mt7986-thermal" : For MT7981 SoC
1717
- "mediatek,mt7986-thermal" : For MT7986 SoC
1818
- "mediatek,mt8183-thermal" : For MT8183 family of SoCs
19+
- "mediatek,mt8365-thermal" : For MT8365 family of SoCs
1920
- "mediatek,mt8516-thermal", "mediatek,mt2701-thermal : For MT8516 family of SoCs
2021
- reg: Address range of the thermal controller
2122
- interrupts: IRQ for the thermal controller

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/intel_dptf.rst

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ ABI.
184184
DPTF Processor thermal RFIM interface
185185
--------------------------------------------
186186

187-
RFIM interface allows adjustment of FIVR (Fully Integrated Voltage Regulator)
188-
and DDR (Double Data Rate)frequencies to avoid RF interference with WiFi and 5G.
187+
RFIM interface allows adjustment of FIVR (Fully Integrated Voltage Regulator),
188+
DDR (Double Data Rate) and DLVR (Digital Linear Voltage Regulator)
189+
frequencies to avoid RF interference with WiFi and 5G.
189190

190191
Switching voltage regulators (VR) generate radiated EMI or RFI at the
191192
fundamental frequency and its harmonics. Some harmonics may interfere
@@ -196,6 +197,15 @@ small % and shift away the switching noise harmonic interference from
196197
radio channels. OEM or ODMs can use the driver to control SOC IVR
197198
operation within the range where it does not impact IVR performance.
198199

200+
Some products use DLVR instead of FIVR as switching voltage regulator.
201+
In this case attributes of DLVR must be adjusted instead of FIVR.
202+
203+
While shifting the frequencies additional clock noise can be introduced,
204+
which is compensated by adjusting Spread spectrum percent. This helps
205+
to reduce the clock noise to meet regulatory compliance. This spreading
206+
% increases bandwidth of signal transmission and hence reduces the
207+
effects of interference, noise and signal fading.
208+
199209
DRAM devices of DDR IO interface and their power plane can generate EMI
200210
at the data rates. Similar to IVR control mechanism, Intel offers a
201211
mechanism by which DDR data rates can be changed if several conditions
@@ -264,6 +274,38 @@ DVFS attributes
264274
``rfi_disable (RW)``
265275
Disable DDR rate change feature
266276

277+
DLVR attributes
278+
279+
:file:`/sys/bus/pci/devices/0000\:00\:04.0/dlvr/`
280+
281+
``dlvr_hardware_rev`` (RO)
282+
DLVR hardware revision.
283+
284+
``dlvr_freq_mhz`` (RO)
285+
Current DLVR PLL frequency in MHz.
286+
287+
``dlvr_freq_select`` (RW)
288+
Sets DLVR PLL clock frequency. Once set, and enabled via
289+
dlvr_rfim_enable, the dlvr_freq_mhz will show the current
290+
DLVR PLL frequency.
291+
292+
``dlvr_pll_busy`` (RO)
293+
PLL can't accept frequency change when set.
294+
295+
``dlvr_rfim_enable`` (RW)
296+
0: Disable RF frequency hopping, 1: Enable RF frequency hopping.
297+
298+
``dlvr_spread_spectrum_pct`` (RW)
299+
Sets DLVR spread spectrum percent value.
300+
301+
``dlvr_control_mode`` (RW)
302+
Specifies how frequencies are spread using spread spectrum.
303+
0: Down spread,
304+
1: Spread in the Center.
305+
306+
``dlvr_control_lock`` (RW)
307+
1: future writes are ignored.
308+
267309
DPTF Power supply and Battery Interface
268310
----------------------------------------
269311

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
@@ -20816,7 +20816,7 @@ L: linux-pm@vger.kernel.org
2081620816
S: Maintained
2081720817
F: Documentation/driver-api/thermal/power_allocator.rst
2081820818
F: drivers/thermal/gov_power_allocator.c
20819-
F: include/trace/events/thermal_power_allocator.h
20819+
F: drivers/thermal/thermal_trace_ipa.h
2082020820

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

drivers/acpi/thermal.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
498498

499499
static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
500500
{
501-
struct acpi_thermal *tz = thermal->devdata;
501+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
502502
int result;
503503

504504
if (!tz)
@@ -516,7 +516,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
516516
static int thermal_get_trip_type(struct thermal_zone_device *thermal,
517517
int trip, enum thermal_trip_type *type)
518518
{
519-
struct acpi_thermal *tz = thermal->devdata;
519+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
520520
int i;
521521

522522
if (!tz || trip < 0)
@@ -560,7 +560,7 @@ static int thermal_get_trip_type(struct thermal_zone_device *thermal,
560560
static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
561561
int trip, int *temp)
562562
{
563-
struct acpi_thermal *tz = thermal->devdata;
563+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
564564
int i;
565565

566566
if (!tz || trip < 0)
@@ -613,7 +613,7 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
613613
static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
614614
int *temperature)
615615
{
616-
struct acpi_thermal *tz = thermal->devdata;
616+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
617617

618618
if (tz->trips.critical.flags.valid) {
619619
*temperature = deci_kelvin_to_millicelsius_with_offset(
@@ -628,7 +628,7 @@ static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
628628
static int thermal_get_trend(struct thermal_zone_device *thermal,
629629
int trip, enum thermal_trend *trend)
630630
{
631-
struct acpi_thermal *tz = thermal->devdata;
631+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
632632
enum thermal_trip_type type;
633633
int i;
634634

@@ -670,7 +670,7 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
670670

671671
static void acpi_thermal_zone_device_hot(struct thermal_zone_device *thermal)
672672
{
673-
struct acpi_thermal *tz = thermal->devdata;
673+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
674674

675675
acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
676676
dev_name(&tz->device->dev),
@@ -679,7 +679,7 @@ static void acpi_thermal_zone_device_hot(struct thermal_zone_device *thermal)
679679

680680
static void acpi_thermal_zone_device_critical(struct thermal_zone_device *thermal)
681681
{
682-
struct acpi_thermal *tz = thermal->devdata;
682+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
683683

684684
acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
685685
dev_name(&tz->device->dev),
@@ -693,7 +693,7 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
693693
bool bind)
694694
{
695695
struct acpi_device *device = cdev->devdata;
696-
struct acpi_thermal *tz = thermal->devdata;
696+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
697697
struct acpi_device *dev;
698698
acpi_handle handle;
699699
int i;
@@ -842,7 +842,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
842842
goto acpi_bus_detach;
843843

844844
dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
845-
tz->thermal_zone->id);
845+
thermal_zone_device_id(tz->thermal_zone));
846846

847847
return 0;
848848

drivers/ata/ahci_imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static int __sata_ahci_read_temperature(void *dev, int *temp)
418418

419419
static int sata_ahci_read_temperature(struct thermal_zone_device *tz, int *temp)
420420
{
421-
return __sata_ahci_read_temperature(tz->devdata, temp);
421+
return __sata_ahci_read_temperature(thermal_zone_device_priv(tz), temp);
422422
}
423423

424424
static ssize_t sata_ahci_show_temp(struct device *dev,

0 commit comments

Comments
 (0)