Re: [PATCH v5 13/13] ASoC: qcom: q6apm: Add support for early buffer mapping on DSP
From: Mark Brown
Date: Tue Mar 17 2026 - 14:04:12 EST
On Mon, Mar 09, 2026 at 06:51:37AM +0000, Srinivas Kandagatla wrote:
> +static void q6apm_dai_pcm_destruct(struct snd_soc_component *component, struct snd_pcm *pcm)
> +{
> + struct snd_pcm_substream *substream;
> + struct snd_soc_pcm_runtime *soc_prtd;
> + struct snd_soc_dai *cpu_dai;
> + int graph_id;
> +
> + if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream)
> + substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
> + else
> + substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
This looks weird, we're destructing the playback substream if the
capture one is present and the capture stream otherwise? If that's
correct the logic is very non-obvious, especially in the case where the
capture stream isn't presenta and...
> + soc_prtd = snd_soc_substream_to_rtd(substream);
> + cpu_dai = snd_soc_rtd_to_cpu(soc_prtd, 0);
...we immediately try convert it into a runtime and CPU DAI?
Attachment:
signature.asc
Description: PGP signature