Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4438279pxb; Mon, 21 Feb 2022 21:37:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqJ6OfQdHCtq1KanLdSKf9kHK+qiNXRkGnYB7lKgY8xgStLvqqBbhDsUY3jB8BTPNXKw8o X-Received: by 2002:a17:902:7144:b0:14f:be0b:1c6e with SMTP id u4-20020a170902714400b0014fbe0b1c6emr6994137plm.118.1645508254307; Mon, 21 Feb 2022 21:37:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645508254; cv=none; d=google.com; s=arc-20160816; b=I99jyfLylrMkV3goJtkfpuR32gMjfm3w8kG2gesa6M3/pSuD6QtkxC6DI6vdjbGIgN koCOPhmAs4YLx0olzfnwM5GR9TQe0CKjl8WQJ3vRdJGWPkVJaZprqtCLAS+wUAqLSqqh fIwbxke0UULHHsqvAlO9QNjYhIwqpKeGiUd+jQT/M+wdNR8BKi7twoekBgwNgqosoPZk 7OS/JBAdO5YTzbjwkwGnwbq4Zma8+iFdSrN6OevkFvvz8jHiU6Nc+TT+/zOFCB4SFkRe vB9m/J+/ih6cu5ixE1fu5MSFsAkmpCrsbp6l0/mEVtWBd1vgKMBJ8re2tM694M+Yf4AB dXTg== 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=Ol0nM/6JhM1mLWZZF/+cg5CiZ89iA9FjGCAxu9MpqgHw/qfM/8S0cBQJ53OMarbmW9 IITmPv2jAWf9oIvPS0+GUtTvHCzMLF7/eMFoLERKqjwVAvCymkuBmlGg3D9suzhRo70X xvpvDetNHg0DHr3IcbA1HvIgjGmBjk5h3HHhqiuCWb+XbsZlvu+JGBq4sDtOmuQaUx/P b4PTs4M+wfL2jQ7OH6GLqYm0IZvj6e3qrSVPde52nbSBWkHiOKptFobA/lCk3OyZhHsI cYjLANZ0ynfjuNYU27arIBw9M4sjYun1qt1gTV/6mSEP0qedA/9R7p+325rq/GdrZGev yX8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LqlssyL1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e27si19281432pgm.286.2022.02.21.21.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:37:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LqlssyL1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 083E495A0C; Mon, 21 Feb 2022 21:04:54 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236143AbiBUJYp (ORCPT + 99 others); Mon, 21 Feb 2022 04:24:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348978AbiBUJLy (ORCPT ); Mon, 21 Feb 2022 04:11:54 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 235BF29801; Mon, 21 Feb 2022 01:04:37 -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 96FB2CE0E7C; Mon, 21 Feb 2022 09:04:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89536C340E9; Mon, 21 Feb 2022 09:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434274; bh=NKr8jcP1dVRBCsxqTN+6PsHJDCIyuR2K4W8XcO7Uze0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LqlssyL1EIQNd9s0U3C1PIM1MJG6GszJ+78xvPZXK6CFTV98CUJ9662EaM0jiEGpH mzPbvnzHpvXfXRqvMqWtfCdnkblzy1q/dhfLRI8hS7TOkuinAIHhZ3ukPjykP44BCi d4QW+TfZ5tqFtoIW31IBJacPVVDSAq0hV3EtSu1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown Subject: [PATCH 5.10 073/121] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw() Date: Mon, 21 Feb 2022 09:49:25 +0100 Message-Id: <20220221084923.679783480@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084921.147454846@linuxfoundation.org> References: <20220221084921.147454846@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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);