Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codec2codec: name link using stream direction

At the moment, codec to codec dai link widgets are named after the
cpu dai and the 1st codec valid on the link. This might be confusing
if there is multiple valid codecs on the link for one stream
direction.

Instead, use the dai link name and the stream direction to name the
the dai link widget

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20190725165949.29699-3-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jerome Brunet and committed by
Mark Brown
054d6500 68c907f1

+4 -8
+4 -8
sound/soc/soc-dapm.c
··· 4056 4056 4057 4057 static struct snd_soc_dapm_widget * 4058 4058 snd_soc_dapm_new_dai(struct snd_soc_card *card, struct snd_soc_pcm_runtime *rtd, 4059 - struct snd_soc_dapm_widget *source, 4060 - struct snd_soc_dapm_widget *sink) 4059 + char *id) 4061 4060 { 4062 4061 struct snd_soc_dapm_widget template; 4063 4062 struct snd_soc_dapm_widget *w; ··· 4066 4067 int ret; 4067 4068 4068 4069 link_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-%s", 4069 - source->name, sink->name); 4070 + rtd->dai_link->name, id); 4070 4071 if (!link_name) 4071 4072 return ERR_PTR(-ENOMEM); 4072 4073 ··· 4246 4247 } 4247 4248 4248 4249 for_each_rtd_codec_dai(rtd, i, codec_dai) { 4249 - 4250 4250 /* connect BE DAI playback if widgets are valid */ 4251 4251 codec = codec_dai->playback_widget; 4252 4252 4253 4253 if (playback_cpu && codec) { 4254 4254 if (!playback) { 4255 4255 playback = snd_soc_dapm_new_dai(card, rtd, 4256 - playback_cpu, 4257 - codec); 4256 + "playback"); 4258 4257 if (IS_ERR(playback)) { 4259 4258 dev_err(rtd->dev, 4260 4259 "ASoC: Failed to create DAI %s: %ld\n", ··· 4281 4284 if (codec && capture_cpu) { 4282 4285 if (!capture) { 4283 4286 capture = snd_soc_dapm_new_dai(card, rtd, 4284 - codec, 4285 - capture_cpu); 4287 + "capture"); 4286 4288 if (IS_ERR(capture)) { 4287 4289 dev_err(rtd->dev, 4288 4290 "ASoC: Failed to create DAI %s: %ld\n",