From 61379d4d883cf92a53a7b7294aaa4ff8fb4ce276 Mon Sep 17 00:00:00 2001 From: Flaviu Nistor Date: Wed, 26 Aug 2026 21:47:48 +0300 Subject: [PATCH] dt-bindings: hwmon: national,lm90: Fix channel constraints for temperature offset Limit temperature-offset-millicelsius to remote channels only, since channel 0 is local and this property does not apply to it. Channel 2 is only valid on devices with two remote sensors, so reject channel 2 for compatibles that do not support a second remote channel. Signed-off-by: Flaviu Nistor Acked-by: Conor Dooley Link: https://patch.msgid.link/20260826184750.4798-2-flaviu.nistor@gmail.com Signed-off-by: Guenter Roeck --- .../bindings/hwmon/national,lm90.yaml | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml index 164068ba069d..a8b2a24501b3 100644 --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml @@ -113,6 +113,23 @@ allOf: properties: ti,extended-range-enable: false + - if: + not: + properties: + compatible: + contains: + enum: + - adi,adt7481 + - dallas,max6695 + - dallas,max6696 + then: + patternProperties: + "^channel@[0-1]$": + properties: + reg: + enum: [0, 1] + "channel@2": false + - if: properties: compatible: @@ -134,6 +151,11 @@ allOf: "^channel@([0-2])$": properties: temperature-offset-millicelsius: false + else: + patternProperties: + "channel@0": + properties: + temperature-offset-millicelsius: false - if: properties: @@ -149,7 +171,7 @@ allOf: - onnn,nct1008 then: patternProperties: - "^channel@([0-2])$": + "^channel@([1-2])$": properties: temperature-offset-millicelsius: maximum: 127750 @@ -172,7 +194,7 @@ allOf: - winbond,w83l771 then: patternProperties: - "^channel@([0-2])$": + "^channel@([1-2])$": properties: temperature-offset-millicelsius: maximum: 127875 @@ -186,7 +208,7 @@ allOf: - ti,tmp461 then: patternProperties: - "^channel@([0-2])$": + "^channel@([1-2])$": properties: temperature-offset-millicelsius: maximum: 127937