* [PATCH v5 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-15 6:03 [PATCH v5 0/2] Add RZ/G2UL ADC support Biju Das
@ 2022-05-15 6:03 ` Biju Das
2022-05-16 16:07 ` Rob Herring
2022-05-15 6:03 ` [PATCH v5 2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label() Biju Das
2022-05-15 17:01 ` [PATCH v5 0/2] Add RZ/G2UL ADC support Jonathan Cameron
2 siblings, 1 reply; 5+ messages in thread
From: Biju Das @ 2022-05-15 6:03 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, Krzysztof Kozlowski
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>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
v4->v5:
* Removed redundant "type:object"
* Added Rb tag from Krzysztof Kozlowski
v3->v4:
* Removed unnecessary SoC specific reg description as it is
equivalent to the logic used in reg.
* Removed Items from reg.
v2->v3:
* Added generic description for reg.
* Improved schema validation by restricting both channel and reg to [0-1].
v1->v2:
* Started using generic compatible for RZ/G2UL and added SoC specific validation
for channels.
---
.../bindings/iio/adc/renesas,rzg2l-adc.yaml | 28 ++++++++++++++++---
1 file changed, 24 insertions(+), 4 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..61c6157cf5a9 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
@@ -76,16 +77,35 @@ patternProperties:
properties:
reg:
description: |
- The channel number. It can have up to 8 channels numbered from 0 to 7.
- items:
- - minimum: 0
- maximum: 7
+ The channel number.
required:
- reg
additionalProperties: false
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a07g043-adc
+ then:
+ patternProperties:
+ "^channel@[2-7]$": false
+ "^channel@[0-1]$":
+ properties:
+ reg:
+ minimum: 0
+ maximum: 1
+ else:
+ patternProperties:
+ "^channel@[0-7]$":
+ properties:
+ reg:
+ minimum: 0
+ maximum: 7
+
additionalProperties: false
examples:
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v5 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC
2022-05-15 6:03 ` [PATCH v5 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC Biju Das
@ 2022-05-16 16:07 ` Rob Herring
0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2022-05-16 16:07 UTC (permalink / raw)
To: Biju Das
Cc: Rob Herring, Lars-Peter Clausen, Krzysztof Kozlowski,
Chris Paterson, Jonathan Cameron, devicetree, Geert Uytterhoeven,
linux-iio, linux-renesas-soc, Biju Das, Lad Prabhakar,
Krzysztof Kozlowski
On Sun, 15 May 2022 07:03:35 +0100, Biju Das 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>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> v4->v5:
> * Removed redundant "type:object"
> * Added Rb tag from Krzysztof Kozlowski
> v3->v4:
> * Removed unnecessary SoC specific reg description as it is
> equivalent to the logic used in reg.
> * Removed Items from reg.
> v2->v3:
> * Added generic description for reg.
> * Improved schema validation by restricting both channel and reg to [0-1].
> v1->v2:
> * Started using generic compatible for RZ/G2UL and added SoC specific validation
> for channels.
> ---
> .../bindings/iio/adc/renesas,rzg2l-adc.yaml | 28 ++++++++++++++++---
> 1 file changed, 24 insertions(+), 4 deletions(-)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v5 2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label()
2022-05-15 6:03 [PATCH v5 0/2] Add RZ/G2UL ADC support Biju Das
2022-05-15 6:03 ` [PATCH v5 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC Biju Das
@ 2022-05-15 6:03 ` Biju Das
2022-05-15 17:01 ` [PATCH v5 0/2] Add RZ/G2UL ADC support Jonathan Cameron
2 siblings, 0 replies; 5+ messages in thread
From: Biju Das @ 2022-05-15 6:03 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>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* No Change.
v3->v4:
* No Change.
v2->v3:
* Added Rb tag from Geert.
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] 5+ messages in thread
* Re: [PATCH v5 0/2] Add RZ/G2UL ADC support
2022-05-15 6:03 [PATCH v5 0/2] Add RZ/G2UL ADC support Biju Das
2022-05-15 6:03 ` [PATCH v5 1/2] dt-bindings: iio: adc: Document Renesas RZ/G2UL ADC Biju Das
2022-05-15 6:03 ` [PATCH v5 2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label() Biju Das
@ 2022-05-15 17:01 ` Jonathan Cameron
2 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2022-05-15 17:01 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 Sun, 15 May 2022 07:03:34 +0100
Biju Das <biju.das.jz@bp.renesas.com> wrote:
> This patch series document ADC found on RZ/G2UL SoC and also removes
> unnecessary channel check from rzg2l_adc_read_label().
>
> v4->v5:
> * Removed redundant "type:object"
> * Added Rb tag from Krzysztof Kozlowski
> v3->v4:
> * Removed unnecessary SoC specific reg description as it is
> equivalent to the logic used in reg.
> * Removed Items from reg.
> v2->v3:
> * Added generic description for reg.
> * Improved schema validation by restricting both channel and reg to [0-1].
> * Added Rb tag from Geert.
> 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 channel check from
> rzg2l_adc_read_label()
>
> .../bindings/iio/adc/renesas,rzg2l-adc.yaml | 28 ++++++++++++++++---
> drivers/iio/adc/rzg2l_adc.c | 3 --
> 2 files changed, 24 insertions(+), 7 deletions(-)
>
Series applied to the togreg branch of iio.git and pushed out as testing
for 0-day to see if we missed anything.
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread