diff options
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-core.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 132946f82a29..f8524b5bfb33 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -576,6 +576,28 @@ free_rtd: return NULL; } +static void snd_soc_fill_dummy_dai(struct snd_soc_card *card) +{ + struct snd_soc_dai_link *dai_link; + int i; + + /* + * COMP_DUMMY() creates size 0 array on dai_link. + * Fill it as dummy DAI in case of CPU/Codec here. + * Do nothing for Platform. + */ + for_each_card_prelinks(card, i, dai_link) { + if (dai_link->num_cpus == 0 && dai_link->cpus) { + dai_link->num_cpus = 1; + dai_link->cpus = &snd_soc_dummy_dlc; + } + if (dai_link->num_codecs == 0 && dai_link->codecs) { + dai_link->num_codecs = 1; + dai_link->codecs = &snd_soc_dummy_dlc; + } + } +} + static void snd_soc_flush_all_delayed_work(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd; @@ -2131,6 +2153,8 @@ static int snd_soc_bind_card(struct snd_soc_card *card) mutex_lock(&client_mutex); snd_soc_card_mutex_lock_root(card); + snd_soc_fill_dummy_dai(card); + snd_soc_dapm_init(&card->dapm, card, NULL); /* check whether any platform is ignore machine FE and using topology */ |