From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE0B2C43334 for ; Wed, 20 Jul 2022 01:15:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D010216F1; Wed, 20 Jul 2022 03:14:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D010216F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658279712; bh=Xvr4lD521Oz1DEqLOoPcl3KybZyDDe8QO1g8AOHOOII=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=juewcMlqrjvWrEiN+NxFdlounBFc/OkZvv2WDN8xflXf1Z0a64BZffQ4yB0boDbrM usJp2wiNlq8GyM5lNBClFDzciBiSNN5bAW8ij88eky3GBxAITAtCYbj7eebfw1F/44 eseoEPSyE57F1gEox2EigUQ9r7iqKOlmjt+DJB1Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 91876F80557; Wed, 20 Jul 2022 03:13:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2AC82F80557; Wed, 20 Jul 2022 03:13:17 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E0099F80548 for ; Wed, 20 Jul 2022 03:13:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E0099F80548 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xpm/JBMy" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4625961730; Wed, 20 Jul 2022 01:13:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 545F8C385A2; Wed, 20 Jul 2022 01:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658279588; bh=Xvr4lD521Oz1DEqLOoPcl3KybZyDDe8QO1g8AOHOOII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xpm/JBMy/w6PK/qzgOjPdneBNBPmqJYDbsnnlZx594E1ScK9+OkOtrRAz54Ug9QBf 8+IcJvkZ3uJCz78Sc6tGSV5P8rHtwL6vwQMhf4KQWT4RO69A2S6khatAeGpOnoJgAL Me4j3kQD4/jpCH4vEmQ+Axr6+aOUEqaM7JiBY7SPh2Q3zOyuUBafJzm9yhNvyfBcrY QfrX3CpenFODOcWJSdxXsZTfyKp7PDFST346v4ixtyaRbrA7fXEdf45zOaV6B3HovA fAnRFeOv3ZO9sTQ0GScoZmOKVDEbTNuCYuQ1dnmEr4vhtMD4eUCAwRvQJFzFaAKJLd IgrWGNDnw3KSw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.18 41/54] ASoC: cs47l92: Fix event generation for OUT1 demux Date: Tue, 19 Jul 2022 21:10:18 -0400 Message-Id: <20220720011031.1023305-41-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220720011031.1023305-1-sashal@kernel.org> References: <20220720011031.1023305-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Sasha Levin , alsa-devel@alsa-project.org, Charles Keepax , tanureal@opensource.cirrus.com, patches@opensource.cirrus.com, tiwai@suse.com, lgirdwood@gmail.com, david.rhodes@cirrus.com, rf@opensource.cirrus.com, Mark Brown , james.schulman@cirrus.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Charles Keepax [ Upstream commit 870d72ab9228575b2f005c9a23ea08787e0f63e6 ] cs47l92_put_demux returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220628153409.3266932-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/cs47l92.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs47l92.c b/sound/soc/codecs/cs47l92.c index a1b8dcdb9f7b..444026b7d54b 100644 --- a/sound/soc/codecs/cs47l92.c +++ b/sound/soc/codecs/cs47l92.c @@ -119,7 +119,13 @@ static int cs47l92_put_demux(struct snd_kcontrol *kcontrol, end: snd_soc_dapm_mutex_unlock(dapm); - return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); + ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); + if (ret < 0) { + dev_err(madera->dev, "Failed to update demux power state: %d\n", ret); + return ret; + } + + return change; } static SOC_ENUM_SINGLE_DECL(cs47l92_outdemux_enum, -- 2.35.1