From nobody Mon Apr 6 12:17:06 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB4E1343D91; Thu, 2 Apr 2026 09:08:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775120890; cv=none; b=pZvEj6N3IV9DDDMYGHJ0bsrO/7+C7wD1j39ZMI2uu+xYVZ8fDl6hx/xM3FDEU7xt9fxOoyMlI4MTyAp8Lksp5WkRdCVSA5x/TzOyMzVi/2gTTt0S1yPQbm+tosopOctk4l8JrHP4uwer09vo0Bytg8fA8MK7YolYajk5LrK1Uf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775120890; c=relaxed/simple; bh=o7nYniCn6+TP4b76xa0XAjkA71E+OuuYC1qwjFc6fG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aWtIVdGX0wtW7LvOeRiQgUj875HAFZSS2mijpOCRki8GTlT6GrRuUUSLc40F4rCASQ1V87IvIzczRL7rHT/jHr/QTEw+ZowFiTsQxg4wz8lad9lUquQoCIpRnamh9Uogn2fMQcMFtXBOFcgDINuSh5bM/N2QSCdRIkMjvR4boO8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-CSE-ConnectionGUID: ztaj1st/QJqMEKVZBjU/+Q== X-CSE-MsgGUID: bP5P1aTaQ5mv4NqqTv9zxw== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 02 Apr 2026 18:08:07 +0900 Received: from ubuntu.adwin.renesas.com (unknown [10.226.92.136]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 7DE81413EA85; Thu, 2 Apr 2026 18:07:59 +0900 (JST) From: John Madieu To: Geert Uytterhoeven , Kuninori Morimoto , Vinod Koul , Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Michael Turquette , Stephen Boyd , Conor Dooley , Frank Li , Liam Girdwood , Magnus Damm , Thomas Gleixner , Jaroslav Kysela , Takashi Iwai , Philipp Zabel , Claudiu Beznea , Biju Das , Fabrizio Castro , Lad Prabhakar , John Madieu , linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-sound@vger.kernel.org, John Madieu Subject: [PATCH v2 07/24] ASoC: rsnd: Add reset controller support to rsnd_mod Date: Thu, 2 Apr 2026 11:05:06 +0200 Message-ID: <20260402090524.9137-8-john.madieu.xa@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260402090524.9137-1-john.madieu.xa@bp.renesas.com> References: <20260402090524.9137-1-john.madieu.xa@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The RZ/G3E SoC requires per-module reset control for the audio subsystem. Add reset controller support to struct rsnd_mod and update rsnd_mod_init() to accept and handle a reset_control parameter. Signed-off-by: John Madieu --- Changes: v2: No changes sound/soc/renesas/rcar/adg.c | 2 +- sound/soc/renesas/rcar/cmd.c | 2 +- sound/soc/renesas/rcar/core.c | 14 +++++++++++++- sound/soc/renesas/rcar/ctu.c | 2 +- sound/soc/renesas/rcar/dma.c | 4 ++-- sound/soc/renesas/rcar/dvc.c | 2 +- sound/soc/renesas/rcar/mix.c | 2 +- sound/soc/renesas/rcar/rsnd.h | 3 +++ sound/soc/renesas/rcar/src.c | 2 +- sound/soc/renesas/rcar/ssi.c | 2 +- sound/soc/renesas/rcar/ssiu.c | 2 +- 11 files changed, 26 insertions(+), 11 deletions(-) diff --git a/sound/soc/renesas/rcar/adg.c b/sound/soc/renesas/rcar/adg.c index 8641b73d1f77..0105c60a144e 100644 --- a/sound/soc/renesas/rcar/adg.c +++ b/sound/soc/renesas/rcar/adg.c @@ -780,7 +780,7 @@ int rsnd_adg_probe(struct rsnd_priv *priv) return -ENOMEM; =20 ret =3D rsnd_mod_init(priv, &adg->mod, &adg_ops, - NULL, 0, 0); + NULL, NULL, 0, 0); if (ret) return ret; =20 diff --git a/sound/soc/renesas/rcar/cmd.c b/sound/soc/renesas/rcar/cmd.c index 8d9a1e345a22..13beef389797 100644 --- a/sound/soc/renesas/rcar/cmd.c +++ b/sound/soc/renesas/rcar/cmd.c @@ -171,7 +171,7 @@ int rsnd_cmd_probe(struct rsnd_priv *priv) =20 for_each_rsnd_cmd(cmd, priv, i) { int ret =3D rsnd_mod_init(priv, rsnd_mod_get(cmd), - &rsnd_cmd_ops, NULL, + &rsnd_cmd_ops, NULL, NULL, RSND_MOD_CMD, i); if (ret) return ret; diff --git a/sound/soc/renesas/rcar/core.c b/sound/soc/renesas/rcar/core.c index 69fb19964a71..6de576736507 100644 --- a/sound/soc/renesas/rcar/core.c +++ b/sound/soc/renesas/rcar/core.c @@ -90,6 +90,7 @@ * */ =20 +#include #include #include #include "rsnd.h" @@ -196,18 +197,29 @@ int rsnd_mod_init(struct rsnd_priv *priv, struct rsnd_mod *mod, struct rsnd_mod_ops *ops, struct clk *clk, + struct reset_control *rstc, enum rsnd_mod_type type, int id) { - int ret =3D clk_prepare(clk); + int ret; =20 + ret =3D clk_prepare_enable(clk); if (ret) return ret; =20 + ret =3D reset_control_deassert(rstc); + if (ret) { + clk_disable_unprepare(clk); + return ret; + } + + clk_disable(clk); + mod->id =3D id; mod->ops =3D ops; mod->type =3D type; mod->clk =3D clk; + mod->rstc =3D rstc; mod->priv =3D priv; =20 return 0; diff --git a/sound/soc/renesas/rcar/ctu.c b/sound/soc/renesas/rcar/ctu.c index bd4c61f9fb3c..81bba6a1af6e 100644 --- a/sound/soc/renesas/rcar/ctu.c +++ b/sound/soc/renesas/rcar/ctu.c @@ -360,7 +360,7 @@ int rsnd_ctu_probe(struct rsnd_priv *priv) } =20 ret =3D rsnd_mod_init(priv, rsnd_mod_get(ctu), &rsnd_ctu_ops, - clk, RSND_MOD_CTU, i); + clk, NULL, RSND_MOD_CTU, i); if (ret) goto rsnd_ctu_probe_done; =20 diff --git a/sound/soc/renesas/rcar/dma.c b/sound/soc/renesas/rcar/dma.c index 2035ce06fe4c..68c859897e68 100644 --- a/sound/soc/renesas/rcar/dma.c +++ b/sound/soc/renesas/rcar/dma.c @@ -803,7 +803,7 @@ static int rsnd_dma_alloc(struct rsnd_dai_stream *io, s= truct rsnd_mod *mod, =20 *dma_mod =3D rsnd_mod_get(dma); =20 - ret =3D rsnd_mod_init(priv, *dma_mod, ops, NULL, + ret =3D rsnd_mod_init(priv, *dma_mod, ops, NULL, NULL, type, dma_id); if (ret < 0) return ret; @@ -879,5 +879,5 @@ int rsnd_dma_probe(struct rsnd_priv *priv) priv->dma =3D dmac; =20 /* dummy mem mod for debug */ - return rsnd_mod_init(NULL, &mem, &mem_ops, NULL, 0, 0); + return rsnd_mod_init(NULL, &mem, &mem_ops, NULL, NULL, 0, 0); } diff --git a/sound/soc/renesas/rcar/dvc.c b/sound/soc/renesas/rcar/dvc.c index 988cbddbc611..bf7146ceb5f6 100644 --- a/sound/soc/renesas/rcar/dvc.c +++ b/sound/soc/renesas/rcar/dvc.c @@ -364,7 +364,7 @@ int rsnd_dvc_probe(struct rsnd_priv *priv) } =20 ret =3D rsnd_mod_init(priv, rsnd_mod_get(dvc), &rsnd_dvc_ops, - clk, RSND_MOD_DVC, i); + clk, NULL, RSND_MOD_DVC, i); if (ret) goto rsnd_dvc_probe_done; =20 diff --git a/sound/soc/renesas/rcar/mix.c b/sound/soc/renesas/rcar/mix.c index aea74e703305..566e9b2a488c 100644 --- a/sound/soc/renesas/rcar/mix.c +++ b/sound/soc/renesas/rcar/mix.c @@ -328,7 +328,7 @@ int rsnd_mix_probe(struct rsnd_priv *priv) } =20 ret =3D rsnd_mod_init(priv, rsnd_mod_get(mix), &rsnd_mix_ops, - clk, RSND_MOD_MIX, i); + clk, NULL, RSND_MOD_MIX, i); if (ret) goto rsnd_mix_probe_done; =20 diff --git a/sound/soc/renesas/rcar/rsnd.h b/sound/soc/renesas/rcar/rsnd.h index 04c70690f7a2..cd7e7df62298 100644 --- a/sound/soc/renesas/rcar/rsnd.h +++ b/sound/soc/renesas/rcar/rsnd.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -353,6 +354,7 @@ struct rsnd_mod { struct rsnd_mod_ops *ops; struct rsnd_priv *priv; struct clk *clk; + struct reset_control *rstc; u32 status; }; /* @@ -420,6 +422,7 @@ int rsnd_mod_init(struct rsnd_priv *priv, struct rsnd_mod *mod, struct rsnd_mod_ops *ops, struct clk *clk, + struct reset_control *rstc, enum rsnd_mod_type type, int id); void rsnd_mod_quit(struct rsnd_mod *mod); diff --git a/sound/soc/renesas/rcar/src.c b/sound/soc/renesas/rcar/src.c index 6a3dbc84f474..8b58cc20e7a8 100644 --- a/sound/soc/renesas/rcar/src.c +++ b/sound/soc/renesas/rcar/src.c @@ -766,7 +766,7 @@ int rsnd_src_probe(struct rsnd_priv *priv) } =20 ret =3D rsnd_mod_init(priv, rsnd_mod_get(src), - &rsnd_src_ops, clk, RSND_MOD_SRC, i); + &rsnd_src_ops, clk, NULL, RSND_MOD_SRC, i); if (ret) goto rsnd_src_probe_done; =20 diff --git a/sound/soc/renesas/rcar/ssi.c b/sound/soc/renesas/rcar/ssi.c index 0420041e282c..c06cebb36170 100644 --- a/sound/soc/renesas/rcar/ssi.c +++ b/sound/soc/renesas/rcar/ssi.c @@ -1225,7 +1225,7 @@ int rsnd_ssi_probe(struct rsnd_priv *priv) ops =3D &rsnd_ssi_dma_ops; =20 ret =3D rsnd_mod_init(priv, rsnd_mod_get(ssi), ops, clk, - RSND_MOD_SSI, i); + NULL, RSND_MOD_SSI, i); if (ret) goto rsnd_ssi_probe_done; =20 diff --git a/sound/soc/renesas/rcar/ssiu.c b/sound/soc/renesas/rcar/ssiu.c index 244fb833292a..0cfa84fe5ea8 100644 --- a/sound/soc/renesas/rcar/ssiu.c +++ b/sound/soc/renesas/rcar/ssiu.c @@ -586,7 +586,7 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv) } =20 ret =3D rsnd_mod_init(priv, rsnd_mod_get(ssiu), - ops, NULL, RSND_MOD_SSIU, i); + ops, NULL, NULL, RSND_MOD_SSIU, i); if (ret) return ret; } --=20 2.25.1