Re: [PATCH] ASoC: spacemit: Remove redundant DAI field initialization

From: Troy Mitchell

Date: Tue Aug 04 2026 - 07:10:13 EST


> 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 = 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

Attachment: signature.asc
Description: PGP signature