summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2021-11-30 19:05:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-14 12:57:17 +0300
commit9b6bf6fca018a54c964d8f668cf0032813c91b2c (patch)
tree2e89410efc5d3d3f5592cb220eba5b728f3c125f /sound
parent339ffb5b56005582aacc860524d2d208604049d1 (diff)
downloadlinux-9b6bf6fca018a54c964d8f668cf0032813c91b2c.tar.xz
ASoC: codecs: wcd934x: return correct value from mixer put
commit d9be0ff4796d1b6f5ee391c1b7e3653a43cedfab upstream. wcd934x_compander_set() currently returns zero eventhough it changes the value. Fix this, so that change notifications are sent correctly. Fixes: 1cde8b822332 ("ASoC: wcd934x: add basic controls") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20211130160507.22180-4-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wcd934x.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index eb4e2f2a24ae..e63c6b723d76 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -3256,6 +3256,9 @@ static int wcd934x_compander_set(struct snd_kcontrol *kc,
int value = ucontrol->value.integer.value[0];
int sel;
+ if (wcd->comp_enabled[comp] == value)
+ return 0;
+
wcd->comp_enabled[comp] = value;
sel = value ? WCD934X_HPH_GAIN_SRC_SEL_COMPANDER :
WCD934X_HPH_GAIN_SRC_SEL_REGISTER;
@@ -3279,10 +3282,10 @@ static int wcd934x_compander_set(struct snd_kcontrol *kc,
case COMPANDER_8:
break;
default:
- break;
+ return 0;
}
- return 0;
+ return 1;
}
static int wcd934x_rx_hph_mode_get(struct snd_kcontrol *kc,