[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240307114445.196981-5-angelogioacchino.delregno@collabora.com>
Date: Thu, 7 Mar 2024 12:44:27 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: broonie@...nel.org
Cc: wenst@...omium.org,
lgirdwood@...il.com,
robh@...nel.org,
krzysztof.kozlowski+dt@...aro.org,
conor+dt@...nel.org,
matthias.bgg@...il.com,
perex@...ex.cz,
tiwai@...e.com,
trevor.wu@...iatek.com,
maso.huang@...iatek.com,
xiazhengqiao@...qin.corp-partner.google.com,
arnd@...db.de,
kuninori.morimoto.gx@...esas.com,
shraash@...gle.com,
amergnat@...libre.com,
nicolas.ferre@...rochip.com,
u.kleine-koenig@...gutronix.de,
dianders@...omium.org,
frank.li@...o.com,
allen-kh.cheng@...iatek.com,
eugen.hristev@...labora.com,
claudiu.beznea@...on.dev,
jarkko.nikula@...mer.com,
jiaxin.yu@...iatek.com,
alpernebiyasak@...il.com,
ckeepax@...nsource.cirrus.com,
zhourui@...qin.corp-partner.google.com,
nfraprado@...labora.com,
alsa-devel@...a-project.org,
shane.chien@...iatek.com,
linux-sound@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
kernel@...labora.com,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Subject: [PATCH v2 04/22] 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: 4302187d955f ("ASoC: mediatek: common: add soundcard driver common code")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
---
sound/soc/mediatek/common/mtk-soundcard-driver.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/mediatek/common/mtk-soundcard-driver.c b/sound/soc/mediatek/common/mtk-soundcard-driver.c
index a58e1e3674de..000a086a8cf4 100644
--- a/sound/soc/mediatek/common/mtk-soundcard-driver.c
+++ b/sound/soc/mediatek/common/mtk-soundcard-driver.c
@@ -22,7 +22,11 @@ static int set_card_codec_info(struct snd_soc_card *card,
codec_node = of_get_child_by_name(sub_node, "codec");
if (!codec_node) {
- dev_dbg(dev, "%s no specified codec\n", dai_link->name);
+ dev_dbg(dev, "%s no specified codec: setting dummy.\n", dai_link->name);
+
+ dai_link->codecs = &snd_soc_dummy_dlc;
+ dai_link->num_codecs = 1;
+ dai_link->dynamic = 1;
return 0;
}
--
2.44.0
Powered by blists - more mailing lists