diff options
author | Dimitris Papastamos <dp@opensource.wolfsonmicro.com> | 2010-12-16 10:53:39 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-12-17 12:36:28 -0500 |
commit | 24ff33ac696802e478714480f505c00a50a89c75 (patch) | |
tree | 3b2e9d3232331b556b2f4cb423dae1ead5565e0c /include/sound | |
parent | 1ec9bc35a6a01555836fa1e4d0f00a3501835b0b (diff) |
ASoC: soc-dapm: Introduce the new snd_soc_dapm_virt_mux type
This new type is a virtual version of snd_soc_dapm_mux. It is used
when a backing register value is not necessary for deciding which
input path to connect. A simple virtual enumeration control e.g.
SOC_DAPM_ENUM_VIRT() can be exposed to userspace which will be used
to choose which path to connect.
The snd_soc_dapm_virt_mux type ensures that during the initial
path setup, the first (which is also the default) input path will
be connected.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc-dapm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 540872fc1390..8031769ac485 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -93,6 +93,9 @@ | |||
93 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 93 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
94 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 94 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
95 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | 95 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} |
96 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | ||
97 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | ||
98 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | ||
96 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 99 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
97 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ | 100 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ |
98 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | 101 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ |
@@ -148,6 +151,11 @@ | |||
148 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 151 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
149 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | 152 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ |
150 | .event = wevent, .event_flags = wflags} | 153 | .event = wevent, .event_flags = wflags} |
154 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | ||
155 | wevent, wflags) \ | ||
156 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | ||
157 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | ||
158 | .event = wevent, .event_flags = wflags} | ||
151 | 159 | ||
152 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 160 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
153 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 161 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
@@ -357,6 +365,7 @@ enum snd_soc_dapm_type { | |||
357 | snd_soc_dapm_input = 0, /* input pin */ | 365 | snd_soc_dapm_input = 0, /* input pin */ |
358 | snd_soc_dapm_output, /* output pin */ | 366 | snd_soc_dapm_output, /* output pin */ |
359 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ | 367 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ |
368 | snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */ | ||
360 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ | 369 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ |
361 | snd_soc_dapm_mixer, /* mixes several analog signals together */ | 370 | snd_soc_dapm_mixer, /* mixes several analog signals together */ |
362 | snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ | 371 | snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ |