[PATCH 4/4] ASoC: hdmi-codec: Don't parse an empty ELD on startup

From: Michał Kopeć

Date: Sat Oct 03 2026 - 15:48:53 EST


A bridge's get_eld() returns an all-zero ELD when no sink is connected.
hdmi_codec_startup() parses it unconditionally, so every open of a
disconnected HDMI/DP PCM logs:

hdmi-audio-codec: HDMI: Unknown ELD version 0

Skip parsing when the ELD is empty and clear the previously parsed
copy instead. The ELD hw constraint already falls back to basic stereo
rates for an empty ELD, so stream setup is unchanged. plugged_cb()
likewise treats a parse failure as debug-only.

Signed-off-by: Michał Kopeć <michal@nozomi.space>
---
sound/soc/codecs/hdmi-codec.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 7aa50c5bd3df8..0e1e532dfc634 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -475,8 +475,12 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
if (ret)
return ret;

- snd_parse_eld(dai->dev, &hcp->eld_parsed,
- hcp->eld, sizeof(hcp->eld));
+ /* An empty ELD means no sink is connected; nothing to parse. */
+ if (hcp->eld[0])
+ snd_parse_eld(dai->dev, &hcp->eld_parsed,
+ hcp->eld, sizeof(hcp->eld));
+ else
+ memset(&hcp->eld_parsed, 0, sizeof(hcp->eld_parsed));

ret = snd_pcm_hw_constraint_eld(substream->runtime, hcp->eld);
if (ret)
--
2.55.0