Skip to content

Commit 7161b25

Browse files
kv2019iujfalusi
authored andcommitted
ASoC: Intel: boards: fix HDMI playback lookup when HDMI-In capture used
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 <kai.vehmanen@linux.intel.com>
1 parent 876ac99 commit 7161b25

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

sound/soc/intel/boards/hda_dsp_common.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
/*
1717
* Search card topology and return PCM device number
18-
* matching Nth HDMI device (zero-based index).
18+
* matching Nth playback HDMI device (zero-based index).
1919
*/
2020
static struct snd_pcm *hda_dsp_hdmi_pcm_handle(struct snd_soc_card *card,
2121
int hdmi_idx)
@@ -25,8 +25,17 @@ static struct snd_pcm *hda_dsp_hdmi_pcm_handle(struct snd_soc_card *card,
2525
int i = 0;
2626

2727
for_each_card_rtds(card, rtd) {
28-
spcm = rtd->pcm ?
29-
rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].pcm : NULL;
28+
/* ignore BE PCMs */
29+
if (rtd->dai_link && rtd->dai_link->no_pcm)
30+
continue;
31+
32+
spcm = rtd->pcm;
33+
34+
/* ignore PCMs with no playback streams */
35+
if (!spcm || !spcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream)
36+
continue;
37+
38+
/* look for FE PCMs with name "HDMI x" */
3039
if (spcm && strstr(spcm->id, "HDMI")) {
3140
if (i == hdmi_idx)
3241
return rtd->pcm;

0 commit comments

Comments
 (0)