diff mbox series

[v1,1/3] ASoC: qcom: common: set codecless link to be a backend

Message ID 20241205023344.2232529-2-alexey.klimov@linaro.org (mailing list archive)
State New
Headers show
Series db845c/rb3: add i2s playback support | expand

Commit Message

Alexey Klimov Dec. 5, 2024, 2:33 a.m. UTC
When codec subnode is missing in DAI link description in DT
the DAI link codec will be set to a dummy codec and link will be
recognised as front end. Any playback attempt will fail since it
will not be able to install hardware parameters. Fix this by
setting codecless link to be a back end.

Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
 sound/soc/qcom/common.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Mark Brown Dec. 16, 2024, 9:48 p.m. UTC | #1
On Thu, Dec 05, 2024 at 02:33:42AM +0000, Alexey Klimov wrote:
> When codec subnode is missing in DAI link description in DT
> the DAI link codec will be set to a dummy codec and link will be
> recognised as front end. Any playback attempt will fail since it
> will not be able to install hardware parameters. Fix this by
> setting codecless link to be a back end.

This is intentional, the sound card should be properly described in the
DT - if there's an expansion board used the description for that should
say what sort of CODEC is there.
diff mbox series

Patch

diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index 928cf5cb5999..e8ae15fcb1a3 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -159,6 +159,10 @@  int qcom_snd_parse_of(struct snd_soc_card *card)
 			link->nonatomic = 1;
 		}
 
+		/* set codecless link with dummy codec to be a backend */
+		if (platform && !codec && link->codecs == &snd_soc_dummy_dlc)
+			link->no_pcm = 1;
+
 		link->stream_name = link->name;
 		link++;