From 4d6e2211aeb932e096f673c88475016b1cc0f8ab Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 12 Nov 2025 19:50:45 +0800 Subject: [PATCH] ASoC: Intel: boards: fix HDMI playback lookup when HDMI-In capture used MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In boards like adl_lt6911_hdmi_ssp/mtl_lt6911_hdmi_ssp/rpl_lt6911_hdmi_ssp, HDMI is supported both for playback via normal HDA display codec, as well as PCM capture from HDMI-In over I2S. The common board driver function hda_dsp_hdmi_pcm_handle() has an invalid assumption that "HDMI" is only used to identify playback HDMI PCMs on the card. This will result in failures if HDMI-In PCMs are defined in topology using the string "HDMI", and they are registered before the playback PCMs. Fix the issue by explicitly looking for FE playback PCMs. Signed-off-by: Kai Vehmanen Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Link: https://patch.msgid.link/20251112115045.337062-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/intel/boards/hda_dsp_common.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/boards/hda_dsp_common.c b/sound/soc/intel/boards/hda_dsp_common.c index 86e541a2c204d..328ffff336a87 100644 --- a/sound/soc/intel/boards/hda_dsp_common.c +++ b/sound/soc/intel/boards/hda_dsp_common.c @@ -15,7 +15,7 @@ /* * Search card topology and return PCM device number - * matching Nth HDMI device (zero-based index). + * matching Nth playback HDMI device (zero-based index). */ static struct snd_pcm *hda_dsp_hdmi_pcm_handle(struct snd_soc_card *card, int hdmi_idx) @@ -25,8 +25,17 @@ static struct snd_pcm *hda_dsp_hdmi_pcm_handle(struct snd_soc_card *card, int i = 0; for_each_card_rtds(card, rtd) { - spcm = rtd->pcm ? - rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].pcm : NULL; + /* ignore BE PCMs */ + if (rtd->dai_link && rtd->dai_link->no_pcm) + continue; + + spcm = rtd->pcm; + + /* ignore PCMs with no playback streams */ + if (!spcm || !spcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) + continue; + + /* look for FE PCMs with name "HDMI x" */ if (spcm && strstr(spcm->id, "HDMI")) { if (i == hdmi_idx) return rtd->pcm; -- 2.47.3