Skip to contentSkip to conversation

ASoC: core: Don't set platform name when of_node is set

PATCH RESEND In review Daniel Baluta 2 participants 2 messages Apr 14, 2021 – Apr 16, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 ASoC: core: Don't set platform name when of_node is set

From: Daniel Baluta <[email protected]>

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.

---
 sound/soc/soc-core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
sound/soc/soc-core.c +5 -1
index 522bae73640a..7a1c011a7fe0 100644
@@ -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) {
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 11 lines · Daniel Baluta

A DAI link has 3 components:
* CPU
* platform
* codec(s)

A component is specified via:
* name
* of_node
* dai_name

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: core: Don't set platform name when of_node is set

      commit: d97140033948363ffdf5ed71dd2366f717e120e7

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark