Skip to content

Commit 241c45e

Browse files
committed
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 will 'hide' ensures that HDMI PCMs will be not 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 a336061 commit 241c45e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sound/soc/intel/boards/sof_sdw.c

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

1325+
static int sof_sdw_add_dai_link(struct snd_soc_card *card,
1326+
struct snd_soc_dai_link *link)
1327+
{
1328+
struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card);
1329+
struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private;
1330+
1331+
/* Ignore the HDMI PCM link if iDisp is not present */
1332+
if (strstr(link->stream_name, "HDMI") && !intel_ctx->hdmi.idisp_codec)
1333+
link->ignore = true;
1334+
1335+
return 0;
1336+
}
1337+
13251338
static int mc_probe(struct platform_device *pdev)
13261339
{
13271340
struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev);
@@ -1348,6 +1361,7 @@ static int mc_probe(struct platform_device *pdev)
13481361
card->name = "soundwire";
13491362
card->owner = THIS_MODULE;
13501363
card->late_probe = sof_sdw_card_late_probe;
1364+
card->add_dai_link = sof_sdw_add_dai_link;
13511365

13521366
snd_soc_card_set_drvdata(card, ctx);
13531367

0 commit comments

Comments
 (0)