[PATCH 4/9] dt-bindings: gpio: change items restriction of clock for rockchip,gpio-bank

Rob Herring robh+dt at kernel.org
Wed Jun 23 10:24:50 PDT 2021


On Tue, Jun 22, 2021 at 7:02 AM Heiko Stübner <heiko at sntech.de> wrote:
>
> Hi Jay,
>
> Am Freitag, 18. Juni 2021, 08:24:44 CEST schrieb Jianqun Xu:
> > From: Liang Chen <cl at rock-chips.com>
> >
> > The clock property need 2 items on some rockchip chips.
> >
> > Signed-off-by: Liang Chen <cl at rock-chips.com>
> > ---
> >  .../devicetree/bindings/gpio/rockchip,gpio-bank.yaml         | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml b/Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml
> > index d993e002cebe..0d62c28fb58d 100644
> > --- a/Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml
> > +++ b/Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml
> > @@ -22,7 +22,10 @@ properties:
> >      maxItems: 1
> >
> >    clocks:
> > -    maxItems: 1
> > +    minItems: 1
> > +    items:
> > +      - description: APB interface clock source
> > +      - description: GPIO debounce reference clock source
>
> as said in a previous mail, please adapt this to use clock-names for the
> two clock variant. Maybe something like
>
> clocks:
>   minItems: 1
>   maxItems: 2

While this is fine, the version above with descriptions is better.

> clock-names:
>   minItems: 1
>   maxItems: 2

Don't need maxItems here. Implied by 'items' length.

>   items:
>     - const: apb_pclk
>     - const: debounce
>
> if:
>    properties:
>      clocks:
>        items:
>          const: 2

This says clocks must have values of 2. You want this:

clocks:
  minItems: 2

Note that is condition will also be true if 'clocks' is not present. I
assume it's required elsewhere.

> then:
>    required:
>     - clock-names
>
> [not yet sure if that works]



More information about the Linux-rockchip mailing list