[PATCH 01/18] dt-bindings: iio: adc: ad4170-4: Restrict AD4170-4 only properties
From: Janani Sunil
Date: Thu Dec 03 2026 - 10:20:48 EST
The binding also covers AD4190-4 and AD4195-4, which lack the integrated
DAC, the XTAL1/XTAL2 pins and the third and fourth excitation current
sources of AD4170-4. Gate all three on the compatible so only AD4170-4
can select them.
AD4190-4 and AD4195-4 also cannot AC excite a bridge through their GPIO
outputs, their CHOP_ADC AC excitation codes being reserved. Require both
excitation pins and both nonzero excitation currents for AC excited
bridges on those devices, so that chopping of the IOUT0 and IOUT1
excitation currents remains the only AC excitation mode.
Fixes: 1b3cee41235b ("dt-bindings: iio: adc: Add AD4170-4")
Signed-off-by: Janani Sunil <janani.sunil@xxxxxxxxxx>
---
.../devicetree/bindings/iio/adc/adi,ad4170-4.yaml | 81 ++++++++++++++++++++--
1 file changed, 75 insertions(+), 6 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml
index da93213d12d4..ef5ca2ed8210 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml
@@ -134,17 +134,86 @@ properties:
maximum: 8
allOf:
- # Some devices don't have integrated DAC
+ # Only AD4170-4 has an integrated DAC. On the other devices, the DAC output is
+ # not routed to the multiplexer either, making mux input number 20 reserved.
- if:
properties:
compatible:
- contains:
- enum:
- - adi,ad4190-4
- - adi,ad4195-4
+ not:
+ contains:
+ const: adi,ad4170-4
then:
properties:
ldac-gpios: false
+ patternProperties:
+ "^channel@[0-9a-f]$":
+ properties:
+ diff-channels:
+ items:
+ anyOf:
+ - maximum: 19
+ - minimum: 21
+
+ # Only AD4170-4 can be clocked by an external crystal. The other devices
+ # have no XTAL1 and XTAL2 pins.
+ - if:
+ properties:
+ compatible:
+ not:
+ contains:
+ const: adi,ad4170-4
+ then:
+ properties:
+ clock-names:
+ const: ext-clk
+
+ # AD4170-4 has four excitation current sources. The other devices have two.
+ - if:
+ properties:
+ compatible:
+ not:
+ contains:
+ const: adi,ad4170-4
+ then:
+ patternProperties:
+ "^channel@[0-9a-f]$":
+ properties:
+ adi,excitation-pin-2: false
+ adi,excitation-pin-3: false
+ adi,excitation-current-2-microamp: false
+ adi,excitation-current-3-microamp: false
+
+ # Only AD4170-4 can AC excite a bridge with its GPIO outputs. On the other
+ # devices, an AC excited bridge needs chopped excitation currents on IOUT0
+ # and IOUT1, which must be nonzero. The driver also requires them to be equal.
+ - if:
+ properties:
+ compatible:
+ not:
+ contains:
+ const: adi,ad4170-4
+ then:
+ patternProperties:
+ "^channel@[0-9a-f]$":
+ if:
+ properties:
+ adi,sensor-type:
+ contains:
+ const: weighscale
+ required:
+ - adi,sensor-type
+ - adi,excitation-ac
+ then:
+ required:
+ - adi,excitation-pin-0
+ - adi,excitation-pin-1
+ - adi,excitation-current-0-microamp
+ - adi,excitation-current-1-microamp
+ properties:
+ adi,excitation-current-0-microamp:
+ minimum: 1
+ adi,excitation-current-1-microamp:
+ minimum: 1
# Require to specify the interrupt pin when using interrupts
- if:
@@ -198,7 +267,7 @@ patternProperties:
17: Internal temperature sensor
18: (AVDD-AVSS)/5
19: (IOVDD-DGND)/5
- 20: DAC output
+ 20: DAC output (AD4170-4 only)
21: ALDO
22: DLDO
23: AVSS
--
2.43.0