Devicetree
 help / color / mirror / Atom feed
* [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema
@ 2026-06-03 20:28 John Madieu
  2026-06-03 20:39 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: John Madieu @ 2026-06-03 20:28 UTC (permalink / raw)
  To: lgirdwood, broonie, robh, krzk+dt, conor+dt, geert+renesas,
	magnus.damm
  Cc: kuninori.morimoto.gx, linux-sound, devicetree, linux-kernel,
	linux-renesas-soc, john.madieu, John Madieu

Express the dvc/src/ssiu dma-names as an items list rather than an
allOf-wrapped single schema, and drop the now-redundant maxItems. Fix
the ports container to reference graph.yaml's ports definition instead
of port-base (a ports container is not itself a port), keeping
port-base on the port@N children, and constrain each playback/capture
phandle-array entry to a single phandle.

While at it, drop the unused top-level #address-cells/#size-cells since
no child node uses a unit address and the ports node provides its own,
require interrupts/dmas/dma-names on the src sub-nodes to match the
ssi/ssiu sub-nodes and the driver, pin clocks and resets to their fixed
counts (47 and 14) to match the clock-names/reset-names lists, and put
compatible and reg first in the example.

Fixes: a86fd3c20218 ("ASoC: dt-bindings: sound: Add DT binding for RZ/G3E sound")
Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
---
 .../sound/renesas,r9a09g047-sound.yaml        | 71 +++++++++++--------
 1 file changed, 43 insertions(+), 28 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml b/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml
index d7fa16554698..80670019d2f4 100644
--- a/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml
+++ b/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml
@@ -42,13 +42,8 @@ properties:
   "#clock-cells":
     const: 0
 
-  "#address-cells":
-    const: 1
-
-  "#size-cells":
-    const: 0
-
   clocks:
+    minItems: 47
     maxItems: 47
 
   clock-names:
@@ -105,6 +100,7 @@ properties:
     maxItems: 1
 
   resets:
+    minItems: 14
     maxItems: 14
 
   reset-names:
@@ -143,11 +139,12 @@ properties:
               through the list to find a free channel.
 
           dma-names:
-            maxItems: 5
-            allOf:
-              - items:
-                  enum:
-                    - tx
+            items:
+              - const: tx
+              - const: tx
+              - const: tx
+              - const: tx
+              - const: tx
 
         required:
           - dmas
@@ -203,12 +200,22 @@ properties:
               falls through the list to find a free channel.
 
           dma-names:
-            maxItems: 10
-            allOf:
-              - items:
-                  enum:
-                    - tx
-                    - rx
+            items:
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+
+        required:
+          - interrupts
+          - dmas
+          - dma-names
 
   ssiu:
     type: object
@@ -229,12 +236,17 @@ properties:
               falls through the list to find a free channel.
 
           dma-names:
-            maxItems: 10
-            allOf:
-              - items:
-                  enum:
-                    - tx
-                    - rx
+            items:
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
+              - enum: [ tx, rx ]
 
         required:
           - dmas
@@ -261,10 +273,9 @@ properties:
           - interrupts
 
   ports:
-    $ref: audio-graph-port.yaml#/definitions/port-base
-    unevaluatedProperties: false
+    $ref: /schemas/graph.yaml#/properties/ports
     patternProperties:
-      '^port@[0-9a-f]+$':
+      '^port(@[0-9a-f]+)?$':
         $ref: audio-graph-port.yaml#/definitions/port-base
         unevaluatedProperties: false
         properties:
@@ -276,6 +287,8 @@ properties:
             properties:
               playback:
                 $ref: /schemas/types.yaml#/definitions/phandle-array
+                items:
+                  maxItems: 1
                 description:
                   Ordered list of phandles to the in-SoC modules used
                   by this DAI in the playback direction. Each phandle
@@ -285,6 +298,8 @@ properties:
                   from CPU to off-SoC endpoint.
               capture:
                 $ref: /schemas/types.yaml#/definitions/phandle-array
+                items:
+                  maxItems: 1
                 description:
                   Ordered list of phandles to the in-SoC modules used
                   by this DAI in the capture direction. Each phandle
@@ -311,8 +326,6 @@ examples:
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
     sound@13c00000 {
-      #sound-dai-cells = <1>;
-      #clock-cells = <0>;
       compatible = "renesas,r9a09g047-sound";
       reg = <0x13c00000 0x10000>,
             <0x13c20000 0x10000>,
@@ -320,6 +333,8 @@ examples:
             <0x13c31000 0x1f000>,
             <0x13c50000 0x10000>;
       reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
+      #sound-dai-cells = <1>;
+      #clock-cells = <0>;
       clocks = <&cpg 245>,
                <&cpg 385>, <&cpg 386>,
                <&cpg 387>, <&cpg 388>,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema
  2026-06-03 20:28 [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema John Madieu
@ 2026-06-03 20:39 ` sashiko-bot
  2026-06-04 12:10 ` Geert Uytterhoeven
  2026-06-04 14:11 ` Rob Herring
  2 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-06-03 20:39 UTC (permalink / raw)
  To: John Madieu; +Cc: devicetree, wsa+renesas, conor+dt, robh

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `dma-names` schema modification unintentionally converts variable-length arrays into strictly fixed-length tuples, enforcing exactly 5 or 10 items instead of allowing 1-5 or 1-10.
--

commit a5213139a119a047832e83895a5e3d493f04d666
Author: John Madieu <john.madieu.xa@bp.renesas.com>

ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema

Express the dvc/src/ssiu dma-names as an items list rather than an
allOf-wrapped single schema, and drop the now-redundant maxItems. Fix
the ports container to reference graph.yaml's ports definition instead
of port-base (a ports container is not itself a port), keeping
port-base on the port@N children, and constrain each playback/capture
phandle-array entry to a single phandle.

> diff --git a/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml b/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml
> index d7fa165546985..80670019d2f45 100644
> --- a/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml
> +++ b/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml

[ ... ]

> @@ -143,11 +139,12 @@ properties:
>                through the list to find a free channel.
>  
>            dma-names:
> -            maxItems: 5
> -            allOf:
> -              - items:
> -                  enum:
> -                    - tx
> +            items:
> +              - const: tx
> +              - const: tx
> +              - const: tx
> +              - const: tx
> +              - const: tx

[Severity: Medium]
Does this unintentionally enforce exactly 5 items?

In dt-schema, specifying an items list without an explicit minItems property
defaults minItems to the length of the list. Since the property description
mentions "As many as 5 can be provided", should we add minItems: 1 here so
it doesn't reject valid device trees specifying fewer fallback channels?

[ ... ]

> @@ -203,12 +200,22 @@ properties:
>                falls through the list to find a free channel.
>  
>            dma-names:
> -            maxItems: 10
> -            allOf:
> -              - items:
> -                  enum:
> -                    - tx
> -                    - rx
> +            items:
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]

[Severity: Medium]
Similarly for the ssi and ssiu nodes, does defining an items list of 10
elements without an explicit minItems implicitly set minItems: 10?

Could this break dtbs_check for valid hardware configurations that provide
fewer than 10 channels?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260603202805.3530046-1-john.madieu.xa@bp.renesas.com?part=1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema
  2026-06-03 20:28 [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema John Madieu
  2026-06-03 20:39 ` sashiko-bot
@ 2026-06-04 12:10 ` Geert Uytterhoeven
  2026-06-04 13:39   ` John Madieu
  2026-06-04 14:11 ` Rob Herring
  2 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2026-06-04 12:10 UTC (permalink / raw)
  To: John Madieu
  Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, magnus.damm,
	kuninori.morimoto.gx, linux-sound, devicetree, linux-kernel,
	linux-renesas-soc, john.madieu

Hi John,

On Wed, 3 Jun 2026 at 22:28, John Madieu <john.madieu.xa@bp.renesas.com> wrote:
> Express the dvc/src/ssiu dma-names as an items list rather than an
> allOf-wrapped single schema, and drop the now-redundant maxItems. Fix
> the ports container to reference graph.yaml's ports definition instead
> of port-base (a ports container is not itself a port), keeping
> port-base on the port@N children, and constrain each playback/capture
> phandle-array entry to a single phandle.
>
> While at it, drop the unused top-level #address-cells/#size-cells since
> no child node uses a unit address and the ports node provides its own,
> require interrupts/dmas/dma-names on the src sub-nodes to match the
> ssi/ssiu sub-nodes and the driver, pin clocks and resets to their fixed
> counts (47 and 14) to match the clock-names/reset-names lists, and put
> compatible and reg first in the example.
>
> Fixes: a86fd3c20218 ("ASoC: dt-bindings: sound: Add DT binding for RZ/G3E sound")
> Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>

Thanks for your patch!

> --- a/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml
> +++ b/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml

> @@ -320,6 +333,8 @@ examples:
>              <0x13c31000 0x1f000>,
>              <0x13c50000 0x10000>;
>        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
> +      #sound-dai-cells = <1>;
> +      #clock-cells = <0>;
>        clocks = <&cpg 245>,
>                 <&cpg 385>, <&cpg 386>,
>                 <&cpg 387>, <&cpg 388>,

What happened to the first clock cells (CPG_MOD)?

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] 5+ messages in thread

* RE: [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema
  2026-06-04 12:10 ` Geert Uytterhoeven
@ 2026-06-04 13:39   ` John Madieu
  0 siblings, 0 replies; 5+ messages in thread
From: John Madieu @ 2026-06-04 13:39 UTC (permalink / raw)
  To: geert
  Cc: lgirdwood@gmail.com, broonie@kernel.org, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, magnus.damm,
	Kuninori Morimoto, linux-sound@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org, john.madieu@gmail.com

Hi Geert,

Thank you for your review.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Donnerstag, 4. Juni 2026 14:10
> To: John Madieu <john.madieu.xa@bp.renesas.com>
> Cc: lgirdwood@gmail.com; broonie@kernel.org; robh@kernel.org;
> krzk+dt@kernel.org; conor+dt@kernel.org; magnus.damm
> <magnus.damm@gmail.com>; Kuninori Morimoto
> <kuninori.morimoto.gx@renesas.com>; linux-sound@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-renesas-
> soc@vger.kernel.org; john.madieu@gmail.com
> Subject: Re: [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-
> names list and ports schema
> 
> Hi John,
> 
> On Wed, 3 Jun 2026 at 22:28, John Madieu <john.madieu.xa@bp.renesas.com>
> wrote:
> > Express the dvc/src/ssiu dma-names as an items list rather than an
> > allOf-wrapped single schema, and drop the now-redundant maxItems. Fix
> > the ports container to reference graph.yaml's ports definition instead
> > of port-base (a ports container is not itself a port), keeping
> > port-base on the port@N children, and constrain each playback/capture
> > phandle-array entry to a single phandle.
> >
> > While at it, drop the unused top-level #address-cells/#size-cells
> > since no child node uses a unit address and the ports node provides
> > its own, require interrupts/dmas/dma-names on the src sub-nodes to
> > match the ssi/ssiu sub-nodes and the driver, pin clocks and resets to
> > their fixed counts (47 and 14) to match the clock-names/reset-names
> > lists, and put compatible and reg first in the example.
> >
> > Fixes: a86fd3c20218 ("ASoC: dt-bindings: sound: Add DT binding for
> > RZ/G3E sound")
> > Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > ---
> > a/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml
> > +++ b/Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.
> > +++ yaml
> 
> > @@ -320,6 +333,8 @@ examples:
> >              <0x13c31000 0x1f000>,
> >              <0x13c50000 0x10000>;
> >        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
> > +      #sound-dai-cells = <1>;
> > +      #clock-cells = <0>;
> >        clocks = <&cpg 245>,
> >                 <&cpg 385>, <&cpg 386>,
> >                 <&cpg 387>, <&cpg 388>,
> 
> What happened to the first clock cells (CPG_MOD)?

My bad. Next version of this patch will also re-establish it.

Regards,
John.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema
  2026-06-03 20:28 [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema John Madieu
  2026-06-03 20:39 ` sashiko-bot
  2026-06-04 12:10 ` Geert Uytterhoeven
@ 2026-06-04 14:11 ` Rob Herring
  2 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2026-06-04 14:11 UTC (permalink / raw)
  To: John Madieu
  Cc: lgirdwood, broonie, krzk+dt, conor+dt, geert+renesas, magnus.damm,
	kuninori.morimoto.gx, linux-sound, devicetree, linux-kernel,
	linux-renesas-soc, john.madieu

On Wed, Jun 03, 2026 at 08:28:05PM +0000, John Madieu wrote:
> Express the dvc/src/ssiu dma-names as an items list rather than an
> allOf-wrapped single schema, and drop the now-redundant maxItems. Fix
> the ports container to reference graph.yaml's ports definition instead
> of port-base (a ports container is not itself a port), keeping
> port-base on the port@N children, and constrain each playback/capture
> phandle-array entry to a single phandle.
> 
> While at it, drop the unused top-level #address-cells/#size-cells since
> no child node uses a unit address and the ports node provides its own,
> require interrupts/dmas/dma-names on the src sub-nodes to match the
> ssi/ssiu sub-nodes and the driver, pin clocks and resets to their fixed
> counts (47 and 14) to match the clock-names/reset-names lists, and put
> compatible and reg first in the example.
> 
> Fixes: a86fd3c20218 ("ASoC: dt-bindings: sound: Add DT binding for RZ/G3E sound")
> Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
> ---
>  .../sound/renesas,r9a09g047-sound.yaml        | 71 +++++++++++--------
>  1 file changed, 43 insertions(+), 28 deletions(-)


> @@ -143,11 +139,12 @@ properties:
>                through the list to find a free channel.
>  
>            dma-names:
> -            maxItems: 5
> -            allOf:
> -              - items:
> -                  enum:
> -                    - tx
> +            items:
> +              - const: tx
> +              - const: tx
> +              - const: tx
> +              - const: tx
> +              - const: tx

All you need is:

maxItems: 5
items:
  const: tx

(The schema form (vs. list form) of 'items' applies to all items.)

>  
>          required:
>            - dmas
> @@ -203,12 +200,22 @@ properties:
>                falls through the list to find a free channel.
>  
>            dma-names:
> -            maxItems: 10
> -            allOf:
> -              - items:
> -                  enum:
> -                    - tx
> -                    - rx
> +            items:
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]

maxItems: 10
items:
  enum: [ tx, rx ]

> +
> +        required:
> +          - interrupts
> +          - dmas
> +          - dma-names
>  
>    ssiu:
>      type: object
> @@ -229,12 +236,17 @@ properties:
>                falls through the list to find a free channel.
>  
>            dma-names:
> -            maxItems: 10
> -            allOf:
> -              - items:
> -                  enum:
> -                    - tx
> -                    - rx
> +            items:
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]
> +              - enum: [ tx, rx ]

And same here.

Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-04 14:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03 20:28 [PATCH] ASoC: dt-bindings: sound: renesas,r9a09g047: Fix dma-names list and ports schema John Madieu
2026-06-03 20:39 ` sashiko-bot
2026-06-04 12:10 ` Geert Uytterhoeven
2026-06-04 13:39   ` John Madieu
2026-06-04 14:11 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox