mbox series

[v4,00/24] Add audio support for the Renesas RZ/G3S SoC

Message ID 20241210170953.2936724-1-claudiu.beznea.uj@bp.renesas.com
Headers show
Series Add audio support for the Renesas RZ/G3S SoC | expand

Message

Claudiu Dec. 10, 2024, 5:09 p.m. UTC
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

Hi,

Series enables the audio support for the Renesas RZ/G3S
SoC along with runtime PM and suspend to RAM.

Patches:
- 01-03/24 - update versaclock3 clock generator driver to support the
             5L35023 hardware variant; versaclock3 provides clocks for
             the audio devices (SSIF, DA7212 codec)
- 04-19/24 - add SSIF support for the RZ/G3S SoC; fixes and cleanups
             were also included
- 20-24/24 - add device tree support

Merge strategy, if any:
- clock patches (01-03/24) can go the clock tree
- audio patches (04-19/24) can go through the audio tree
- device tree patches (20-24/24) can go through the Renesas tree

Thank you,
Claudiu Beznea

Changes in v4:
- added patch 18/24 "ASoC: dt-bindings: renesas,rz-ssi: Remove DMA
  description"
- collected tags
- addressed review comments
- dropped already integrated patches
- the changelog for each patch is detailed within the individual
  patches

Changes in v3:
- use renesas instead of sh in audio patches title
- use proper fixes tag for patch
  "ASoC: renesas: rz-ssi: Terminate all the DMA transactions"
- collected tags

Changes in v2:
- fixed typos pointed out in the review process
- dropped da7213 patches already applied
- dropped patch "ASoC: sh: rz-ssi: Use a proper bitmask for clear bits"
  as requested in the review process


Claudiu Beznea (24):
  clk: versaclock3: Prepare for the addition of 5L35023 device
  dt-bindings: clock: versaclock3: Document 5L35023 Versa3 clock
    generator
  clk: versaclock3: Add support for the 5L35023 variant
  ASoC: renesas: rz-ssi: Terminate all the DMA transactions
  ASoC: renesas: rz-ssi: Use only the proper amount of dividers
  ASoC: renesas: rz-ssi: Fix typo on SSI_RATES macro comment
  ASoC: renesas: rz-ssi: Remove pdev member of struct rz_ssi_priv
  ASoC: renesas: rz-ssi: Remove the rz_ssi_get_dai() function
  ASoC: renesas: rz-ssi: Remove the first argument of
    rz_ssi_stream_is_play()
  ASoC: renesas: rz-ssi: Use readl_poll_timeout_atomic()
  ASoC: renesas: rz-ssi: Use temporary variable for struct device
  ASoC: renesas: rz-ssi: Use goto label names that specify their actions
  ASoC: renesas: rz-ssi: Rely on the ASoC subsystem to runtime
    resume/suspend the SSI
  ASoC: renesas: rz-ssi: Enable runtime PM autosuspend support
  ASoC: renesas: rz-ssi: Add runtime PM support
  ASoC: renesas: rz-ssi: Issue software reset in hw_params API
  ASoC: renesas: rz-ssi: Add suspend to RAM support
  ASoC: dt-bindings: renesas,rz-ssi: Remove DMA description
  ASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC
  arm64: dts: renesas: r9a08g045: Add SSI nodes
  arm64: dts: renesas: rzg3s-smarc-som: Add versa3 clock generator node
  arm64: dts: renesas: Add da7212 audio codec node
  arm64: dts: renesas: rzg3s-smarc: Enable SSI3
  arm64: dts: renesas: rzg3s-smarc: Add sound card

 .../bindings/clock/renesas,5p35023.yaml       |   1 +
 .../bindings/sound/renesas,rz-ssi.yaml        |  19 +-
 arch/arm64/boot/dts/renesas/r9a08g045.dtsi    |  94 ++++++++
 .../boot/dts/renesas/rzg3s-smarc-som.dtsi     |  47 +++-
 arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi  |  63 +++++
 drivers/clk/clk-versaclock3.c                 |  67 ++++--
 sound/soc/renesas/rz-ssi.c                    | 226 +++++++++++-------
 7 files changed, 388 insertions(+), 129 deletions(-)

Comments

Stephen Boyd Dec. 10, 2024, 10:51 p.m. UTC | #1
Quoting Claudiu (2024-12-10 09:09:30)
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> 
> The 5P35023 and 5L35035 Versa 3 clock generator variants are different but
> the versaclock3 driver could be used with small adjustments. The features
> that are implemented in driver and differs b/w variants are the PLL2 Fvco
> and clock sel bit for SE2 clock. Adjust the driver to prepare for the
> addition of 5L35023 device.
> 
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---

Applied to clk-next
Stephen Boyd Dec. 10, 2024, 10:52 p.m. UTC | #2
Quoting Claudiu (2024-12-10 09:09:32)
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> 
> Add support for the 5L35023 variant of the Versa 3 clock generator.
> 
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---

Applied to clk-next
Geert Uytterhoeven Dec. 11, 2024, 12:35 p.m. UTC | #3
On Tue, Dec 10, 2024 at 6:10 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> The stop trigger invokes rz_ssi_stop() and rz_ssi_stream_quit().
> - The purpose of rz_ssi_stop() is to disable TX/RX, terminate DMA
>   transactions, and set the controller to idle.
> - The purpose of rz_ssi_stream_quit() is to reset the substream-specific
>   software data by setting strm->running and strm->substream appropriately.
>
> The function rz_ssi_is_stream_running() checks if both strm->substream and
> strm->running are valid and returns true if so. Its implementation is as
> follows:
>
> static inline bool rz_ssi_is_stream_running(struct rz_ssi_stream *strm)
> {
>     return strm->substream && strm->running;
> }
>
> When the controller is configured in full-duplex mode (with both playback
> and capture active), the rz_ssi_stop() function does not modify the
> controller settings when called for the first substream in the full-duplex
> setup. Instead, it simply sets strm->running = 0 and returns if the
> companion substream is still running. The following code illustrates this:
>
> static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
> {
>     strm->running = 0;
>
>     if (rz_ssi_is_stream_running(&ssi->playback) ||
>         rz_ssi_is_stream_running(&ssi->capture))
>         return 0;
>
>     // ...
> }
>
> The controller settings, along with the DMA termination (for the last
> stopped substream), are only applied when the last substream in the
> full-duplex setup is stopped.
>
> While applying the controller settings only when the last substream stops
> is not problematic, terminating the DMA operations for only one substream
> causes failures when starting and stopping full-duplex operations multiple
> times in a loop.
>
> To address this issue, call dmaengine_terminate_async() for both substreams
> involved in the full-duplex setup when the last substream in the setup is
> stopped.
>
> Fixes: 4f8cd05a4305 ("ASoC: sh: rz-ssi: Add full duplex support")
> Cc: stable@vger.kernel.org
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
>
> Changes in v4:
> - updated patch description

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Dec. 11, 2024, 12:37 p.m. UTC | #4
On Tue, Dec 10, 2024 at 6:10 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> There is no need to populate the ckdv[] with invalid dividers as that
> part will not be indexed anyway. The ssi->audio_mck/bclk_rate should
> always be >= 0. While at it, change the ckdv type as u8, as the divider
> 128 was previously using the s8 sign bit.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
>
> Changes in v4:
> - changed the ckdv type from s8 to u8 and updated patch description
>   to reflect it

Fixes: 03e786bd43410fa9 ("ASoC: sh: Add RZ/G2L SSIF-2 driver")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Dec. 11, 2024, 12:40 p.m. UTC | #5
On Tue, Dec 10, 2024 at 6:10 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Add DT nodes for the SSI IPs available on the Renesas RZ/G3S SoC. Along
> with it external audio clocks were added. Board device tree could use it
> and update the frequencies.
>
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
>
> Changes in v4:
> - s/audio-clk1/audio1-clk
> - s/audio-clk2/audio2-clk
> - dropped status for the audio clock nodes
> - collected tags

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v6.14.

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Dec. 11, 2024, 12:41 p.m. UTC | #6
On Tue, Dec 10, 2024 at 6:10 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Add versa3 clock generator node. It provides the clocks for the Ethernet
> PHY, PCIe, audio devices.
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

Thanks, will queue in renesas-devel for v6.14.

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Dec. 11, 2024, 12:41 p.m. UTC | #7
On Tue, Dec 10, 2024 at 6:10 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Add the da7212 audio codec node. Along with it regulators nodes were
> reworked to be able to re-use them on da7212.
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
>
> Changes in v4:
> - collected tags
> - dropped #address-cells, #size-cells
> - moved #sound-dai-cells after clock names to align with the
>   documentation example

Thanks, will queue in renesas-devel for v6.14.

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Dec. 11, 2024, 12:42 p.m. UTC | #8
On Tue, Dec 10, 2024 at 6:11 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Enable SSI3.
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
>
> Changes in v4:
> - collected tags
> - dropped status for audio_clk2

Thanks, will queue in renesas-devel for v6.14.

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Dec. 11, 2024, 12:43 p.m. UTC | #9
On Tue, Dec 10, 2024 at 6:11 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Add sound card with SSI3 as CPU DAI and DA7212 as codec DAI.
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
>
> Changes in v4:
> - collected tags

Thanks, will queue in renesas-devel for v6.14.

Gr{oetje,eeting}s,

                        Geert
Mark Brown Dec. 11, 2024, 5:46 p.m. UTC | #10
On Tue, 10 Dec 2024 19:09:29 +0200, Claudiu wrote:
> Series enables the audio support for the Renesas RZ/G3S
> SoC along with runtime PM and suspend to RAM.
> 
> Patches:
> - 01-03/24 - update versaclock3 clock generator driver to support the
>              5L35023 hardware variant; versaclock3 provides clocks for
>              the audio devices (SSIF, DA7212 codec)
> - 04-19/24 - add SSIF support for the RZ/G3S SoC; fixes and cleanups
>              were also included
> - 20-24/24 - add device tree support
> 
> [...]

Applied to

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

Thanks!

[04/24] ASoC: renesas: rz-ssi: Terminate all the DMA transactions
        commit: 541011dc2d7c4c82523706f726f422a5e23cc86f
[05/24] ASoC: renesas: rz-ssi: Use only the proper amount of dividers
        commit: 55c209cd4318c701e6e88e0b2512a0f12dd02a7d
[06/24] ASoC: renesas: rz-ssi: Fix typo on SSI_RATES macro comment
        commit: 100c6b22d6c70adabdf45dcb346d7d853bff6a30
[07/24] ASoC: renesas: rz-ssi: Remove pdev member of struct rz_ssi_priv
        commit: a73710a25808a585a2bf0a8325eb16fd6a2f370c
[08/24] ASoC: renesas: rz-ssi: Remove the rz_ssi_get_dai() function
        commit: dec61e16e72db196e8dc1daf7f7022fd98e6d921
[09/24] ASoC: renesas: rz-ssi: Remove the first argument of rz_ssi_stream_is_play()
        commit: 109e60866f11c7db8f720f01b0bda3105c47b463
[10/24] ASoC: renesas: rz-ssi: Use readl_poll_timeout_atomic()
        commit: 4bf77dfa3308b7cfda29d9c4ead1dc32f1ceefa9
[11/24] ASoC: renesas: rz-ssi: Use temporary variable for struct device
        commit: 403366d2a43eb7c911c6cddf1d7882e429d1212d
[12/24] ASoC: renesas: rz-ssi: Use goto label names that specify their actions
        commit: f0c155c9da7536ab33687b5207eb21e704122a56
[13/24] ASoC: renesas: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend the SSI
        commit: e8fcf25f562891d5c0734d4f49c44bb6aa72bc15
[14/24] ASoC: renesas: rz-ssi: Enable runtime PM autosuspend support
        commit: cf3a79e4f826fc680fd7bfef7c427e2cc6023bc3
[15/24] ASoC: renesas: rz-ssi: Add runtime PM support
        commit: 3888672495fcaee98b90196c0a899b1c2eb57d5b
[16/24] ASoC: renesas: rz-ssi: Issue software reset in hw_params API
        commit: fc2a31affb22394d1d74d3ecc86b5c68da33d52a
[17/24] ASoC: renesas: rz-ssi: Add suspend to RAM support
        commit: 1fc778f7c833aeb13041adc06f016f1a2dff7350
[18/24] ASoC: dt-bindings: renesas,rz-ssi: Remove DMA description
        commit: c28dac5d3a6e87615d4c8e50f574c320172a3d55
[19/24] ASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC
        commit: 699a9733a354d74482ae4d4304acdbb0c0318a23

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