devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Ciprian Regus <ciprian.regus@analog.com>
Cc: <krzysztof.kozlowski+dt@linaro.org>, <robh+dt@kernel.org>,
	<linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] dt-bindings: iio: dac: add adi,ad5754.yaml
Date: Sat, 5 Nov 2022 12:55:10 +0000	[thread overview]
Message-ID: <20221105125510.313f2037@jic23-huawei> (raw)
In-Reply-To: <20221104172343.617690-2-ciprian.regus@analog.com>

On Fri, 4 Nov 2022 19:23:42 +0200
Ciprian Regus <ciprian.regus@analog.com> wrote:

> Add devicetree bindings documentation for the AD5754 DAC driver.
> 
> Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
Hi Ciprian,

To add to Krzysztof's detailed review, a request for a bit more
variation in the example.

> ---
> changes in v2:
>  - dropped "device driver" from the title.
>  - added the vendor prefix to the 'output-range-microvolt' property.
>  - fixed example indentation (4 spaces).
>  .../bindings/iio/dac/adi,ad5754.yaml          | 182 ++++++++++++++++++
>  1 file changed, 182 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5754.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5754.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5754.yaml
> new file mode 100644
> index 000000000000..4c9c5ba90931
...

> +patternProperties:
> +  "^channel@([0-3])$":
> +    type: object
> +    description: Configurations for the DAC channels
> +
> +    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
> +
...

> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    spi {
> +        status = "okay";
> +
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        dac@0 {
> +            compatible = "adi,ad5754r";
> +            reg = <0>;
> +            spi-max-frequency = <1000000>;
> +            spi-cpol;
> +
> +            clr-gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
> +
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            channel@0 {
> +                reg = <0>;
> +                adi,output-range-microvolt = <0 5000000>;
> +            };
> +            channel@1 {
> +                reg = <1>;
> +                adi,output-range-microvolt = <0 5000000>;

Nice to have rather than necessary, but maybe the example could
include a few different options from those available for this
property?

> +            };
> +            channel@2 {
> +                reg = <2>;
> +                adi,output-range-microvolt = <0 5000000>;
> +            };
> +            channel@3 {
> +                reg = <3>;
> +                adi,output-range-microvolt = <0 5000000>;
> +            };
> +        };
> +    };


  parent reply	other threads:[~2022-11-05 12:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 17:23 [PATCH v2 0/2] Add support for the AD5754 DAC Ciprian Regus
2022-11-04 17:23 ` [PATCH v2 1/2] dt-bindings: iio: dac: add adi,ad5754.yaml Ciprian Regus
2022-11-04 17:50   ` Krzysztof Kozlowski
2022-11-05 12:55   ` Jonathan Cameron [this message]
2022-11-04 17:23 ` [PATCH v2 2/2] drivers: iio: dac: Add AD5754 DAC driver Ciprian Regus
2022-11-05 13:20   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221105125510.313f2037@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=ciprian.regus@analog.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).