From nobody Mon Apr 6 12:17:07 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31AB83DD50C; Thu, 19 Mar 2026 15:57:05 +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=1773935828; cv=none; b=NMKSwSSfI0ulccgwGJG4Rye0pQNt5ec0nQTpSMFlpnIH3CI1wx/PAVhhIqbingWQJjFzZzSBlHubcSdOO+Mhl8Zz/Gp/utsvLmgsdHKcYKFkyqbkLfthum9Or8KsqJ3BWGmeHBEVU0dnuxCQtHs/2WLREOQ9K09TkUMEOCroNI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773935828; c=relaxed/simple; bh=BiFjNbYTzxnk6ALKdyDPQZUoxOq+1KLiy6vWkM//XsQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HtfxRMWw6CrRSJFTGkfAI1rqV25SDcogvOpRquLSg2nS5aw+egpHynHfbvV7qQ+oqYeSF369ARttM/9Qv8ZhpL2A4Pvdu/gyjxMnDf1w5HiQSCOANg3r8rIBSgtwxrrv0qk7jQjOZ4OrZazF7ZXzh/InyG3FyJ22hwwOGLkXSvA= 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: hxGmEF+LTbGWgg0WNz9hbw== X-CSE-MsgGUID: TPrQGtIwSSqzP0avKxzA9w== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 20 Mar 2026 00:57:05 +0900 Received: from ubuntu.adwin.renesas.com (unknown [10.226.93.35]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id C88B4401B647; Fri, 20 Mar 2026 00:56:56 +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 15/22] ASoC: rsnd: src: Add SRC reset and clock support for RZ/G3E Date: Thu, 19 Mar 2026 16:53:27 +0100 Message-ID: <20260319155334.51278-16-john.madieu.xa@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260319155334.51278-1-john.madieu.xa@bp.renesas.com> References: <20260319155334.51278-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 explicit SCU (Sampling Rate Converter Unit) reset and clock management unlike previous R-Car generations: - scu_clk: SCU module clock - scu_clkx2: SCU double-rate clock - scu_supply_clk: SCU supply clock Without these clocks enabled, the SRC module cannot operate on RZ/G3E. Add support for the shared SCU reset controller used by the SRC modules on the Renesas RZ/G3E SoC. All SRC instances are gated by the same "scu" reset line. Signed-off-by: John Madieu --- sound/soc/renesas/rcar/rsnd.h | 7 ++++++ sound/soc/renesas/rcar/src.c | 45 +++++++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/sound/soc/renesas/rcar/rsnd.h b/sound/soc/renesas/rcar/rsnd.h index 6bde304f93a8..a803c0f03665 100644 --- a/sound/soc/renesas/rcar/rsnd.h +++ b/sound/soc/renesas/rcar/rsnd.h @@ -642,6 +642,13 @@ struct rsnd_priv { struct clk *clk_audmac_pp; struct reset_control *rstc_audmac_pp; =20 + /* + * Below values will be filled in rsnd_src_probe() + */ + struct clk *clk_scu; + struct clk *clk_scu_x2; + struct clk *clk_scu_supply; + spinlock_t lock; unsigned int ssiu_busif_count; unsigned long flags; diff --git a/sound/soc/renesas/rcar/src.c b/sound/soc/renesas/rcar/src.c index 8b58cc20e7a8..e1f609589406 100644 --- a/sound/soc/renesas/rcar/src.c +++ b/sound/soc/renesas/rcar/src.c @@ -516,6 +516,7 @@ static int rsnd_src_init(struct rsnd_mod *mod, struct rsnd_priv *priv) { struct rsnd_src *src =3D rsnd_mod_to_src(mod); + struct device *dev =3D rsnd_priv_to_dev(priv); int ret; =20 /* reset sync convert_rate */ @@ -526,6 +527,12 @@ static int rsnd_src_init(struct rsnd_mod *mod, if (ret < 0) return ret; =20 + ret =3D clk_prepare_enable(priv->clk_scu_supply); + if (ret) { + dev_err(dev, "Cannot enable scu_supply_clk\n"); + return ret; + } + rsnd_src_activation(mod); =20 rsnd_src_init_convert_rate(io, mod); @@ -549,6 +556,8 @@ static int rsnd_src_quit(struct rsnd_mod *mod, src->sync.val =3D src->current_sync_rate =3D 0; =20 + clk_disable_unprepare(priv->clk_scu_supply); + return 0; } =20 @@ -711,8 +720,9 @@ struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *pri= v, int id) =20 int rsnd_src_probe(struct rsnd_priv *priv) { - struct device_node *node; struct device *dev =3D rsnd_priv_to_dev(priv); + struct reset_control *rstc; + struct device_node *node; struct rsnd_src *src; struct clk *clk; char name[RSND_SRC_NAME_SIZE]; @@ -737,6 +747,27 @@ int rsnd_src_probe(struct rsnd_priv *priv) priv->src_nr =3D nr; priv->src =3D src; =20 + priv->clk_scu =3D devm_clk_get_optional_enabled(dev, "scu"); + if (IS_ERR(priv->clk_scu)) { + ret =3D dev_err_probe(dev, PTR_ERR(priv->clk_scu), + "failed to get scu clock\n"); + goto rsnd_src_probe_done; + } + + priv->clk_scu_x2 =3D devm_clk_get_optional_enabled(dev, "scu_x2"); + if (IS_ERR(priv->clk_scu_x2)) { + ret =3D dev_err_probe(dev, PTR_ERR(priv->clk_scu_x2), + "failed to get scu_x2 clock\n"); + goto rsnd_src_probe_done; + } + + priv->clk_scu_supply =3D devm_clk_get_optional(dev, "scu_supply"); + if (IS_ERR(priv->clk_scu_supply)) { + ret =3D dev_err_probe(dev, PTR_ERR(priv->clk_scu_supply), + "failed to get scu_supply clock\n"); + goto rsnd_src_probe_done; + } + i =3D 0; for_each_child_of_node_scoped(node, np) { if (!of_device_is_available(np)) @@ -759,6 +790,16 @@ int rsnd_src_probe(struct rsnd_priv *priv) goto rsnd_src_probe_done; } =20 + /* + * RZ/G3E uses a shared SCU reset controller for all SRC modules. + * R-Car platforms typically don't have SRC reset controls. + */ + rstc =3D devm_reset_control_get_optional_shared(dev, "scu"); + if (IS_ERR(rstc)) { + ret =3D PTR_ERR(rstc); + goto rsnd_src_probe_done; + } + clk =3D devm_clk_get(dev, name); if (IS_ERR(clk)) { ret =3D PTR_ERR(clk); @@ -766,7 +807,7 @@ int rsnd_src_probe(struct rsnd_priv *priv) } =20 ret =3D rsnd_mod_init(priv, rsnd_mod_get(src), - &rsnd_src_ops, clk, NULL, RSND_MOD_SRC, i); + &rsnd_src_ops, clk, rstc, RSND_MOD_SRC, i); if (ret) goto rsnd_src_probe_done; =20 --=20 2.25.1