summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-16 19:43:20 -0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-17 08:10:21 -0800
commitfe360685f9cf41a897c50fea50b4b95f3f622d7c (patch)
tree626d5d7462b7d9408f0f2bcd16b77d25633523e4 /sound
parent888df395ebc5c88cde45478660197ca46665efe2 (diff)
ASoC: dapm: Convert stream events to use DAI widgets
This means we don't need to walk through every single widget in the system for each stream event which is a bit less silly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-dapm.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index a4707d0fdf3d..86569044f662 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2946,38 +2946,29 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm,
int event)
{
struct snd_soc_dapm_widget *w;
- const char *stream_name;
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
- stream_name = dai->driver->playback.stream_name;
+ w = dai->playback_widget;
else
- stream_name = dai->driver->capture.stream_name;
+ w = dai->capture_widget;
- if (!stream_name)
+ if (!w)
return;
- list_for_each_entry(w, &dapm->card->widgets, list)
- {
- if (!w->sname || w->dapm != dapm)
- continue;
- dev_vdbg(w->dapm->dev, "widget %s\n %s stream %s event %d\n",
- w->name, w->sname, stream_name, event);
- if (strstr(w->sname, stream_name)) {
- dapm_mark_dirty(w, "stream event");
- switch(event) {
- case SND_SOC_DAPM_STREAM_START:
- w->active = 1;
- break;
- case SND_SOC_DAPM_STREAM_STOP:
- w->active = 0;
- break;
- case SND_SOC_DAPM_STREAM_SUSPEND:
- case SND_SOC_DAPM_STREAM_RESUME:
- case SND_SOC_DAPM_STREAM_PAUSE_PUSH:
- case SND_SOC_DAPM_STREAM_PAUSE_RELEASE:
- break;
- }
- }
+ dapm_mark_dirty(w, "stream event");
+
+ switch (event) {
+ case SND_SOC_DAPM_STREAM_START:
+ w->active = 1;
+ break;
+ case SND_SOC_DAPM_STREAM_STOP:
+ w->active = 0;
+ break;
+ case SND_SOC_DAPM_STREAM_SUSPEND:
+ case SND_SOC_DAPM_STREAM_RESUME:
+ case SND_SOC_DAPM_STREAM_PAUSE_PUSH:
+ case SND_SOC_DAPM_STREAM_PAUSE_RELEASE:
+ break;
}
dapm_power_widgets(dapm, event);