Skip to content

Commit

Permalink
ASoC: es8328: Fix event generation for deemphasis control
Browse files Browse the repository at this point in the history
[ Upstream commit 8259610 ]

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>
  • Loading branch information
broonie authored and gregkh committed Jun 22, 2022
1 parent c7b8c37 commit a572c74
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/soc/codecs/es8328.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down

0 comments on commit a572c74

Please sign in to comment.