Re: [PATCH] ASoC: spacemit: Remove redundant DAI field initialization
"Troy Mitchell" <[email protected]> Tue, 04 Aug 2026 02:59:36 -0700
| Newsgroups | dev.linux.lists.spacemit,org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound |
|---|---|
| Message-ID | <[email protected]> |
--0cb53cc854d56efd7aaf92f0490d3586ec96bc93b77b8c725886ac6337f3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
> I traced the probe path and confirmed that snd_soc_dai_stream_valid()
> is called from soc_new_pcm().
> However, I still couldn't see where a nonzero channels_min alone leads
> to creating a capture substream
> without an RX DMA channel.
> To avoid confusion, I'm referring specifically to the DMA-based
> configuration, not PIO mode.
> Could you point me to the relevant call path?
More precisely, channels_min alone is not sufficient. The codec DAI must
also support capture (or be the dummy DAI for a dynamic link), and the link
must not be playback_only.
Under those conditions, the path is:
soc_new_pcm()
-> soc_get_playback_capture()
-> soc_create_pcm(..., capture =3D 1)
-> snd_pcm_new()
-> snd_pcm_new_stream(CAPTURE, 1)
-> snd_soc_pcm_component_new()
-> dmaengine_pcm_new()
dmaengine_pcm_request_chan_of() tolerates a missing "rx" channel and leaves
pcm->chan[CAPTURE] NULL. Once the capture substream exists,
dmaengine_pcm_new() returns -EINVAL with
"Missing dma channel for stream: 1".
The conditional initialization prevents the CPU DAI from advertising that
direction for a tx-only node.
- Troy
--0cb53cc854d56efd7aaf92f0490d3586ec96bc93b77b8c725886ac6337f3
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iIMEABYKACsWIQSL4Ay2cExaPXAQcU2YCe+A+TM0LwUCanG4CA0caUB0cm95LXku
b3JnAAoJEJgJ74D5MzQvmhgA/iKim769XKKzBMQSQN0e0WT8cDcERmf6hZVpFc2P
GucAAQCL7rMgg02LAyIJm55KkoPR7IBfAkfgUjclm5YznSGKCg==
=QizS
-----END PGP SIGNATURE-----
--0cb53cc854d56efd7aaf92f0490d3586ec96bc93b77b8c725886ac6337f3--