Skip to content

Commit fd0b2fd

Browse files
committed
ASoC: sof-function-topology-lib: select different amp topologies
We are going to support echo reference on the SoundWire function topologies. And the echo reference DAI should only be created once. The jack topology is always loaded before the amp topology. Therefore always create the echo reference DAI in the jack topology. And create the echo reference DAI in amp topology if no jack topology is required. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 5f4a36a commit fd0b2fd

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

sound/soc/intel/common/sof-function-topology-lib.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,18 @@ int sof_sdw_get_tplg_files(struct snd_soc_card *card, const struct snd_soc_acpi_
5656
tplg_dev_name = "sdca-jack";
5757
} else if (strstr(dai_link->name, "SmartAmp")) {
5858
tplg_dev = TPLG_DEVICE_SDCA_AMP;
59-
tplg_dev_name = devm_kasprintf(card->dev, GFP_KERNEL,
60-
"sdca-%damp", dai_link->num_cpus);
59+
/*
60+
* The echo reference DAI will be created in the sdca-jack function topology.
61+
* Select the topology with the echo reference DAI if the sdca-jack topology
62+
* is not required, otherwise select the one without it.
63+
* */
64+
if (tplg_mask & BIT(TPLG_DEVICE_SDCA_JACK))
65+
tplg_dev_name = devm_kasprintf(card->dev, GFP_KERNEL,
66+
"sdca-%damp", dai_link->num_cpus);
67+
else
68+
tplg_dev_name = devm_kasprintf(card->dev, GFP_KERNEL,
69+
"sdca-%damp-ref_dai",
70+
dai_link->num_cpus);
6171
if (!tplg_dev_name)
6272
return -ENOMEM;
6373
} else if (strstr(dai_link->name, "SmartMic")) {

0 commit comments

Comments
 (0)