aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-08-08 14:54:44 +0900
committerMark Brown <broonie@kernel.org>2019-08-09 18:13:58 +0100
commitc2b71c71037bea7765aa6ff37824520d19108769 (patch)
tree38f96c77c57dd99f53dcee439b04cadf55ea3fb3 /include/sound
parentASoC: mediatek: mt8183-mt6358-ts3a227-max98357: use snd_soc_dai_link_component for aux_dev (diff)
downloadlinux-dev-c2b71c71037bea7765aa6ff37824520d19108769.tar.xz
linux-dev-c2b71c71037bea7765aa6ff37824520d19108769.zip
ASoC: soc-core: add for_each_xxx macro for aux_dev
To be more readable code, this patch adds new for_each_xxx() macro for aux_dev. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87ftmc6w8s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2fc56e5963f3..b1fe5ebea257 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1087,6 +1087,10 @@ struct snd_soc_card {
for ((i) = 0; \
((i) < (card)->num_links) && ((link) = &(card)->dai_link[i]); \
(i)++)
+#define for_each_card_pre_auxs(card, i, aux) \
+ for ((i) = 0; \
+ ((i) < (card)->num_aux_devs) && ((aux) = &(card)->aux_dev[i]); \
+ (i)++)
#define for_each_card_links(card, link) \
list_for_each_entry(link, &(card)->dai_link_list, list)
@@ -1098,6 +1102,12 @@ struct snd_soc_card {
#define for_each_card_rtds_safe(card, rtd, _rtd) \
list_for_each_entry_safe(rtd, _rtd, &(card)->rtd_list, list)
+#define for_each_card_auxs(card, component) \
+ list_for_each_entry(component, &card->aux_comp_list, card_aux_list)
+#define for_each_card_auxs_safe(card, component, _comp) \
+ list_for_each_entry_safe(component, _comp, \
+ &card->aux_comp_list, card_aux_list)
+
#define for_each_card_components(card, component) \
list_for_each_entry(component, &(card)->component_dev_list, card_list)