Commit 3fc27e9a authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Mark Brown

ASoC: codecs: wsa881x: fix return values from kcontrol put

wsa881x_set_port() and wsa881x_put_pa_gain() currently returns zero eventhough
it changes the value. Fix this, so that change notifications are sent
correctly.

Fixes: a0aab9e1 ("ASoC: codecs: add wsa881x amplifier support")
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130160507.22180-5-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d9be0ff4
...@@ -772,7 +772,8 @@ static int wsa881x_put_pa_gain(struct snd_kcontrol *kc, ...@@ -772,7 +772,8 @@ static int wsa881x_put_pa_gain(struct snd_kcontrol *kc,
usleep_range(1000, 1010); usleep_range(1000, 1010);
} }
return 0;
return 1;
} }
static int wsa881x_get_port(struct snd_kcontrol *kcontrol, static int wsa881x_get_port(struct snd_kcontrol *kcontrol,
...@@ -816,15 +817,22 @@ static int wsa881x_set_port(struct snd_kcontrol *kcontrol, ...@@ -816,15 +817,22 @@ static int wsa881x_set_port(struct snd_kcontrol *kcontrol,
(struct soc_mixer_control *)kcontrol->private_value; (struct soc_mixer_control *)kcontrol->private_value;
int portidx = mixer->reg; int portidx = mixer->reg;
if (ucontrol->value.integer.value[0]) if (ucontrol->value.integer.value[0]) {
if (data->port_enable[portidx])
return 0;
data->port_enable[portidx] = true; data->port_enable[portidx] = true;
else } else {
if (!data->port_enable[portidx])
return 0;
data->port_enable[portidx] = false; data->port_enable[portidx] = false;
}
if (portidx == WSA881X_PORT_BOOST) /* Boost Switch */ if (portidx == WSA881X_PORT_BOOST) /* Boost Switch */
wsa881x_boost_ctrl(comp, data->port_enable[portidx]); wsa881x_boost_ctrl(comp, data->port_enable[portidx]);
return 0; return 1;
} }
static const char * const smart_boost_lvl_text[] = { static const char * const smart_boost_lvl_text[] = {
......
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