Re: [PATCH v6 2/3] dt-bindings: iio: adc: add adi,max11410.yaml

From: Krzysztof Kozlowski
Date: Mon Oct 03 2022 - 02:55:41 EST


On 02/10/2022 15:06, Jonathan Cameron wrote:
>>> + interrupts:
>>> + minItems: 1
>>> + maxItems: 2
>>> +
>>> + interrupt-names:
>>> + description: Name of the gpio pin of max11410 used for IRQ
>>> + items:
>>> + - enum:
>>> + - gpio0
>>> + - gpio1
>>
>> This is wrong. You said in interrupts you can have two items, but here
>> you list only one. I don't know what do you want to achieve here.
>
> Aim is 0, 1 or 2 interrupts + knowing which ones they are.
> Device has two pins that have very similar functionality and board
> designers are likely to pick one or the two more or less at random depending
> on which trace is easier to route.
>
> So my guess is this needs minItems, maxItems.

The current choice allows 0 or 1 interrupt. If you want 0-2 then it
should be:

minItems: 1
items:
- enum: [gpio0, gpio1]
- const: gpio1

This one would also work:

minItems: 1
maxItems: 2
items:
enum: [gpio0, gpio1]

but the order of interrupts should be rather defined, so I would prefer
first.


Best regards,
Krzysztof