[PATCH v7 00/18] ASoC: rsnd: Add RZ/G3E audio driver support

John Madieu posted 18 patches 2 weeks ago
.../sound/renesas,r9a09g047-sound.yaml        | 800 ++++++++++++++++++
sound/soc/renesas/rcar/adg.c                  | 168 +++-
sound/soc/renesas/rcar/cmd.c                  |   2 +-
sound/soc/renesas/rcar/core.c                 | 161 +++-
sound/soc/renesas/rcar/ctu.c                  |  29 +-
sound/soc/renesas/rcar/dma.c                  | 280 ++++--
sound/soc/renesas/rcar/dvc.c                  |  29 +-
sound/soc/renesas/rcar/gen.c                  | 180 ++++
sound/soc/renesas/rcar/mix.c                  |  29 +-
sound/soc/renesas/rcar/rsnd.h                 |  73 +-
sound/soc/renesas/rcar/src.c                  |  91 +-
sound/soc/renesas/rcar/ssi.c                  |  49 +-
sound/soc/renesas/rcar/ssiu.c                 |  92 +-
13 files changed, 1857 insertions(+), 126 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml
[PATCH v7 00/18] ASoC: rsnd: Add RZ/G3E audio driver support
Posted by John Madieu 2 weeks ago
Add audio support for the Renesas RZ/G3E SoC to the R-Car Sound
driver. The RZ/G3E audio subsystem is based on R-Car Sound IP but
has several differences requiring dedicated handling:

  - SSI operates exclusively in BUSIF mode (no PIO)
  - 2-4 BUSIF channels per SSI (layout differs from R-Car)
  - Separate register regions for SCU, ADG, SSIU, SSI accessed by name
  - Per-SSI ADG and SSIF supply clocks
  - Dedicated audmapp clock/reset for Audio DMAC peri-peri
  - Per-SSI and per-module reset controllers via CPG
  - Unprefixed DT sub-node names (ssi, ssiu, src, ...) instead of
    rcar_sound,xxx
  - Hyphenated indexed clock/reset names (ssi-0, src-0, adg-ssi-0,
    audio-clka, ...) instead of the legacy dotted form

Link to v6 at [1].

Changes:

v7:
 - Split [PATCH v6 09/16] "ssui: Add RZ/G3E SSIU BUSIF support" into
   two patches: a preparatory "ssiu: Add shared SSI reset controller
   support" and "ssiu: Add RZ/G3E BUSIF support".
 - Split [PATCH v6 14/16] "src: Add SRC reset and clock support for
   RZ/G3E" into two patches: "src: Acquire shared SCU clocks for
   RZ/G3E" and "src: Add SRC reset support for RZ/G3E".
 - DT binding: add per-property descriptions for the DMA specifier
   lists, for the property-less mix/ctu sub-nodes and for the dai
   playback/capture phandle arrays; add #sound-dai-cells and
   #clock-cells to the required list; drop the dmas/dma-names
   blanket allowance on the ssi sub-node; add DT labels in the
   example so the phandle references resolve and dt_binding_check
   passes (Rob, sashiko-bot).
 - rsnd_mod_quit(): assert the reset before unpreparing the clock,
   mirroring the clock-then-reset ordering of rsnd_mod_init(); drop
   the unused <linux/delay.h> include (sashiko-bot).
 - adg: replace the bitwise-OR error accumulation in
   rsnd_adg_clk_control() with dedicated
   rsnd_adg_ssi_clk_prepare()/_unprepare() helpers that stop at the
   first failure, unwind the partially prepared clocks and preserve
   the first error, guarded by a new ssi_clk_prepared flag
   (sashiko-bot).
 - dma: wrap the index arguments of the RDMA_*_G3E address macros in
   parentheses (sashiko-bot).
 - src: acquire the shared "scu" reset once before the per-SRC probe
   loop instead of inside it.
 - core: split the r9a09g047 match-data initialiser line after the
   comma rather than after the pipe (Geert Uytterhoeven).
 - Fix the kernel-doc comment of rsnd_devm_clk_get_indexed() to refer
   to -ENOENT instead of ENODEV (Mark).
 - Fix the "audmacpp" spelling to "audmapp" in the AUDMAC peri-peri
   patch subject and commit message.

v6:
 - Rename all indexed clock-names and reset-names from the dotted form
   ("ssi.0", "src.0", "adg.ssi.0", "clk_a", ...) to the hyphenated form
   ("ssi-0", "src-0", "adg-ssi-0", "audio-clka", ...).
 - DT binding: tighten #sound-dai-cells to const: 1, drop the unused
   clock-frequency and clkout-lr-asynchronous properties.
 - Add a new preparatory patch to handle the hyphenated DT name first and
   fall back to the legacy dotted form, so existing R-Car DTs keep
   working unchanged while new bindings can use the hyphenated convention.
 - Convert the SSI, SRC, CTU, DVC and MIX probes to the helpers and drop
   the per-module name buffers and NAME_SIZE defines.
 - Add a new patch adding a third clkin name table for RZ/G3E and
   dispatching to it in the same style as the existing Gen4
   branch. CLKA/B/C/I enum values, the clkin[] array and the
   BRGA/BRGB derivation are unchanged; only the DT lookup names
   differ and use the hyphenated form.
 - audmacpp: enable the clock before deasserting the reset so the
   block sees a stable clock on the way out of reset (and mirror
   the ordering on suspend/resume).
 - SRC: use devm_clk_get_optional_enabled() for scu_supply and drop
   the manual prepare/enable in rsnd_src_init()/rsnd_src_quit(),
   so scu_supply has the same lifetime as scu/scu_x2.
 - adg: simplify the per-SSI ADG and SSIF supply clock
 - Strip out the "rcar_sound," from binding, DT, and add corresponding
   code support.
 - suspend/resume: respect the probe ordering in
   rsnd_dma_suspend()/_resume() (assert reset before disabling
   clock on suspend; enable clock before deasserting reset on
   resume)
 - Guard rsnd_src_suspend()/_resume() so platforms without SRC are safe.

v5:
 - Drop the rsnd.yaml binding split (patches 01/12 and 02/12 from v4).
 - Extract RSND_SOC_MASK fix as a standalone bug-fix patch (was
   previously embedded in patch 04) per Kuninori's request.
 - Split the DMA refactor out of patch 06/12 into its own
   preparatory patch, so the struct/lookup introduction and the
   RZ/G3E address tables are in separate commits.
 - Add new patch "Support unprefixed DT node names for RZ/G3E"
   converting rsnd_parse_of_node() to a function that tries the
   legacy rcar_sound, prefix first, then falls back to the bare
   name.
 - Simplify flags layout comment per Kuninori's feedback.
 - Add comment clarifying that clock/reset acquisition is optional
   and no-error when absent from DT, and drop spurious blank line
   in rsnd.h.
 - Move RZ/G3E DMA address comment to rsnd_rzg3e_dma_addr(), not
   the shared header. Separate the line-wrap-only change in
   rsnd_gen2_dma_addr() into the preparatory patch only.

v4:
 - Add reset_control_assert() in rsnd_mod_quit() for symmetry with
   deassert in rsnd_mod_init() (Mark Brown)
 - Fix RSND_SOC_MASK to (0xF << 4) to avoid overlap with
   RSND_RZ_MASK. Add nibble layout comment documenting the flag
   bit allocation.
 - Move audmapp_clk and audmapp_rstc from struct rsnd_priv into
   struct rsnd_dma_ctrl.
 - Replace raw [3][2][3] DMA address array with named structs
   (rsnd_dma_addr_dir, rsnd_dma_addr_map) for self-documenting
   table initializers.
 - Move busif_status_count from file-static into new
   struct rsnd_ssiu_ctrl, following the rsnd_dma_ctrl pattern.
   Remove duplicate priv variable. Properly propagate reset errors
   via dev_err_probe().
 - Clarify commit message regarding PIO mode still being available
   on R-Car.
 - Collapse dev_err_probe() and rsnd_mod_init() calls to single
   lines.
 - Move per-SSI ADG and SSIF supply clock prepare/unprepare into
   rsnd_adg_clk_control() instead of separate functions.
 - Move shared SCU clocks from file-statics into new
   struct rsnd_src_ctrl.
 - Merge rsnd_adg_mod_get() helper directly into the suspend/resume
   patch.
 - Drop former patch 12/14 "Add rsnd_adg_mod_get() for PM support".
 - Drop former patch 13/14 "Export rsnd_ssiu_mod_get() for PM
   support".

v3:
 - Split out from v2 series [2] to ASoC-specific patchset.

v2:
 - Split of rsnd.yaml into common and R-Car-specific schemas.
 - Introduce RZ/G3E sound binding as a standalone schema.
 - Addressed Kuninori's comments (details in individual patches).

[1] https://lore.kernel.org/all/20260512182631.3842065-1-john.madieu.xa@bp.renesas.com/
[2] https://lore.kernel.org/all/20260415124731.3684773-1-john.madieu.xa@bp.renesas.com/

John Madieu (18):
  ASoC: dt-bindings: sound: Add DT binding for RZ/G3E sound
  ASoC: rsnd: Fix RSND_SOC_MASK width to single nibble
  ASoC: rsnd: Add reset controller support to rsnd_mod
  ASoC: rsnd: Support hyphen or dot in indexed clock and reset names
  ASoC: rsnd: Add RZ/G3E SoC probing and register map
  ASoC: rsnd: Add audmapp clock and reset support for RZ/G3E
  ASoC: rsnd: Refactor DMA address tables with named structs
  ASoC: rsnd: Add RZ/G3E DMA address calculation support
  ASoC: rsnd: ssiu: Add shared SSI reset controller support
  ASoC: rsnd: ssiu: Add RZ/G3E BUSIF support
  ASoC: rsnd: Add SSI reset support for RZ/G3E platform
  ASoC: rsnd: Add ADG reset support for RZ/G3E
  ASoC: rsnd: adg: Add per-SSI ADG and SSIF supply clock management
  ASoC: rsnd: adg: Look up RZ/G3E clkin under audio-clk{a,b,c,i}
  ASoC: rsnd: src: Acquire shared SCU clocks for RZ/G3E
  ASoC: rsnd: src: Add SRC reset support for RZ/G3E
  ASoC: rsnd: Support unprefixed DT node names for RZ/G3E
  ASoC: rsnd: Add system suspend/resume support

 .../sound/renesas,r9a09g047-sound.yaml        | 800 ++++++++++++++++++
 sound/soc/renesas/rcar/adg.c                  | 168 +++-
 sound/soc/renesas/rcar/cmd.c                  |   2 +-
 sound/soc/renesas/rcar/core.c                 | 161 +++-
 sound/soc/renesas/rcar/ctu.c                  |  29 +-
 sound/soc/renesas/rcar/dma.c                  | 280 ++++--
 sound/soc/renesas/rcar/dvc.c                  |  29 +-
 sound/soc/renesas/rcar/gen.c                  | 180 ++++
 sound/soc/renesas/rcar/mix.c                  |  29 +-
 sound/soc/renesas/rcar/rsnd.h                 |  73 +-
 sound/soc/renesas/rcar/src.c                  |  91 +-
 sound/soc/renesas/rcar/ssi.c                  |  49 +-
 sound/soc/renesas/rcar/ssiu.c                 |  92 +-
 13 files changed, 1857 insertions(+), 126 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/renesas,r9a09g047-sound.yaml

-- 
2.25.1
Re: [PATCH v7 00/18] ASoC: rsnd: Add RZ/G3E audio driver support
Posted by Kuninori Morimoto 2 weeks ago
Hi John

> Add audio support for the Renesas RZ/G3E SoC to the R-Car Sound
> driver. The RZ/G3E audio subsystem is based on R-Car Sound IP but
> has several differences requiring dedicated handling:
> 
>   - SSI operates exclusively in BUSIF mode (no PIO)
>   - 2-4 BUSIF channels per SSI (layout differs from R-Car)
>   - Separate register regions for SCU, ADG, SSIU, SSI accessed by name
>   - Per-SSI ADG and SSIF supply clocks
>   - Dedicated audmapp clock/reset for Audio DMAC peri-peri
>   - Per-SSI and per-module reset controllers via CPG
>   - Unprefixed DT sub-node names (ssi, ssiu, src, ...) instead of
>     rcar_sound,xxx
>   - Hyphenated indexed clock/reset names (ssi-0, src-0, adg-ssi-0,
>     audio-clka, ...) instead of the legacy dotted form

Thank you for the patches.

For all patches (except DT bindings)

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>


Thank you for your help !!

Best regards
---
Kuninori Morimoto
Re: [PATCH v7 00/18] ASoC: rsnd: Add RZ/G3E audio driver support
Posted by Mark Brown 6 days, 10 hours ago
On Mon, 25 May 2026 11:02:12 +0000, John Madieu wrote:
> ASoC: rsnd: Add RZ/G3E audio driver support
> 
> Add audio support for the Renesas RZ/G3E SoC to the R-Car Sound
> driver. The RZ/G3E audio subsystem is based on R-Car Sound IP but
> has several differences requiring dedicated handling:
> 
>   - SSI operates exclusively in BUSIF mode (no PIO)
>   - 2-4 BUSIF channels per SSI (layout differs from R-Car)
>   - Separate register regions for SCU, ADG, SSIU, SSI accessed by name
>   - Per-SSI ADG and SSIF supply clocks
>   - Dedicated audmapp clock/reset for Audio DMAC peri-peri
>   - Per-SSI and per-module reset controllers via CPG
>   - Unprefixed DT sub-node names (ssi, ssiu, src, ...) instead of
>     rcar_sound,xxx
>   - Hyphenated indexed clock/reset names (ssi-0, src-0, adg-ssi-0,
>     audio-clka, ...) instead of the legacy dotted form
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2

Thanks!

[01/18] ASoC: dt-bindings: sound: Add DT binding for RZ/G3E sound
        https://git.kernel.org/broonie/sound/c/a86fd3c20218
[02/18] ASoC: rsnd: Fix RSND_SOC_MASK width to single nibble
        https://git.kernel.org/broonie/sound/c/c0758279367e
[03/18] ASoC: rsnd: Add reset controller support to rsnd_mod
        https://git.kernel.org/broonie/sound/c/83c9631e974f
[04/18] ASoC: rsnd: Support hyphen or dot in indexed clock and reset names
        https://git.kernel.org/broonie/sound/c/22622faf8120
[05/18] ASoC: rsnd: Add RZ/G3E SoC probing and register map
        https://git.kernel.org/broonie/sound/c/948b075ebc95
[06/18] ASoC: rsnd: Add audmapp clock and reset support for RZ/G3E
        https://git.kernel.org/broonie/sound/c/fb859f6fc43b
[07/18] ASoC: rsnd: Refactor DMA address tables with named structs
        https://git.kernel.org/broonie/sound/c/e870c10f8bb6
[08/18] ASoC: rsnd: Add RZ/G3E DMA address calculation support
        https://git.kernel.org/broonie/sound/c/1cd10dab6702
[09/18] ASoC: rsnd: ssiu: Add shared SSI reset controller support
        https://git.kernel.org/broonie/sound/c/b4ef837a28a1
[10/18] ASoC: rsnd: ssiu: Add RZ/G3E BUSIF support
        https://git.kernel.org/broonie/sound/c/80f43c521771
[11/18] ASoC: rsnd: Add SSI reset support for RZ/G3E platform
        https://git.kernel.org/broonie/sound/c/692f03422f0e
[12/18] ASoC: rsnd: Add ADG reset support for RZ/G3E
        https://git.kernel.org/broonie/sound/c/9267b89985de
[13/18] ASoC: rsnd: adg: Add per-SSI ADG and SSIF supply clock management
        https://git.kernel.org/broonie/sound/c/47899d53f86f
[14/18] ASoC: rsnd: adg: Look up RZ/G3E clkin under audio-clk{a,b,c,i}
        https://git.kernel.org/broonie/sound/c/16593532c47a
[15/18] ASoC: rsnd: src: Acquire shared SCU clocks for RZ/G3E
        https://git.kernel.org/broonie/sound/c/799836bc37ac
[16/18] ASoC: rsnd: src: Add SRC reset support for RZ/G3E
        https://git.kernel.org/broonie/sound/c/33a3500a34b8
[17/18] ASoC: rsnd: Support unprefixed DT node names for RZ/G3E
        https://git.kernel.org/broonie/sound/c/ec1b5ebf6d8b
[18/18] ASoC: rsnd: Add system suspend/resume support
        https://git.kernel.org/broonie/sound/c/ef19ecf042b4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark