Re: [PATCH 16/22] ASoC: rsnd: Export module getters for PM support

From: Kuninori Morimoto

Date: Sun Mar 22 2026 - 21:46:30 EST



Hi John

> Export rsnd_adg_mod_get() and rsnd_ssiu_mod_get() to make them
> accessible from core.c.

It is *adding* new rsnd_ssiu_mod_get(),
and exporting rsnd_ssiu_mod_get() different type of features

>
> This is preparation for system suspend/resume support, where the PM
> callbacks need to iterate over all modules to save and restore their
> clock and reset state. Other modules (SSI, SRC, CTU, MIX, DVC) already
> have their getters exported.
>
> Signed-off-by: John Madieu <john.madieu.xa@xxxxxxxxxxxxxx>
> ---
> sound/soc/renesas/rcar/adg.c | 10 ++++++++++
> sound/soc/renesas/rcar/rsnd.h | 2 ++
> sound/soc/renesas/rcar/ssiu.c | 2 +-
> 3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/renesas/rcar/adg.c b/sound/soc/renesas/rcar/adg.c
> index 131a60689f6d..d73f29bc9de7 100644
> --- a/sound/soc/renesas/rcar/adg.c
> +++ b/sound/soc/renesas/rcar/adg.c
> @@ -906,6 +906,16 @@ int rsnd_adg_probe(struct rsnd_priv *priv)
> return 0;
> }
>
> +struct rsnd_mod *rsnd_adg_mod_get(struct rsnd_priv *priv)
> +{
> + struct rsnd_adg *adg = rsnd_priv_to_adg(priv);
> +
> + if (!adg)
> + return NULL;
> +
> + return rsnd_mod_get(adg);
> +}
> +
> void rsnd_adg_remove(struct rsnd_priv *priv)
> {
> struct device *dev = rsnd_priv_to_dev(priv);
> diff --git a/sound/soc/renesas/rcar/rsnd.h b/sound/soc/renesas/rcar/rsnd.h
> index a803c0f03665..2cee5c2aa7d7 100644
> --- a/sound/soc/renesas/rcar/rsnd.h
> +++ b/sound/soc/renesas/rcar/rsnd.h
> @@ -628,6 +628,7 @@ int rsnd_adg_set_cmd_timsel_gen2(struct rsnd_mod *cmd_mod,
> #define rsnd_adg_clk_disable(priv) rsnd_adg_clk_control(priv, 0)
> int rsnd_adg_clk_control(struct rsnd_priv *priv, int enable);
> void rsnd_adg_clk_dbg_info(struct rsnd_priv *priv, struct seq_file *m);
> +struct rsnd_mod *rsnd_adg_mod_get(struct rsnd_priv *priv);
>
> /*
> * R-Car sound priv
> @@ -824,6 +825,7 @@ int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod);
> int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod);
>
> #define rsnd_ssi_of_node(priv) rsnd_parse_of_node(priv, RSND_NODE_SSI)
> +struct rsnd_mod *rsnd_ssiu_mod_get(struct rsnd_priv *priv, int id);
> void rsnd_parse_connect_ssi(struct rsnd_dai *rdai,
> struct device_node *playback,
> struct device_node *capture);
> diff --git a/sound/soc/renesas/rcar/ssiu.c b/sound/soc/renesas/rcar/ssiu.c
> index f377d9414633..1462f02c2a7f 100644
> --- a/sound/soc/renesas/rcar/ssiu.c
> +++ b/sound/soc/renesas/rcar/ssiu.c
> @@ -434,7 +434,7 @@ static struct rsnd_mod_ops rsnd_ssiu_ops_gen2 = {
> DEBUG_INFO
> };
>
> -static struct rsnd_mod *rsnd_ssiu_mod_get(struct rsnd_priv *priv, int id)
> +struct rsnd_mod *rsnd_ssiu_mod_get(struct rsnd_priv *priv, int id)
> {
> if (WARN_ON(id < 0 || id >= rsnd_ssiu_nr(priv)))
> id = 0;
> --
> 2.25.1
>