Re: [PATCH v2 1/2] dt-bindings: iio: dac: add adi,ad5754.yaml

From: Krzysztof Kozlowski
Date: Fri Nov 04 2022 - 13:50:55 EST


On 04/11/2022 13:23, Ciprian Regus wrote:
> Add devicetree bindings documentation for the AD5754 DAC driver.
>
> Signed-off-by: Ciprian Regus <ciprian.regus@xxxxxxxxxx>

Thank you for your patch. There is something to discuss/improve.
> +
> + '#size-cells':
> + const: 0
> +
> +patternProperties:
> + "^channel@([0-3])$":
> + type: object
> + description: Configurations for the DAC channels

additionalProperties: false

(on this level of indentation)

> +
> + properties:
> + reg:
> + description: Channel number
> + maxItems: 1
> +
> + adi,output-range-microvolt:
> + description: |
> + Voltage range of a channel as <minimum, maximum>.
> + oneOf:
> + - items:
> + - const: 0
> + - enum: [5000000, 10000000, 10800000]
> + - items:
> + - const: -5000000
> + - const: 5000000
> + - items:
> + - const: -10000000
> + - const: 10000000
> + - items:
> + - const: -10800000
> + - const: 10800000
> +
> + required:
> + - reg
> + - adi,output-range-microvolt
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - adi,ad5722
> + - adi,ad5732
> + - adi,ad5752
> + - adi,ad5722r
> + - adi,ad5732r
> + - adi,ad5752r
> + then:
> + patternProperties:
> + "^channel@([0-3])$":
> + type: object
> + properties:
> + reg:
> + description: Channel number
> + enum: [0, 1]
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - adi,ad5724
> + - adi,ad5734
> + - adi,ad5754
> + - adi,ad5724r
> + - adi,ad5734r
> + - adi,ad5754r
> + then:
> + patternProperties:
> + "^channel@([0-3])$":
> + type: object
> + properties:
> + reg:
> + description: Channel number
> + enum: [0, 1, 2, 3]
> +
> +required:
> + - compatible
> + - reg
> + - spi-max-frequency
> + - spi-cpol
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> +
> + spi {
> + status = "okay";

Drop status



Best regards,
Krzysztof