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@renesas.com>
---
.../iio/adc/renesas,r9a09g077-adc.yaml | 170 ++++++++++++++++++
MAINTAINERS | 7 +
2 files changed, 177 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml
diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml
new file mode 100644
index 000000000000..840108cd317e
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml
@@ -0,0 +1,170 @@
+# 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@renesas.com>
+
+description: |
+ A/D Converter block is a successive approximation analog-to-digital converter
+ with a 12-bit accuracy. Up to 15 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
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ items:
+ - description: A/D scan end interrupt
+ - description: A/D scan end interrupt for Group B
+ - description: A/D scan end interrupt for Group C
+ - description: Window A compare match
+ - description: Window B compare match
+ - description: Compare match
+ - description: Compare mismatch
+
+ interrupt-names:
+ items:
+ - const: adi
+ - const: gbadi
+ - const: gcadi
+ - const: cmpai
+ - const: cmpbi
+ - const: wcmpm
+ - const: wcmpum
+
+ clocks:
+ items:
+ - description: converter clock
+ - description: peripheral clock
+
+ clock-names:
+ items:
+ - const: adclk
+ - const: pclk
+
+ power-domains:
+ maxItems: 1
+
+ renesas,max-channels:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ Maximum number of channels supported by the ADC.
+ RZ/T2H has two ADCs with 4 channels and one with 6 channels.
+ RZ/N2H has two ADCs with 4 channels and one with 15 channels.
+
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ "#io-channel-cells":
+ const: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+ - power-domains
+ - renesas,max-channels
+
+patternProperties:
+ "^channel@[0-9a-e]$":
+ $ref: adc.yaml
+ type: object
+ description: The external channels which are connected to the ADC.
+
+ properties:
+ reg:
+ description: The channel number.
+ maximum: 14
+
+ required:
+ - reg
+
+ additionalProperties: false
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a09g077-adc
+ then:
+ properties:
+ renesas,max-channels:
+ enum: [4, 6]
+
+ patternProperties:
+ "^channel@[6-9a-e]$": false
+ "^channel@[0-5]$":
+ properties:
+ reg:
+ maximum: 5
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,r9a09g087-adc
+ then:
+ properties:
+ renesas,max-channels:
+ enum: [4, 15]
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ adc@80008000 {
+ compatible = "renesas,r9a09g077-adc";
+ reg = <0x80008000 0x400>;
+ interrupts = <GIC_SPI 708 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 709 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 710 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 711 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 712 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 855 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 856 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "adi", "gbadi", "gcadi",
+ "cmpai", "cmpbi", "wcmpm", "wcmpum";
+ clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>,
+ <&cpg CPG_MOD 225>;
+ clock-names = "adclk", "pclk";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #io-channel-cells = <1>;
+ renesas,max-channels = <6>;
+
+ channel@0 {
+ reg = <0x0>;
+ };
+ channel@1 {
+ reg = <0x1>;
+ };
+ channel@2 {
+ reg = <0x2>;
+ };
+ channel@3 {
+ reg = <0x3>;
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index 9f4b48801879..07e0d37cf468 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -21822,6 +21822,13 @@ S: Supported
F: Documentation/devicetree/bindings/timer/renesas,rz-mtu3.yaml
F: drivers/counter/rz-mtu3-cnt.c
+RENESAS RZ/T2H / RZ/N2H A/D DRIVER
+M: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
+L: linux-iio@vger.kernel.org
+L: linux-renesas-soc@vger.kernel.org
+S: Supported
+F: Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml
+
RENESAS RTCA-3 RTC DRIVER
M: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
L: linux-rtc@vger.kernel.org
--
2.51.0
Hi Cosmin, On Tue, 23 Sept 2025 at 18:06, Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> 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@renesas.com> Thanks for your patch! > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml > @@ -0,0 +1,170 @@ > +# 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@renesas.com> > + > +description: | > + A/D Converter block is a successive approximation analog-to-digital converter > + with a 12-bit accuracy. Up to 15 analog input channels can be selected. The documentation for several registers talks about bitmasks for ch0-ch15, so the actual hardware block supports up to 16 channels. > + 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 > + > + reg: > + maxItems: 1 > + > + interrupts: > + items: > + - description: A/D scan end interrupt > + - description: A/D scan end interrupt for Group B > + - description: A/D scan end interrupt for Group C > + - description: Window A compare match > + - description: Window B compare match > + - description: Compare match > + - description: Compare mismatch > + > + interrupt-names: > + items: > + - const: adi > + - const: gbadi > + - const: gcadi > + - const: cmpai > + - const: cmpbi > + - const: wcmpm > + - const: wcmpum > + > + clocks: > + items: > + - description: converter clock Converter > + - description: peripheral clock Peripheral > + > + clock-names: > + items: > + - const: adclk > + - const: pclk > + > + power-domains: > + maxItems: 1 > + > + renesas,max-channels: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | > + Maximum number of channels supported by the ADC. > + RZ/T2H has two ADCs with 4 channels and one with 6 channels. > + RZ/N2H has two ADCs with 4 channels and one with 15 channels. According to the documentation, both SoCs have three instances? I agree with Connor that this should be dropped: the same information is available from the channel@N subnodes, and future SoCs could have gaps in the numbering. FTR, from a quick glance, it looks like this module is very similar to the ADC on RZ/A2M, so I hope we can reuse the driver for that SoC. > +patternProperties: > + "^channel@[0-9a-e]$": 0-9a-f > + $ref: adc.yaml > + type: object > + description: The external channels which are connected to the ADC. > + > + properties: > + reg: > + description: The channel number. > + maximum: 14 15 But I don't think it is needed, as the dtc check for non-matching unit addresses and reg properties should already enforce this. > + > + required: > + - reg > + > + additionalProperties: false > + > +allOf: > + - if: > + properties: > + compatible: > + contains: > + const: renesas,r9a09g077-adc > + then: > + properties: > + renesas,max-channels: > + enum: [4, 6] > + > + patternProperties: > + "^channel@[6-9a-e]$": false 6-9a-f > + "^channel@[0-5]$": > + properties: > + reg: > + maximum: 5 Not needed as per above. 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
On Tue, Sep 23, 2025 at 07:05:16PM +0300, Cosmin Tanislav 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@renesas.com> > --- > .../iio/adc/renesas,r9a09g077-adc.yaml | 170 ++++++++++++++++++ > MAINTAINERS | 7 + > 2 files changed, 177 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml > > diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml > new file mode 100644 > index 000000000000..840108cd317e > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml > @@ -0,0 +1,170 @@ > +# 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@renesas.com> > + > +description: | > + A/D Converter block is a successive approximation analog-to-digital converter > + with a 12-bit accuracy. Up to 15 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 > + > + reg: > + maxItems: 1 > + > + interrupts: > + items: > + - description: A/D scan end interrupt > + - description: A/D scan end interrupt for Group B > + - description: A/D scan end interrupt for Group C > + - description: Window A compare match > + - description: Window B compare match > + - description: Compare match > + - description: Compare mismatch > + > + interrupt-names: > + items: > + - const: adi > + - const: gbadi > + - const: gcadi > + - const: cmpai > + - const: cmpbi > + - const: wcmpm > + - const: wcmpum > + > + clocks: > + items: > + - description: converter clock > + - description: peripheral clock > + > + clock-names: > + items: > + - const: adclk > + - const: pclk > + > + power-domains: > + maxItems: 1 > + > + renesas,max-channels: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | > + Maximum number of channels supported by the ADC. > + RZ/T2H has two ADCs with 4 channels and one with 6 channels. > + RZ/N2H has two ADCs with 4 channels and one with 15 channels. What is the point of this? Why do you need to know how many channels there can be in the driver, isn't it enough to just figure out how many child nodes you have? > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > + "#io-channel-cells": > + const: 1 > + > +required: > + - compatible > + - reg > + - interrupts > + - clocks > + - clock-names > + - power-domains > + - renesas,max-channels This should be after patternProperties. > + > +patternProperties: > + "^channel@[0-9a-e]$": > + $ref: adc.yaml > + type: object > + description: The external channels which are connected to the ADC. > + > + properties: > + reg: > + description: The channel number. > + maximum: 14 > + > + required: > + - reg > + > + additionalProperties: false You don't include any properties other than reg from adc.yaml, and using additionalProperties: false blocks their use. Is that intentional or should this be unevaluatedProperties: false? Cheers, Conor. > + > +allOf: > + - if: > + properties: > + compatible: > + contains: > + const: renesas,r9a09g077-adc > + then: > + properties: > + renesas,max-channels: > + enum: [4, 6] > + > + patternProperties: > + "^channel@[6-9a-e]$": false > + "^channel@[0-5]$": > + properties: > + reg: > + maximum: 5 > + > + - if: > + properties: > + compatible: > + contains: > + enum: > + - renesas,r9a09g087-adc > + then: > + properties: > + renesas,max-channels: > + enum: [4, 15] > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h> > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + > + adc@80008000 { > + compatible = "renesas,r9a09g077-adc"; > + reg = <0x80008000 0x400>; > + interrupts = <GIC_SPI 708 IRQ_TYPE_EDGE_RISING>, > + <GIC_SPI 709 IRQ_TYPE_EDGE_RISING>, > + <GIC_SPI 710 IRQ_TYPE_EDGE_RISING>, > + <GIC_SPI 711 IRQ_TYPE_LEVEL_HIGH>, > + <GIC_SPI 712 IRQ_TYPE_LEVEL_HIGH>, > + <GIC_SPI 855 IRQ_TYPE_EDGE_RISING>, > + <GIC_SPI 856 IRQ_TYPE_EDGE_RISING>; > + interrupt-names = "adi", "gbadi", "gcadi", > + "cmpai", "cmpbi", "wcmpm", "wcmpum"; > + clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>, > + <&cpg CPG_MOD 225>; > + clock-names = "adclk", "pclk"; > + power-domains = <&cpg>; > + #address-cells = <1>; > + #size-cells = <0>; > + #io-channel-cells = <1>; > + renesas,max-channels = <6>; > + > + channel@0 { > + reg = <0x0>; > + }; > + channel@1 { > + reg = <0x1>; > + }; > + channel@2 { > + reg = <0x2>; > + }; > + channel@3 { > + reg = <0x3>; > + }; > + }; > diff --git a/MAINTAINERS b/MAINTAINERS > index 9f4b48801879..07e0d37cf468 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -21822,6 +21822,13 @@ S: Supported > F: Documentation/devicetree/bindings/timer/renesas,rz-mtu3.yaml > F: drivers/counter/rz-mtu3-cnt.c > > +RENESAS RZ/T2H / RZ/N2H A/D DRIVER > +M: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> > +L: linux-iio@vger.kernel.org > +L: linux-renesas-soc@vger.kernel.org > +S: Supported > +F: Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml > + > RENESAS RTCA-3 RTC DRIVER > M: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> > L: linux-rtc@vger.kernel.org > -- > 2.51.0 >
© 2016 - 2025 Red Hat, Inc.