]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: Intel: skl_hda_dsp_generic: Implement add_dai_link to filter HDMI PCMs
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 19 Jun 2025 08:42:21 +0000 (11:42 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 19 Jun 2025 12:19:15 +0000 (13:19 +0100)
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>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250619084222.559-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/skl_hda_dsp_generic.c

index 0554c7e2cb34e541ba105bb6dd6e7573bbee73d5..519218385fdf74135838a3fd82dd7ca7de4e8c79 100644 (file)
@@ -85,6 +85,18 @@ skl_hda_get_board_quirk(struct snd_soc_acpi_mach_params *mach_params)
        return board_quirk;
 }
 
+static int skl_hda_add_dai_link(struct snd_soc_card *card,
+                               struct snd_soc_dai_link *link)
+{
+       struct sof_card_private *ctx = snd_soc_card_get_drvdata(card);
+
+       /* Ignore the HDMI PCM link if iDisp is not present */
+       if (strstr(link->stream_name, "HDMI") && !ctx->hdmi.idisp_codec)
+               link->ignore = true;
+
+       return 0;
+}
+
 static int skl_hda_audio_probe(struct platform_device *pdev)
 {
        struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
@@ -101,6 +113,7 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
        card->owner = THIS_MODULE;
        card->fully_routed = true;
        card->late_probe = skl_hda_card_late_probe;
+       card->add_dai_link = skl_hda_add_dai_link;
 
        dev_dbg(&pdev->dev, "board_quirk = %lx\n", board_quirk);