Commit de6214a3 authored by Shreyas NC's avatar Shreyas NC Committed by Mark Brown

ASoC: Add multiple CPU DAI support in DAPM

DAPM handles DAIs during soc_dapm_stream_event() and during addition
and creation of DAI widgets i.e., dapm_add_valid_dai_widget() and
dapm_connect_dai_link_widgets().

Extend these functions to handle multiple cpu dai.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarShreyas NC <shreyas.nc@intel.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200225133917.21314-5-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6c4b13b5
...@@ -4361,9 +4361,19 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card, ...@@ -4361,9 +4361,19 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card,
struct snd_soc_dai *codec_dai; struct snd_soc_dai *codec_dai;
int i; int i;
for_each_rtd_codec_dai(rtd, i, codec_dai) if (rtd->num_cpus == 1) {
dapm_add_valid_dai_widget(card, rtd, for_each_rtd_codec_dai(rtd, i, codec_dai)
codec_dai, rtd->cpu_dais[0]); dapm_add_valid_dai_widget(card, rtd, codec_dai,
rtd->cpu_dais[0]);
} else if (rtd->num_codecs == rtd->num_cpus) {
for_each_rtd_codec_dai(rtd, i, codec_dai)
dapm_add_valid_dai_widget(card, rtd, codec_dai,
rtd->cpu_dais[i]);
} else {
dev_err(card->dev,
"N cpus to M codecs link is not supported yet\n");
}
} }
static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream, static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream,
...@@ -4424,9 +4434,11 @@ static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, ...@@ -4424,9 +4434,11 @@ static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
int event) int event)
{ {
struct snd_soc_dai *codec_dai; struct snd_soc_dai *codec_dai;
struct snd_soc_dai *cpu_dai;
int i; int i;
soc_dapm_dai_stream_event(rtd->cpu_dai, stream, event); for_each_rtd_cpu_dai(rtd, i, cpu_dai)
soc_dapm_dai_stream_event(rtd->cpu_dai, stream, event);
for_each_rtd_codec_dai(rtd, i, codec_dai) for_each_rtd_codec_dai(rtd, i, codec_dai)
soc_dapm_dai_stream_event(codec_dai, stream, event); soc_dapm_dai_stream_event(codec_dai, stream, event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment