[PATCH v2 1/6] ASoC: renesas: fsi: Add shared SPU clock support
From: phucduc . bui
Date: Mon Apr 13 2026 - 06:14:16 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
Add SPU clock pointer, reference counter, and locking in fsi_master for
shared FSIA/FSIB usage, and initialize them in fsi_probe().
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
Changes in v2:
- Add spu_count to track active users of the SPU clock.
- Add clk_lock mutex to prevent race conditions during SPU clock
enable/disable operations.
- Initialize spu_count and clk_lock during driver probe.
sound/soc/renesas/fsi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c
index 1491c2f2cc96..196ec7bac33d 100644
--- a/sound/soc/renesas/fsi.c
+++ b/sound/soc/renesas/fsi.c
@@ -292,8 +292,11 @@ struct fsi_master {
void __iomem *base;
struct fsi_priv fsia;
struct fsi_priv fsib;
+ struct clk *clk_spu;
const struct fsi_core *core;
+ int spu_count;
spinlock_t lock;
+ struct mutex clk_lock;
};
static inline int fsi_stream_is_play(struct fsi_priv *fsi,
@@ -1961,7 +1964,9 @@ static int fsi_probe(struct platform_device *pdev)
/* master setting */
master->core = core;
+ master->spu_count = 0;
spin_lock_init(&master->lock);
+ mutex_init(&master->clk_lock);
/* FSI A setting */
fsi = &master->fsia;
--
2.43.0