[PATCH 07/22] ASoC: dt-bindings: renesas,rsnd: Add RZ/G3E support

John Madieu posted 22 patches 2 weeks, 3 days ago
There is a newer version of this series
[PATCH 07/22] ASoC: dt-bindings: renesas,rsnd: Add RZ/G3E support
Posted by John Madieu 2 weeks, 3 days ago
Add support for the RZ/G3E (R9A09G047) SoC audio subsystem.

RZ/G3E has a different audio architecture from R-Car Gen2/Gen3/Gen4,
with additional clocks and resets:
- Per-SSI ADG clocks (adg.ssi.0-9)
- SCU related clocks (scu, scu_x2, scu_supply)
- SSIF supply clock
- AUDMAC peri-peri clock
- ADG clock
- Additional resets for SCU, ADG, and AUDMAC peri-peri

RZ/G3E has 5 DMA controllers that can all be used by audio peripherals.
To allow the DMA core to distribute channels across all available
controllers, increase the maximum number of DMA entries in DVC, SRC,
and SSIU sub-nodes so that multiple providers can be listed with
repeated channel names.

Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
---
 .../bindings/sound/renesas,rsnd.yaml          | 169 +++++++++++++++---
 1 file changed, 148 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
index e8a2acb92646..bc8885c4fa24 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
+++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
@@ -58,6 +58,7 @@ properties:
           - renesas,rcar_sound-gen2
           - renesas,rcar_sound-gen3
           - renesas,rcar_sound-gen4
+          - renesas,rcar_sound-r9a09g047     # RZ/G3E
 
   reg:
     minItems: 1
@@ -97,20 +98,22 @@ properties:
 
   resets:
     minItems: 1
-    maxItems: 11
+    maxItems: 14
 
   reset-names:
     minItems: 1
-    maxItems: 11
+    maxItems: 14
 
   clocks:
     description: References to SSI/SRC/MIX/CTU/DVC/AUDIO_CLK clocks.
     minItems: 1
-    maxItems: 31
+    maxItems: 47
 
   clock-names:
     description: List of necessary clock names.
     # details are defined below
+    minItems: 1
+    maxItems: 47
 
   # ports is below
   port:
@@ -136,9 +139,17 @@ properties:
 
         properties:
           dmas:
-            maxItems: 1
+            description:
+              Must contain unique DMA specifiers, one per available
+              DMAC. On RZ/G3E, up to 5 for transmission.
+            minItems: 1
+            maxItems: 5
           dma-names:
-            const: tx
+            minItems: 1
+            maxItems: 5
+            items:
+              enum:
+                - tx
         required:
           - dmas
           - dma-names
@@ -174,13 +185,19 @@ properties:
           interrupts:
             maxItems: 1
           dmas:
-            maxItems: 2
+            description:
+              Must contain unique DMA specifiers, one per available
+              DMAC, for each transfer direction. On RZ/G3E, up to 5
+              for transmission and up to 5 for reception.
+            minItems: 2
+            maxItems: 10
           dma-names:
-            allOf:
-              - items:
-                  enum:
-                    - tx
-                    - rx
+            minItems: 2
+            maxItems: 10
+            items:
+              enum:
+                - tx
+                - rx
     additionalProperties: false
 
   rcar_sound,ssiu:
@@ -193,13 +210,19 @@ properties:
 
         properties:
           dmas:
-            maxItems: 2
+            description:
+              Must contain unique DMA specifiers, one per available
+              DMAC, for each transfer direction. On RZ/G3E, up to 5
+              for transmission and up to 5 for reception.
+            minItems: 2
+            maxItems: 10
           dma-names:
-            allOf:
-              - items:
-                  enum:
-                    - tx
-                    - rx
+            minItems: 2
+            maxItems: 10
+            items:
+              enum:
+                - tx
+                - rx
         required:
           - dmas
           - dma-names
@@ -299,7 +322,7 @@ allOf:
               - sru
               - ssi
               - adg
-  # for Gen2/Gen3
+  # for Gen2/Gen3/RZ/G3E
   - if:
       properties:
         compatible:
@@ -307,6 +330,7 @@ allOf:
             enum:
               - renesas,rcar_sound-gen2
               - renesas,rcar_sound-gen3
+              - renesas,rcar_sound-r9a09g047
     then:
       properties:
         reg:
@@ -338,7 +362,7 @@ allOf:
               - sdmc
 
   # --------------------
-  # clock-names
+  # clock-names / reset-names
   # --------------------
   - if:
       properties:
@@ -354,10 +378,18 @@ allOf:
               - ssi.0
               - ssiu.0
               - clkin
-    else:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - renesas,rcar_sound-gen2
+              - renesas,rcar_sound-gen3
+    then:
       properties:
+        clocks:
+          maxItems: 31
         clock-names:
-          minItems: 1
           maxItems: 31
           items:
             oneOf:
@@ -368,6 +400,101 @@ allOf:
               - pattern: '^ctu\.[0-1]$'
               - pattern: '^dvc\.[0-1]$'
               - pattern: '^clk_(a|b|c|i)$'
+        resets:
+          maxItems: 11
+        reset-names:
+          maxItems: 11
+          items:
+            oneOf:
+              - const: ssi-all
+              - pattern: '^ssi\.[0-9]$'
+        rcar_sound,dvc:
+          patternProperties:
+            "^dvc-[0-1]$":
+              properties:
+                dmas:
+                  maxItems: 1
+                dma-names:
+                  maxItems: 1
+        rcar_sound,src:
+          patternProperties:
+            "^src-[0-9]$":
+              properties:
+                dmas:
+                  maxItems: 2
+                dma-names:
+                  maxItems: 2
+        rcar_sound,ssiu:
+          patternProperties:
+            "^ssiu-[0-9]+$":
+              properties:
+                dmas:
+                  maxItems: 2
+                dma-names:
+                  maxItems: 2
+  # for RZ/G3E
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,rcar_sound-r9a09g047
+    then:
+      properties:
+        clocks:
+          maxItems: 47
+        clock-names:
+          maxItems: 47
+          items:
+            oneOf:
+              - const: ssi-all
+              - pattern: '^ssi\.[0-9]$'
+              - pattern: '^src\.[0-9]$'
+              - pattern: '^mix\.[0-1]$'
+              - pattern: '^ctu\.[0-1]$'
+              - pattern: '^dvc\.[0-1]$'
+              - pattern: '^clk_(a|b|c|i)$'
+              - const: ssif_supply
+              - const: scu
+              - const: scu_x2
+              - const: scu_supply
+              - pattern: '^adg\.ssi\.[0-9]$'
+              - const: audmac_pp
+              - const: adg
+        resets:
+          maxItems: 14
+        reset-names:
+          maxItems: 14
+          items:
+            oneOf:
+              - const: ssi-all
+              - pattern: '^ssi\.[0-9]$'
+              - const: scu
+              - const: adg
+              - const: audmac_pp
+        rcar_sound,dvc:
+          patternProperties:
+            "^dvc-[0-1]$":
+              properties:
+                dmas:
+                  maxItems: 5
+                dma-names:
+                  maxItems: 5
+        rcar_sound,src:
+          patternProperties:
+            "^src-[0-9]$":
+              properties:
+                dmas:
+                  maxItems: 10
+                dma-names:
+                  maxItems: 10
+        rcar_sound,ssiu:
+          patternProperties:
+            "^ssiu-[0-9]+$":
+              properties:
+                dmas:
+                  maxItems: 10
+                dma-names:
+                  maxItems: 10
 
 unevaluatedProperties: false
 
-- 
2.25.1
Re: [PATCH 07/22] ASoC: dt-bindings: renesas,rsnd: Add RZ/G3E support
Posted by Krzysztof Kozlowski 2 weeks, 3 days ago
On Thu, Mar 19, 2026 at 04:53:19PM +0100, John Madieu wrote:
> Add support for the RZ/G3E (R9A09G047) SoC audio subsystem.
> 
> RZ/G3E has a different audio architecture from R-Car Gen2/Gen3/Gen4,
> with additional clocks and resets:
> - Per-SSI ADG clocks (adg.ssi.0-9)
> - SCU related clocks (scu, scu_x2, scu_supply)
> - SSIF supply clock
> - AUDMAC peri-peri clock
> - ADG clock
> - Additional resets for SCU, ADG, and AUDMAC peri-peri
> 
> RZ/G3E has 5 DMA controllers that can all be used by audio peripherals.
> To allow the DMA core to distribute channels across all available
> controllers, increase the maximum number of DMA entries in DVC, SRC,
> and SSIU sub-nodes so that multiple providers can be listed with
> repeated channel names.
> 
> Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
> ---
>  .../bindings/sound/renesas,rsnd.yaml          | 169 +++++++++++++++---
>  1 file changed, 148 insertions(+), 21 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> index e8a2acb92646..bc8885c4fa24 100644
> --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> @@ -58,6 +58,7 @@ properties:
>            - renesas,rcar_sound-gen2
>            - renesas,rcar_sound-gen3
>            - renesas,rcar_sound-gen4
> +          - renesas,rcar_sound-r9a09g047     # RZ/G3E

Do not use underscores in compatibles. Previously used wrong style is
not the excuse here, just like previously poor code, mistakes, bugs,
unreadable approches is not justification to repeat the same.

>  
>    reg:
>      minItems: 1
> @@ -97,20 +98,22 @@ properties:
>  
>    resets:
>      minItems: 1
> -    maxItems: 11
> +    maxItems: 14
>  
>    reset-names:
>      minItems: 1
> -    maxItems: 11
> +    maxItems: 14
>  
>    clocks:
>      description: References to SSI/SRC/MIX/CTU/DVC/AUDIO_CLK clocks.
>      minItems: 1
> -    maxItems: 31
> +    maxItems: 47
>  
>    clock-names:
>      description: List of necessary clock names.
>      # details are defined below
> +    minItems: 1
> +    maxItems: 47
>  
>    # ports is below
>    port:
> @@ -136,9 +139,17 @@ properties:
>  
>          properties:
>            dmas:
> -            maxItems: 1
> +            description:
> +              Must contain unique DMA specifiers, one per available
> +              DMAC. On RZ/G3E, up to 5 for transmission.
> +            minItems: 1
> +            maxItems: 5
>            dma-names:
> -            const: tx
> +            minItems: 1
> +            maxItems: 5
> +            items:
> +              enum:
> +                - tx

Multiple levels, multiple if:then: (further) - I don't find this binding
manageable/readable. You should split it, with common binding defining
common part of hardware or interface if there is such.

Best regards,
Krzysztof