aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2011-03-30 23:27:27 +0100
committerColin Cross <ccross@android.com>2011-06-14 09:06:11 -0700
commit70d9308c044b4ba3af896aa20105f3ac4f5f2f1a (patch)
tree999fc67cd65be5a86259bc051b4e42edcd71073e /sound/soc/soc-dapm.c
parent110e2f989d912b5d0f40fbef1de97f1dc99dc1ab (diff)
downloadkernel_samsung_espresso10-70d9308c044b4ba3af896aa20105f3ac4f5f2f1a.zip
kernel_samsung_espresso10-70d9308c044b4ba3af896aa20105f3ac4f5f2f1a.tar.gz
kernel_samsung_espresso10-70d9308c044b4ba3af896aa20105f3ac4f5f2f1a.tar.bz2
ASoC: dapm - Add DAPM stream completion event
In preparation for ASoC DSP support. This adds a callback function to be called at the completion of a DAPM stream event. This can be used by DSP components to perform calculations based on DAPM graphs. Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 7e05c6b..f369656 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2440,6 +2440,9 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm,
}
dapm_power_widgets(dapm, event);
+ /* do we need to notify any clients that DAPM stream is complete */
+ if (dapm->stream_event)
+ dapm->stream_event(dapm);
}
/**
@@ -2461,9 +2464,12 @@ int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
if (stream == NULL)
return 0;
- mutex_lock(&codec->mutex);
- soc_dapm_stream_event(&codec->dapm, stream, event);
- mutex_unlock(&codec->mutex);
+ mutex_lock(&rtd->card->dapm_mutex);
+
+ soc_dapm_stream_event(&rtd->platform->dapm, stream, event);
+ soc_dapm_stream_event(&rtd->codec->dapm, stream, event);
+
+ mutex_unlock(&rtd->card->dapm_mutex);
return 0;
}