Commit 8db78ace authored by Sameer Pujar's avatar Sameer Pujar Committed by Mark Brown

ASoC: tegra: Fix kcontrol put callback in AMX

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Filter
out duplicate updates in AMX driver.

Fixes: 77f7df34 ("ASoC: tegra: Add Tegra210 based AMX driver")
Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
Suggested-by: default avatarJaroslav Kysela <perex@perex.cz>
Suggested-by: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-15-git-send-email-spujar@nvidia.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b31f8feb
...@@ -222,6 +222,9 @@ static int tegra210_amx_put_byte_map(struct snd_kcontrol *kcontrol, ...@@ -222,6 +222,9 @@ static int tegra210_amx_put_byte_map(struct snd_kcontrol *kcontrol,
int reg = mc->reg; int reg = mc->reg;
int value = ucontrol->value.integer.value[0]; int value = ucontrol->value.integer.value[0];
if (value == bytes_map[reg])
return 0;
if (value >= 0 && value <= 255) { if (value >= 0 && value <= 255) {
/* Update byte map and enable slot */ /* Update byte map and enable slot */
bytes_map[reg] = value; bytes_map[reg] = value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment