The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] ASoC: atmel: mchp-pdmc: Clear busy_stream in hw_free()
@ 2026-11-16 11:02 phucduc.bui
  0 siblings, 0 replies; only message in thread
From: phucduc.bui @ 2026-11-16 11:02 UTC (permalink / raw)
  To: Mark Brown, Claudiu Beznea, Andrei Simion, Nicolas Ferre,
	Alexandre Belloni
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Codrin Ciubotariu,
	linux-sound, linux-arm-kernel, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

busy_stream is set in hw_params() but only cleared in remove(), so the
"Audio Filter" and "SINC Filter Order" controls keep returning -EBUSY
after the first hw_params().

Add a hw_free() callback that clears busy_stream, to balance hw_params(),
and drop the reset from remove().

Fixes: 2ed1a4a5c005 ("ASoC: atmel: mchp-pdmc: Retain Non-Runtime Controls")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/soc/atmel/mchp-pdmc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c
index 039b2eba0d9d..8b55d864f3d5 100644
--- a/sound/soc/atmel/mchp-pdmc.c
+++ b/sound/soc/atmel/mchp-pdmc.c
@@ -614,6 +614,15 @@ static int mchp_pdmc_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
+static int mchp_pdmc_hw_free(struct snd_pcm_substream *substream,
+			     struct snd_soc_dai *dai)
+{
+	struct mchp_pdmc *dd = snd_soc_dai_get_drvdata(dai);
+
+	atomic_set(&dd->busy_stream, 0);
+	return 0;
+}
+
 static void mchp_pdmc_noise_filter_workaround(struct mchp_pdmc *dd)
 {
 	u32 tmp, steps = 16;
@@ -748,6 +757,7 @@ static const struct snd_soc_dai_ops mchp_pdmc_dai_ops = {
 	.set_fmt	= mchp_pdmc_set_fmt,
 	.startup	= mchp_pdmc_startup,
 	.hw_params	= mchp_pdmc_hw_params,
+	.hw_free	= mchp_pdmc_hw_free,
 	.trigger	= mchp_pdmc_trigger,
 	.pcm_new	= &mchp_pdmc_pcm_new,
 	.auto_selectable_formats	= &mchp_selectable_formats,
@@ -1121,8 +1131,6 @@ static void mchp_pdmc_remove(struct platform_device *pdev)
 {
 	struct mchp_pdmc *dd = platform_get_drvdata(pdev);
 
-	atomic_set(&dd->busy_stream, 0);
-
 	if (!pm_runtime_status_suspended(dd->dev))
 		mchp_pdmc_runtime_suspend(dd->dev);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-16 11:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 11:02 [PATCH] ASoC: atmel: mchp-pdmc: Clear busy_stream in hw_free() phucduc.bui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox