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 Rob,

Thanks for the feedback.

> Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL
> ADC
> 
> On Tue, May 10, 2022 at 05:54:59AM +0000, Biju Das wrote:
> > Hi Geert,
> >
> > Thanks for the feedback.
> >
> > > Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas
> > > RZ/G2UL ADC
> > >
> > > 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].
> >
> > OK.
> >
> > >
> > > > > > +          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:
> >
> > I just added similar check for RZ/G2UL by making channel@2-7 false and
> > But dt-binding checks is passing with channel@2-7 present in the example.
> Validation should fail, but it is passing. I will go with current
> implementation, as it does proper validation.
> >
> > +if:
> > +  properties:
> > +    compatible:
> > +      contains:
> > +        const: renesas,r9a07g043-adc
> > +  then:
> > +    properties:
> > +      channel@2: false
> > +      channel@3: false
> > +      channel@4: false
> > +      channel@5: false
> > +      channel@6: false
> > +      channel@7: false
> 
> patternProperties:
>   '^channel@[2-7]$': false

This fixes the validation for channels. But how do we restrict reg index between 0-1 ?
The below example is passing instead of failing.
      channel@0 {
        reg = <5>;
      };
 
The Current implementation restricts both channel and reg to [0-1] for RZ/G2UL.

Regards,
BIju




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux