* [PATCH v2 0/2] Add RZ/G2UL support
@ 2022-05-05 18:40 Biju Das
2022-05-05 18:40 ` [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC 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
0 siblings, 2 replies; 17+ messages in thread
From: Biju Das @ 2022-05-05 18:40 UTC (permalink / raw)
To: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski
Cc: Biju Das, Lad Prabhakar, Lars-Peter Clausen, linux-iio,
linux-renesas-soc, devicetree, Geert Uytterhoeven,
Chris Paterson, Biju Das
This patch series document ADC found on RZ/G2UL SoC and also removes
unnecessary channel check from rzg2l_adc_read_label().
v1->v2:
* Started using generic compatible for RZ/G2UL and added SoC specific validation
for number of supported channels.
Biju Das (2):
dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
iio: adc: rzg2l_adc: Remove unnecessary check from
rzg2l_adc_read_label()
.../bindings/iio/adc/renesas,rzg2l-adc.yaml | 45 ++++++++++++++++---
drivers/iio/adc/rzg2l_adc.c | 3 --
2 files changed, 38 insertions(+), 10 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-05 18:40 [PATCH v2 0/2] Add RZ/G2UL support Biju Das
@ 2022-05-05 18:40 ` Biju Das
2022-05-06 7:17 ` Geert Uytterhoeven
` (2 more replies)
2022-05-05 18:40 ` [PATCH v2 2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label() Biju Das
1 sibling, 3 replies; 17+ messages in thread
From: Biju Das @ 2022-05-05 18:40 UTC (permalink / raw)
To: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski
Cc: Biju Das, Lad Prabhakar, Lars-Peter Clausen, linux-iio,
linux-renesas-soc, devicetree, Geert Uytterhoeven,
Chris Paterson, Biju Das
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>
---
v1->v2:
* Started using generic compatible for RZ/G2UL and added SoC specific validation
for channels.
---
.../bindings/iio/adc/renesas,rzg2l-adc.yaml | 45 ++++++++++++++++---
1 file changed, 38 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
index d66c24cae1e1..2da3538a3543 100644
--- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
@@ -19,6 +19,7 @@ properties:
compatible:
items:
- enum:
+ - renesas,r9a07g043-adc # RZ/G2UL
- renesas,r9a07g044-adc # RZ/G2L
- renesas,r9a07g054-adc # RZ/V2L
- const: renesas,rzg2l-adc
@@ -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]$":
+ 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:
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label()
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-05 18:40 ` Biju Das
2022-05-06 7:17 ` Geert Uytterhoeven
1 sibling, 1 reply; 17+ messages in thread
From: Biju Das @ 2022-05-05 18:40 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Biju Das, Lad Prabhakar, Lars-Peter Clausen, linux-iio,
linux-renesas-soc, Geert Uytterhoeven, Chris Paterson, Biju Das
Remove unnecessary channel check from rzg2l_adc_read_label(), as the channel error
handling is already done in probe(). Therefore no need to validate at runtime.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2:
* New patch
---
drivers/iio/adc/rzg2l_adc.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c
index 7585144b9715..bee5f9861acb 100644
--- a/drivers/iio/adc/rzg2l_adc.c
+++ b/drivers/iio/adc/rzg2l_adc.c
@@ -260,9 +260,6 @@ static int rzg2l_adc_read_label(struct iio_dev *iio_dev,
const struct iio_chan_spec *chan,
char *label)
{
- if (chan->channel >= RZG2L_ADC_MAX_CHANNELS)
- return -EINVAL;
-
return sysfs_emit(label, "%s\n", rzg2l_adc_channel_name[chan->channel]);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
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-07 5:38 ` Lad, Prabhakar
2022-05-07 14:30 ` Jonathan Cameron
2 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2022-05-06 7:17 UTC (permalink / raw)
To: Biju Das
Cc: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
Lad Prabhakar, Lars-Peter Clausen, linux-iio, Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Chris Paterson, Biju Das
Hi Biju,
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>
> ---
> 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]
> + 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?
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label()
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
0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2022-05-06 7:17 UTC (permalink / raw)
To: Biju Das
Cc: Jonathan Cameron, Lad Prabhakar, Lars-Peter Clausen, linux-iio,
Linux-Renesas, Geert Uytterhoeven, Chris Paterson, Biju Das
On Thu, May 5, 2022 at 8:40 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Remove unnecessary channel check from rzg2l_adc_read_label(), as the channel error
> handling is already done in probe(). Therefore no need to validate at runtime.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v2:
> * New patch
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-06 7:17 ` Geert Uytterhoeven
@ 2022-05-06 8:40 ` Biju Das
2022-05-09 12:48 ` Geert Uytterhoeven
0 siblings, 1 reply; 17+ messages in thread
From: Biju Das @ 2022-05-06 8:40 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Chris Paterson, Biju Das
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@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>
> > ---
> > 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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
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-07 5:38 ` Lad, Prabhakar
2022-05-07 14:30 ` Jonathan Cameron
2 siblings, 0 replies; 17+ messages in thread
From: Lad, Prabhakar @ 2022-05-07 5:38 UTC (permalink / raw)
To: Biju Das
Cc: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
Lad Prabhakar, Lars-Peter Clausen, linux-iio, Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Chris Paterson, Biju Das
Hi Biju,
Thank you for the patch.
On Fri, May 6, 2022 at 2:09 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>
> ---
> v1->v2:
> * Started using generic compatible for RZ/G2UL and added SoC specific validation
> for channels.
> ---
> .../bindings/iio/adc/renesas,rzg2l-adc.yaml | 45 ++++++++++++++++---
> 1 file changed, 38 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> index d66c24cae1e1..2da3538a3543 100644
> --- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> @@ -19,6 +19,7 @@ properties:
> compatible:
> items:
> - enum:
> + - renesas,r9a07g043-adc # RZ/G2UL
> - renesas,r9a07g044-adc # RZ/G2L
> - renesas,r9a07g054-adc # RZ/V2L
> - const: renesas,rzg2l-adc
> @@ -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]$":
> + 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:
Can the above hunk be replaced by else instead?
Cheers,
Prabhakar
> + 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:
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
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-07 5:38 ` Lad, Prabhakar
@ 2022-05-07 14:30 ` Jonathan Cameron
2022-05-10 6:00 ` Biju Das
2 siblings, 1 reply; 17+ messages in thread
From: Jonathan Cameron @ 2022-05-07 14:30 UTC (permalink / raw)
To: Biju Das
Cc: Rob Herring, Krzysztof Kozlowski, Lad Prabhakar,
Lars-Peter Clausen, linux-iio, linux-renesas-soc, devicetree,
Geert Uytterhoeven, Chris Paterson, Biju Das
On Thu, 5 May 2022 19:40:36 +0100
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>
> ---
> v1->v2:
> * Started using generic compatible for RZ/G2UL and added SoC specific validation
> for channels.
> ---
> .../bindings/iio/adc/renesas,rzg2l-adc.yaml | 45 ++++++++++++++++---
> 1 file changed, 38 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> index d66c24cae1e1..2da3538a3543 100644
> --- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> @@ -19,6 +19,7 @@ properties:
> compatible:
> items:
> - enum:
> + - renesas,r9a07g043-adc # RZ/G2UL
> - renesas,r9a07g044-adc # RZ/G2L
> - renesas,r9a07g054-adc # RZ/V2L
> - const: renesas,rzg2l-adc
> @@ -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.
Leave
description: |
The channel number.
here. The rest of this description is obvious from the below schema so doesn't
need to also be in the descriptions.
> - 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]$":
> + 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:
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-06 8:40 ` Biju Das
@ 2022-05-09 12:48 ` Geert Uytterhoeven
2022-05-10 5:54 ` Biju Das
0 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2022-05-09 12:48 UTC (permalink / raw)
To: Biju Das
Cc: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Chris Paterson, Biju Das
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].
> > > + 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@glider.be/
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-09 12:48 ` Geert Uytterhoeven
@ 2022-05-10 5:54 ` Biju Das
2022-05-10 16:14 ` Rob Herring
0 siblings, 1 reply; 17+ messages in thread
From: Biju Das @ 2022-05-10 5:54 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Chris Paterson, Biju Das
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
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-07 14:30 ` Jonathan Cameron
@ 2022-05-10 6:00 ` Biju Das
0 siblings, 0 replies; 17+ messages in thread
From: Biju Das @ 2022-05-10 6:00 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Rob Herring, Krzysztof Kozlowski, Prabhakar Mahadev Lad,
Lars-Peter Clausen, linux-iio, linux-renesas-soc, devicetree,
Geert Uytterhoeven, Chris Paterson, Biju Das
Hi Jonathan,
Thanks for the feedback.
> Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL
> ADC
>
> On Thu, 5 May 2022 19:40:36 +0100
> 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>
> > ---
> > v1->v2:
> > * Started using generic compatible for RZ/G2UL and added SoC specific
> validation
> > for channels.
> > ---
> > .../bindings/iio/adc/renesas,rzg2l-adc.yaml | 45 ++++++++++++++++---
> > 1 file changed, 38 insertions(+), 7 deletions(-)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> > b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> > index d66c24cae1e1..2da3538a3543 100644
> > --- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> > +++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
> > @@ -19,6 +19,7 @@ properties:
> > compatible:
> > items:
> > - enum:
> > + - renesas,r9a07g043-adc # RZ/G2UL
> > - renesas,r9a07g044-adc # RZ/G2L
> > - renesas,r9a07g054-adc # RZ/V2L
> > - const: renesas,rzg2l-adc
> > @@ -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.
> Leave
> description: |
> The channel number.
> here. The rest of this description is obvious from the below schema so
> doesn't need to also be in the descriptions.
OK will do the changes in next revision.
Cheers,
Biju
>
> > - 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]$":
> > + 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:
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-10 5:54 ` Biju Das
@ 2022-05-10 16:14 ` Rob Herring
2022-05-10 18:31 ` Biju Das
0 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2022-05-10 16:14 UTC (permalink / raw)
To: Biju Das
Cc: Geert Uytterhoeven, Jonathan Cameron, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Chris Paterson, Biju Das
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
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-10 16:14 ` Rob Herring
@ 2022-05-10 18:31 ` Biju Das
2022-05-11 6:03 ` Biju Das
2022-05-11 6:53 ` Geert Uytterhoeven
0 siblings, 2 replies; 17+ messages in thread
From: Biju Das @ 2022-05-10 18:31 UTC (permalink / raw)
To: Rob Herring
Cc: Geert Uytterhoeven, Jonathan Cameron, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Chris Paterson, Biju Das
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@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
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-10 18:31 ` Biju Das
@ 2022-05-11 6:03 ` Biju Das
2022-05-11 6:53 ` Geert Uytterhoeven
1 sibling, 0 replies; 17+ messages in thread
From: Biju Das @ 2022-05-11 6:03 UTC (permalink / raw)
To: Biju Das, Rob Herring
Cc: Geert Uytterhoeven, Jonathan Cameron, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Chris Paterson, Biju Das
Hi Rob,
> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: 10 May 2022 19:31
> To: Rob Herring <robh@kernel.org>
> 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-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
>
> 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@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,rzg2
> > > > > > > +++ l-
> > 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.
Looks like the below change is restricting both channel and reg to [0-1] for
RZ/G2UL. I will send next version based on this.
+ "^channel@[2-7]$": false
+ "^channel@[0-1]$":
Cheers,
Biju
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
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
1 sibling, 2 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2022-05-11 6:53 UTC (permalink / raw)
To: Biju Das
Cc: Rob Herring, Jonathan Cameron, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Chris Paterson, Biju Das
Hi Biju,
On Tue, May 10, 2022 at 8:31 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL
> > ADC
> > 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>;
> };
I expect that to be flagged by the generic unit-address vs. reg check?
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-11 6:53 ` Geert Uytterhoeven
@ 2022-05-11 7:30 ` Biju Das
2022-05-18 1:50 ` Rob Herring
1 sibling, 0 replies; 17+ messages in thread
From: Biju Das @ 2022-05-11 7:30 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Rob Herring, Jonathan Cameron, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Chris Paterson, Biju Das
Hi Geert,
Thanks for the feedback.
> Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL
> ADC
>
> Hi Biju,
>
> On Tue, May 10, 2022 at 8:31 PM Biju Das <biju.das.jz@bp.renesas.com>
> wrote:
> > > Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas
> > > RZ/G2UL ADC
> > > 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>;
> > };
>
> I expect that to be flagged by the generic unit-address vs. reg check?
You mean this should be take care by dt-schema automatically, right?
Currently it is not the case. It needs additional check for taking care [1]
[1] https://lore.kernel.org/linux-renesas-soc/CAMuHMdWNP_H9FNcygXZp0Ysw=wGXzV71Q_U7Hs=wH_Vctnz1pg@mail.gmail.com/T/#u
Cheers,
Biju
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-11 6:53 ` Geert Uytterhoeven
2022-05-11 7:30 ` Biju Das
@ 2022-05-18 1:50 ` Rob Herring
1 sibling, 0 replies; 17+ messages in thread
From: Rob Herring @ 2022-05-18 1:50 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Biju Das, Jonathan Cameron, Krzysztof Kozlowski,
Prabhakar Mahadev Lad, Lars-Peter Clausen, linux-iio,
Linux-Renesas,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Chris Paterson, Biju Das
On Wed, May 11, 2022 at 08:53:53AM +0200, Geert Uytterhoeven wrote:
> Hi Biju,
>
> On Tue, May 10, 2022 at 8:31 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL
> > > ADC
> > > 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>;
> > };
>
> I expect that to be flagged by the generic unit-address vs. reg check?
No such thing. All the unit-address vs. reg value checks are bus
specific (and in dtc). David G was against any generic/default check...
Rob
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2022-05-18 1:50 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
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.