Patch "ASoC: max9768: Fix event generation for playback mute" has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: max9768: Fix event generation for playback mute

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-max9768-fix-event-generation-for-playback-mute.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b4346b2960126bc34e63420858dc44f33f93bfe3
Author: Mark Brown <broonie@xxxxxxxxxx>
Date:   Tue Nov 12 13:09:50 2024 +0000

    ASoC: max9768: Fix event generation for playback mute
    
    [ Upstream commit 2ae6da569e34e1d26c5275442d17ffd75fd343b3 ]
    
    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@xxxxxxxxxx>
    Link: https://patch.msgid.link/20241112-asoc-max9768-event-v1-1-ba5d50599787@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/codecs/max9768.c b/sound/soc/codecs/max9768.c
index e4793a5d179ef..8af3c7e5317fb 100644
--- a/sound/soc/codecs/max9768.c
+++ b/sound/soc/codecs/max9768.c
@@ -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,




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux