[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210325112627.275632-1-daniel.baluta@oss.nxp.com>
Date: Thu, 25 Mar 2021 13:26:27 +0200
From: Daniel Baluta <daniel.baluta@....nxp.com>
To: alsa-devel@...a-project.org, lgirdwood@...il.com, perex@...ex.cz,
tiwai@...e.com
Cc: daniel.baluta@...il.com, linux-kernel@...r.kernel.org,
linux-imx@....com, ranjani.sridharan@...ux.intel.com,
pierre-louis.bossart@...ux.intel.com, shengjiu.wang@....com,
aisheng.dong@....com, Daniel Baluta <daniel.baluta@....com>
Subject: [PATCH v2] ASoC: core: Don't set platform name when of_node is set
From: Daniel Baluta <daniel.baluta@....com>
A DAI link has 3 components:
* CPU
* platform
* codec(s)
A component is specified via:
* name
* of_node
* dai_name
In order to avoid confusion when building a sound card we disallow
matching by both name and of_node (1).
soc_check_tplg_fes allows overriding certain BE links by overriding
BE link name. This doesn't work well if BE link was specified via DT,
because we end up with a link with both name and of_node specified
which is conflicting with (1).
In order to fix this we need to:
* override of_node if component was specified via DT
* override name, otherwise.
Signed-off-by: Daniel Baluta <daniel.baluta@....com>
---
sound/soc/soc-core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 522bae73640a..7a1c011a7fe0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1648,7 +1648,11 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
dev_err(card->dev, "init platform error");
continue;
}
- dai_link->platforms->name = component->name;
+
+ if (component->dev->of_node)
+ dai_link->platforms->of_node = component->dev->of_node;
+ else
+ dai_link->platforms->name = component->name;
/* convert non BE into BE */
if (!dai_link->no_pcm) {
--
2.27.0
Powered by blists - more mailing lists