summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown2011-01-18 17:14:44 +0100
committerMark Brown2011-01-19 14:02:32 +0100
commit474b62d6eee733abdcd36f8e3e5ce504fbb9110b (patch)
tree1b399ebd627111f806fe7a20daa9f3df87ff567a /sound/soc/soc-dapm.c
parentASoC: Add support for sequencing within (diff)
downloadkernel-qcow2-linux-474b62d6eee733abdcd36f8e3e5ce504fbb9110b.tar.gz
kernel-qcow2-linux-474b62d6eee733abdcd36f8e3e5ce504fbb9110b.tar.xz
kernel-qcow2-linux-474b62d6eee733abdcd36f8e3e5ce504fbb9110b.zip
ASoC: Provide per widget type callback when executing DAPM sequences
Many modern devices have features such as DC servos which take time to start. Currently these are handled by per-widget events but this makes it difficult to paralleise operations on multiple widgets, meaning delays can end up being needlessly serialised. By providing a callback to drivers when all widgets of a given type have been handled during a DAPM sequence the core allows drivers to start operations separately and wait for them to complete much more simply. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index eb7436c7acad..37b376f4c75d 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -878,7 +878,7 @@ static void dapm_seq_run(struct snd_soc_dapm_context *dapm,
int cur_subseq = -1;
int cur_reg = SND_SOC_NOPM;
struct snd_soc_dapm_context *cur_dapm = NULL;
- int ret;
+ int ret, i;
int *sort;
if (power_up)
@@ -895,6 +895,13 @@ static void dapm_seq_run(struct snd_soc_dapm_context *dapm,
if (!list_empty(&pending))
dapm_seq_run_coalesced(cur_dapm, &pending);
+ if (cur_dapm && cur_dapm->seq_notifier) {
+ for (i = 0; i < ARRAY_SIZE(dapm_up_seq); i++)
+ if (sort[i] == cur_sort)
+ cur_dapm->seq_notifier(cur_dapm,
+ i);
+ }
+
INIT_LIST_HEAD(&pending);
cur_sort = -1;
cur_subseq = -1;
@@ -956,6 +963,13 @@ static void dapm_seq_run(struct snd_soc_dapm_context *dapm,
if (!list_empty(&pending))
dapm_seq_run_coalesced(dapm, &pending);
+
+ if (cur_dapm && cur_dapm->seq_notifier) {
+ for (i = 0; i < ARRAY_SIZE(dapm_up_seq); i++)
+ if (sort[i] == cur_sort)
+ cur_dapm->seq_notifier(cur_dapm,
+ i);
+ }
}
static void dapm_widget_update(struct snd_soc_dapm_context *dapm)