linux/sound/soc
Jarkko Nikula ead9b9199c ASoC: Add optional name_prefix for codec kcontrol, widget and route names
There is a need to prefix codec kcontrol, widget and internal route names in
an ASoC machine that has multiple codecs with conflicting names. The name
collision would occur when codec drivers try to registering kcontrols with
the same name or when building audio paths.

This patch introduces optional prefix_map into struct snd_soc_card. With it
machine drivers can specify a unique name prefix to each codec that have
conflicting names with anothers. Prefix to codec is matched with codec
name.

Following example illustrates a machine that has two same codec instances.
Name collision from kcontrol registration is avoided by specifying a name
prefix "foo" for the second codec. As the codec widget names are prefixed
then second audio map for that codec shows a prefixed widget name.

static const struct snd_soc_dapm_route map0[] = {
	{"Spk", NULL, "MONO"},
};

static const struct snd_soc_dapm_route map1[] = {
	{"Vibra", NULL, "foo MONO"},
};

static struct snd_soc_prefix_map codec_prefix[] = {
	{
		.dev_name = "codec.2",
		.name_prefix = "foo",
	},
};

static struct snd_soc_card card = {
	...
	.prefix_map = codec_prefix,
	.num_prefixes = ARRAY_SIZE(codec_prefix),
};

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-15 15:24:58 +00:00
..
atmel Merge branch 'for-2.6.37' into for-2.6.38 2010-11-11 16:00:49 +00:00
au1x ASoC: fix au1x platform 2010-08-31 13:06:31 +01:00
blackfin Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into for-2.6.37 2010-08-15 14:56:40 +01:00
codecs ASoC: Reset WM8962 with default ID value 2010-11-12 15:33:44 +00:00
davinci ASoC: Decouple DAPM from CODECs 2010-11-06 11:28:29 -04:00
ep93xx ASoC: Decouple DAPM from CODECs 2010-11-06 11:28:29 -04:00
fsl ASoC: Return proper error if snd_soc_register_dais fails in psc_i2s_of_probe 2010-11-08 16:28:33 +00:00
imx ASoC: Decouple DAPM from CODECs 2010-11-06 11:28:29 -04:00
jz4740 ASoC: Decouple DAPM from CODECs 2010-11-06 11:28:29 -04:00
kirkwood ASoC: Add support for OpenRD Ultimate 2010-11-15 12:27:57 +00:00
nuc900 ASoC: remove duplicated include for nuc900 2010-10-05 19:26:00 -07:00
omap ASoC: Decouple DAPM from CODECs 2010-11-06 11:28:29 -04:00
pxa Merge branch 'for-2.6.37' into for-2.6.38 2010-11-06 11:35:44 -04:00
s3c24xx Merge branch 'for-2.6.37' into for-2.6.38 2010-11-15 13:20:12 +00:00
s6000 ASoC: Decouple DAPM from CODECs 2010-11-06 11:28:29 -04:00
sh ASoC: Decouple DAPM from CODECs 2010-11-06 11:28:29 -04:00
txx9 ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
Kconfig ASoC: soc-cache: Add support for LZO register caching 2010-11-11 15:59:01 +00:00
Makefile ASoC: Fix sorting of Makefile and Kconfig 2010-07-05 23:35:29 +09:00
soc-cache.c ASoC: soc-cache: Add support for rbtree based register caching 2010-11-11 15:59:22 +00:00
soc-core.c ASoC: Add optional name_prefix for codec kcontrol, widget and route names 2010-11-15 15:24:58 +00:00
soc-dapm.c ASoC: Add optional name_prefix for codec kcontrol, widget and route names 2010-11-15 15:24:58 +00:00
soc-jack.c ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks 2010-11-15 11:44:43 +00:00
soc-utils.c ASoC: Add BCLK calculation utility for TDM mode too 2009-11-25 19:55:46 +00:00