ASoC: soc-core: support dai_link with platforms_num != 1

Add support platforms_num != 1 in dai_link. Initially, the main purpose of
this change was to make the platform optional in the dai_link, instead of
inserting the dummy platform driver.

This particular case had just been solved by Kuninori Morimoto with
commit 1d76898928 ("ASoC: soc-core: allow no Platform on dai_link").

However, this change may still be useful for those who need multiple
platform components on a single dai_link (it solves one of the FIXME
note in soc-core)

Acked-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Jerome Brunet <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
Jerome Brunet 2019-06-27 14:13:50 +02:00 • committed by Mark Brown
commit 3461473998
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0
2 changed files with 30 additions and 35 deletions

View file

@ -997,6 +997,12 @@ struct snd_soc_dai_link {
((i) < link->num_codecs) && ((codec) = &link->codecs[i]); \
(i)++)
#define for_each_link_platforms(link, i, platform) \
for ((i) = 0; \
((i) < link->num_platforms) && \
((platform) = &link->platforms[i]); \
(i)++)
/*
* Sample 1 : Single CPU/Codec/Platform
*