Question about DPCM private_data of soc-compress.c

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Mon Jan 23 04:08:49 CET 2023


Hi ALSA ML

I'm not familiar with soc-compress.c, but I think dpcm_capture case don't need "else" ?
I think it is same as soc-pcm.c :: soc_new_pcm().
I'm happy to post patch if someone acknowledge this question.

	--- soc-compress.c --------
	int snd_soc_new_compress(...)
	{
		...
		if (rtd->dai_link->dynamic) {
			...
			if (rtd->dai_link->dpcm_playback)
				be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
-			else if (rtd->dai_link->dpcm_capture)
+			if (rtd->dai_link->dpcm_capture)
				be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
			...
		}
		...
	}

	--- soc-pcm.c ---------------
	int soc_new_pcm(...)
	{
		...
		if (rtd->dai_link->no_pcm || rtd->dai_link->params) {
			if (playback)
				pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
=>			if (capture)
				pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
			goto out;
		}
		...
	}

Thank you for your help !!

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list