diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-07-26 19:05:00 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-29 14:01:39 +0100 |
commit | e63bfd45aba4269811662de0954785622a2ac928 (patch) | |
tree | 8040968ee41870609cd6064d10ba2e4fc84a4273 /include/sound | |
parent | 1ce43acff0c078fd560ee0f2a4ae10b8da28e388 (diff) |
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>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc-dapm.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index cadc7fc5d727..4973083d89ce 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -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 |