Skip to content

Commit 054d650

Browse files
jbrun3tbroonie
authored andcommitted
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>
1 parent 68c907f commit 054d650

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎sound/soc/soc-dapm.c‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,8 +4056,7 @@ snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
40564056

40574057
static struct snd_soc_dapm_widget *
40584058
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)
40614060
{
40624061
struct snd_soc_dapm_widget template;
40634062
struct snd_soc_dapm_widget *w;
@@ -4067,7 +4066,7 @@ snd_soc_dapm_new_dai(struct snd_soc_card *card, struct snd_soc_pcm_runtime *rtd,
40674066
int ret;
40684067

40694068
link_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-%s",
4070-
source->name, sink->name);
4069+
rtd->dai_link->name, id);
40714070
if (!link_name)
40724071
return ERR_PTR(-ENOMEM);
40734072

@@ -4247,15 +4246,13 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card,
42474246
}
42484247

42494248
for_each_rtd_codec_dai(rtd, i, codec_dai) {
4250-
42514249
/* connect BE DAI playback if widgets are valid */
42524250
codec = codec_dai->playback_widget;
42534251

42544252
if (playback_cpu && codec) {
42554253
if (!playback) {
42564254
playback = snd_soc_dapm_new_dai(card, rtd,
4257-
playback_cpu,
4258-
codec);
4255+
"playback");
42594256
if (IS_ERR(playback)) {
42604257
dev_err(rtd->dev,
42614258
"ASoC: Failed to create DAI %s: %ld\n",
@@ -4284,8 +4281,7 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card,
42844281
if (codec && capture_cpu) {
42854282
if (!capture) {
42864283
capture = snd_soc_dapm_new_dai(card, rtd,
4287-
codec,
4288-
capture_cpu);
4284+
"capture");
42894285
if (IS_ERR(capture)) {
42904286
dev_err(rtd->dev,
42914287
"ASoC: Failed to create DAI %s: %ld\n",

0 commit comments

Comments
 (0)