ASoC: dapm: Add widget path iterators

Add helper iterator macros for iterating over the source and sink paths of
widget. This will make it easier to change the implementation later on.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Lars-Peter Clausen
2015-07-26 19:05:00 +02:00
committed by Mark Brown
parent 1ce43acff0
commit e63bfd45ab
3 changed files with 35 additions and 17 deletions

View File

@@ -673,4 +673,22 @@ static inline enum snd_soc_bias_level snd_soc_dapm_get_bias_level(
return dapm->bias_level;
}
/**
* snd_soc_dapm_widget_for_each_sink_path - Iterates over all paths leaving a
* widget
* @w: The widget
* @p: The path iterator variable
*/
#define snd_soc_dapm_widget_for_each_sink_path(w, p) \
list_for_each_entry(p, &w->sinks, list_source)
/**
* snd_soc_dapm_widget_for_each_source_path - Iterates over all paths leading to
* a widget
* @w: The widget
* @p: The path iterator variable
*/
#define snd_soc_dapm_widget_for_each_source_path(w, p) \
list_for_each_entry(p, &w->sources, list_sink)
#endif