]> Git Repo - linux.git/commitdiff
ASoC: es8328: Fix event generation for deemphasis control
authorMark Brown <[email protected]>
Fri, 3 Jun 2022 12:39:37 +0000 (14:39 +0200)
committerMark Brown <[email protected]>
Mon, 6 Jun 2022 11:31:27 +0000 (12:31 +0100)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
sound/soc/codecs/es8328.c

index 3f00ead97006e714abe3dbdf7cc6777fd3083458..dd53dfd87b04ee0c28d9a2419898be5fb9565567 100644 (file)
@@ -161,13 +161,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;
 }
 
 
This page took 0.108656 seconds and 4 git commands to generate.