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 1F92EC433EF for ; Thu, 14 Jul 2022 04:38:09 +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 5607C1A28; Thu, 14 Jul 2022 06:37:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5607C1A28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657773487; bh=LTiHrq0h5LtFHCuEgsogHVuSPBYt7hnhL+zVi3RRRX4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DbjgxqAQOhqPtXooKDcMxHBmi2MjsAkTvjgURb+rMxMp0TabW39b/OqYfZr1qxqDh OAjkXY/YUBg2HBii8gshx7qNKXKaNHDJZY148VlHmEXKcP56Wb6KmYzYDSrYiasYpQ u7AL41KFNW+ex22MgevDpoe1To44IjYa0ZLIH4yI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2487EF806F1; Thu, 14 Jul 2022 06:26:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6E18EF806EF; Thu, 14 Jul 2022 06:26:03 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 460E4F80687 for ; Thu, 14 Jul 2022 06:25:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 460E4F80687 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j92/IbC4" 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 BB4DEB82383; Thu, 14 Jul 2022 04:25:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5694C34114; Thu, 14 Jul 2022 04:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772755; bh=LTiHrq0h5LtFHCuEgsogHVuSPBYt7hnhL+zVi3RRRX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j92/IbC4fZLRD8+SPFWHDnGYDlVcrcvGBv2k9o9LlgzFbb9iCMC8P2IhQPVmGc+Sg jzgrTnmMRgisAM4xcKocX5JTd87melj9bQZJyAywlgOdKJKodrMYJEQFO9XRmnU0md eCC3bL1VF9gPwNahdWGO+GTWqOLQ2pPwxLc9FnQCGCx6zYPoWQqHUF+yAwG3S2yxtz pLkyWWJlI2DnxOY7rxjiJ0/P9AEQt1JnA8s15hOQK9qJFnEhcFi5daV3L2ZUYrpiwA T81f+1OINrb3AGN0dmupV+dpjigvSA6vHgGGkHM2ChhpRZM+nW8ltizGfg92ELQsBE eDbSCg8QfpA+w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 06/15] ASoC: cs47l15: Fix event generation for low power mux control Date: Thu, 14 Jul 2022 00:25:31 -0400 Message-Id: <20220714042541.282175-6-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042541.282175-1-sashal@kernel.org> References: <20220714042541.282175-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 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 254f9d96e766..7c20642f160a 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 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 1DDB3CCA486 for ; Thu, 14 Jul 2022 04:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233187AbiGNEep (ORCPT ); Thu, 14 Jul 2022 00:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237546AbiGNEdO (ORCPT ); Thu, 14 Jul 2022 00:33:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AD2B3A4A2; Wed, 13 Jul 2022 21:25:56 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D5C3461E51; Thu, 14 Jul 2022 04:25:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5694C34114; Thu, 14 Jul 2022 04:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772755; bh=LTiHrq0h5LtFHCuEgsogHVuSPBYt7hnhL+zVi3RRRX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j92/IbC4fZLRD8+SPFWHDnGYDlVcrcvGBv2k9o9LlgzFbb9iCMC8P2IhQPVmGc+Sg jzgrTnmMRgisAM4xcKocX5JTd87melj9bQZJyAywlgOdKJKodrMYJEQFO9XRmnU0md eCC3bL1VF9gPwNahdWGO+GTWqOLQ2pPwxLc9FnQCGCx6zYPoWQqHUF+yAwG3S2yxtz pLkyWWJlI2DnxOY7rxjiJ0/P9AEQt1JnA8s15hOQK9qJFnEhcFi5daV3L2ZUYrpiwA T81f+1OINrb3AGN0dmupV+dpjigvSA6vHgGGkHM2ChhpRZM+nW8ltizGfg92ELQsBE eDbSCg8QfpA+w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Charles Keepax , Mark Brown , Sasha Levin , james.schulman@cirrus.com, david.rhodes@cirrus.com, tanureal@opensource.cirrus.com, rf@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.10 06/15] ASoC: cs47l15: Fix event generation for low power mux control Date: Thu, 14 Jul 2022 00:25:31 -0400 Message-Id: <20220714042541.282175-6-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042541.282175-1-sashal@kernel.org> References: <20220714042541.282175-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 254f9d96e766..7c20642f160a 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