Skip to content

Commit 2b7c463

Browse files
committed
ASoC: ops: Fix stereo change notifications in snd_soc_put_xr_sx()
When writing out a stereo control we discard the change notification from the first channel, meaning that events are only generated based on changes to the second channel. Ensure that we report a change if either channel has changed. Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220201155629.120510-5-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 650204d commit 2b7c463

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

sound/soc/soc-ops.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
895895
unsigned long mask = (1UL<<mc->nbits)-1;
896896
long max = mc->max;
897897
long val = ucontrol->value.integer.value[0];
898+
int ret = 0;
898899
unsigned int i;
899900

900901
if (val < mc->min || val > mc->max)
@@ -909,9 +910,11 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
909910
regmask, regval);
910911
if (err < 0)
911912
return err;
913+
if (err > 0)
914+
ret = err;
912915
}
913916

914-
return 0;
917+
return ret;
915918
}
916919
EXPORT_SYMBOL_GPL(snd_soc_put_xr_sx);
917920

0 commit comments

Comments
 (0)