Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4450762imw; Tue, 19 Jul 2022 06:54:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vppur9EphCijVf3oOeq43GuLd1R6pbdkvtmNSTu4m1ez/+ZQXF7urbMInw1Ks42tQiCr3b X-Received: by 2002:a05:6402:2742:b0:43a:bd75:5e82 with SMTP id z2-20020a056402274200b0043abd755e82mr43006359edd.274.1658238858343; Tue, 19 Jul 2022 06:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238858; cv=none; d=google.com; s=arc-20160816; b=kKcaGzjgrnrLdTgn0Z9n/YcpiEb8eqCl2Wa59W5EIvC169v74n88P+RZhXfbOMCaeK 1dMMr7eYQsxG3wvNawNhqsHYfaHPG+ewhkyrg2LzjQK8COMRSe9UIaLIaT4MIbd6BU1c bPl0mpvIbvSozs+AXcw6NVWqBNx17LBRDX74ueMMGUFNhnpPrTBhGtogQdldnpHXv2vo ClMZEEIwbpOKt3M5mvHe+fgP7NPrpKLl+E8296wUJ7z4YVJa0LOZuJbd2w8OJ35GZ6js EFm3noeoNzRbTG1GnhMmcjWh7yo6nyB53Nu4wQktUqemmhhPSfk7gINdVwFSeeRhySO6 neRw== 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=7qMek9lmAdNkRQIiATnQAWFMGDOAoZzFYkoeaJxET2A=; b=D+XU59MyRWqqPlJ1hyiG2cnAKJqP27zy+GYu5QJiVFp6W6m5Dzhi9bwmsENqzzu2wN LolgNXs8qwRENrkEzdrd2Mne+4V/u/STDU8YhICi8T8lyZSu+kBzKiAa9otshBtLqWOS zl5kfNUQz6/ugJlvUkRxN3aZhKJ0s1cvsJSnzeMAsNJgIipu9N4esn+rkIt4iMhQLOIE M6EShLT5HIUhXaYRxz4VGti5o1c0eBuYo/Q+1zwJ+7UhuOugembLe12fAFObthfOov7L J3K02keIn8o9rGSTw/iXXpASWmoinXE1SPZ18dtL+3KasVQudXz00kHqc//8WFyq078C TNKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TaJ2u9yE; 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 g11-20020aa7d1cb000000b0043a734c7014si16829381edp.78.2022.07.19.06.53.53; Tue, 19 Jul 2022 06:54:18 -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=TaJ2u9yE; 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 S241530AbiGSMrT (ORCPT + 99 others); Tue, 19 Jul 2022 08:47:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239414AbiGSMpW (ORCPT ); Tue, 19 Jul 2022 08:45:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CC3F558FF; Tue, 19 Jul 2022 05:18:09 -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 CEF78B81B1C; Tue, 19 Jul 2022 12:17:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1547C341C6; Tue, 19 Jul 2022 12:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233059; bh=JG031+SIFPqD7zsmkiMMSaalhVUkd4njI1+DibBd8D0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TaJ2u9yEUbNg1SQTRAg2vjtu/kfKecrpVZt4Sn5eKbZMJ/5OKQg77y2tQ8h1VcRd5 QX3QTtQPdsUflbKaIEHDbfwKihcqeBTny6J/QI4v4Yxd8+Dih1ki4YyN39Lmg0pzv1 Invhp7stNSWXO7qH0TYQI+hs++ohl9UgXPxL2/B4= 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.15 142/167] ASoC: wm5110: Fix DRE control Date: Tue, 19 Jul 2022 13:54:34 +0200 Message-Id: <20220719114710.231987100@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114656.750574879@linuxfoundation.org> References: <20220719114656.750574879@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 5c2d45d05c97..7c6e01720d65 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