Skip to content

Commit

Permalink
ASoC: ops: Fix stereo change notifications in snd_soc_put_xr_sx()
Browse files Browse the repository at this point in the history
commit 2b7c463 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
broonie authored and gregkh committed Feb 23, 2022
1 parent e8ee1a1 commit a06d52d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/soc/soc-ops.c
Expand Up @@ -895,6 +895,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
unsigned long mask = (1UL<<mc->nbits)-1;
long max = mc->max;
long val = ucontrol->value.integer.value[0];
int ret = 0;
unsigned int i;

if (val < mc->min || val > mc->max)
Expand All @@ -909,9 +910,11 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
regmask, regval);
if (err < 0)
return err;
if (err > 0)
ret = err;
}

return 0;
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_put_xr_sx);

Expand Down

0 comments on commit a06d52d

Please sign in to comment.