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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33861C43334 for ; Thu, 14 Jul 2022 04:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235239AbiGNEZz (ORCPT ); Thu, 14 Jul 2022 00:25:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234752AbiGNEZQ (ORCPT ); Thu, 14 Jul 2022 00:25:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC7E627CEB; Wed, 13 Jul 2022 21:23:23 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 1E25DB82371; Thu, 14 Jul 2022 04:23:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A848C341CA; Thu, 14 Jul 2022 04:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772600; bh=Nw9GIA0IvSM+nBcMCdX3mSHyRJJF5jJYhfuCJ1FOG6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FN6lHruFurAlfettCHqY5368hLDdmKTHMUOU5DDhOklGaAwyCjNdAb/X95SscnkHx 9+eKYNhADG6rqaoaG6YRwVB5o74vRN1Kto136aOkGaUzj7ntf2fmGIdthiH4YTyqFz WRoT+eQz08Zra401DtWAxFUgu9Dyb0EMHQEQ/7Iy0tOQgno5FbqctcFyxuxFbMhYYM TdZQtMrt1NSXk8WO8L0i8248xWuOXOuKpWOnaqX+tgCR1Xd6ttNNSpvQAmSBrgOj+E x78cS0p5oF6mjV67QRR2WjUP+nZwYLAca0MKngLA/2iaKoqQ1QWj8wic7ZH6Xr9aH3 uIMoS7Bn30Tow== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Charles Keepax , Mark Brown , Sasha Levin , rf@opensource.cirrus.com, james.schulman@cirrus.com, david.rhodes@cirrus.com, tanureal@opensource.cirrus.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, patches@opensource.cirrus.com Subject: [PATCH AUTOSEL 5.18 23/41] ASoC: cs47l15: Fix event generation for low power mux control Date: Thu, 14 Jul 2022 00:22:03 -0400 Message-Id: <20220714042221.281187-23-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042221.281187-1-sashal@kernel.org> References: <20220714042221.281187-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Charles Keepax [ Upstream commit 7f103af4a10f375b9b346b4d0b730f6a66b8c451 ] cs47l15_in1_adc_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/cs47l15.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs47l15.c b/sound/soc/codecs/cs47l15.c index 391fd7da331f..1c7d52bef893 100644 --- a/sound/soc/codecs/cs47l15.c +++ b/sound/soc/codecs/cs47l15.c @@ -122,6 +122,9 @@ static int cs47l15_in1_adc_put(struct snd_kcontrol *kcontrol, snd_soc_kcontrol_component(kcontrol); struct cs47l15 *cs47l15 = snd_soc_component_get_drvdata(component); + if (!!ucontrol->value.integer.value[0] == cs47l15->in1_lp_mode) + return 0; + switch (ucontrol->value.integer.value[0]) { case 0: /* Set IN1 to normal mode */ @@ -150,7 +153,7 @@ static int cs47l15_in1_adc_put(struct snd_kcontrol *kcontrol, break; } - return 0; + return 1; } static const struct snd_kcontrol_new cs47l15_snd_controls[] = { -- 2.35.1