All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>
Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
Date: Tue, 10 May 2022 11:14:05 -0500	[thread overview]
Message-ID: <YnqPTQVUNADk/YO4@robh.at.kernel.org> (raw)
In-Reply-To: <OS0PR01MB5922CD6D965A6138721F9A5886C99@OS0PR01MB5922.jpnprd01.prod.outlook.com>

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@bp.renesas.com>
> > 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@bp.renesas.com> 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@bp.renesas.com>
> > 
> > > > > ---
> > > > > 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

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

  reply	other threads:[~2022-05-10 16:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 18:40 [PATCH v2 0/2] Add RZ/G2UL support Biju Das
2022-05-05 18:40 ` [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC Biju Das
2022-05-06  7:17   ` Geert Uytterhoeven
2022-05-06  8:40     ` Biju Das
2022-05-09 12:48       ` Geert Uytterhoeven
2022-05-10  5:54         ` Biju Das
2022-05-10 16:14           ` Rob Herring [this message]
2022-05-10 18:31             ` Biju Das
2022-05-11  6:03               ` Biju Das
2022-05-11  6:53               ` Geert Uytterhoeven
2022-05-11  7:30                 ` Biju Das
2022-05-18  1:50                 ` Rob Herring
2022-05-07  5:38   ` Lad, Prabhakar
2022-05-07 14:30   ` Jonathan Cameron
2022-05-10  6:00     ` Biju Das
2022-05-05 18:40 ` [PATCH v2 2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label() Biju Das
2022-05-06  7:17   ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YnqPTQVUNADk/YO4@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=Chris.Paterson2@renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=biju.das@bp.renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.