[PATCH v6 11/11] ASoC: renesas: fsi: Add SPU clock control in hw_startup/shutdown
From: phucduc . bui
Date: Tue Jun 09 2026 - 07:47:35 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
Enable and disable the SPU clock in fsi_hw_startup() and
fsi_hw_shutdown() to ensure the clock is active while the
driver accesses hardware registers.
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
Changes in v6:
- Add Acked-by tag from Kuninori Morimoto.
- Minor refactor in clock enable/disable paths.
Changes in v5:
- Drop spu_count and rely on the clk core for clock reference
counting.
sound/soc/renesas/fsi.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c
index e26f39dfe059..b72396b5de7d 100644
--- a/sound/soc/renesas/fsi.c
+++ b/sound/soc/renesas/fsi.c
@@ -1560,6 +1560,11 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
struct device *dev)
{
u32 data = 0;
+ int ret;
+ /* enable spu bus bridge clock */
+ ret = clk_enable(fsi->master->clk_spu);
+ if (ret)
+ return ret;
/* clock setting */
if (fsi_is_clk_master(fsi))
@@ -1605,8 +1610,13 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
fsi_fifo_init(fsi, io, dev);
/* start master clock */
- if (fsi_is_clk_master(fsi))
- return fsi_clk_enable(dev, fsi);
+ if (fsi_is_clk_master(fsi)) {
+ ret = fsi_clk_enable(dev, fsi);
+ if (ret) {
+ clk_disable(fsi->master->clk_spu);
+ return ret;
+ }
+ }
return 0;
}
@@ -1614,9 +1624,15 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
static int fsi_hw_shutdown(struct fsi_priv *fsi,
struct device *dev)
{
+ int ret;
/* stop master clock */
- if (fsi_is_clk_master(fsi))
- return fsi_clk_disable(dev, fsi);
+ if (fsi_is_clk_master(fsi)) {
+ ret = fsi_clk_disable(dev, fsi);
+ if (ret)
+ return ret;
+ }
+ /* stop spu bus bridge clock */
+ clk_disable(fsi->master->clk_spu);
return 0;
}
--
2.43.0