Re: [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios
From: Krzysztof Kozlowski
Date: Fri Feb 13 2026 - 03:11:58 EST
On Thu, Feb 12, 2026 at 07:19:54PM +0100, Taha Ed-Dafili wrote:
> The AD5504 output range (0-30V or 0-60V) is determined by the R_SEL pin.
>
> Add `adi,output-range-volts` and `adi,output-range-gpios` to describe
> this hardware state, using `allOf` to enforce mutual exclusivity.
> Also add `vlogic-supply`, `clear-gpios`, and `ldac-gpios` to complete
> the hardware description.
>
> Suggested-by: David Lechner <dlechner@xxxxxxxxxxxx>
> Signed-off-by: Taha Ed-Dafili <0rayn.dev@xxxxxxxxx>
> ---
> .../bindings/iio/dac/adi,ad5504.yaml | 38 +++++++++++++++++++
> 1 file changed, 38 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> index 9c2c038683b4..3e832e501b0e 100644
> --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> @@ -27,12 +27,50 @@ properties:
> maxItems: 1
>
> vcc-supply: true
> + vlogic-supply: true
> +
> + adi,output-range-volts:
Use proper property unit suffix, see dt-schema.
And really, you should have checked - you already have properties for
this! See dac schema.
> + description:
> + Hard-wired /R_SEL pin state. 30 V when pin is high and 60 V when
> + pin is low.
> + $ref: /schemas/types.yaml#/definitions/uint32
> + enum: [30, 60]
> + default: 60
> +
> + adi,output-range-gpios:
So another same roperty? If you looked around you would find
adi,range-gpios, which would be better than multiplying properties.
Anyway, gpios do not take vendor prefixes, so you want range-sel-gpios
or range-gpios. I guess the latter.
> + description:
> + GPIO connected to the R_SEL pin to select the output voltage range.
> + maxItems: 1
> +
> + clear-gpios:
> + description: GPIO that controls the /CLR pin (active low).
> + maxItems: 1
> +
> + ldac-gpios:
> + description: GPIO that controls the /LDAC pin (active low).
> + maxItems: 1
>
> additionalProperties: false
>
> required:
> - compatible
> - reg
> + - vcc-supply
> +
> +allOf:
allOf:
- not:
required:
- foo
- bar
Should give you exactly same result, with less code.
> + - if:
> + required:
> + - adi,output-range-gpios
> + then:
> + properties:
> + adi,output-range-volts: false
> +
> + - if:
> + required:
> + - adi,output-range-volts
> + then:
> + properties:
> + adi,output-range-gpios: false
>
> examples:
> - |
> --
> 2.47.3
>