[alsa-devel] [PATCH 0/4] Implement control sharing
Stephen Warren
swarren at nvidia.com
Fri Apr 29 01:37:57 CEST 2011
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.
I have tested this on NVIDIA Tegra Seaboard, specifically with the WM8903
"ADC Input" control, and a locally-enabled digital mic setup.
I have not compiled nor tested any other platforms.
This patchset does not implement control sharing for dapm_new_mixer() yet.
I can do so after discussion/review of this patch series, although note that
I don't have anything to test the actual sharing on for such controls.
Stephen Warren (4):
ASoC: s/w->kcontrols/w->kcontrol_news/g
ASoC: Add w->kcontrols, and populate it
ASoC: Store a list of widgets in a DAPM mux/mixer kcontrol
ASoC: Implement mux control sharing
include/sound/soc-dapm.h | 75 +++++----
sound/soc/codecs/88pm860x-codec.c | 2 +-
sound/soc/soc-dapm.c | 315 ++++++++++++++++++++++++++-----------
3 files changed, 266 insertions(+), 126 deletions(-)
More information about the Alsa-devel
mailing list