Re: [PATCH v3 2/7] dt-bindings: iio: adc: document RZ/T2H and RZ/N2H ADC

From: Geert Uytterhoeven
Date: Thu Oct 02 2025 - 08:30:21 EST


Hi Cosmin,

On Wed, 1 Oct 2025 at 14:24, Cosmin Tanislav
<cosmin-gabriel.tanislav.xa@xxxxxxxxxxx> wrote:
> Document the A/D 12-Bit successive approximation converters found in the
> Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs.
>
> RZ/T2H has two ADCs with 4 channels and one with 6.
> RZ/N2H has two ADCs with 4 channels and one with 15.
>
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx>
> Acked-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

Thanks for your patch!

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml
> @@ -0,0 +1,160 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/renesas,r9a09g077-adc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas RZ/T2H / RZ/N2H ADC12
> +
> +maintainers:
> + - Cosmin Tanislav <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx>
> +
> +description: |
> + A/D Converter block is a successive approximation analog-to-digital converter
> + with a 12-bit accuracy. Up to 16 analog input channels can be selected.
> + Conversions can be performed in single or continuous mode. Result of the ADC
> + is stored in a 16-bit data register corresponding to each channel.
> +
> +properties:
> + compatible:
> + enum:
> + - renesas,r9a09g077-adc # RZ/T2H
> + - renesas,r9a09g087-adc # RZ/N2H

Given the number of channels is now handled completely through the
number of subnodes, I wonder if this should be changed to:

oneOf:
- items:
- const: renesas,r9a09g087-adc # RZ/N2H
- const: renesas,r9a09g077-adc # RZ/T2H
- items:
- const: renesas,r9a09g077-adc # RZ/T2H

...

> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: renesas,r9a09g077-adc
> + then:
> + patternProperties:
> + "^channel@[6-9a-f]$": false
> + "^channel@[0-5]$":
> + properties:
> + reg:
> + maximum: 5
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - renesas,r9a09g087-adc
> + then:
> + patternProperties:
> + "^channel@[f]$": false
> + "^channel@[0-9a-e]$":
> + properties:
> + reg:
> + maximum: 14

... and the SoC-specific restrictions above dropped?
The number of channels is instance-specific anyway.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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