summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/es8328.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-06-03 14:39:37 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-25 11:49:14 +0200
commit4c9e502bbb2d34c7944b500a4b9c77f5887b9cdc (patch)
treed7d9ca1d3431d927ce9463b5dfa0d2c39b2ddacc /sound/soc/codecs/es8328.c
parente2132adb4374b46ba68e4db7b8a2862fa24947ab (diff)
downloadlinux-stable-4c9e502bbb2d34c7944b500a4b9c77f5887b9cdc.tar.gz
linux-stable-4c9e502bbb2d34c7944b500a4b9c77f5887b9cdc.tar.bz2
linux-stable-4c9e502bbb2d34c7944b500a4b9c77f5887b9cdc.zip
ASoC: es8328: Fix event generation for deemphasis control
[ Upstream commit 8259610c2ec01c5cbfb61882ae176aabacac9c19 ] Currently the put() method for the deemphasis control returns 0 when a new value is written to the control even if the value changed, meaning events are not generated. Fix this, skip the work of updating the value when it is unchanged and then return 1 after having done so. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20220603123937.4013603-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/soc/codecs/es8328.c')
-rw-r--r--sound/soc/codecs/es8328.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
index 3afa163f7652..dcb01889e177 100644
--- a/sound/soc/codecs/es8328.c
+++ b/sound/soc/codecs/es8328.c
@@ -165,13 +165,16 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol,
if (deemph > 1)
return -EINVAL;
+ if (es8328->deemph == deemph)
+ return 0;
+
ret = es8328_set_deemph(component);
if (ret < 0)
return ret;
es8328->deemph = deemph;
- return 0;
+ return 1;
}