linux/sound/soc
Stephen Warren af46800b9a ASoC: Implement mux control sharing
Control sharing is enabled when two widgets include pointers to the
same kcontrol_new in their definition. Specifically:

static const struct snd_kcontrol_new adcinput_mux =
	SOC_DAPM_ENUM("ADC Input", adcinput_enum);

static const struct snd_soc_dapm_widget wm8903_dapm_widgets[] = {
  SND_SOC_DAPM_MUX("Left ADC Input", SND_SOC_NOPM, 0, 0, &adcinput_mux),
  SND_SOC_DAPM_MUX("Right ADC Input", SND_SOC_NOPM, 0, 0, &adcinput_mux),
};

This is useful when a single register bit or field affects multiple
muxes at once. The common case is to have separate control bits or
fields for each mux (channel). An alternative way of looking at this
is that the mux is a stereo (or even n-channel) mux, rather than
independant mono muxes.

Without this change, a separate kcontrol will be created for each
DAPM_MUX. This has the following disadvantages:

* Confuses the user/programmer with redundant controls that don't
  map to separate hardware.

* When one of the controls is changed, ASoC fails to update the DAPM
  logic for paths solely affected by the other controls impacted by
  the same register bits. This causes some paths not to be correctly
  powered up or down. Prior to this change, to work around this, the
  user or programmer had to manually toggle all duplicate controls away
  from the intended setting, and then back to it.

Control sharing implies that the control is named based on the
kcontrol_new itself, not any of the widgets that are affected by it.

Control sharing is implemented by: When creating kcontrols, if a
kcontrol does not yet exist for a particular kcontrol_new, then a new
kcontrol is created with a list of widgets containing just a single
entry. This is the normal case. However, if a kcontrol does already
exists for the given kcontrol_new, the current widget is simply added
to that kcontrol's list of affected widgets.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-05-03 19:29:15 +01:00
..
atmel ASoC: Merge branch 'for-2.6.39' into for-2.6.40 2011-04-18 18:07:43 +01:00
au1x ASoC: Remove -codec from WM8731 driver name 2011-03-30 07:15:33 +09:00
blackfin ASoC: Blackfin: push down SPORT settings from global variables 2011-03-30 07:20:05 +09:00
codecs ASoC: s/w->kcontrols/w->kcontrol_news/g 2011-05-03 19:28:47 +01:00
davinci davinci-mcasp: fix _CBM_CFS pin directions 2011-04-26 11:43:53 +01:00
ep93xx ASoC: Enable 192kHz sample rate for EP93xx. 2011-03-09 13:08:42 +00:00
fsl Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2011-03-18 10:46:37 -07:00
imx ASoC: Merge branch 'for-2.6.39' into for-2.6.40 2011-04-18 18:07:43 +01:00
jz4740 Merge branch 'for-2.6.39' into for-2.6.40 2011-05-03 19:07:45 +01:00
kirkwood Fix common misspellings 2011-03-31 11:26:23 -03:00
mid-x86 ASoC: Merge branch 'for-2.6.39' into for-2.6.40 2011-04-18 18:07:43 +01:00
nuc900 Merge branch 'for-2.6.37' into for-2.6.38 2010-11-30 11:35:43 +00:00
omap Fix common misspellings 2011-03-31 11:26:23 -03:00
pxa ASoC: Properly handle spitz MIC GPIO 2011-04-03 22:11:09 +09:00
s6000 ASoC: Remove needless inclusion of tlv320aic3x.h from machine drivers 2011-01-05 11:28:50 +00:00
samsung ASoC: Don't specify the DMA driver for Goni baseband link 2011-04-28 12:11:06 +01:00
sh ASoC: sh: fsi: Add module/port clock control function 2011-04-26 11:42:11 +01:00
tegra ASoC: tegra: TrimSlice machine support 2011-05-03 18:42:44 +01:00
txx9 ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
Kconfig ASoC: tegra: Kconfig and Makefile 2011-01-10 22:21:09 +00:00
Makefile ASoC: tegra: Kconfig and Makefile 2011-01-10 22:21:09 +00:00
soc-cache.c ASoC: remove unused comment 2011-04-20 13:50:16 +01:00
soc-core.c ASoC: Move DAPM widget debugfs entry creation to snd_soc_dapm_new_widgets 2011-05-03 18:43:44 +01:00
soc-dapm.c ASoC: Implement mux control sharing 2011-05-03 19:29:15 +01:00
soc-jack.c ASoC: Merge branch 'for-2.6.39' into for-2.6.40 2011-04-18 18:07:43 +01:00
soc-utils.c ASoC: Work around allmodconfig failure 2011-04-28 12:09:06 +01:00