* [PATCH v1 11/12] dt-bindings: thermal: Describe multi-source zone aggregation
[not found] <20261119094706.3439040-1-daniel.lezcano@oss.qualcomm.com>
@ 2026-11-19 9:46 ` Daniel Lezcano
0 siblings, 0 replies; only message in thread
From: Daniel Lezcano @ 2026-11-19 9:46 UTC (permalink / raw)
To: daniel.lezcano, rafael
Cc: Zhang Rui, Lukasz Luba, Rob Herring, Krzysztof Kozlowski,
Anvesh Jain P, Ulf Hansson, linux-pm, Daniel Lezcano,
Conor Dooley,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
Allow multiple hardware thermal sensor references and associate supplied
coefficients positionally with those references. Use signed cells to
represent existing negative calibration values and aggregate offsets.
Document approximate averaging when multi-source coefficients are absent,
with unity gain for one source. Explicit multi-source multipliers retain
the unscaled affine interpretation and are not normalized. Require
nonzero explicit multipliers to distinguish supplied values from the
core initializer default request.
Preserve existing single-source sensor-specific slope and offset
interpretations, including zero values and driver-specific scaling.
Add examples of averaging and explicit signed multi-source combinations.
Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
---
.../bindings/thermal/thermal-zones.yaml | 46 ++++++++++++++++---
1 file changed, 39 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
index 72e419124f98..10cf1fb8cb9a 100644
--- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
+++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
@@ -95,10 +95,13 @@ patternProperties:
thermal-sensors:
$ref: /schemas/types.yaml#/definitions/phandle-array
- maxItems: 1
- description:
- The thermal sensor phandle and sensor specifier used to monitor this
- thermal zone.
+ description: |
+ A list of hardware thermal sensor provider phandles and sensor
+ specifiers used to monitor this thermal zone. Each entry uses the
+ number of specifier cells defined by its provider's
+ #thermal-sensor-cells. Multiple entries describe an aggregation of
+ the corresponding source zone temperatures. Thermal zone nodes are
+ not referenced by this property.
coefficients:
$ref: /schemas/types.yaml#/definitions/int32-array
@@ -110,9 +113,23 @@ patternProperties:
z = c0 * x0 + c1 * x1 + ... + c(n-1) * x(n-1) + cn
where c0, c1, .., cn are the coefficients.
- Coefficients default to 1 in case this property is not specified. The
- coefficients are ordered and are matched with sensors by means of the
- sensor ID. Additional coefficients are interpreted as constant offset.
+ For multiple sources, the first n coefficients correspond to entries
+ in thermal-sensors in list order, not to provider-specific sensor IDs.
+ Supply all n multipliers, optionally followed by the constant offset
+ in millicelsius. Multipliers are signed nonzero unscaled integers;
+ there is no implicit divisor or normalization for supplied values.
+ An omitted offset is zero.
+
+ When coefficients are absent for a multi-source zone, the temperature
+ is the approximate arithmetic mean of the source zone temperatures.
+ Contributions are distributed as evenly as possible in source order
+ with a total gain of one. A single source consequently has a default
+ multiplier of one.
+
+ Existing single-source hardware zones retain their sensor-specific
+ slope and offset calibration interpretation, including signed or zero
+ values and any sensor-specific scaling. Their default slope is one
+ and default offset is zero.
sustainable-power:
$ref: /schemas/types.yaml#/definitions/uint32
@@ -339,6 +356,21 @@ examples:
/* ... */
+ // With no coefficients, use approximately equal contributions.
+ skin-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+ thermal-sensors = <&tsens0 1>, <&tsens0 5>;
+ };
+
+ // Explicit multipliers are not normalized: board = 2*T0 - T1 - 1000.
+ board-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+ thermal-sensors = <&tsens0 1>, <&tsens0 5>;
+ coefficients = <2 (-1) (-1000)>;
+ };
+
gpu-top-thermal {
polling-delay-passive = <250>;
polling-delay = <1000>;
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread