public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: John Madieu <john.madieu.xa@bp.renesas.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	 Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	 Geert Uytterhoeven <geert+renesas@glider.be>,
	Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	 Magnus Damm <magnus.damm@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	 Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	john.madieu@gmail.com,  linux-sound@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 01/12] ASoC: dt-bindings: renesas,rsnd: Split into generic and SoC-specific parts
Date: Fri, 10 Apr 2026 09:05:29 +0200	[thread overview]
Message-ID: <20260410-private-natural-chital-fea61b@quoll> (raw)
In-Reply-To: <20260409090302.2243305-2-john.madieu.xa@bp.renesas.com>

On Thu, Apr 09, 2026 at 11:02:50AM +0200, John Madieu wrote:
> The current renesas,rsnd.yaml binding file handles all supported SoCs
> in a single schema, resulting in deeply nested if/else/then constructs
> that become increasingly difficult to maintain. Each new SoC addition
> amplifies this complexity, making reviews harder and diffs noisier than
> they need to be.
> 
> Refactor the binding by extracting the common properties shared across
> all SoCs into a dedicated renesas,rsnd-common.yaml schema, and keeping
> only SoC-specific constraints (required nodes, port counts, clock names,
> etc.) in per-SoC or per-family files that $ref the common part.
> 
> This prepares the ground for upcoming SoCs such as the RZ/G3E, which
> introduces a different set of audio resources compared to existing
> R-Car Gen variants. With the split in place, adding RZ/G3E support
> becomes a self-contained change that neither bloats a monolithic schema
> nor buries new constraints inside ever-deeper conditional blocks.
> 
> No functional change in validation behaviour for existing device trees.
> 
> Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
> ---
> 
> Changes:
>  
> v4: No changes
> v3: No changes
> v2:
>  - Split of rsnd.yaml into common and R-Car-specific schemas
> 
>  .../bindings/sound/renesas,rsnd-common.yaml   | 196 +++++++++++
>  .../bindings/sound/renesas,rsnd.yaml          | 319 +++++-------------
>  2 files changed, 274 insertions(+), 241 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/renesas,rsnd-common.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd-common.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd-common.yaml
> new file mode 100644
> index 000000000000..ec6bf644d1a4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd-common.yaml
> @@ -0,0 +1,196 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/renesas,rsnd-common.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas R-Car/RZ Sound Common Properties
> +
> +maintainers:
> +  - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> +
> +description:
> +  Common property and subnode definitions shared by Renesas R-Car and RZ
> +  sound controller bindings.
> +
> +select: false

Drop

> +
> +properties:
> +  compatible: true

Drop

> +
> +  reg: true
> +
> +  reg-names: true

Drop both. They are pointless if they do not provide any reasonable
information like constraints.

> +
> +  "#sound-dai-cells":
> +    description:
> +      Must be 0 for a single-DAI system and 1 for a multi-DAI system.
> +    enum: [0, 1]

Drop, dai-common brings it.

> +
> +  "#clock-cells":
> +    description:
> +      Must be 0 when the system has audio_clkout and 1 when it has
> +      audio_clkout0/1/2/3.
> +    enum: [0, 1]

Is every device a clock? Anyway, having it here is almost pointless if
every binding has to add it anyway.

> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +  clock-frequency:
> +    description: Audio clock output frequency for audio_clkout0/1/2/3.
> +
> +  clkout-lr-asynchronous:
> +    description: audio_clkoutn is asynchronous with lr-clock.
> +    $ref: /schemas/types.yaml#/definitions/flag
> +
> +  power-domains: true
> +
> +  resets: true
> +
> +  reset-names: true
> +
> +  clocks: true
> +
> +  clock-names: true

All pointless.

Please use existing code as guideline. Which recently added common
bindings have such syntax?


> +
> +  port:
> +    $ref: audio-graph-port.yaml#/definitions/port-base
> +    unevaluatedProperties: false
> +    patternProperties:
> +      "^endpoint(@[0-9a-f]+)?$":
> +        $ref: audio-graph-port.yaml#/definitions/endpoint-base
> +        properties:
> +          playback:
> +            $ref: /schemas/types.yaml#/definitions/phandle-array
> +          capture:
> +            $ref: /schemas/types.yaml#/definitions/phandle-array
> +        unevaluatedProperties: false
> +
> +  rcar_sound,dvc:
> +    description: DVC subnode.
> +    type: object
> +    patternProperties:
> +      "^dvc-[0-1]$":
> +        type: object
> +        additionalProperties: false
> +        properties:
> +          dmas: true
> +          dma-names: true
> +        required:
> +          - dmas
> +          - dma-names
> +    additionalProperties: false
> +
> +  rcar_sound,mix:
> +    description: MIX subnode.
> +    type: object
> +    patternProperties:
> +      "^mix-[0-1]$":
> +        type: object
> +        additionalProperties: false
> +    additionalProperties: false
> +
> +  rcar_sound,ctu:
> +    description: CTU subnode.
> +    type: object
> +    patternProperties:
> +      "^ctu-[0-7]$":
> +        type: object
> +        additionalProperties: false
> +    additionalProperties: false
> +
> +  rcar_sound,src:
> +    description: SRC subnode.
> +    type: object
> +    patternProperties:
> +      "^src-[0-9]$":
> +        type: object
> +        additionalProperties: false
> +        properties:
> +          interrupts:
> +            maxItems: 1
> +          dmas: true
> +          dma-names: true
> +    additionalProperties: false
> +
> +  rcar_sound,ssiu:
> +    description: SSIU subnode.
> +    type: object
> +    patternProperties:
> +      "^ssiu-[0-9]+$":
> +        type: object
> +        additionalProperties: false
> +        properties:
> +          dmas: true
> +          dma-names: true
> +        required:
> +          - dmas
> +          - dma-names
> +    additionalProperties: false
> +
> +  rcar_sound,ssi:
> +    description: SSI subnode.
> +    type: object
> +    patternProperties:
> +      "^ssi-[0-9]$":
> +        type: object
> +        additionalProperties: false
> +        properties:
> +          interrupts:
> +            maxItems: 1
> +          dmas: true
> +          dma-names: true
> +          shared-pin:
> +            description: Shared clock pin.
> +            $ref: /schemas/types.yaml#/definitions/flag
> +          pio-transfer:
> +            description: PIO transfer mode.
> +            $ref: /schemas/types.yaml#/definitions/flag
> +          no-busif:
> +            description: BUSIF is not used for the mem-to-SSI via DMA case.
> +            $ref: /schemas/types.yaml#/definitions/flag
> +        required:
> +          - interrupts
> +    additionalProperties: false
> +
> +patternProperties:
> +  'rcar_sound,dai(@[0-9a-f]+)?$':
> +    description: DAI subnode.
> +    type: object
> +    patternProperties:
> +      "^dai([0-9]+)?$":
> +        type: object
> +        additionalProperties: false
> +        properties:
> +          playback:
> +            $ref: /schemas/types.yaml#/definitions/phandle-array
> +          capture:
> +            $ref: /schemas/types.yaml#/definitions/phandle-array
> +        anyOf:
> +          - required:
> +              - playback
> +          - required:
> +              - capture
> +    additionalProperties: false
> +
> +  'ports(@[0-9a-f]+)?$':
> +    $ref: audio-graph-port.yaml#/definitions/port-base
> +    unevaluatedProperties: false
> +    patternProperties:
> +      '^port(@[0-9a-f]+)?$':
> +        $ref: "#/properties/port"
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - clocks
> +  - clock-names
> +
> +allOf:
> +  - $ref: dai-common.yaml#
> +
> +additionalProperties: true
> diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> index e8a2acb92646..0d989922a5b4 100644
> --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> @@ -9,8 +9,11 @@ title: Renesas R-Car Sound Driver
>  maintainers:
>    - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>  
> -properties:
> +description:
> +  Binding for Renesas R-Car Gen1/Gen2/Gen3/Gen4 and RZ/G1/G2 sound

Drop "Binding for" and describe the hardware instead.

> +  controllers using the standard RSND layout.
>  
> +properties:
>    compatible:
>      oneOf:
>        # for Gen1 SoC
> @@ -67,34 +70,6 @@ properties:
>      minItems: 1
>      maxItems: 5
>  
> -  "#sound-dai-cells":
> -    description: |
> -      it must be 0 if your system is using single DAI
> -      it must be 1 if your system is using multi  DAIs
> -      This is used on simple-audio-card
> -    enum: [0, 1]
> -
> -  "#clock-cells":
> -    description: |
> -      it must be 0 if your system has audio_clkout
> -      it must be 1 if your system has audio_clkout0/1/2/3
> -    enum: [0, 1]
> -
> -  "#address-cells":
> -    const: 1
> -
> -  "#size-cells":
> -    const: 0
> -
> -  clock-frequency:
> -    description: for audio_clkout0/1/2/3
> -
> -  clkout-lr-asynchronous:
> -    description: audio_clkoutn is asynchronizes with lr-clock.
> -    $ref: /schemas/types.yaml#/definitions/flag
> -
> -  power-domains: true
> -
>    resets:
>      minItems: 1
>      maxItems: 11
> @@ -109,181 +84,45 @@ properties:
>      maxItems: 31
>  
>    clock-names:
> -    description: List of necessary clock names.
> -    # details are defined below
> -
> -  # ports is below
> -  port:
> -    $ref: audio-graph-port.yaml#/definitions/port-base
> -    unevaluatedProperties: false
> -    patternProperties:
> -      "^endpoint(@[0-9a-f]+)?":
> -        $ref: audio-graph-port.yaml#/definitions/endpoint-base
> -        properties:
> -          playback:
> -            $ref: /schemas/types.yaml#/definitions/phandle-array
> -          capture:
> -            $ref: /schemas/types.yaml#/definitions/phandle-array
> -        unevaluatedProperties: false
> -
> -  rcar_sound,dvc:
> -    description: DVC subnode.
> -    type: object
> -    patternProperties:
> -      "^dvc-[0-1]$":
> -        type: object
> -        additionalProperties: false
> -
> -        properties:
> -          dmas:
> -            maxItems: 1
> -          dma-names:
> -            const: tx
> -        required:
> -          - dmas
> -          - dma-names
> -    additionalProperties: false
> -
> -  rcar_sound,mix:
> -    description: MIX subnode.
> -    type: object
> -    patternProperties:
> -      "^mix-[0-1]$":
> -        type: object
> -        additionalProperties: false
> -    additionalProperties: false
> -
> -  rcar_sound,ctu:
> -    description: CTU subnode.
> -    type: object
> -    patternProperties:
> -      "^ctu-[0-7]$":
> -        type: object
> -        additionalProperties: false
> -    additionalProperties: false
> -
> -  rcar_sound,src:
> -    description: SRC subnode.
> -    type: object
> -    patternProperties:
> -      "^src-[0-9]$":
> -        type: object
> -        additionalProperties: false
> -
> -        properties:
> -          interrupts:
> -            maxItems: 1
> -          dmas:
> -            maxItems: 2
> -          dma-names:
> -            allOf:
> -              - items:
> -                  enum:
> -                    - tx
> -                    - rx
> -    additionalProperties: false
> -
> -  rcar_sound,ssiu:
> -    description: SSIU subnode.
> -    type: object
> -    patternProperties:
> -      "^ssiu-[0-9]+$":
> -        type: object
> -        additionalProperties: false
> -
> -        properties:
> -          dmas:
> -            maxItems: 2
> -          dma-names:
> -            allOf:
> -              - items:
> -                  enum:
> -                    - tx
> -                    - rx
> -        required:
> -          - dmas
> -          - dma-names
> -    additionalProperties: false
> -
> -  rcar_sound,ssi:
> -    description: SSI subnode.
> -    type: object
> -    patternProperties:
> -      "^ssi-[0-9]$":
> -        type: object
> -        additionalProperties: false
> -
> -        properties:
> -          interrupts:
> -            maxItems: 1
> -          dmas:
> -            minItems: 2
> -            maxItems: 4
> -          dma-names:
> -            allOf:
> -              - items:
> -                  enum:
> -                    - tx
> -                    - rx
> -                    - txu # if no ssiu node
> -                    - rxu # if no ssiu node
> -
> -          shared-pin:
> -            description: shared clock pin
> -            $ref: /schemas/types.yaml#/definitions/flag
> -          pio-transfer:
> -            description: PIO transfer mode
> -            $ref: /schemas/types.yaml#/definitions/flag
> -          no-busif:
> -            description: BUSIF is not used when [mem -> SSI] via DMA case
> -            $ref: /schemas/types.yaml#/definitions/flag
> -        required:
> -          - interrupts
> -    additionalProperties: false
> +    description: List of clock names.
> +    minItems: 1
> +    maxItems: 31
> +
> +  "#sound-dai-cells": true
> +
> +  "#clock-cells": true
> +
> +  "#address-cells": true
> +
> +  "#size-cells": true
> +
> +  clock-frequency: true
> +
> +  clkout-lr-asynchronous: true
> +
> +  power-domains: true
> +
> +  port: true
> +
> +  rcar_sound,dvc: true
> +
> +  rcar_sound,mix: true
> +
> +  rcar_sound,ctu: true
> +
> +  rcar_sound,src: true
> +
> +  rcar_sound,ssiu: true
> +
> +  rcar_sound,ssi: true

What are all these? Why are you adding such blanket properties? This is
not the syntax binding should follow, there are almost no other bindings
using such style. Except pin control maybe and this is not a pinctrl.

You miss here proper constraints for all your properties like clock-cells, sound-dai-cells and so on.

>  
>  patternProperties:
> -  # For DAI base
> -  'rcar_sound,dai(@[0-9a-f]+)?$':
> -    description: DAI subnode.
> -    type: object
> -    patternProperties:
> -      "^dai([0-9]+)?$":
> -        type: object
> -        additionalProperties: false
> -
> -        properties:
> -          playback:
> -            $ref: /schemas/types.yaml#/definitions/phandle-array
> -          capture:
> -            $ref: /schemas/types.yaml#/definitions/phandle-array
> -        anyOf:
> -          - required:
> -              - playback
> -          - required:
> -              - capture
> -    additionalProperties: false
> -
> -  'ports(@[0-9a-f]+)?$':
> -    $ref: audio-graph-port.yaml#/definitions/port-base
> -    unevaluatedProperties: false
> -    patternProperties:
> -      '^port(@[0-9a-f]+)?$':
> -        $ref: "#/properties/port"
> -
> -required:
> -  - compatible
> -  - reg
> -  - reg-names
> -  - clocks
> -  - clock-names
> +  'rcar_sound,dai(@[0-9a-f]+)?$': true
> +  'ports(@[0-9a-f]+)?$': true

Also no. This is pure redundant code. No effect, no benefits.

>  
>  allOf:
> -  - $ref: dai-common.yaml#
> +  - $ref: renesas,rsnd-common.yaml#

Best regards,
Krzysztof


  reply	other threads:[~2026-04-10  7:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09  9:02 [PATCH v4 00/12] ASoC: rsnd: Add RZ/G3E audio driver support John Madieu
2026-04-09  9:02 ` [PATCH v4 01/12] ASoC: dt-bindings: renesas,rsnd: Split into generic and SoC-specific parts John Madieu
2026-04-10  7:05   ` Krzysztof Kozlowski [this message]
2026-04-09  9:02 ` [PATCH v4 02/12] ASoC: dt-bindings: Add RZ/G3E (R9A09G047) sound binding John Madieu
2026-04-10  7:10   ` Krzysztof Kozlowski
2026-04-15 10:43     ` John Madieu
2026-04-09  9:02 ` [PATCH v4 03/12] ASoC: rsnd: Add reset controller support to rsnd_mod John Madieu
2026-04-09  9:02 ` [PATCH v4 04/12] ASoC: rsnd: Add RZ/G3E SoC probing and register map John Madieu
2026-04-10  1:54   ` Kuninori Morimoto
2026-04-09  9:02 ` [PATCH v4 05/12] ASoC: rsnd: Add audmacpp clock and reset support for RZ/G3E John Madieu
2026-04-10  1:56   ` Kuninori Morimoto
2026-04-09  9:02 ` [PATCH v4 06/12] ASoC: rsnd: Add RZ/G3E DMA address calculation support John Madieu
2026-04-10  2:06   ` Kuninori Morimoto
2026-04-09  9:02 ` [PATCH v4 07/12] ASoC: rsnd: ssui: Add RZ/G3E SSIU BUSIF support John Madieu
2026-04-09  9:02 ` [PATCH v4 08/12] ASoC: rsnd: Add SSI reset support for RZ/G3E platforms John Madieu
2026-04-09  9:02 ` [PATCH v4 09/12] ASoC: rsnd: Add ADG reset support for RZ/G3E John Madieu
2026-04-09  9:02 ` [PATCH v4 10/12] ASoC: rsnd: adg: Add per-SSI ADG and SSIF supply clock management John Madieu
2026-04-09  9:03 ` [PATCH v4 11/12] ASoC: rsnd: src: Add SRC reset and clock support for RZ/G3E John Madieu
2026-04-09  9:03 ` [PATCH v4 12/12] ASoC: rsnd: Add system suspend/resume support John Madieu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260410-private-natural-chital-fea61b@quoll \
    --to=krzk@kernel.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=john.madieu.xa@bp.renesas.com \
    --cc=john.madieu@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox