aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc-dapm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/soc-dapm.h')
-rw-r--r--include/sound/soc-dapm.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index a7def6a9a030..ec8a45f9a069 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -140,16 +140,30 @@
140#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 140#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
141{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 141{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
142 .shift = wshift, .invert = winvert} 142 .shift = wshift, .invert = winvert}
143#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \
144 wevent, wflags) \
145{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
146 .shift = wshift, .invert = winvert, \
147 .event = wevent, .event_flags = wflags}
143#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 148#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
144{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 149{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \
145 .shift = wshift, .invert = winvert} 150 .shift = wshift, .invert = winvert}
151#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \
152 wevent, wflags) \
153{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \
154 .shift = wshift, .invert = winvert, \
155 .event = wevent, .event_flags = wflags}
146 156
147/* generic register modifier widget */ 157/* generic widgets */
148#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ 158#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \
149{ .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ 159{ .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \
150 .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ 160 .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \
151 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ 161 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \
152 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 162 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
163#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \
164{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \
165 .shift = wshift, .invert = winvert, .event = wevent, \
166 .event_flags = wflags}
153 167
154/* dapm kcontrol types */ 168/* dapm kcontrol types */
155#define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ 169#define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \
@@ -265,8 +279,6 @@ int snd_soc_dapm_add_routes(struct snd_soc_codec *codec,
265/* dapm events */ 279/* dapm events */
266int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, 280int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream,
267 int event); 281 int event);
268int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev,
269 enum snd_soc_bias_level level);
270 282
271/* dapm sys fs - used by the core */ 283/* dapm sys fs - used by the core */
272int snd_soc_dapm_sys_add(struct device *dev); 284int snd_soc_dapm_sys_add(struct device *dev);
@@ -298,6 +310,7 @@ enum snd_soc_dapm_type {
298 snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ 310 snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */
299 snd_soc_dapm_pre, /* machine specific pre widget - exec first */ 311 snd_soc_dapm_pre, /* machine specific pre widget - exec first */
300 snd_soc_dapm_post, /* machine specific post widget - exec last */ 312 snd_soc_dapm_post, /* machine specific post widget - exec last */
313 snd_soc_dapm_supply, /* power/clock supply */
301}; 314};
302 315
303/* 316/*
@@ -357,6 +370,8 @@ struct snd_soc_dapm_widget {
357 unsigned char suspend:1; /* was active before suspend */ 370 unsigned char suspend:1; /* was active before suspend */
358 unsigned char pmdown:1; /* waiting for timeout */ 371 unsigned char pmdown:1; /* waiting for timeout */
359 372
373 int (*power_check)(struct snd_soc_dapm_widget *w);
374
360 /* external events */ 375 /* external events */
361 unsigned short event_flags; /* flags to specify event types */ 376 unsigned short event_flags; /* flags to specify event types */
362 int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int); 377 int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int);
@@ -368,6 +383,9 @@ struct snd_soc_dapm_widget {
368 /* widget input and outputs */ 383 /* widget input and outputs */
369 struct list_head sources; 384 struct list_head sources;
370 struct list_head sinks; 385 struct list_head sinks;
386
387 /* used during DAPM updates */
388 struct list_head power_list;
371}; 389};
372 390
373#endif 391#endif