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 1FBE5C433EF for ; Wed, 20 Jul 2022 01:20:11 +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 46DBE178D; Wed, 20 Jul 2022 03:19:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 46DBE178D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658280009; bh=7IZTApLTynglbD7aV1nvNHgpHlfeAnDxZGwzIB+MTSQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gW4PFlhMjMHHwz24PumNTgR6Nk8gjQZR7cbXCi2vEcbPQB5tIU+vq8jvzD4QoM6IT FHxEtE+2XIIGUV4L9IiISdDZ1LMwASqb6NZS8eQhXLMeGf4cPhRY/wl0rxBAy2FGGU rV6K49TJT3KAWU3eIhDXhMMITIKdtD+cwsh0Hap4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3F90BF8055C; Wed, 20 Jul 2022 03:18:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3BC2FF80566; Wed, 20 Jul 2022 03:18:12 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 07803F804FA for ; Wed, 20 Jul 2022 03:18:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 07803F804FA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="obvAygvF" 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 C03A4617EF; Wed, 20 Jul 2022 01:18:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7871C385A9; Wed, 20 Jul 2022 01:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658279884; bh=7IZTApLTynglbD7aV1nvNHgpHlfeAnDxZGwzIB+MTSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=obvAygvF3OPRWA46JJydGQIHx4GscMo0JdEJUSdMFXoouhVI1Q2yRvi/BHvI7btg5 pH5NDKen1nf7fiPWS+kKTz92NQgwAVDGoJAdYDNs67yOMAltkoILqP9j5MEIUu0Qlm N5ghAQsAGBRdOA+So3vHmpBBb65NqAn5Vxycb8rJa/dUGvFSd8gQEb9RUOPmjlUm5l pA2QTXTpFEhsNgL8M9N+5h0whrc99VBGHC2a/MxS1YXG/Wsbcvmsp0PBgyDhDnd846 mrB5BOuHbfL3523293SilJzHfncbtAKdhDcWk9N4QWnXNkX7kECNtkbZK7ayePADwn lLm787sYgRJ4w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 12/16] ASoC: cs47l92: Fix event generation for OUT1 demux Date: Tue, 19 Jul 2022 21:17:26 -0400 Message-Id: <20220720011730.1025099-12-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220720011730.1025099-1-sashal@kernel.org> References: <20220720011730.1025099-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 d50f75f3b3e4..cb7d02c3f11b 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