Re: [PATCH 17/22] ASoC: rsnd: Add system suspend/resume support
From: Kuninori Morimoto
Date: Tue Mar 24 2026 - 21:41:20 EST
Hi John
> You're right. The ALSA framework already handles per-module stop/start
> through SNDRV_PCM_TRIGGER_SUSPEND/RESUME, which calls each module's
> .quit/.init (and thus rsnd_mod_power_off/rsnd_mod_power_on).
>
> So the per-module clk_prepare/clk_unprepare cycle in rsnd_suspend_mod/
> rsnd_resume_mod is unnecessary.
>
> What RZ/G3E actually needs beyond the existing ADG handling is:
>
> 1- Reset handling for modules that have reset control
> 2- audmac-pp clock/reset toggle (infrastructure, like ADG)
>
> However, there is no need to make these changes conditionally
> based on SoC family as the optional clock/reset APIs are used.
> Do you find any issues with my approach ?
OK
Since we have separated files for each modules, I think it's beter
to follow that style.
This is just an idea
core.c
void rsnd_suspend_xxx(clk, reset)
{
clk_unprepare(clk);
reset_control_assert(rstc);
}
int rsnd_suspend(struct device *dev)
{
/*
* Reverse order of probe:
* ADG -> DVC -> MIX -> CTU -> SRC -> SSIU -> SSI -> DMA
*/
rsnd_adg_suspend(...);
rsnd_dvc_suspend(...);
rsnd_mix_suspend(...);
rsnd_ctu_suspend(...);
rsnd_src_suspend(...);
...
}
ssi.c
void rsnd_ssi_suspend(priv)
{
for_each_rsnd_ssi(ssi, priv, i) {
mod = rsnd_mod_get(ssi);
rsnd_suspend_xxx(mod->clk, mod->rstc);
}
}
src.c
void rsnd_src_suspend(priv)
{
for_each_rsnd_src(src, priv, i) {
mod = rsnd_mod_get(src);
rsnd_suspend_xxx(mod->clk, mod->rstc);
}
rsnd_suspend_xxx(priv->clk_scu_x2, NULL);
rsnd_suspend_xxx(priv->clk_scu, NULL);
}
dma.c
void rsnd_dma_suspend_xxx(priv)
{
rsnd_suspend_xxx(priv->clk_audmac_pp, NULL);
rsnd_suspend_xxx(priv->rstc_audmac_pp, NULL);
}
Thank you for your help !!
Best regards
---
Kuninori Morimoto