Skip to content

Commit 5f39231

Browse files
AngeloGioacchino Del Regnobroonie
authored andcommitted
ASoC: mediatek: Assign dummy when codec not specified for a DAI link
MediaTek sound card drivers are checking whether a DAI link is present and used on a board to assign the correct parameters and this is done by checking the codec DAI names at probe time. If no real codec is present, assign the dummy codec to the DAI link to avoid NULL pointer during string comparison. Fixes: 4302187 ("ASoC: mediatek: common: add soundcard driver common code") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://msgid.link/r/20240313110147.1267793-5-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent d6c0175 commit 5f39231

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sound/soc/mediatek/common/mtk-soundcard-driver.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ static int set_card_codec_info(struct snd_soc_card *card,
2222

2323
codec_node = of_get_child_by_name(sub_node, "codec");
2424
if (!codec_node) {
25-
dev_dbg(dev, "%s no specified codec\n", dai_link->name);
25+
dev_dbg(dev, "%s no specified codec: setting dummy.\n", dai_link->name);
26+
27+
dai_link->codecs = &snd_soc_dummy_dlc;
28+
dai_link->num_codecs = 1;
29+
dai_link->dynamic = 1;
2630
return 0;
2731
}
2832

0 commit comments

Comments
 (0)