]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: qcom: q6asm: set runtime correctly for each stream
authorSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Thu, 23 Oct 2025 10:24:33 +0000 (11:24 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 5 Nov 2025 13:28:25 +0000 (13:28 +0000)
Both capture and playback can have different runtimes, so set them
accordingly.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Alexey Klimov <alexey.klimov@linaro.org> # RB5, RB3
Link: https://patch.msgid.link/20251023102444.88158-10-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6asm-dai.c

index c2a33d6a0827146e46777d5ae9c4c6f588550711..97256313c01a2ac32244eaf0f92d0bffb1a24acd 100644 (file)
@@ -433,10 +433,13 @@ static int q6asm_dai_open(struct snd_soc_component *component,
 
        runtime->private_data = prtd;
 
-       snd_soc_set_runtime_hwparams(substream, &q6asm_dai_hardware_playback);
-
-       runtime->dma_bytes = q6asm_dai_hardware_playback.buffer_bytes_max;
-
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+               snd_soc_set_runtime_hwparams(substream, &q6asm_dai_hardware_playback);
+               runtime->dma_bytes = q6asm_dai_hardware_playback.buffer_bytes_max;
+       } else {
+               snd_soc_set_runtime_hwparams(substream, &q6asm_dai_hardware_capture);
+               runtime->dma_bytes = q6asm_dai_hardware_capture.buffer_bytes_max;
+       }
 
        if (pdata->sid < 0)
                prtd->phys = substream->dma_buffer.addr;