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 739D1C43334 for ; Thu, 14 Jul 2022 04:40:52 +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 B053F1AB4; Thu, 14 Jul 2022 06:40:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B053F1AB4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657773650; bh=bOkeFcRvEJXwqCdMD4VM9co/zqhkv616K5F1BysyWvM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AkTnO+C5i8np/QjpC9D/nzivp0cri4ccSKS7+NGpgF2XzRkAKScr5dxbdUXiIsdaM 7HilBLA7INKq8pCqPVcodefGZSIjlykduGwL/oATE0HRMes5jysDKpKlNx9KYjKTpV bjs+9Dzsfw13ORdJvvCmXIeqZ/lTHBhIdCr5duDE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 29EC2F805C6; Thu, 14 Jul 2022 06:27:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7CFCEF80735; Thu, 14 Jul 2022 06:27:08 +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 DD628F805C3 for ; Thu, 14 Jul 2022 06:27:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DD628F805C3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eHPxItax" 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 C942761EBD; Thu, 14 Jul 2022 04:26:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16C08C34114; Thu, 14 Jul 2022 04:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772819; bh=bOkeFcRvEJXwqCdMD4VM9co/zqhkv616K5F1BysyWvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eHPxItaxvob9K6enIGpz8Z18yNJoAT73RzptbUpjSHPL+MeVHok7NDgGk/UHJj+eb INgASU8gCY8tNBpnauiHA7bcIolCe+D8VN/jzhLbBc1IPZvTORgOO6Du2odPFkdkxU LuZllokijetcHDjzf9VziP0pOPrmIx8ebp3UCI6brdupR/AH1Y/tAira+MKOcM8Nx5 4lQnC49wF4iSaPFOPYt0qBThpxUWZA+4cueUlpCAM7vpHIujbIvSHh+N1bWrM/yy5d xjxECz4wcH5hRo38/s/iCODfhgpyM7Kcz2aY+hY5eZFIQsRYtQ1U6QtaRxSwPWKR4a eC+fZhzRd5WgQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 2/5] ASoC: wm5110: Fix DRE control Date: Thu, 14 Jul 2022 00:26:49 -0400 Message-Id: <20220714042653.282599-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042653.282599-1-sashal@kernel.org> References: <20220714042653.282599-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 , patches@opensource.cirrus.com, simont@opensource.cirrus.com, tiwai@suse.com, lgirdwood@gmail.com, Mark Brown 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 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 858a24fc28e8..9d099d75021c 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -406,6 +406,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); @@ -433,8 +434,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; @@ -447,6 +448,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 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 6886BC433EF for ; Thu, 14 Jul 2022 04:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237575AbiGNEiE (ORCPT ); Thu, 14 Jul 2022 00:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237578AbiGNEhX (ORCPT ); Thu, 14 Jul 2022 00:37:23 -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 4B57E3DBD8; Wed, 13 Jul 2022 21:27:00 -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 C5AEE61EB4; Thu, 14 Jul 2022 04:26:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16C08C34114; Thu, 14 Jul 2022 04:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772819; bh=bOkeFcRvEJXwqCdMD4VM9co/zqhkv616K5F1BysyWvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eHPxItaxvob9K6enIGpz8Z18yNJoAT73RzptbUpjSHPL+MeVHok7NDgGk/UHJj+eb INgASU8gCY8tNBpnauiHA7bcIolCe+D8VN/jzhLbBc1IPZvTORgOO6Du2odPFkdkxU LuZllokijetcHDjzf9VziP0pOPrmIx8ebp3UCI6brdupR/AH1Y/tAira+MKOcM8Nx5 4lQnC49wF4iSaPFOPYt0qBThpxUWZA+4cueUlpCAM7vpHIujbIvSHh+N1bWrM/yy5d xjxECz4wcH5hRo38/s/iCODfhgpyM7Kcz2aY+hY5eZFIQsRYtQ1U6QtaRxSwPWKR4a eC+fZhzRd5WgQ== 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.14 2/5] ASoC: wm5110: Fix DRE control Date: Thu, 14 Jul 2022 00:26:49 -0400 Message-Id: <20220714042653.282599-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042653.282599-1-sashal@kernel.org> References: <20220714042653.282599-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 858a24fc28e8..9d099d75021c 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -406,6 +406,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); @@ -433,8 +434,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; @@ -447,6 +448,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