Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4152680pxb; Mon, 21 Feb 2022 13:25:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzP1ntaduVTWmstM6S1KGkMn9TuciKs+Zr0QYyKKJODcxvW4YsmV7jGmUF3i3k5NlXM/62X X-Received: by 2002:a17:906:4c83:b0:6b7:b321:5d54 with SMTP id q3-20020a1709064c8300b006b7b3215d54mr16803631eju.676.1645478755645; Mon, 21 Feb 2022 13:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645478755; cv=none; d=google.com; s=arc-20160816; b=UauMA58N+iSZdaPxHoe0vHPsvB3FBCsF7OaphpV0BLtS/9kzrHqVxST5BfvQyj/18u LORfUakLYB6n12MLT4D7qHWakclhPRnX4LgGmojHFUHTnNg37STNedrHO6hxWWVEm8e7 4UzYi7bGmXhOp+niqxyCHfWc0Ajn7AlDXtI9mHG7T08nJtV8VMClcxwjvd81VLS5izpJ omWHwtXz3t6R8l7iU1AyrXRftTViDeZzIB8FhlZN1cPHs/dIB3Zj7mj7V8a2weCDh2fn OmGl8vLJtVtFJhIGKjZLWlPW/rL3lUHP/qwyMVPl3Ja361pMz4hAFmvATXthZm4l1PFZ /vVQ== 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=3ai4pSbsAEr/90vXeAQjU8CUyTLDykZQnl52+a2gRyY=; b=qMKYeoctraKFFZ206DYzGzGWt5xObUig3WNN8+lBMxyAlqVNrfV8EUDBa+U2GifdWq vdoR165Q32MHAfOxhI4rVLkfoCaBUws5Np6zKweD5QzAps/FWbxqgx2n4Pkpn+zQq3PZ hD9RavcQghRXJYQEzhJv5Yyhml8TJJyWgTY8bb6AHIRscKvcX14I+rvYs4D0dnBQgxup SAui6ezh3yICjyFZ2yLHzbeWFuXdSgLNBSQs9rUjUsXa1yEX0aRAl0IVkQDAvGGU6XkH jI+Th/nJbU3Csm1fB9czrk6rQW6eHOBZx6uudEkhVg8FgsiFpJdLy1b8zbcS+tbYzayO MdJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aTlrHgcf; 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 n26si7659126edr.499.2022.02.21.13.25.33; Mon, 21 Feb 2022 13:25:55 -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=aTlrHgcf; 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 S232741AbiBUJ7r (ORCPT + 99 others); Mon, 21 Feb 2022 04:59:47 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351991AbiBUJwq (ORCPT ); Mon, 21 Feb 2022 04:52:46 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B0BA1D0F2; Mon, 21 Feb 2022 01:23:06 -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 sin.source.kernel.org (Postfix) with ESMTPS id D9AC3CE0EA9; Mon, 21 Feb 2022 09:23:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4977C340E9; Mon, 21 Feb 2022 09:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645435383; bh=NKr8jcP1dVRBCsxqTN+6PsHJDCIyuR2K4W8XcO7Uze0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aTlrHgcfVC9vOFHNXl542g2OOFfrP76sMrnwmUKygyEv/hU/+w2qZRa2vjsQjbrGS JXxn7L7SAN3qyW3Vt7+MfPtX3fT4wwIodXpuEmmIAsOTKzOsIuN4xRAZZyJSYH8thB dal72T5MEzs/IlX00r0mou6wkQNzBjXMN81mnauA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown Subject: [PATCH 5.16 143/227] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw() Date: Mon, 21 Feb 2022 09:49:22 +0100 Message-Id: <20220221084939.592717242@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084934.836145070@linuxfoundation.org> References: <20220221084934.836145070@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 @@ -308,7 +308,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; @@ -350,12 +350,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);