diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2018-09-03 02:12:56 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-09-04 16:59:11 +0100 |
commit | 0b7990e38971da403ce223d8bdc758a817eb72f8 (patch) | |
tree | acaec9b0b94b9f7a8823b665cab92502eda84bd8 /include/sound | |
parent | 3db769f17714ae65f2faf44ff2bae9d52f4bd46b (diff) | |
download | op-kernel-dev-0b7990e38971da403ce223d8bdc758a817eb72f8.zip op-kernel-dev-0b7990e38971da403ce223d8bdc758a817eb72f8.tar.gz |
ASoC: add for_each_rtd_codec_dai() macro
ALSA SoC snd_soc_pcm_runtime has snd_soc_dai array for codec_dai.
To be more readable code, this patch adds
new for_each_rtd_codec_dai() macro, and replace existing code to it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index ce42c57..6b68b31 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1158,6 +1158,13 @@ struct snd_soc_pcm_runtime { unsigned int dev_registered:1; unsigned int pop_wait:1; }; +#define for_each_rtd_codec_dai(rtd, i, dai)\ + for ((i) = 0; \ + ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \ + (i)++) +#define for_each_rtd_codec_dai_reverse(rtd, i, dai) \ + for (; ((i--) >= 0) && ((dai) = rtd->codec_dais[i]);) + /* mixer control */ struct soc_mixer_control { |