aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc-dapm.h
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-01-21 15:10:47 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-01-25 09:50:45 -0500
commit8484c63f4b363d79febe35f95328e38018b65026 (patch)
tree43e3950e81319f2e921a7ba1796ca35d64f7dd4a /include/sound/soc-dapm.h
parent821dd91ec7838e1313d783384ea9ce43510d4013 (diff)
ASoC: add simplified versions of widget macros
Many macros from include/sound/soc-dapm.h take an array and a number of elements in it as arguments, whereas most users use static arrays and use "x, ARRAY_SIZE(x)" as arguments. This patch adds simplified versions of those macros, calling ARRAY_SIZE() internally. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Liam Girdwood <lrg@slimlogic.oc.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound/soc-dapm.h')
-rw-r--r--include/sound/soc-dapm.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c5c95e1da65b..c0922a034223 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -95,6 +95,21 @@
95 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ 95 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \
96 .num_kcontrols = 1} 96 .num_kcontrols = 1}
97 97
98/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
99#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
100 wcontrols) \
101{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
102 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
103#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \
104 wcontrols)\
105{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
106 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
107#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \
108 wcontrols)\
109{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \
110 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \
111 .num_kcontrols = ARRAY_SIZE(wcontrols)}
112
98/* path domain with event - event handler must return 0 for success */ 113/* path domain with event - event handler must return 0 for success */
99#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 114#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \
100 wncontrols, wevent, wflags) \ 115 wncontrols, wevent, wflags) \
@@ -126,6 +141,23 @@
126 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 141 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
127 .event = wevent, .event_flags = wflags} 142 .event = wevent, .event_flags = wflags}
128 143
144/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
145#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
146 wevent, wflags) \
147{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
148 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
149 .event = wevent, .event_flags = wflags}
150#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
151 wevent, wflags) \
152{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
153 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
154 .event = wevent, .event_flags = wflags}
155#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \
156 wcontrols, wevent, wflags) \
157{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
158 .invert = winvert, .kcontrols = wcontrols, \
159 .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags}
160
129/* events that are pre and post DAPM */ 161/* events that are pre and post DAPM */
130#define SND_SOC_DAPM_PRE(wname, wevent) \ 162#define SND_SOC_DAPM_PRE(wname, wevent) \
131{ .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ 163{ .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \