ASoC: dapm - add method to get AIF widget from stream
PATCH 1/1 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 <[email protected]>
--- include/sound/soc-dapm.h | 2 ++ sound/soc/soc-dapm.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 0 deletions(-)
include/sound/soc-dapm.h +2 -0
@@ -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,
sound/soc/soc-dapm.c +17 -0
@@ -1882,6 +1882,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->card->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
Signature · 1 line
1.7.4.1