aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-16 22:43:20 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-17 11:10:21 -0500
commitfe360685f9cf41a897c50fea50b4b95f3f622d7c (patch)
tree626d5d7462b7d9408f0f2bcd16b77d25633523e4 /sound/soc/soc-dapm.c
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/soc/soc-dapm.c')
-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,
2946 int event) 2946 int event)
2947{ 2947{
2948 struct snd_soc_dapm_widget *w; 2948 struct snd_soc_dapm_widget *w;
2949 const char *stream_name;
2950 2949
2951 if (stream == SNDRV_PCM_STREAM_PLAYBACK) 2950 if (stream == SNDRV_PCM_STREAM_PLAYBACK)
2952 stream_name = dai->driver->playback.stream_name; 2951 w = dai->playback_widget;
2953 else 2952 else
2954 stream_name = dai->driver->capture.stream_name; 2953 w = dai->capture_widget;
2955 2954
2956 if (!stream_name) 2955 if (!w)
2957 return; 2956 return;
2958 2957
2959 list_for_each_entry(w, &dapm->card->widgets, list) 2958 dapm_mark_dirty(w, "stream event");
2960 { 2959
2961 if (!w->sname || w->dapm != dapm) 2960 switch (event) {
2962 continue; 2961 case SND_SOC_DAPM_STREAM_START:
2963 dev_vdbg(w->dapm->dev, "widget %s\n %s stream %s event %d\n", 2962 w->active = 1;
2964 w->name, w->sname, stream_name, event); 2963 break;
2965 if (strstr(w->sname, stream_name)) { 2964 case SND_SOC_DAPM_STREAM_STOP:
2966 dapm_mark_dirty(w, "stream event"); 2965 w->active = 0;
2967 switch(event) { 2966 break;
2968 case SND_SOC_DAPM_STREAM_START: 2967 case SND_SOC_DAPM_STREAM_SUSPEND:
2969 w->active = 1; 2968 case SND_SOC_DAPM_STREAM_RESUME:
2970 break; 2969 case SND_SOC_DAPM_STREAM_PAUSE_PUSH:
2971 case SND_SOC_DAPM_STREAM_STOP: 2970 case SND_SOC_DAPM_STREAM_PAUSE_RELEASE:
2972 w->active = 0; 2971 break;
2973 break;
2974 case SND_SOC_DAPM_STREAM_SUSPEND:
2975 case SND_SOC_DAPM_STREAM_RESUME:
2976 case SND_SOC_DAPM_STREAM_PAUSE_PUSH:
2977 case SND_SOC_DAPM_STREAM_PAUSE_RELEASE:
2978 break;
2979 }
2980 }
2981 } 2972 }
2982 2973
2983 dapm_power_widgets(dapm, event); 2974 dapm_power_widgets(dapm, event);