diff mbox series

[04/10] ASoC: fsl-asoc-card: unset DAPM routes with dummy codec

Message ID 20230901144550.520072-5-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>

Unset DAPM routes when using the dummy codec.
The dummy codec doesn't provide DAPM widgets per design, as it doesn't
represent any real hardware. Thus the default DAPM audio routes do not
work because there is no Playback or Capture DAPM widget.

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 | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index d210147aebfe..5ef26ae512de 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -712,6 +712,8 @@  static int fsl_asoc_card_probe(struct platform_device *pdev)
 	} else if (of_device_is_compatible(np, "fsl,imx-audio-dummy-codec")) {
 		codec_dai_name = "snd-soc-dummy-dai";
 		priv->dai_fmt |= SND_SOC_DAIFMT_CBC_CFC;
+		priv->card.dapm_routes = NULL;
+		priv->card.num_dapm_routes = 0;
 	} else {
 		dev_err(&pdev->dev, "unknown Device Tree compatible\n");
 		ret = -EINVAL;