Re: [PATCH 1/2] dt-bindings: iio: dac: Document Analog Devices AD5413 single-channel DAC

From: Jonathan Cameron

Date: Fri Oct 16 2026 - 19:04:16 EST


On Sat, 17 Oct 2026 03:23:53 +0800
Bruce Tsao via B4 Relay <devnull+bruce.tsao.analog.com@xxxxxxxxxx> wrote:

> From: Bruce Tsao <bruce.tsao@xxxxxxxxxx>
>
> Document the devicetree bindings for the Analog Devices AD5413, a
> single-channel precision DAC controlled via SPI. The device supports
> voltage or current output modes and programmable slew-rate control.
>
> Signed-off-by: Bruce Tsao <bruce.tsao@xxxxxxxxxx>
Hi Bruce,

Welcome to IIO.

> ---
> .../devicetree/bindings/iio/dac/adi,ad5413.yaml | 101 +++++++++++++++++++++
> 1 file changed, 101 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5413.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5413.yaml
> new file mode 100644
> index 000000000000..74e869304aab
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5413.yaml
> @@ -0,0 +1,101 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/dac/adi,ad5413.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD5413 DAC
> +
> +description:
> + Analog Devices AD5413 is a single-channel precision DAC supporting voltage
> + or current output modes with programmable slew-rate control.
> + The output mode is selected via the adi,chan-current-mode property.
> + Optional reset GPIO may be provided.

New line per sentence isn't really adding anything. I'd reflow this
a a paragraph.

> +
> +maintainers:
> + - bruce.tsao@xxxxxxxxxx
> +
> +properties:
> + compatible:
> + const: adi,ad5413
> +
> + spi-max-frequency:
> + maximum: 50000000
> +
> + spi-cpha: true
> +
> + spi-cpol: false
> +
> + reset-gpios:
> + maxItems: 1
> + description: Optional reset GPIO (active low).
From a quick glance looks like we also have LDAC SYNC and FAULT.
+ a reference out that probably wants to be modeled as a supply.

Upshot is this looks like an incomplete binding and generally
we try to make them as complete as possible from the start, even
if the driver doesn't yet use everything.

> +
> + avdd-supply:
> + description: Analog positive supply (AVDD)
> +
> + dvdd-supply:
> + description: Digital positive supply (DVDD)
> +
> + avss-supply:
> + description: Analog negative supply (AVSS)
> +
> + adi,chan-current-mode:
> + type: boolean
> + description: Select current output mode. If absent, voltage mode is used.

We have some existing dt bindings for multi mode channels on adi
parts. See adi,ch-func in various other bindings.
Whilst we've had various discussions about generalizing that to
a generic dac binding so far we haven't done so. Maybe now is the time...


> +
> + adi,slew-time-us:
> + description: Output digital slew control time in microseconds
> + minimum: 0
> + maximum: 1000000
> + default: 0
> +
> +required:
> + - compatible
> + - spi-cpha
> + - avdd-supply
> + - dvdd-supply
> + - avss-supply
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> +
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + dac@0 {
> + compatible = "adi,ad5413";
> + reg = <0>;
> + spi-max-frequency = <1000000>;
> + spi-cpha;
> + reset-gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
> + avdd-supply = <&avdd>;
> + dvdd-supply = <&dvdd>;
> + avss-supply = <&avss>;
> + adi,slew-time-us = <125>;
> + };
> + };
> +
> + - |
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + dac@0 {
> + compatible = "adi,ad5413";
> + reg = <0>;
> + spi-max-frequency = <1000000>;
> + spi-cpha;
> + avdd-supply = <&avdd>;
> + dvdd-supply = <&dvdd>;
> + avss-supply = <&avss>;
> +
> + adi,chan-current-mode;
> + };
> + };
>