[PATCH] ALSA: cs8427: read the PCM stream IEC958 status from its own buffer
From: raoxu
Date: Wed Nov 04 2026 - 03:38:19 EST
From: Xu Rao <raoxu@xxxxxxxxxxxxx>
The IEC958 Playback PCM Stream control writes pcm_status, but its
get callback always returns def_status. As a result, userspace
reads back the default status instead of the PCM stream status after
writing the stream control. Rate changes also update pcm_status
without being reflected in the value returned by the control.
Select the status buffer using the same private_value as the put
callback. The default control continues to return def_status,
while the PCM stream control now returns its own current status.
Signed-off-by: Xu Rao <raoxu@xxxxxxxxxxxxx>
---
sound/i2c/cs8427.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c
index 1de985ba85d9..773383471f17 100644
--- a/sound/i2c/cs8427.c
+++ b/sound/i2c/cs8427.c
@@ -424,9 +424,11 @@ static int snd_cs8427_spdif_get(struct snd_kcontrol *kcontrol,
{
struct snd_i2c_device *device = snd_kcontrol_chip(kcontrol);
struct cs8427 *chip = device->private_data;
+ const char *status = kcontrol->private_value ?
+ chip->playback.pcm_status : chip->playback.def_status;
snd_i2c_lock(device->bus);
- memcpy(ucontrol->value.iec958.status, chip->playback.def_status, 24);
+ memcpy(ucontrol->value.iec958.status, status, 24);
snd_i2c_unlock(device->bus);
return 0;
}
--
2.50.1