Skip to content

Commit 1b74211

Browse files
jbrun3tbroonie
authored andcommitted
ASoC: meson: axg-card: set link name based on link node name
So far the link names of the axg sound card was derived from the cpu name of the link. Since the dai link must be unique, it works as long as a device does not provide more than one cpu dai. However, the 'tohdmitx' does provide 2 dais used as cpu on codec-to-codec links Instead of cpu name, use the node name of the dai link. DT already enforce the uniqueness of this name Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Tested-by: Neil Armstrong <narmstrong@baylibre.com> Tested-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent cf61f5b commit 1b74211

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sound/soc/meson/axg-card.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ static int axg_card_parse_dai(struct snd_soc_card *card,
8080

8181
static int axg_card_set_link_name(struct snd_soc_card *card,
8282
struct snd_soc_dai_link *link,
83+
struct device_node *node,
8384
const char *prefix)
8485
{
8586
char *name = devm_kasprintf(card->dev, GFP_KERNEL, "%s.%s",
86-
prefix, link->cpu_of_node->full_name);
87+
prefix, node->full_name);
8788
if (!name)
8889
return -ENOMEM;
8990

@@ -474,7 +475,7 @@ static int axg_card_set_be_link(struct snd_soc_card *card,
474475
codec++;
475476
}
476477

477-
ret = axg_card_set_link_name(card, link, "be");
478+
ret = axg_card_set_link_name(card, link, node, "be");
478479
if (ret)
479480
dev_err(card->dev, "error setting %pOFn link name\n", np);
480481

@@ -483,6 +484,7 @@ static int axg_card_set_be_link(struct snd_soc_card *card,
483484

484485
static int axg_card_set_fe_link(struct snd_soc_card *card,
485486
struct snd_soc_dai_link *link,
487+
struct device_node *node,
486488
bool is_playback)
487489
{
488490
link->dynamic = 1;
@@ -497,7 +499,7 @@ static int axg_card_set_fe_link(struct snd_soc_card *card,
497499
else
498500
link->dpcm_capture = 1;
499501

500-
return axg_card_set_link_name(card, link, "fe");
502+
return axg_card_set_link_name(card, link, node, "fe");
501503
}
502504

503505
static int axg_card_cpu_is_capture_fe(struct device_node *np)
@@ -527,9 +529,9 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
527529
return ret;
528530

529531
if (axg_card_cpu_is_playback_fe(dai_link->cpu_of_node))
530-
ret = axg_card_set_fe_link(card, dai_link, true);
532+
ret = axg_card_set_fe_link(card, dai_link, np, true);
531533
else if (axg_card_cpu_is_capture_fe(dai_link->cpu_of_node))
532-
ret = axg_card_set_fe_link(card, dai_link, false);
534+
ret = axg_card_set_fe_link(card, dai_link, np, false);
533535
else
534536
ret = axg_card_set_be_link(card, dai_link, np);
535537

0 commit comments

Comments
 (0)