Skip to contentSkip to conversation

ASoC: core: Add name prefix for machines with different topologies

PATCH In review Liam Girdwood 2 participants 4 messages Mar 14, 2018 – Apr 17, 2018

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

PATCH 1/1 ASoC: core: Add name prefix for machines with different topologies

Provide a mechanism for drivers to modify there card name with a prefix so that userspace can load a different configuration file to default. This can be useful when topology has changed the PCMs and kcontrols for a machine.

This will be used by SOF to differentiate sound card names for UCM etc.

---
 include/sound/soc.h  | 2 ++
 sound/soc/soc-core.c | 8 ++++++++
 2 files changed, 10 insertions(+)
include/sound/soc.h +2 -0
index 4e368c308f93..99b77feab364 100644
@@ -1015,6 +1015,7 @@ struct snd_soc_platform_driver {
 
 	/* this platform uses topology and ignore machine driver FEs */
 	const char *ignore_machine;
+	const char *topology_name_prefix;
 	int (*be_hw_params_fixup)(struct snd_soc_pcm_runtime *rtd,
 				  struct snd_pcm_hw_params *params);
 	bool use_dai_pcm_id;	/* use the DAI link PCM ID as PCM device number */
@@ -1167,6 +1168,7 @@ struct snd_soc_card {
 	const char *long_name;
 	const char *driver_name;
 	char dmi_longname[80];
+	char topology_shortname[32];
 
 	struct device *dev;
 	struct snd_card *snd_card;
sound/soc/soc-core.c +8 -0
index 33840e5bc24e..4ab2b4ac8522 100644
@@ -2144,6 +2144,14 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
 			if (!dai_link->stream_name)
 				dai_link->stream_name = dai_link->name;
 		}
+
+		/* Inform userspace we are using alternate topology */
+		if (platform->driver->topology_name_prefix) {
+			snprintf(card->topology_shortname, 32, "%s-%s",
+				 platform->driver->topology_name_prefix,
+				 card->name);
+			card->name = card->topology_shortname;
+		}
 	}
 }
 
Signature · 1 line
2.14.1
maintainer
#1 lore raw
Quoted 4 lines · Liam Girdwood

Provide a mechanism for drivers to modify there card name with a prefix so that userspace can load a different configuration file to default. This can be useful when topology has changed the PCMs and kcontrols for a machine.

This doesn't apply against current code, please check and resend.

maintainer
#2 lore raw

Applied "ASoC: core: Add name prefix for machines with topology rewrites" to the asoc tree

In reply to Liam Girdwood

The patch

ASoC: core: Add name prefix for machines with topology rewrites

has been applied to the asoc tree at

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

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

Quoted 1 line

From f11a5c27f9287cacad74af31cd92d4413eccc05a Mon Sep 17 00:00:00 2001

From: Liam Girdwood <[email protected]>
Date: Tue, 27 Mar 2018 14:30:41 +0100
Subject: [PATCH] ASoC: core: Add name prefix for machines with topology
rewrites

---
 include/sound/soc.h  | 2 ++
 sound/soc/soc-core.c | 8 ++++++++
 2 files changed, 10 insertions(+)
include/sound/soc.h +2 -0
index fac4ff04fb7d..3676d0a8f532 100644
@@ -1015,6 +1015,7 @@ struct snd_soc_platform_driver {
 
 	/* this platform uses topology and ignore machine driver FEs */
 	const char *ignore_machine;
+	const char *topology_name_prefix;
 	int (*be_hw_params_fixup)(struct snd_soc_pcm_runtime *rtd,
 				  struct snd_pcm_hw_params *params);
 	bool use_dai_pcm_id;	/* use the DAI link PCM ID as PCM device number */
@@ -1167,6 +1168,7 @@ struct snd_soc_card {
 	const char *long_name;
 	const char *driver_name;
 	char dmi_longname[80];
+	char topology_shortname[32];
 
 	struct device *dev;
 	struct snd_card *snd_card;
sound/soc/soc-core.c +8 -0
index 8f01fe8296ff..aa1c33b3cce0 100644
@@ -2143,6 +2143,14 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
 			if (!dai_link->stream_name)
 				dai_link->stream_name = dai_link->name;
 		}
+
+		/* Inform userspace we are using alternate topology */
+		if (platform->driver->topology_name_prefix) {
+			snprintf(card->topology_shortname, 32, "%s-%s",
+				 platform->driver->topology_name_prefix,
+				 card->name);
+			card->name = card->topology_shortname;
+		}
 	}
 }
 
Signature · 1 line
2.17.0
maintainer
#3 lore raw

Applied "ASoC: core: Add name prefix for machines with topology rewrites" to the asoc tree

In reply to Liam Girdwood

The patch

ASoC: core: Add name prefix for machines with topology rewrites

has been applied to the asoc tree at

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

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

Quoted 1 line

From f11a5c27f9287cacad74af31cd92d4413eccc05a Mon Sep 17 00:00:00 2001

From: Liam Girdwood <[email protected]>
Date: Tue, 27 Mar 2018 14:30:41 +0100
Subject: [PATCH] ASoC: core: Add name prefix for machines with topology
rewrites

---
 include/sound/soc.h  | 2 ++
 sound/soc/soc-core.c | 8 ++++++++
 2 files changed, 10 insertions(+)
include/sound/soc.h +2 -0
index fac4ff04fb7d..3676d0a8f532 100644
@@ -1015,6 +1015,7 @@ struct snd_soc_platform_driver {
 
 	/* this platform uses topology and ignore machine driver FEs */
 	const char *ignore_machine;
+	const char *topology_name_prefix;
 	int (*be_hw_params_fixup)(struct snd_soc_pcm_runtime *rtd,
 				  struct snd_pcm_hw_params *params);
 	bool use_dai_pcm_id;	/* use the DAI link PCM ID as PCM device number */
@@ -1167,6 +1168,7 @@ struct snd_soc_card {
 	const char *long_name;
 	const char *driver_name;
 	char dmi_longname[80];
+	char topology_shortname[32];
 
 	struct device *dev;
 	struct snd_card *snd_card;
sound/soc/soc-core.c +8 -0
index 8f01fe8296ff..aa1c33b3cce0 100644
@@ -2143,6 +2143,14 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
 			if (!dai_link->stream_name)
 				dai_link->stream_name = dai_link->name;
 		}
+
+		/* Inform userspace we are using alternate topology */
+		if (platform->driver->topology_name_prefix) {
+			snprintf(card->topology_shortname, 32, "%s-%s",
+				 platform->driver->topology_name_prefix,
+				 card->name);
+			card->name = card->topology_shortname;
+		}
 	}
 }
 
Signature · 1 line
2.17.0