提交 11eb53b1 编写于 作者: M Mark Brown 提交者: Zheng Zengkai

ASoC: es8328: Fix event generation for deemphasis control

stable inclusion
from stable-v5.10.124
commit a572c7440251fff218bcec093d047ec3a91bb106
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6E7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a572c7440251fff218bcec093d047ec3a91bb106

--------------------------------

[ Upstream commit 8259610c ]

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: NMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220603123937.4013603-1-broonie@kernel.orgSigned-off-by: NMark Brown <broonie@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 9b9c77ce
...@@ -161,13 +161,16 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol, ...@@ -161,13 +161,16 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol,
if (deemph > 1) if (deemph > 1)
return -EINVAL; return -EINVAL;
if (es8328->deemph == deemph)
return 0;
ret = es8328_set_deemph(component); ret = es8328_set_deemph(component);
if (ret < 0) if (ret < 0)
return ret; return ret;
es8328->deemph = deemph; es8328->deemph = deemph;
return 0; return 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册