Re: [PATCH 16/38] dt-bindings: power: supply: tps65217: Convert to DT schema format

From: Sebastian Reichel
Date: Tue Mar 16 2021 - 12:21:25 EST


Hi Rob,

On Mon, Mar 15, 2021 at 12:33:23PM -0600, Rob Herring wrote:
> On Fri, Mar 12, 2021 at 8:44 AM Sebastian Reichel
> <sebastian.reichel@xxxxxxxxxxxxx> wrote:
> > + interrupts:
> > + minItems: 2
> > + maxItems: 2
>
> We've lost info that was in the original binding. You could do
> something like this:
>
> items:
> - description: USB charger
> const: 0
> - description: AC charger
> const: 1
>
> (Usually the interrupt values would be out of scope of the binding,
> but I guess here it makes some sense.)

I initially did this, but it did not work. I see the following for
dt_binding_check (dtbs_check triggers the same):

Documentation/devicetree/bindings/power/supply/tps65217-charger.example.dt.yaml: charger: interrupts:0: [0] is too short
From schema: Documentation/devicetree/bindings/power/supply/tps65217-charger.yaml
Documentation/devicetree/bindings/power/supply/tps65217-charger.example.dt.yaml: charger: interrupts: [[0], [1]] is too long
From schema: Documentation/devicetree/bindings/power/supply/tps65217-charger.yaml
Documentation/devicetree/bindings/power/supply/tps65217-charger.example.dt.yaml: charger: interrupts: Additional items are not allowed ([1] was unexpected)
From schema: Documentation/devicetree/bindings/power/supply/tps65217-charger.yaml

Seemed to be a limitation in the validation tool, so I just dropped
the extra information. If we do not want to loose information I can
add it to the description, or should the validation tool be fixed?
I suppose it's kind of unusual, that the binding can provide the
interrupt line numbers.

-- Sebastian

Attachment: signature.asc
Description: PGP signature