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 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
 
 additionalProperties: false
 
@@ -125,7 +105,7 @@ examples:
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
     adc: adc@10059000 {
-      compatible = "renesas,r9a07g044-adc", "renesas,rzg2l-adc";
+      compatible = "renesas,r9a07g043-adc", "renesas,rzg2l-adc";

$ make ARCH=arm64 DT_CHECKER_FLAGS=-m DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml CROSS_COMPILE=~/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- dt_binding_check -j8
  LINT    Documentation/devicetree/bindings
  DTEX    Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dts
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  DTC     Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dtb
  CHECK   Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dtb

Cheers,
Biju





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux