Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3973486pxb; Mon, 21 Feb 2022 09:21:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3zq3tdvjtLB95/K4g6XFIMvvFf1pDKKU8fiPQYbgMbPzMZKeqaKA+PC2/wksx9rQJ7Jvw X-Received: by 2002:a17:906:ad8d:b0:6ae:9bd6:1e9a with SMTP id la13-20020a170906ad8d00b006ae9bd61e9amr16789626ejb.337.1645464084131; Mon, 21 Feb 2022 09:21:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645464084; cv=none; d=google.com; s=arc-20160816; b=RCUfUFHZbwnT6PSLodB8QrQkAmK3s1Fy0plqkukU6TXYejuEDQOh8DNHOJ1s/f+yvt cpLUI2mTO4lRtNl5VNKP2iQDwhBa+MD/zXS+CDUpRTqN0AMofEACnWBFSzlg8KJTCWju FXl0FD+AYj5ATaxAIr2UwpXQp3SjLRfqToCRrJKPZdkP+km6XAEcIXsw8hPeYQhgsvIv tnANHKoOQwPYsKO+D0fzWscvMw/UB1bYl0lEyi6Elz8jsRnanMhkQVLmp6wnI4v9ZVHh MRWsB4mQwKllu4Bt1p69Jl7nn9hvaMXsWGYCK+rj1ovJM+lYI7kFekqrRxkrCHZD/XkJ Kt4w== 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=8sCg65U2cS+x7e3LtYeT1pR7o5+TJjz2sUqVwBFHqfc=; b=Bw/2w5e2Ee31x+M8pEJ74FifRtEekC12AjkwJaxZCk6V9ySCLnsjjpSblY7qNPiPYg Qtjs7sSPzyf40CePhUqyb+TNGdm2D1jMW/mnOH/O2LRUe39fLrTBH6EKNCntkF05xxxc JkVbzPHvI+6DjbvTotUTP7DQ3ke3gPxwG22PqjlHKQwPB4hu9oPdLAd6XpXC3sQbN43v 7g7KDjtZEo/UvuU4GHKffP1WjK3/iOfKh+vIE7iAYNN3v+rSowO1UWgTuJeDRNtqjv8e v4teybq0lIQiGu0fNtxILc3ZXGcFQ1QLqrSz1kn218XO6Ye2HT9DJy/CFuvoD7fCarsW EouQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=moSkn9ZB; 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 l19si9689030edc.347.2022.02.21.09.21.00; Mon, 21 Feb 2022 09:21:24 -0800 (PST) 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=moSkn9ZB; 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 S1348641AbiBUJLb (ORCPT + 99 others); Mon, 21 Feb 2022 04:11:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347598AbiBUJHI (ORCPT ); Mon, 21 Feb 2022 04:07:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D81CE26567; Mon, 21 Feb 2022 00:59:53 -0800 (PST) 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 74FA461152; Mon, 21 Feb 2022 08:59:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 606D0C340E9; Mon, 21 Feb 2022 08:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645433992; bh=XNcZJD8WoDEQAQnmMUE/R3Xrqgj7fY2o72ZslMisX7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=moSkn9ZBd2mvChxlwmrK7IlPsOv8HF4ZG/IhUzhfzaUKpmhanOu7NYdVNqcMYYEpm tV205QsdnOAW4p4o3G2slWGmfR6+67qK1r0qRQO/i2kQUrPwezz9DYoQM8w0vJBDWP n5KMGwkiLxJgBgiFH036Wa7eBlhmSobcE3eCvmpE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown Subject: [PATCH 5.4 48/80] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw() Date: Mon, 21 Feb 2022 09:49:28 +0100 Message-Id: <20220221084917.145751668@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@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.1 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,T_SCC_BODY_TEXT_LINE 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: Mark Brown commit 564778d7b1ea465f9487eedeece7527a033549c5 upstream. When writing out a stereo control we discard the change notification from the first channel, meaning that events are only generated based on changes to the second channel. Ensure that we report a change if either channel has changed. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220201155629.120510-2-broonie@kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-ops.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -314,7 +314,7 @@ int snd_soc_put_volsw(struct snd_kcontro unsigned int sign_bit = mc->sign_bit; unsigned int mask = (1 << fls(max)) - 1; unsigned int invert = mc->invert; - int err; + int err, ret; bool type_2r = false; unsigned int val2 = 0; unsigned int val, val_mask; @@ -356,12 +356,18 @@ int snd_soc_put_volsw(struct snd_kcontro err = snd_soc_component_update_bits(component, reg, val_mask, val); if (err < 0) return err; + ret = err; - if (type_2r) + if (type_2r) { err = snd_soc_component_update_bits(component, reg2, val_mask, - val2); + val2); + /* Don't discard any error code or drop change flag */ + if (ret == 0 || err < 0) { + ret = err; + } + } - return err; + return ret; } EXPORT_SYMBOL_GPL(snd_soc_put_volsw);