diff options
author | Liam Girdwood <lrg@ti.com> | 2011-02-01 20:58:15 +0000 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-06-14 09:06:11 -0700 |
commit | 92d2a4437de00db659b7551b1bb947b918601a4d (patch) | |
tree | c75c1dbae0f2ba901d96cb1283fb41c094ccaacc | |
parent | a04b1985fb0f295bed15162719f1be21d2832441 (diff) | |
download | kernel_samsung_tuna-92d2a4437de00db659b7551b1bb947b918601a4d.zip kernel_samsung_tuna-92d2a4437de00db659b7551b1bb947b918601a4d.tar.gz kernel_samsung_tuna-92d2a4437de00db659b7551b1bb947b918601a4d.tar.bz2 |
ASoC: dapm - add method to get AIF widget from stream
In preparation for ASoC DSP support.
Provide a method to get the AIF widget name from the stream name.
Signed-off-by: Liam Girdwood <lrg@ti.com>
-rw-r--r-- | include/sound/soc-dapm.h | 2 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c46e7d8..f37c293 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -348,6 +348,8 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, const struct snd_soc_dapm_route *route, int num); +const char *snd_soc_dapm_get_aif(struct snd_soc_dapm_context *dapm, + const char *stream_name, enum snd_soc_dapm_type type); /* dapm events */ int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index f031764..7e05c6b 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1884,6 +1884,23 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) } EXPORT_SYMBOL_GPL(snd_soc_dapm_new_widgets); +const char *snd_soc_dapm_get_aif(struct snd_soc_dapm_context *dapm, + const char *stream_name, enum snd_soc_dapm_type type) +{ + struct snd_soc_dapm_widget *w; + + list_for_each_entry(w, &dapm->widgets, list) { + + if (!w->sname) + continue; + + if (w->id == type && strstr(w->sname, stream_name)) + return w->name; + } + return NULL; +} +EXPORT_SYMBOL_GPL(snd_soc_dapm_get_aif); + /** * snd_soc_dapm_get_volsw - dapm mixer get callback * @kcontrol: mixer control |