[PATCH 0/3] ALSA: hda: Separate codec read status from response

From: Sreeraj S Kurup

Date: Thu Dec 03 2026 - 12:08:24 EST


Hi,

This series improves error handling in the HDA codec command and read
APIs.

Currently, snd_hdac_make_cmd() returns an unsigned int and uses -1 to
indicate an invalid command. Since -1 is converted to 0xffffffff,
which can also represent a valid encoded HDA command, callers cannot
reliably distinguish an error from a valid command.

This series changes snd_hdac_make_cmd() to return an integer status
and provide the encoded command through an output parameter. It also
updates snd_hdac_codec_read() to return an integer status and provide
the codec response through an output parameter.

The affected callers in the HDA core and ASoC HDMI codec driver are
updated to use the new API and handle errors appropriately.

Patch overview:

1. ALSA: hda: core: Fix command creation error handling
2. ALSA: hda: hdmi_chmap: Update HDMI channel map codec read callers
3. ASoC: codecs: hdac_hdmi: Update codec read API callers

Patches 2 and 3 depend on the API changes introduced in patch 1.

Please let me know if any changes are needed.

Thanks,
Sreeraj

Sreeraj S Kurup (3):
ALSA: hda: core: Fix command creation error handling
ALSA: hda: hdmi_chmap: Update HDMI channel map codec read callers
ASoC: codecs: hdac_hdmi: Update codec read API callers

include/sound/hdaudio.h | 2 +-
sound/hda/core/device.c | 69 ++++++++++++++++++++++++----------
sound/hda/core/hdmi_chmap.c | 30 ++++++++++++---
sound/soc/codecs/hdac_hdmi.c | 72 +++++++++++++++++++++++-------------
4 files changed, 123 insertions(+), 50 deletions(-)

--
2.55.0