1

ASoC: max9768: Fix event generation for playback mute

The max9768 has a custom control for playback mute which unconditionally
returns 0 from the put() operation, rather than returning 1 on change to
ensure notifications are generated to userspace. Check to see if the value
has changed and return appropriately.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20241112-asoc-max9768-event-v1-1-ba5d50599787@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Mark Brown 2024-11-12 13:09:50 +00:00
parent d859923fae
commit 2ae6da569e
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -54,10 +54,17 @@ static int max9768_set_gpio(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol);
struct max9768 *max9768 = snd_soc_component_get_drvdata(c);
bool val = !ucontrol->value.integer.value[0];
int ret;
gpiod_set_value_cansleep(max9768->mute, !ucontrol->value.integer.value[0]);
if (val != gpiod_get_value_cansleep(max9768->mute))
ret = 1;
else
ret = 0;
return 0;
gpiod_set_value_cansleep(max9768->mute, val);
return ret;
}
static const DECLARE_TLV_DB_RANGE(volume_tlv,