[PATCH v2 1/2] dt-bindings: hwmon: national,lm90: Fix channel constraints for temperature offset

From: Flaviu Nistor

Date: Wed Aug 26 2026 - 14:49:01 EST


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 <flaviu.nistor@xxxxxxxxx>
---
Changes in v2:
- Use else statement in if/then block as suggested by Conor Dooley.
- Link to v1: https://lore.kernel.org/all/20260824183900.8983-2-flaviu.nistor@xxxxxxxxx/

.../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
--
2.34.1