Skip to content

Commit fba2934

Browse files
ujfalusibroonie
authored andcommitted
ASoC: Intel: sof_sdw: Always register the HDMI dai links
The topology files for SDW devices require HDMI dai links to be present and this is granted under normal conditions but in case of special use cases the display (i915) driver might not be enabled due to deny-listing, booting with nomodeset or just not compiled at all. This should not block the non HDMI audio to be usable so register the dai links unconditionally. The code has been prepared for this and in case of no HDMI audio the link is created with dummy codec. Closes: thesofproject#4594 Closes: thesofproject#4648 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20231124124032.15946-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3d1dc8b commit fba2934

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

sound/soc/intel/boards/sof_sdw.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
15461546
{
15471547
struct device *dev = card->dev;
15481548
struct snd_soc_acpi_mach *mach = dev_get_platdata(card->dev);
1549-
int sdw_be_num = 0, ssp_num = 0, dmic_num = 0, hdmi_num = 0, bt_num = 0;
1549+
int sdw_be_num = 0, ssp_num = 0, dmic_num = 0, bt_num = 0;
15501550
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
15511551
struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params;
15521552
const struct snd_soc_acpi_link_adr *adr_link = mach_params->links;
@@ -1564,6 +1564,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
15641564
char *codec_name, *codec_dai_name;
15651565
int i, j, be_id = 0;
15661566
int codec_index;
1567+
int hdmi_num;
15671568
int ret;
15681569

15691570
ret = get_dailink_info(dev, adr_link, &sdw_be_num, &codec_conf_num);
@@ -1584,14 +1585,13 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
15841585
ssp_num = hweight_long(ssp_mask);
15851586
}
15861587

1587-
if (mach_params->codec_mask & IDISP_CODEC_MASK) {
1588+
if (mach_params->codec_mask & IDISP_CODEC_MASK)
15881589
ctx->hdmi.idisp_codec = true;
15891590

1590-
if (sof_sdw_quirk & SOF_SDW_TGL_HDMI)
1591-
hdmi_num = SOF_TGL_HDMI_COUNT;
1592-
else
1593-
hdmi_num = SOF_PRE_TGL_HDMI_COUNT;
1594-
}
1591+
if (sof_sdw_quirk & SOF_SDW_TGL_HDMI)
1592+
hdmi_num = SOF_TGL_HDMI_COUNT;
1593+
else
1594+
hdmi_num = SOF_PRE_TGL_HDMI_COUNT;
15951595

15961596
/* enable dmic01 & dmic16k */
15971597
if (sof_sdw_quirk & SOF_SDW_PCH_DMIC || mach_params->dmic_num)
@@ -1601,7 +1601,8 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
16011601
bt_num = 1;
16021602

16031603
dev_dbg(dev, "sdw %d, ssp %d, dmic %d, hdmi %d, bt: %d\n",
1604-
sdw_be_num, ssp_num, dmic_num, hdmi_num, bt_num);
1604+
sdw_be_num, ssp_num, dmic_num,
1605+
ctx->hdmi.idisp_codec ? hdmi_num : 0, bt_num);
16051606

16061607
/* allocate BE dailinks */
16071608
num_links = sdw_be_num + ssp_num + dmic_num + hdmi_num + bt_num;

0 commit comments

Comments
 (0)