diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-01-15 08:40:50 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-01-19 08:02:32 -0500 |
commit | 20e4859dedfc7e7b620d1756b29f8483c5be5fcc (patch) | |
tree | e7fff82807a50a5e0930438d7bf2f93826a95ec7 /include/sound/soc-dapm.h | |
parent | 828a842f2e02de5d884ee14bd3c21ddbc77ec60e (diff) |
ASoC: Add support for sequencing within
With larger devices there may be many widgets of the same type in series
in an audio path. Allow drivers to specify an additional level of ordering
within each widget type by adding a subsequence number to widgets and then
splitting operations on widgets so that widgets of the same type but
different sequence numbers are processed separately. A typical example
would be a supply widget which requires that another widget be enabled
to provide power or clocking.
SND_SOC_DAPM_PGA_S() and SND_SOC_DAPM_SUPPLY_S() macros are provided
allowing this to be used with PGAs and supplies as these are the most
commonly affected widgets.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/sound/soc-dapm.h')
-rw-r--r-- | include/sound/soc-dapm.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 8031769ac485..a3760c93a8a3 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -157,6 +157,18 @@ | |||
157 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | 157 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ |
158 | .event = wevent, .event_flags = wflags} | 158 | .event = wevent, .event_flags = wflags} |
159 | 159 | ||
160 | /* additional sequencing control within an event type */ | ||
161 | #define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, wcontrols, \ | ||
162 | wncontrols, wevent, wflags) \ | ||
163 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | ||
164 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | ||
165 | .event = wevent, .event_flags = wflags, .subseq = wsubseq} | ||
166 | #define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ | ||
167 | wflags) \ | ||
168 | { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ | ||
169 | .shift = wshift, .invert = winvert, .event = wevent, \ | ||
170 | .event_flags = wflags, .subseq = wsubseq} | ||
171 | |||
160 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 172 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
161 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 173 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
162 | wevent, wflags) \ | 174 | wevent, wflags) \ |
@@ -450,6 +462,7 @@ struct snd_soc_dapm_widget { | |||
450 | unsigned char ext:1; /* has external widgets */ | 462 | unsigned char ext:1; /* has external widgets */ |
451 | unsigned char force:1; /* force state */ | 463 | unsigned char force:1; /* force state */ |
452 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ | 464 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ |
465 | int subseq; /* sort within widget type */ | ||
453 | 466 | ||
454 | int (*power_check)(struct snd_soc_dapm_widget *w); | 467 | int (*power_check)(struct snd_soc_dapm_widget *w); |
455 | 468 | ||