Re: [PATCH 1/5] dt-bindings: iio: adc: ad7380: add AD7389-4

From: Krzysztof Kozlowski
Date: Mon Apr 07 2025 - 02:42:27 EST


On Wed, Apr 02, 2025 at 09:39:43AM GMT, David Lechner wrote:
> On 4/2/25 3:25 AM, Krzysztof Kozlowski wrote:
> > On Tue, Apr 01, 2025 at 05:50:08PM -0500, David Lechner wrote:
> >> Add compatible and quirks for AD7389-4. This is essentially the same as
> >> AD7380-4 but instead of having no internal reference, it has no external
> >> reference voltage supply.
> >
> > So neither refio nor refin, but your schema says:
> >
> >> + then:
> >> + properties:
> >> + refio-supply: false
> >
> > So what about refin, which is also external reference?
>
> This is already handled by the existing if statement:
>
> - if:
> properties:
> compatible:
> enum:
> - adi,ad7380-4
> - adi,adaq4370-4
> - adi,adaq4380-4
> - adi,adaq4381-4
> then:
> properties:
> refio-supply: false
> required:
> - refin-supply
> else:
> properties:
> refin-supply: false

The way the if-then are organized there is not how I would expect, so
thus confusion. Each if: condition has else:, so to understand what
applies to given model one has to read everything!

And you add here second method - if without else.

This is supposed to be simple:
if:
- model_foo
then:
...

if:
- model_bar
then:
...

if:
- model_baz
then:
...


Best regards,
Krzysztof