[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1614254912-15746-1-git-send-email-shengjiu.wang@nxp.com>
Date: Thu, 25 Feb 2021 20:08:32 +0800
From: Shengjiu Wang <shengjiu.wang@....com>
To: lgirdwood@...il.com, broonie@...nel.org, perex@...ex.cz,
tiwai@...e.com, pierre-louis.bossart@...ux.intel.com,
stephan@...hold.net, guennadi.liakhovetski@...ux.intel.com,
kai.vehmanen@...ux.intel.com, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] ASoC: simple-card: Add dummy dai support simple sound card
If sound card doesn't need specific codec device, just
dummy codec is enough, then we can link the dummy component
directly.
In this case, user needs to specify below setting in
devicetree. Previously the sound-dai is a node of codec,
now we check if it is zero before parsing the node, zero
means dummy component is specified.
simple-audio-card,codec {
sound-dai = <0>;
};
Signed-off-by: Shengjiu Wang <shengjiu.wang@....com>
---
sound/soc/generic/simple-card.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index c262281bc64d..8b0cabd1bad1 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -34,10 +34,19 @@ static int asoc_simple_parse_dai(struct device_node *node,
{
struct of_phandle_args args;
int ret;
+ u32 val;
if (!node)
return 0;
+ ret = of_property_read_u32(node, DAI, &val);
+ if (val == 0) {
+ dlc->of_node = NULL;
+ dlc->dai_name = "snd-soc-dummy-dai";
+ dlc->name = "snd-soc-dummy";
+ return 0;
+ }
+
/*
* Get node via "sound-dai = <&phandle port>"
* it will be used as xxx_of_node on soc_bind_dai_link()
--
2.27.0
Powered by blists - more mailing lists