Skip to content

Commit 5d26c17

Browse files
committed
Merge tag 'thermal-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal updates from Daniel Lezcano: - Use the newly introduced 'hot' and 'critical' ops for the acpi thermal driver (Daniel Lezcano) - Remove the notify ops as it is no longer used (Daniel Lezcano) - Remove the 'forced passive' option and the unused bind/unbind functions (Daniel Lezcano) - Remove the THERMAL_TRIPS_NONE and the code cleanup around this macro (Daniel Lezcano) - Rework the delays to make them pre-computed instead of computing them again and again at each polling interval (Daniel Lezcano) - Remove the pointless 'thermal_zone_device_reset' function (Daniel Lezcano) - Use the critical and hot ops to prevent an unexpected system shutdown on int340x (Kai-Heng Feng) - Make the cooling device state private to the thermal subsystem (Daniel Lezcano) - Prevent to use not-power-aware actor devices with the power allocator governor (Lukasz Luba) - Remove 'zx' and 'tango' support along with the corresponding platforms (Arnd Bergman) - Fix several issues on the Omap thermal driver (Tony Lindgren) - Add support for adc-tm5 PMIC thermal monitor for Qcom platforms (Dmitry Baryshkov) - Fix an initialization loop in the adc-tm5 (Colin Ian King) - Fix a return error check in the cpufreq cooling device (Viresh Kumar) * tag 'thermal-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (26 commits) thermal: cpufreq_cooling: freq_qos_update_request() returns < 0 on error thermal: qcom: Fix comparison with uninitialized variable channels_available thermal: qcom: add support for adc-tm5 PMIC thermal monitor dt-bindings: thermal: qcom: add adc-thermal monitor bindings thermal: ti-soc-thermal: Use non-inverted define for omap4 thermal: ti-soc-thermal: Simplify polling with iopoll thermal: ti-soc-thermal: Fix stuck sensor with continuous mode for 4430 thermal: ti-soc-thermal: Skip pointless register access for dra7 thermal/drivers/zx: Remove zx driver thermal/drivers/tango: Remove tango driver thermal: power allocator: fail binding for non-power actor devices thermal/core: Make cooling device state change private thermal: intel: pch: Fix unexpected shutdown at critical temperature thermal: int340x: Fix unexpected shutdown at critical temperature thermal/core: Remove pointless thermal_zone_device_reset() function thermal/core: Remove ms based delay fields thermal/core: Use precomputed jiffies for the polling thermal/core: Precompute the delays from msecs to jiffies thermal/core: Remove unused macro THERMAL_TRIPS_NONE thermal/core: Remove THERMAL_TRIPS_NONE test ...
2 parents b996c10 + a51afb1 commit 5d26c17

33 files changed

+978
-795
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/qcom-spmi-adc-tm5.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm's SPMI PMIC ADC Thermal Monitoring
8+
maintainers:
9+
- Dmitry Baryshkov <[email protected]>
10+
11+
properties:
12+
compatible:
13+
const: qcom,spmi-adc-tm5
14+
15+
reg:
16+
maxItems: 1
17+
18+
interrupts:
19+
maxItems: 1
20+
21+
"#thermal-sensor-cells":
22+
const: 1
23+
description:
24+
Number of cells required to uniquely identify the thermal sensors. Since
25+
we have multiple sensors this is set to 1
26+
27+
"#address-cells":
28+
const: 1
29+
30+
"#size-cells":
31+
const: 0
32+
33+
qcom,avg-samples:
34+
$ref: /schemas/types.yaml#/definitions/uint32
35+
description: Number of samples to be used for measurement.
36+
enum:
37+
- 1
38+
- 2
39+
- 4
40+
- 8
41+
- 16
42+
default: 1
43+
44+
qcom,decimation:
45+
$ref: /schemas/types.yaml#/definitions/uint32
46+
description: This parameter is used to decrease ADC sampling rate.
47+
Quicker measurements can be made by reducing decimation ratio.
48+
enum:
49+
- 250
50+
- 420
51+
- 840
52+
default: 840
53+
54+
patternProperties:
55+
"^([-a-z0-9]*)@[0-7]$":
56+
type: object
57+
description:
58+
Represent one thermal sensor.
59+
60+
properties:
61+
reg:
62+
$ref: /schemas/types.yaml#/definitions/uint32
63+
description: Specify the sensor channel. There are 8 channels in PMIC5's ADC TM
64+
minimum: 0
65+
maximum: 7
66+
67+
io-channels:
68+
description:
69+
From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor
70+
71+
qcom,ratiometric:
72+
$ref: /schemas/types.yaml#/definitions/flag
73+
description:
74+
Channel calibration type.
75+
If this property is specified VADC will use the VDD reference
76+
(1.875V) and GND for channel calibration. If property is not found,
77+
channel will be calibrated with 0V and 1.25V reference channels,
78+
also known as absolute calibration.
79+
80+
qcom,hw-settle-time-us:
81+
$ref: /schemas/types.yaml#/definitions/uint32
82+
description: Time between AMUX getting configured and the ADC starting conversion.
83+
enum: [15, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000]
84+
85+
qcom,pre-scaling:
86+
$ref: /schemas/types.yaml#/definitions/uint32-array
87+
description: Used for scaling the channel input signal before the
88+
signal is fed to VADC. The configuration for this node is to know the
89+
pre-determined ratio and use it for post scaling. It is a pair of
90+
integers, denoting the numerator and denominator of the fraction by
91+
which input signal is multiplied. For example, <1 3> indicates the
92+
signal is scaled down to 1/3 of its value before ADC measurement. If
93+
property is not found default value depending on chip will be used.
94+
items:
95+
- const: 1
96+
- enum: [ 1, 3, 4, 6, 20, 8, 10 ]
97+
98+
required:
99+
- reg
100+
- io-channels
101+
102+
additionalProperties:
103+
false
104+
105+
required:
106+
- compatible
107+
- reg
108+
- interrupts
109+
- "#address-cells"
110+
- "#size-cells"
111+
- "#thermal-sensor-cells"
112+
113+
additionalProperties: false
114+
115+
examples:
116+
- |
117+
#include <dt-bindings/iio/qcom,spmi-vadc.h>
118+
#include <dt-bindings/interrupt-controller/irq.h>
119+
spmi_bus {
120+
#address-cells = <1>;
121+
#size-cells = <0>;
122+
pm8150b_adc: adc@3100 {
123+
reg = <0x3100>;
124+
compatible = "qcom,spmi-adc5";
125+
#address-cells = <1>;
126+
#size-cells = <0>;
127+
#io-channel-cells = <1>;
128+
129+
/* Other propreties are omitted */
130+
conn-therm@4f {
131+
reg = <ADC5_AMUX_THM3_100K_PU>;
132+
qcom,ratiometric;
133+
qcom,hw-settle-time = <200>;
134+
};
135+
};
136+
137+
pm8150b_adc_tm: adc-tm@3500 {
138+
compatible = "qcom,spmi-adc-tm5";
139+
reg = <0x3500>;
140+
interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
141+
#thermal-sensor-cells = <1>;
142+
#address-cells = <1>;
143+
#size-cells = <0>;
144+
145+
conn-therm@0 {
146+
reg = <0>;
147+
io-channels = <&pm8150b_adc ADC5_AMUX_THM3_100K_PU>;
148+
qcom,ratiometric;
149+
qcom,hw-settle-time-us = <200>;
150+
};
151+
};
152+
};
153+
...

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

Lines changed: 0 additions & 17 deletions
This file was deleted.

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

Lines changed: 0 additions & 116 deletions
This file was deleted.

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -520,19 +520,6 @@ available_policies
520520

521521
RW, Optional
522522

523-
passive
524-
Attribute is only present for zones in which the passive cooling
525-
policy is not supported by native thermal driver. Default is zero
526-
and can be set to a temperature (in millidegrees) to enable a
527-
passive trip point for the zone. Activation is done by polling with
528-
an interval of 1 second.
529-
530-
Unit: millidegrees Celsius
531-
532-
Valid values: 0 (disabled) or greater than 1000
533-
534-
RW, Optional
535-
536523
emul_temp
537524
Interface to set the emulated temperature method in thermal zone
538525
(sensor). After setting this temperature, the thermal zone may pass

drivers/acpi/thermal.c

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -670,27 +670,24 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
670670
return 0;
671671
}
672672

673-
674-
static int thermal_notify(struct thermal_zone_device *thermal, int trip,
675-
enum thermal_trip_type trip_type)
673+
static void acpi_thermal_zone_device_hot(struct thermal_zone_device *thermal)
676674
{
677-
u8 type = 0;
678675
struct acpi_thermal *tz = thermal->devdata;
679676

680-
if (trip_type == THERMAL_TRIP_CRITICAL)
681-
type = ACPI_THERMAL_NOTIFY_CRITICAL;
682-
else if (trip_type == THERMAL_TRIP_HOT)
683-
type = ACPI_THERMAL_NOTIFY_HOT;
684-
else
685-
return 0;
686-
687677
acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
688-
dev_name(&tz->device->dev), type, 1);
678+
dev_name(&tz->device->dev),
679+
ACPI_THERMAL_NOTIFY_HOT, 1);
680+
}
689681

690-
if (trip_type == THERMAL_TRIP_CRITICAL && nocrt)
691-
return 1;
682+
static void acpi_thermal_zone_device_critical(struct thermal_zone_device *thermal)
683+
{
684+
struct acpi_thermal *tz = thermal->devdata;
692685

693-
return 0;
686+
acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
687+
dev_name(&tz->device->dev),
688+
ACPI_THERMAL_NOTIFY_CRITICAL, 1);
689+
690+
thermal_zone_device_critical(thermal);
694691
}
695692

696693
static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
@@ -760,25 +757,6 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
760757
}
761758
}
762759

763-
for (i = 0; i < tz->devices.count; i++) {
764-
handle = tz->devices.handles[i];
765-
status = acpi_bus_get_device(handle, &dev);
766-
if (ACPI_SUCCESS(status) && (dev == device)) {
767-
if (bind)
768-
result = thermal_zone_bind_cooling_device
769-
(thermal, THERMAL_TRIPS_NONE,
770-
cdev, THERMAL_NO_LIMIT,
771-
THERMAL_NO_LIMIT,
772-
THERMAL_WEIGHT_DEFAULT);
773-
else
774-
result = thermal_zone_unbind_cooling_device
775-
(thermal, THERMAL_TRIPS_NONE,
776-
cdev);
777-
if (result)
778-
goto failed;
779-
}
780-
}
781-
782760
failed:
783761
return result;
784762
}
@@ -805,7 +783,8 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
805783
.get_trip_temp = thermal_get_trip_temp,
806784
.get_crit_temp = thermal_get_crit_temp,
807785
.get_trend = thermal_get_trend,
808-
.notify = thermal_notify,
786+
.hot = acpi_thermal_zone_device_hot,
787+
.critical = acpi_thermal_zone_device_critical,
809788
};
810789

811790
static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)

drivers/hwmon/pwm-fan.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ static int pwm_fan_probe(struct platform_device *pdev)
458458
return ret;
459459
}
460460
ctx->cdev = cdev;
461-
thermal_cdev_update(cdev);
462461
}
463462

464463
return 0;

0 commit comments

Comments
 (0)