[PATCH v2] ASoC: spacemit: fix RX DMA params not set when TX is running

Troy Mitchell posted 1 patch 1 month, 2 weeks ago
sound/soc/spacemit/k1_i2s.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH v2] ASoC: spacemit: fix RX DMA params not set when TX is running
Posted by Troy Mitchell 1 month, 2 weeks ago
When TX is already running (SSCR_SSE is set), the hw_params callback
returns early before setting up DMA parameters for the RX stream. This
prevents the capture path from configuring its DMA data properly.

Move the SSCR_SSE check after DMA parameter setup and format
constraints, so both TX and RX streams get their DMA configuration
regardless of whether the hardware is already enabled. The early return
now only skips the register writes that would disrupt an active stream.

Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Changes in v2:
- Combine two consecutive SSCR reads into one
- Fix Fixes tag SHA1 to match the upstream commit
- Split from the original 7-patch series into a standalone fix
Link: https://lore.kernel.org/all/20260429-k3-i2s-v1-1-2fe99db11ecb@linux.spacemit.com/
---
 sound/soc/spacemit/k1_i2s.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c
index 1cb99f1abc7c..dccf6dcb72b1 100644
--- a/sound/soc/spacemit/k1_i2s.c
+++ b/sound/soc/spacemit/k1_i2s.c
@@ -117,10 +117,6 @@ static int spacemit_i2s_hw_params(struct snd_pcm_substream *substream,
 	u32 val;
 	int ret;
 
-	val = readl(i2s->base + SSCR);
-	if (val & SSCR_SSE)
-		return 0;
-
 	dma_data = &i2s->playback_dma_data;
 
 	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
@@ -181,6 +177,9 @@ static int spacemit_i2s_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	val = readl(i2s->base + SSCR);
+	if (val & SSCR_SSE)
+		return 0;
+
 	val &= ~SSCR_DW_32BYTE;
 	val |= data_width;
 	writel(val, i2s->base + SSCR);

---
base-commit: c7275b05bc428c7373d97aa2da02d3a7fa6b9f66
change-id: 20260429-k1-i2s-fix-de60c4611c14

Best regards,
--  
Troy Mitchell <troy.mitchell@linux.spacemit.com>
Re: [PATCH v2] ASoC: spacemit: fix RX DMA params not set when TX is running
Posted by Mark Brown 1 month, 1 week ago
On Wed, 29 Apr 2026 17:00:50 +0800, Troy Mitchell wrote:
> ASoC: spacemit: fix RX DMA params not set when TX is running

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1

Thanks!

[1/1] ASoC: spacemit: fix RX DMA params not set when TX is running
      https://git.kernel.org/broonie/sound/c/ec0611868f2f

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark