summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorSameer Pujar <spujar@nvidia.com>2021-11-18 12:37:09 +0530
committerMark Brown <broonie@kernel.org>2021-11-18 19:02:42 +0000
commit8db78ace1ba897302131422ce15c5eb04510cef8 (patch)
tree3d707d19cb806bd96f6b1b1936d7f641bbc6d8f4 /sound
parentb31f8febd1850bbe74aba184779ec54552d92752 (diff)
downloadlinux-8db78ace1ba897302131422ce15c5eb04510cef8.tar.gz
linux-8db78ace1ba897302131422ce15c5eb04510cef8.tar.bz2
linux-8db78ace1ba897302131422ce15c5eb04510cef8.zip
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: 77f7df346c45 ("ASoC: tegra: Add Tegra210 based AMX driver") Signed-off-by: Sameer Pujar <spujar@nvidia.com> Suggested-by: Jaroslav Kysela <perex@perex.cz> Suggested-by: Mark Brown <broonie@kernel.org> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/1637219231-406-15-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra210_amx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra210_amx.c b/sound/soc/tegra/tegra210_amx.c
index af9bddfc3120..689576302ede 100644
--- a/sound/soc/tegra/tegra210_amx.c
+++ b/sound/soc/tegra/tegra210_amx.c
@@ -222,6 +222,9 @@ static int tegra210_amx_put_byte_map(struct snd_kcontrol *kcontrol,
int reg = mc->reg;
int value = ucontrol->value.integer.value[0];
+ if (value == bytes_map[reg])
+ return 0;
+
if (value >= 0 && value <= 255) {
/* Update byte map and enable slot */
bytes_map[reg] = value;