From nobody Mon Apr 6 12:12:12 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C153C368962; Thu, 2 Apr 2026 09:09:20 +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=1775120962; cv=none; b=W42wgxUqcgVnc4UIxozFV2ml3My1a1Aolmzd/6Biau5Zlti244MJiof905MBjt0QtXHISiB1772XzCQR/aUnQ5oNyIYS/fiyTZEto/qQG16LaemU5zcJjIeUMBbJ5/5LJEEr4gEVRy3Xj29dcKJ2UbimsuAOFd3uHW2EYiJ5h5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775120962; c=relaxed/simple; bh=RgxtrmYDG3leJ7S6EE6mmn/Q2bMMV/4Xqvgxbz8M7Iw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HVeqO3ncr6tCNC2qUCn5htMaI/fxH4j3J+xzrTDaO0ExCZca1TvSRoKMT3EWNhxb0O9WniGqBtSDIxOcnXvTPHt5fPUjdyj+GW7xXu3eit1v2/35UHYtbpKwYcvD46+Qbqfm5NGs2OG8W/zIaB/BZzen2UUdXUTSzlnA59tpuMM= 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: 284a3b3RROmhPRQ3nndh4w== X-CSE-MsgGUID: mVxyfJeMSEGm7zz+v0fzXg== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 02 Apr 2026 18:09:20 +0900 Received: from ubuntu.adwin.renesas.com (unknown [10.226.92.136]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 5378D413EB4D; Thu, 2 Apr 2026 18:09:10 +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 15/24] ASoC: rsnd: src: Add SRC reset and clock support for RZ/G3E Date: Thu, 2 Apr 2026 11:05:14 +0200 Message-ID: <20260402090524.9137-16-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 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 --- Changes: v2: No changes 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 2c5738926093..8700b39b535e 100644 --- a/sound/soc/renesas/rcar/rsnd.h +++ b/sound/soc/renesas/rcar/rsnd.h @@ -632,6 +632,13 @@ struct rsnd_priv { struct clk *audmapp_clk; struct reset_control *audmapp_rstc; =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