aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc-dapm.h
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-07-29 11:14:01 -0400
committerMark Brown <broonie@linaro.org>2013-07-29 13:41:00 -0400
commitde9ba98b6d2629f53fd271a973176c2fa9736d9c (patch)
treef3dd7477dfcf63ca2effa74fa1a5a5d998df853e /include/sound/soc-dapm.h
parent5106b92f80a2cd37c52cffed80b4f5acfb77ccfd (diff)
ASoC: dapm: Make widget power register settings more flexible
Currently the DAPM code is limited to only setting or clearing a single bit in a register to power a widget up or down. This patch extends the DAPM code to be more flexible in that regard and allow widgets to use arbitrary values to be used to put a widget in either on or off state. Since the snd_soc_dapm_widget struct already contains a on_val and off_val field no additional fields need to be added and in fact the invert field can even be removed. Also the generated code is slightly smaller. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/sound/soc-dapm.h')
-rw-r--r--include/sound/soc-dapm.h163
1 files changed, 93 insertions, 70 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 693c75bbd5d1..3575721a955d 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -70,121 +70,144 @@ struct device;
70 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 70 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
71 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 71 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
72 72
73#define SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) \
74 .reg = wreg, .mask = 1, .shift = wshift, \
75 .on_val = winvert ? 0 : 1, .off_val = winvert ? 1 : 0
76
73/* path domain */ 77/* path domain */
74#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ 78#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\
75 wcontrols, wncontrols) \ 79 wcontrols, wncontrols) \
76{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 80{ .id = snd_soc_dapm_pga, .name = wname, \
77 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 81 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
82 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
78#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ 83#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
79 wcontrols, wncontrols) \ 84 wcontrols, wncontrols) \
80{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ 85{ .id = snd_soc_dapm_out_drv, .name = wname, \
81 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 86 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
87 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
82#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 88#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
83 wcontrols, wncontrols)\ 89 wcontrols, wncontrols)\
84{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 90{ .id = snd_soc_dapm_mixer, .name = wname, \
85 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 91 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
92 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
86#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ 93#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \
87 wcontrols, wncontrols)\ 94 wcontrols, wncontrols)\
88{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 95{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
89 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 96 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
90 .num_kcontrols = wncontrols} 97 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
91#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ 98#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \
92{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ 99{ .id = snd_soc_dapm_micbias, .name = wname, \
93 .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0} 100 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
101 .kcontrol_news = NULL, .num_kcontrols = 0}
94#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ 102#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \
95{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 103{ .id = snd_soc_dapm_switch, .name = wname, \
96 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 104 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
105 .kcontrol_news = wcontrols, .num_kcontrols = 1}
97#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ 106#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
98{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 107{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \
99 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 108 .kcontrol_news = wcontrols, .num_kcontrols = 1}
100#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ 109#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
101{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ 110{ .id = snd_soc_dapm_virt_mux, .name = wname, \
102 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 111 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
112 .kcontrol_news = wcontrols, .num_kcontrols = 1}
103#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ 113#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
104{ .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ 114{ .id = snd_soc_dapm_value_mux, .name = wname, \
105 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 115 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
106 .num_kcontrols = 1} 116 .kcontrol_news = wcontrols, .num_kcontrols = 1}
107 117
108/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 118/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
109#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 119#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
110 wcontrols) \ 120 wcontrols) \
111{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 121{ .id = snd_soc_dapm_pga, .name = wname, \
112 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 122 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
123 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
113#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ 124#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \
114 wcontrols)\ 125 wcontrols)\
115{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 126{ .id = snd_soc_dapm_mixer, .name = wname, \
116 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 127 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
128 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
117#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ 129#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \
118 wcontrols)\ 130 wcontrols)\
119{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 131{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
120 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 132 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
121 .num_kcontrols = ARRAY_SIZE(wcontrols)} 133 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
122 134
123/* path domain with event - event handler must return 0 for success */ 135/* path domain with event - event handler must return 0 for success */
124#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 136#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \
125 wncontrols, wevent, wflags) \ 137 wncontrols, wevent, wflags) \
126{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 138{ .id = snd_soc_dapm_pga, .name = wname, \
127 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 139 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
140 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
128 .event = wevent, .event_flags = wflags} 141 .event = wevent, .event_flags = wflags}
129#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ 142#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
130 wncontrols, wevent, wflags) \ 143 wncontrols, wevent, wflags) \
131{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ 144{ .id = snd_soc_dapm_out_drv, .name = wname, \
132 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 145 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
146 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
133 .event = wevent, .event_flags = wflags} 147 .event = wevent, .event_flags = wflags}
134#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 148#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
135 wncontrols, wevent, wflags) \ 149 wncontrols, wevent, wflags) \
136{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 150{ .id = snd_soc_dapm_mixer, .name = wname, \
137 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 151 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
152 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
138 .event = wevent, .event_flags = wflags} 153 .event = wevent, .event_flags = wflags}
139#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ 154#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \
140 wcontrols, wncontrols, wevent, wflags) \ 155 wcontrols, wncontrols, wevent, wflags) \
141{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 156{ .id = snd_soc_dapm_mixer, .name = wname, \
142 .invert = winvert, .kcontrol_news = wcontrols, \ 157 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
158 .kcontrol_news = wcontrols, \
143 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} 159 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags}
144#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ 160#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \
145 wevent, wflags) \ 161 wevent, wflags) \
146{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 162{ .id = snd_soc_dapm_switch, .name = wname, \
147 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 163 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
164 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
148 .event = wevent, .event_flags = wflags} 165 .event = wevent, .event_flags = wflags}
149#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 166#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
150 wevent, wflags) \ 167 wevent, wflags) \
151{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 168{ .id = snd_soc_dapm_mux, .name = wname, \
152 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 169 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
170 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
153 .event = wevent, .event_flags = wflags} 171 .event = wevent, .event_flags = wflags}
154#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 172#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
155 wevent, wflags) \ 173 wevent, wflags) \
156{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ 174{ .id = snd_soc_dapm_virt_mux, .name = wname, \
157 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 175 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
176 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
158 .event = wevent, .event_flags = wflags} 177 .event = wevent, .event_flags = wflags}
159 178
160/* additional sequencing control within an event type */ 179/* additional sequencing control within an event type */
161#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ 180#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
162 wevent, wflags) \ 181 wevent, wflags) \
163{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 182{ .id = snd_soc_dapm_pga, .name = wname, \
164 .invert = winvert, .event = wevent, .event_flags = wflags, \ 183 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
184 .event = wevent, .event_flags = wflags, \
165 .subseq = wsubseq} 185 .subseq = wsubseq}
166#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ 186#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \
167 wflags) \ 187 wflags) \
168{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 188{ .id = snd_soc_dapm_supply, .name = wname, \
169 .shift = wshift, .invert = winvert, .event = wevent, \ 189 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
170 .event_flags = wflags, .subseq = wsubseq} 190 .event = wevent, .event_flags = wflags, .subseq = wsubseq}
171 191
172/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 192/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
173#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 193#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
174 wevent, wflags) \ 194 wevent, wflags) \
175{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 195{ .id = snd_soc_dapm_pga, .name = wname, \
176 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 196 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
197 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
177 .event = wevent, .event_flags = wflags} 198 .event = wevent, .event_flags = wflags}
178#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 199#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
179 wevent, wflags) \ 200 wevent, wflags) \
180{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 201{ .id = snd_soc_dapm_mixer, .name = wname, \
181 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 202 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
203 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
182 .event = wevent, .event_flags = wflags} 204 .event = wevent, .event_flags = wflags}
183#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ 205#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \
184 wcontrols, wevent, wflags) \ 206 wcontrols, wevent, wflags) \
185{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 207{ .id = snd_soc_dapm_mixer, .name = wname, \
186 .invert = winvert, .kcontrol_news = wcontrols, \ 208 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
187 .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} 209 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
210 .event = wevent, .event_flags = wflags}
188 211
189/* events that are pre and post DAPM */ 212/* events that are pre and post DAPM */
190#define SND_SOC_DAPM_PRE(wname, wevent) \ 213#define SND_SOC_DAPM_PRE(wname, wevent) \
@@ -199,35 +222,36 @@ struct device;
199/* stream domain */ 222/* stream domain */
200#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ 223#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \
201{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 224{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
202 .reg = wreg, .shift = wshift, .invert = winvert } 225 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
203#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ 226#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \
204 wevent, wflags) \ 227 wevent, wflags) \
205{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 228{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
206 .reg = wreg, .shift = wshift, .invert = winvert, \ 229 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
207 .event = wevent, .event_flags = wflags } 230 .event = wevent, .event_flags = wflags }
208#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ 231#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \
209{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 232{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
210 .reg = wreg, .shift = wshift, .invert = winvert } 233 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
211#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ 234#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \
212 wevent, wflags) \ 235 wevent, wflags) \
213{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 236{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
214 .reg = wreg, .shift = wshift, .invert = winvert, \ 237 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
215 .event = wevent, .event_flags = wflags } 238 .event = wevent, .event_flags = wflags }
216#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 239#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
217{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 240{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
218 .shift = wshift, .invert = winvert} 241 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) }
219#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ 242#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \
220 wevent, wflags) \ 243 wevent, wflags) \
221{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 244{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
222 .shift = wshift, .invert = winvert, \ 245 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
223 .event = wevent, .event_flags = wflags} 246 .event = wevent, .event_flags = wflags}
247
224#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 248#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
225{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 249{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
226 .shift = wshift, .invert = winvert} 250 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
227#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ 251#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \
228 wevent, wflags) \ 252 wevent, wflags) \
229{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 253{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
230 .shift = wshift, .invert = winvert, \ 254 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
231 .event = wevent, .event_flags = wflags} 255 .event = wevent, .event_flags = wflags}
232#define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ 256#define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \
233{ .id = snd_soc_dapm_clock_supply, .name = wname, \ 257{ .id = snd_soc_dapm_clock_supply, .name = wname, \
@@ -241,14 +265,14 @@ struct device;
241 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ 265 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \
242 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 266 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
243#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ 267#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \
244{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 268{ .id = snd_soc_dapm_supply, .name = wname, \
245 .shift = wshift, .invert = winvert, .event = wevent, \ 269 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
246 .event_flags = wflags} 270 .event = wevent, .event_flags = wflags}
247#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ 271#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \
248{ .id = snd_soc_dapm_regulator_supply, .name = wname, \ 272{ .id = snd_soc_dapm_regulator_supply, .name = wname, \
249 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ 273 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \
250 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ 274 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \
251 .invert = wflags} 275 .on_val = wflags}
252 276
253 277
254/* dapm kcontrol types */ 278/* dapm kcontrol types */
@@ -527,7 +551,6 @@ struct snd_soc_dapm_widget {
527 unsigned int on_val; /* on state value */ 551 unsigned int on_val; /* on state value */
528 unsigned int off_val; /* off state value */ 552 unsigned int off_val; /* off state value */
529 unsigned char power:1; /* block power status */ 553 unsigned char power:1; /* block power status */
530 unsigned char invert:1; /* invert the power bit */
531 unsigned char active:1; /* active stream on DAC, ADC's */ 554 unsigned char active:1; /* active stream on DAC, ADC's */
532 unsigned char connected:1; /* connected codec pin */ 555 unsigned char connected:1; /* connected codec pin */
533 unsigned char new:1; /* cnew complete */ 556 unsigned char new:1; /* cnew complete */