Skip to content

Commit 48e1714

Browse files
ujfalusiranj063
authored andcommitted
ASoC: Intel: sof_sdw: Implement add_dai_link to filter HDMI PCMs
If the system does not have iDisp codec then mark the HDMI PCM link as ignore. This ensures that HDMI PCMs will not be created when there is no iDisp codec available. When iDisp codec is not present and the HDMI PCMs were created they were not operational, all operations would fail on them. With this patch it is possible to load the topology with HDMI links, but gives the ability to ignore them and thus prevent the creation of the nonworking PCM devices. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 382ace4 commit 48e1714

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

sound/soc/intel/boards/sof_sdw.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,19 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card)
13141314
return ret;
13151315
}
13161316

1317+
static int sof_sdw_add_dai_link(struct snd_soc_card *card,
1318+
struct snd_soc_dai_link *link)
1319+
{
1320+
struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card);
1321+
struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private;
1322+
1323+
/* Ignore the HDMI PCM link if iDisp is not present */
1324+
if (strstr(link->stream_name, "HDMI") && !intel_ctx->hdmi.idisp_codec)
1325+
link->ignore = true;
1326+
1327+
return 0;
1328+
}
1329+
13171330
static int mc_probe(struct platform_device *pdev)
13181331
{
13191332
struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev);
@@ -1340,6 +1353,7 @@ static int mc_probe(struct platform_device *pdev)
13401353
card->name = "soundwire";
13411354
card->owner = THIS_MODULE;
13421355
card->late_probe = sof_sdw_card_late_probe;
1356+
card->add_dai_link = sof_sdw_add_dai_link;
13431357

13441358
snd_soc_card_set_drvdata(card, ctx);
13451359

0 commit comments

Comments
 (0)