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 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>
> > ---
> > v1->v2:
> >  * Started using generic compatible for RZ/G2UL and added SoC specific
> validation
> >    for channels.
> 
> Thanks for the update!
> 
> > --- 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.
Please see the logs

Test 1:- Update the current example with renesas,r9a07g043-adc and run dt-binding check,
         We get proper results.

biju@biju-VirtualBox:~/rzg2l-linux$ git diff
diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
index 2da3538a3543..a349e307f11e 100644
--- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
@@ -125,7 +125,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";
       reg = <0x10059000 0x400>;
       interrupts = <GIC_SPI 347 IRQ_TYPE_EDGE_RISING>;
       clocks = <&cpg CPG_MOD R9A07G044_ADC_ADCLK>,
biju@biju-VirtualBox:~/rzg2l-linux$ 

biju@biju-VirtualBox:~/rzg2l-linux$ 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
/home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dtb: adc@10059000: channel@2:reg:0:0: 2 is greater than the maximum of 1
	From schema: /home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
/home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dtb: adc@10059000: channel@3:reg:0:0: 3 is greater than the maximum of 1
	From schema: /home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
/home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dtb: adc@10059000: channel@4:reg:0:0: 4 is greater than the maximum of 1
	From schema: /home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
/home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dtb: adc@10059000: channel@5:reg:0:0: 5 is greater than the maximum of 1
	From schema: /home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
/home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dtb: adc@10059000: channel@6:reg:0:0: 6 is greater than the maximum of 1
	From schema: /home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
/home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.example.dtb: adc@10059000: channel@7:reg:0:0: 7 is greater than the maximum of 1
	From schema: /home/biju/rzg2l-linux/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
biju@biju-VirtualBox:~/rzg2l-linux$

Test2: Update the current example with [0,1] change and renesas,r9a07g043-adc and run dt-binding check.
       Checking is passing for channel[2,7]. The results are not expected one, I am not sure is it dt-schema related issue??

biju@biju-VirtualBox:~/rzg2l-linux$ git diff
--- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
@@ -89,7 +89,7 @@ allOf:
             const: renesas,r9a07g043-adc
     then:
       patternProperties:
-        "^channel@[0-7]$":
+        "^channel@[0-1]$":
           type: object
           properties:
             reg:
@@ -125,7 +125,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";
       reg = <0x10059000 0x400>;
       interrupts = <GIC_SPI 347 IRQ_TYPE_EDGE_RISING>;
       clocks = <&cpg CPG_MOD R9A07G044_ADC_ADCLK>,
biju@biju-VirtualBox:~/rzg2l-linux$ 

biju@biju-VirtualBox:~/rzg2l-linux$ 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
biju@biju-VirtualBox:~/rzg2l-linux$


> 
> > +          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.

Cheers,
Biju

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-
> m68k.org
> 
> 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 USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux