Re: [PATCH] dt-bindings: thermal: Use signed integers for coefficients
From: Rob Herring
Date: Fri Nov 06 2026 - 15:08:15 EST
On Fri, Nov 06, 2026 at 02:03:24PM +0100, Krzysztof Kozlowski wrote:
> On Tue, Nov 03, 2026 at 10:43:57PM +0100, Daniel Lezcano wrote:
> > The coefficients property describes the coefficients of a linear
> > equation used to derive a thermal zone temperature. Both the slope
> > and the constant offset can be negative, and the thermal core stores
> > them as signed integers.
> >
> > Existing Device Trees already rely on signed values. OMAP4460 uses
> > an offset of -9301, while OMAP5 uses offsets of -1791 and -2992.
> > Broadcom platforms also use negative slopes. Declaring the property
> > as uint32-array does not represent these values correctly.
> >
> > Change the property type to int32-array so schema validation decodes
> > the cells as signed 32-bit integers, matching their intended meaning
> > and the thermal implementation. The cell width and binary encoding
> > remain unchanged, preserving compatibility with existing Device
> > Trees.
> >
> > Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones")
> > Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxxxxxxxx>
> > ---
> > Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> drivers/thermal/thermal_of.c still uses u32. Maybe we should have
> of_property_read_s32_array() wrapper so the binding can match the ABI
> code exactly?
>
> Rob?
Yes, please. I did a pass fixing type mismatches so it would be good to
not add new ones.
Rob