Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Biju,

On Fri, May 6, 2022 at 10:40 AM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL
> > On Thu, May 5, 2022 at 8:40 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > > Document Renesas RZ/G2UL ADC bindings. RZ/G2UL ADC is almost identical
> > > to RZ/G2L, but it has 2 analog input channels compared to 8 channels
> > > on the RZ/G2L.
> > >
> > > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>

> > > --- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> > > @@ -74,18 +75,48 @@ patternProperties:
> > >        Represents the external channels which are connected to the ADC.
> > >
> > >      properties:
> > > -      reg:
> > > -        description: |
> > > -          The channel number. It can have up to 8 channels numbered from
> > 0 to 7.
> > > -        items:
> > > -          - minimum: 0
> > > -            maximum: 7
> > > -
> > > +      reg: true
> > >      required:
> > >        - reg
> > >
> > >      additionalProperties: false
> > >
> > > +allOf:
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            const: renesas,r9a07g043-adc
> > > +    then:
> > > +      patternProperties:
> > > +        "^channel@[0-7]$":
> >
> > [0-1]
>
> Looks like with this change, validation doesn't work as expected.

OK, keep it at [0-7].

> > > +          type: object
> > > +          properties:
> > > +            reg:
> > > +              description: |
> > > +                The channel number. It can have up to 2 channels
> > numbered from 0 to 1.
> > > +              items:
> > > +                - minimum: 0
> > > +                  maximum: 1
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            enum:
> > > +              - renesas,r9a07g044-adc
> > > +              - renesas,r9a07g054-adc
> > > +    then:
> > > +      patternProperties:
> > > +        "^channel@[0-7]$":
> > > +          type: object
> > > +          properties:
> > > +            reg:
> > > +              description: |
> > > +                The channel number. It can have up to 8 channels
> > numbered from 0 to 7.
> > > +              items:
> > > +                - minimum: 0
> > > +                  maximum: 7
> > > +
> > >  additionalProperties: false
> > >
> > >  examples:
> >
> > The rest LGTM, but I'm wondering if more of the channel subnodes
> > description can be factored out to the common part?
>
> You mean above reg: true?? ie, add as part of the below description??
>
> type: object
>     description: |
>       Represents the external channels which are connected to the ADC.

I think I've found a solution while converting the R-Car Gen2
USB PHY bindings.  You can mark channels 3-7 false on RZ/G2UL,
cfr. the second channel on RZ/G1C in "[PATCH] dt-bindings:
phy: renesas,rcar-gen2-usb-phy: Convert to json-schema"
https://lore.kernel.org/r/8e48edc5e7b65f8dfd8b76c583e0265b9b97e62b.1652099944.git.geert+renesas@xxxxxxxxx/

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux