linux/include
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
..
acpi Merge branch 'misc' into release 2010-10-26 14:51:00 -04:00
asm-generic audit: make link()/linkat() match "attribute change" predicate 2010-10-30 08:45:43 -04:00
crypto Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
drm Merge remote branch 'intel/drm-intel-next' of ../drm-next into drm-core-next 2010-10-26 09:23:22 +10:00
keys DNS: Separate out CIFS DNS Resolver code 2010-08-05 17:17:51 +00:00
linux ASoC: Remove broken WM8350 direction constants 2010-11-10 15:40:06 +00:00
math-emu math-emu: correct test for downshifting fraction in _FP_FROM_INT() 2010-07-20 18:45:14 -07:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2010-10-28 09:35:11 -07:00
mtd mtd: Define MLC Flash as a different flash type 2010-10-25 00:50:20 +01:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-10-29 14:17:12 -07:00
pcmcia pcmcia: IOCARD is also required for using IRQs 2010-10-22 08:46:36 +02:00
rdma IB/core: Add VLAN support for IBoE 2010-10-25 10:20:39 -07:00
rxrpc net: use __packed annotation 2010-06-03 03:21:52 -07:00
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-10-31 20:43:12 -04:00
sound ASoC: Add optional name_prefix for codec kcontrol, widget and route names 2010-11-15 15:24:58 +00:00
trace ASoC: Add DAPM trace events 2010-11-11 14:54:31 +00:00
video Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/genesis-2.6 into devel-stable 2010-10-28 20:14:38 +01:00
xen Merge branch 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2010-10-28 17:11:17 -07:00
Kbuild