On 06/20/2018 05:54 AM, Shreyas NC wrote:
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().
can you split this patch in two, one where you add dapm_add_valid_dai_widget() and the second one where you add the multi-cpu stuff? the current diff format is really hard to read with the two changes lumped together.
- for (i = 0; i < rtd->num_codecs; i++) {
struct snd_soc_dai *codec_dai = rtd->codec_dais[i];
for (j = 0; j < rtd->num_cpu_dai; j++) {
cpu_dai = rtd->cpu_dais[j];
dapm_add_valid_dai_widget(card, rtd,
codec_dai, cpu_dai);
I didn't click on this earlier, but what makes you think all codec_dais are connected to all cpu_dais? That doesn't seem quite right. For the multi-codec case, all the codec_dais hang from a single cpu_dai. it's a stretch for me to have a full M:N connectivity. And that's clearly not the case for SoundWire stream in the multi-link case. Can't we use the dai_link information here to only connect cpu_ and codec_dais that are related?
}
} } @@ -4211,7 +4230,9 @@ static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, { int i;
- soc_dapm_dai_stream_event(rtd->cpu_dai, stream, event);
- for (i = 0; i < rtd->num_cpu_dai; i++)
soc_dapm_dai_stream_event(rtd->cpu_dais[i], stream, event);
- for (i = 0; i < rtd->num_codecs; i++) soc_dapm_dai_stream_event(rtd->codec_dais[i], stream, event);