Re: [PATCH v2 1/5] dt-bindings: iio: dac: ad5504: add output-range and missing gpios

From: Nuno Sá

Date: Wed Mar 11 2026 - 07:58:44 EST


On Tue, 2026-03-10 at 17:48 +0000, Taha Ed-Dafili wrote:
> The AD5504 output range (0-30V or 0-60V) is determined by the R_SEL pin.
>
> Use standard output-range-microvolt and range-sel-gpios properties to
> describe the hardware configuration of the R_SEL pin. Ensure mutual
> exclusivity using the not/required logic. Additionally, add missing
> vlogic-supply, clear-gpios, ldac-gpios and datasheet links, and provide
> a complete usage example.
>
> Suggested-by: David Lechner <dlechner@xxxxxxxxxxxx>
> Suggested-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
> Signed-off-by: Taha Ed-Dafili <0rayn.dev@xxxxxxxxx>
> ---
>  .../bindings/iio/dac/adi,ad5504.yaml          | 40 ++++++++++++++++++-
>  1 file changed, 39 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> b/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> index 9c2c038683b4..c0b2d470949a 100644
> --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> @@ -10,8 +10,10 @@ maintainers:
>    - Lars-Peter Clausen <lars@xxxxxxxxxx>
>    - Jonathan Cameron <jic23@xxxxxxxxxx>
>  
> -description:
> +description: |
>    High voltage (up to 60V) DACs with temperature sensor alarm function
>https://www.analog.com/media/en/technical-documentation/data-sheets/ad5504.pdf
>https://www.analog.com/media/en/technical-documentation/data-sheets/ad5501.pdf
>  
>  properties:
>    compatible:
> @@ -27,16 +29,48 @@ properties:
>      maxItems: 1
>  
>    vcc-supply: true
> +  vlogic-supply: true
> +
> +  output-range-microvolt:
> +    description: |
> +      Specify the channel output full scale range. The R_SEL pin
> +      determines if the range is 0-30V or 0-60V.
> +    items:
> +      - const: 0
> +      - enum: [30000000, 60000000]
> +    default: [0, 60000000]
> +
> +  range-sel-gpios:
> +    description:
> +      GPIO connected to the R_SEL pin to select the output voltage range.
> +    maxItems: 1
> +
> +  clear-gpios:

I would match the datasheet name. So clr.

- Nuno Sá
> +    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:
> +  - not:
> +      required:
> +        - range-sel-gpios
> +        - output-range-microvolt
>  
>  examples:
>    - |
>      #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/gpio/gpio.h>
> +
>      spi {
>          #address-cells = <1>;
>          #size-cells = <0>;
> @@ -45,6 +79,10 @@ examples:
>              compatible = "adi,ad5504";
>              vcc-supply = <&dac_vcc>;
>              interrupts = <55 IRQ_TYPE_EDGE_FALLING>;
> +
> +            output-range-microvolt = <0 60000000>;
> +            clear-gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
> +            ldac-gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
>          };
>      };
>  ...