Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4430299imw; Tue, 19 Jul 2022 06:32:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v4hanbf0pKwu2FNEN0yB0+qGUh0Qn/9y5SNpJi8pu3eFjMzAZMQKB270dml6bE4BYukuWa X-Received: by 2002:a17:907:60d1:b0:72f:42a0:f3f9 with SMTP id hv17-20020a17090760d100b0072f42a0f3f9mr6879072ejc.727.1658237544301; Tue, 19 Jul 2022 06:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658237544; cv=none; d=google.com; s=arc-20160816; b=uNEgN0oc05RtEQAY0d7CvemqT0zsxWevOBoMJdhA2MfgvfU17+8yRJsMNRWLa4OTMp FWh6sArbcjal0cwVm+B3hHevrYcZ9xImDS+eI0H3nm6F5rhSrnIpfx1i9wOdPtNF2mqM lAGK0uJyUnrBdbx8WQpsF43y05j+LJJib/DXXYec2YA/geRjBPH6JQpTWb4PktOtTGZt lVSrGDagGYA7FMw5XGk+21ChZYAxMkUwkIrjlMqCjhtTm4fpn4v2Ov4sUwu6LN43ozcr pBjViAiH7yRQ+dpw5WM6NHmyQRPZl9IAtghzOuokRP431QT/9mqRdzEQDP7i/cQDsnwD k8TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jm1vLSUs6ZFQ8OykBCn4IBMEGs/3dIRHwcIiSYb2fRM=; b=VzLcZpD/0LgvG18MudcOJ+XkQhW+vQTMZgEklFqYmhB41OWDd+amERSxQwXJO46uCc yIVyI+xepWGcZx27WcKGWAQkPrAY9EfC3JTIon4bxQFIIl72lJQ3AsRe4kpgFO3mFL5S kSApo68zKGnxKF4R9bOENmvOFWMCLKFb+i7Juc1kfNJgpTaJb5g9Hjs+wYDc3hQjaW1V 4NWiVRazvdO++QuZePrv8QC5kxLWE9zDCcqnXAmIpUEudwfkjB4sQG7u2UuZFEu7WTee dAhH2z6hahX2A8+ts8Yl4awplaVqgzjVewwOUCdCsul/fCE0rDnMBKq3Otyre4ISoHcy J7sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZCbBFbmD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp23-20020a1709073e1700b0072b3b8d31f8si22195505ejc.63.2022.07.19.06.31.57; Tue, 19 Jul 2022 06:32:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZCbBFbmD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237687AbiGSMQ3 (ORCPT + 99 others); Tue, 19 Jul 2022 08:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239501AbiGSMOp (ORCPT ); Tue, 19 Jul 2022 08:14:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08C8452E75; Tue, 19 Jul 2022 05:05:39 -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 16555B81B31; Tue, 19 Jul 2022 12:04:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68943C341C6; Tue, 19 Jul 2022 12:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232293; bh=ws8AHWwDPDlJOFTDJ3zKqYO043Rjd52kX/2CbSrbOEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZCbBFbmDmm2LxAeGDIHGuZB31w84UyhYuu/0o7GwRK9dDlNBGc4a+mBQM24u5mkN3 r7meh6QebkCjqWdX6YhTejEsMEvwRt/NPXqlOlKgewMBFQY54atRVPtJsBfdld9PK4 YHG3yRvHP4/m2wC7HmT6l3Ycvu0IKHIfWwSTQ3Bc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.4 55/71] ASoC: wm5110: Fix DRE control Date: Tue, 19 Jul 2022 13:54:18 +0200 Message-Id: <20220719114557.670213774@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114552.477018590@linuxfoundation.org> References: <20220719114552.477018590@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 9dc215b5c504..06ec3f48c808 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -413,6 +413,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); @@ -440,8 +441,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; @@ -454,6 +455,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