diff mbox series

[02/10] ASoC: fsl-asoc-card: prevent deferment with dummy codec

Message ID 20230901144550.520072-3-elinor.montmasson@savoirfairelinux.com (mailing list archive)
State New, archived
Headers show
Series [01/10] ASoC: fsl-asoc-card: add new compatible for dummy codec | expand

Commit Message

Elinor Montmasson Sept. 1, 2023, 2:45 p.m. UTC
From: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>

Prevent deferment during sound card initialisation when using the
dummy codec.
If the codec isn't an ac97, it is expected to have a device tree node
for the codec. If not, the sound card initialisation is deferred.
However, the dummy codec has no device tree node, thus we must
handle this specific use case.

Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Co-authored-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index c12a356a86d5..d656df0b0eea 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -748,7 +748,8 @@  static int fsl_asoc_card_probe(struct platform_device *pdev)
 	of_node_put(bitclkprovider);
 	of_node_put(frameprovider);
 
-	if (!fsl_asoc_card_is_ac97(priv) && !codec_dev) {
+	if (!fsl_asoc_card_is_ac97(priv) && !codec_dev
+	  && !of_device_is_compatible(np, "fsl,imx-audio-dummy-codec")) {
 		dev_dbg(&pdev->dev, "failed to find codec device\n");
 		ret = -EPROBE_DEFER;
 		goto asrc_fail;