ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fri, 24 Nov 2023 12:40:15 +0000 (14:40 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 24 Nov 2023 12:55:04 +0000 (12:55 +0000)
When the HDMI is not present due to disabled display support
we will use dummy codec and the HDMI routes will refer to non existent
DAPM widgets.

Trim the route list from the HDMI routes to be able to probe the card even
if the HDMI dais are not registered.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231124124015.15878-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/skl_hda_dsp_generic.c

index 6c6ef63cd5d9ef1ae8a7e306e7f0147d42b45c9e..6e172719c9795b1aa0932f7c7bde8285dbd83c55 100644 (file)
@@ -154,6 +154,8 @@ static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
                card->dapm_widgets = skl_hda_widgets;
                card->num_dapm_widgets = ARRAY_SIZE(skl_hda_widgets);
                if (!ctx->idisp_codec) {
+                       card->dapm_routes = &skl_hda_map[IDISP_ROUTE_COUNT];
+                       num_route -= IDISP_ROUTE_COUNT;
                        for (i = 0; i < IDISP_DAI_COUNT; i++) {
                                skl_hda_be_dai_links[i].codecs = &snd_soc_dummy_dlc;
                                skl_hda_be_dai_links[i].num_codecs = 1;