]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: spacemit: fix RX DMA params not set when TX is running
authorTroy Mitchell <troy.mitchell@linux.spacemit.com>
Wed, 29 Apr 2026 09:00:50 +0000 (17:00 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 4 May 2026 13:02:50 +0000 (22:02 +0900)
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>
Link: https://patch.msgid.link/20260429-k1-i2s-fix-v2-1-8d67835aaddc@linux.spacemit.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/spacemit/k1_i2s.c

index 43481f387c446cbc51b0a45b132e22ed9cb64aad..5420ca2aefbd87e61109cc028422e435abd5a594 100644 (file)
@@ -148,10 +148,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)
@@ -199,6 +195,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);