mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Taha Ed-Dafili <0rayn.dev@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-mentees@lists.linuxfoundation.org, me@brighamcampbell.com,
	skhan@linuxfoundation.org
Subject: Re: [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios
Date: Fri, 13 Feb 2026 09:11:48 +0100	[thread overview]
Message-ID: <20260213-curvy-voracious-yak-cc13ec@quoll> (raw)
In-Reply-To: <20260212181955.42724-2-0rayn.dev@gmail.com>

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@baylibre.com>
> Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
> ---
>  .../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
> 

  reply	other threads:[~2026-02-13  8:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 18:19 [PATCH v1 0/2] iio: dac: ad5504: fix voltage scaling and add missing bindings Taha Ed-Dafili
2026-02-12 18:19 ` [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios Taha Ed-Dafili
2026-02-13  8:11   ` Krzysztof Kozlowski [this message]
2026-02-13 17:05     ` Taha Ed-Dafili
2026-02-13 17:07       ` Krzysztof Kozlowski
2026-02-12 18:19 ` [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation Taha Ed-Dafili
2026-02-12 20:15   ` Andy Shevchenko
2026-02-13 17:05     ` Taha Ed-Dafili
2026-02-15 18:03       ` Jonathan Cameron
2026-02-15 18:05     ` Jonathan Cameron
2026-02-16  7:21       ` Andy Shevchenko

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=20260213-curvy-voracious-yak-cc13ec@quoll \
    --to=krzk@kernel.org \
    --cc=0rayn.dev@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mentees@lists.linuxfoundation.org \
    --cc=me@brighamcampbell.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.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

all inboxes | Powered by JetHome®