You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASoC: sdw_utils: Call init callbacks on the correct codec DAI
asoc_sdw_rtd_init() needs to call the rtd_init() callbacks for each
codec in a dailink. It was finding the codecs by looking for the
matching DAI name in codec_info_list[] but this is broken because the
DAI name isn't guaranteed to be unique. Parts using the same codec
driver (so the same DAI names) might require different machine driver
setup.
An array of pointers to the codec_info[] entries used to construct the
dailink are saved into the private data of the dailink.
Then asoc_sdw_rtd_init() can then use that array to get the correct
information to initialize support for that codec.
The rtd_init() callbacks in the codec_info[] array take a struct
snd_soc_dai, so the codec DAIs created by ASoC must be matched up with
the corresponding codec_info[] entry used to create the dailink. The
DAI name cannot be used for this because multiple parts in codec_info[]
could have the same DAI names. Instead, the order of codec DAI entries
in struct snd_soc_pcm_runtime is expected to be the same as the order
of codec DAIs in struct snd_soc_dai_link->codecs. As the order of
codec DAI entries in struct snd_soc_dai_link->codecs also matches the
order of their corresponding codec_info[] pointers added to the dailink
private data, it follows that there is a 1:1 mapping with the order of
DAIs returned by for_each_rtd_codec_dais(). In other words:
dailink.codec[i]
was created from endpoint[i]
and
dailink private dai_info[i]
was created from endpoint[i].codec_info
so
for_each_rtd_codec_dais(..., i, ...)
corresponds to endpoint[i]
and dai_info[i]
Change-Id: Idde610bfe8909a40b884e07801f7418c57711774
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
0 commit comments