Commit fe360685 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 888df395
...@@ -2946,38 +2946,29 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm, ...@@ -2946,38 +2946,29 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm,
int event) int event)
{ {
struct snd_soc_dapm_widget *w; struct snd_soc_dapm_widget *w;
const char *stream_name;
if (stream == SNDRV_PCM_STREAM_PLAYBACK) if (stream == SNDRV_PCM_STREAM_PLAYBACK)
stream_name = dai->driver->playback.stream_name; w = dai->playback_widget;
else else
stream_name = dai->driver->capture.stream_name; w = dai->capture_widget;
if (!stream_name) if (!w)
return; return;
list_for_each_entry(w, &dapm->card->widgets, list) dapm_mark_dirty(w, "stream event");
{
if (!w->sname || w->dapm != dapm) switch (event) {
continue; case SND_SOC_DAPM_STREAM_START:
dev_vdbg(w->dapm->dev, "widget %s\n %s stream %s event %d\n", w->active = 1;
w->name, w->sname, stream_name, event); break;
if (strstr(w->sname, stream_name)) { case SND_SOC_DAPM_STREAM_STOP:
dapm_mark_dirty(w, "stream event"); w->active = 0;
switch(event) { break;
case SND_SOC_DAPM_STREAM_START: case SND_SOC_DAPM_STREAM_SUSPEND:
w->active = 1; case SND_SOC_DAPM_STREAM_RESUME:
break; case SND_SOC_DAPM_STREAM_PAUSE_PUSH:
case SND_SOC_DAPM_STREAM_STOP: case SND_SOC_DAPM_STREAM_PAUSE_RELEASE:
w->active = 0; break;
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); dapm_power_widgets(dapm, event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment