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 47D01C43334 for ; Thu, 14 Jul 2022 04:37:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237048AbiGNEh3 (ORCPT ); Thu, 14 Jul 2022 00:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232500AbiGNEgr (ORCPT ); Thu, 14 Jul 2022 00:36:47 -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 0D384D103; Wed, 13 Jul 2022 21:26:43 -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 9434261EB3; Thu, 14 Jul 2022 04:26:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFD54C385A2; Thu, 14 Jul 2022 04:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772803; bh=Fx1M8c3FrFG6aIocqtJj5YqSitj0ITCfGvnQlG5jYXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Prp/cRaYA3osRig5Va6R1AoqfxlelYEjLjADXbBViywMUS3Yh+fzyvYjqYVL3MasQ xqyWBfl3wXTx0AYoTSebiNNXNs8R46rKGSroOdaSZrvwPKMEO1KTBI2lk9/LuOB6Nb /HiETQrKRIsoje2UOZiHS14qiABdrk9QSndamuKvDP4pZJzU8+d/mmzhK+oZPaDVAL gA4ATp8FG9qvuphTx+dWjE0Yo48/3T46T2lviESBBhFdXwa6+jSP/HnZV3YYKJddrY Pcife0gDhOndo7UVRZbHO2tJW+RsAHs2TaEA++V/AGVobBrx8SDF+F02FTd8JPgadY z7Vv4B4AL777w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Charles Keepax , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, simont@opensource.cirrus.com, patches@opensource.cirrus.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 4.19 2/6] ASoC: wm5110: Fix DRE control Date: Thu, 14 Jul 2022 00:26:32 -0400 Message-Id: <20220714042637.282511-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042637.282511-1-sashal@kernel.org> References: <20220714042637.282511-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 0bc0ae9a5938d512fd5d44f11c9c04892dcf4961 ] The DRE controls on wm5110 should return a value of 1 if the DRE state is actually changed, update to fix this. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220621102041.1713504-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm5110.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index b0789a03d699..e510aca55163 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -414,6 +414,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift; unsigned int lold, rold; unsigned int lena, rena; + bool change = false; int ret; snd_soc_dapm_mutex_lock(dapm); @@ -441,8 +442,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, goto err; } - ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE, - mask, lnew | rnew); + ret = regmap_update_bits_check(arizona->regmap, ARIZONA_DRE_ENABLE, + mask, lnew | rnew, &change); if (ret) { dev_err(arizona->dev, "Failed to set DRE: %d\n", ret); goto err; @@ -455,6 +456,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, if (!rnew && rold) wm5110_clear_pga_volume(arizona, mc->rshift); + if (change) + ret = 1; + err: snd_soc_dapm_mutex_unlock(dapm); -- 2.35.1