From patchwork Tue Feb 1 15:56:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 539291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55360C433EF for ; Tue, 1 Feb 2022 15:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240740AbiBAP5O (ORCPT ); Tue, 1 Feb 2022 10:57:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237158AbiBAP5O (ORCPT ); Tue, 1 Feb 2022 10:57:14 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AEF3C061714 for ; Tue, 1 Feb 2022 07:57:14 -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 ams.source.kernel.org (Postfix) with ESMTPS id 650E2B82EBD for ; Tue, 1 Feb 2022 15:57:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDEDDC340F0; Tue, 1 Feb 2022 15:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643731031; bh=vyfCmVN4cP8EJFev5OlGD4JMevMybuuoL0d1c6/ahXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rFLvO9q33ilRsyRpuuaAOyMwzfnEoc7VwsL6ZG/E/GFi0kGaR8pit7H+026pKe+8w Rfis/CFcufQzJ6Njb4phuaXcR2dEbvlxbYus9esOd7+PoTL5bJEhzJAzhu1dHZUIp4 aapswsTlHupOn5poJo/5vpw7emw/H5qfQ8kqvsUBDEKZxF0Qld3sO3vHOYpkwBmK8D DcG7WlWqibaTeCx6cmYujEMSyK3SgKY/sEdUVWgMYpnYAnj6zsp347PYio9D6U4fou DP5Aricyd1HsDnC5LHNbOuWXzppgKsGxEGLspr3pKafcyPzH54t5InAP8NyeP6yzdF IJVrjNT2YKBVQ== From: Mark Brown To: Liam Girdwood Cc: alsa-devel@alsa-project.org, Mark Brown , stable@vger.kernel.org Subject: [PATCH v1 1/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw() Date: Tue, 1 Feb 2022 15:56:26 +0000 Message-Id: <20220201155629.120510-2-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220201155629.120510-1-broonie@kernel.org> References: <20220201155629.120510-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1412; h=from:subject; bh=vyfCmVN4cP8EJFev5OlGD4JMevMybuuoL0d1c6/ahXU=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBh+Vgqyj3RRowfIomn2gl40mR6v6m93MVSOT9peFNo UnaPOZCJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYflYKgAKCRAk1otyXVSH0PoFB/ 4r5HJraZKdm/GamVCaxo8UcM5+n/RiGAWKCHOE3U7GZt9DlAU20uvlPf9A/Co1camFVTuc+//1wa4O dqHJIbCQK4lt+DK0fMaI62GQLqbTAf0Mzsef7E5zG5eJhhOELAjkhEhYMRH/2Yu5BWqqJqox+RIZnD O7W8h6en+X9MNjnBp59/YOSTJ5yy+9cZPadfvWbrp0scKufNBK/jj4AWfjobowyowrqvi+GxGcyM3H ldaBWnjKpNQw3+MKjUGAetYixsGrXuIx9y9LbEN6rOXTVvj04sXJijjAv8hFhDyM+Y3BF3/wkyekvW 3IVNjvYdR2LUL8tWToITRzAnLjj/+9 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- sound/soc/soc-ops.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 08eaa9ddf191..73c9d53de25b 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -308,7 +308,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, 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; @@ -336,12 +336,18 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, 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); From patchwork Tue Feb 1 15:56:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 540390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74C29C433F5 for ; Tue, 1 Feb 2022 15:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240739AbiBAP5N (ORCPT ); Tue, 1 Feb 2022 10:57:13 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:33974 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237158AbiBAP5N (ORCPT ); Tue, 1 Feb 2022 10:57:13 -0500 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 79FA8616FC for ; Tue, 1 Feb 2022 15:57:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AE0CC340EE; Tue, 1 Feb 2022 15:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643731032; bh=9ZDO1dKDNw9O5jWNY34xTQv5y0vT3/uQHUgt832f6vQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QCyjiYEDSQfZ85Yj3Q8WW8b1Urs8kbGBfA8NjlGupGJvYQB0PFQkZiVrJbCiLV1P3 fv5UQPXspCnAZIRVAfXByAjye+SZcZcGnq8nupw4WUmVP/4l1PMiAP52BrVLYBVkgP ARSCOdjNLBuhyfJttoZq79+Riiz19fYNxyNCxXDvlxmmBItVNDqZx7lpxMCA/FKQge uyoFmnyt+eg4sKYMRMImFDSXyb8GwG/CydU+ArLhcKIjt2a1YoqWrUDt4gjFj6Ao9E ziMSjVPMhwTdBC+br6tTn0Ti9avVJy7meNnwrlJodU8kcTaqmMUYY8PFTZ+Z6U/IMt aiWwlfqA1ZVuQ== From: Mark Brown To: Liam Girdwood Cc: alsa-devel@alsa-project.org, Mark Brown , stable@vger.kernel.org Subject: [PATCH v1 2/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_sx() Date: Tue, 1 Feb 2022 15:56:27 +0000 Message-Id: <20220201155629.120510-3-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220201155629.120510-1-broonie@kernel.org> References: <20220201155629.120510-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1359; h=from:subject; bh=9ZDO1dKDNw9O5jWNY34xTQv5y0vT3/uQHUgt832f6vQ=; b=owGbwMvMwMWocq27KDak/QLjabUkhsSfEdqm+RcD8nRtZdyy52fv3dQ+NV3XMj/5702/lm2tUs3y 8ys6GY1ZGBi5GGTFFFnWPstYlR4usXX+o/mvYAaxMoFMYeDiFICJCP5j/6fzT/eMU98ztdT03y+l/t S8WV4u1s/6f2+rCsdvLpHFZ4/b5k3XX9YRVuY++fSF0D97cjS00joUI/2at+8y97PJLUt68eCFUEPl hNeGgsunu8f/ffwwTcNs/tf4PHl7T9HnvRcKqjQqmtNOshjtcl3VoVac2ZfSIT/t2OuMubWierHJP+ vbFC1e3I9Ydt38zMY7ZzIb6nc7MRdzrtB65ivzbtW0WqaOwkn7I2Qk7hX6Lcjg+7SRLa18weUtRznn 3VU21hJ/Xfxqvxnfp+tfutZuZnvM8jmwQMnl8KdDB53yNV5rvPLxuVb45Uy/763eel8d5wc/PwnHr6 10fpA+WbzqhxxTQ/kivf57qdHMAA== X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- sound/soc/soc-ops.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 73c9d53de25b..f0d1aeb38346 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -413,6 +413,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, int min = mc->min; unsigned int mask = (1U << (fls(min + max) - 1)) - 1; int err = 0; + int ret; unsigned int val, val_mask; val_mask = mask << shift; @@ -422,6 +423,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, err = snd_soc_component_update_bits(component, reg, val_mask, val); if (err < 0) return err; + ret = err; if (snd_soc_volsw_is_stereo(mc)) { unsigned int val2; @@ -432,6 +434,11 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, err = snd_soc_component_update_bits(component, reg2, val_mask, val2); + + /* Don't discard any error code or drop change flag */ + if (ret == 0 || err < 0) { + ret = err; + } } return err; } From patchwork Tue Feb 1 15:56:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 540389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDEB9C433F5 for ; Tue, 1 Feb 2022 15:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240744AbiBAP5R (ORCPT ); Tue, 1 Feb 2022 10:57:17 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:52682 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240742AbiBAP5Q (ORCPT ); Tue, 1 Feb 2022 10:57:16 -0500 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 EEAF7B82EBD for ; Tue, 1 Feb 2022 15:57:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74BDBC340ED; Tue, 1 Feb 2022 15:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643731034; bh=QTGmCkc8xHsSc4UxccqN8v9eMK0ZjM1hmtWk5qpf5Bc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qY/b0b96iQv7eSGC7spV5Be59adzduJK4OVNElpUiBBcHLAxoF48IHxJJkKwML1AM Fbh1cgEGb5WSEDpnboi9DNJAqurwLUOWkZ6V70WtV1yC7cxbKGt4gsObqc2+yW9S4C cqz/hlG9w+b8wAFINeHb1QwtbIeK1W2GTSaheHmKyu7VcTijUG8vGFMrc3jezlQBXL LnBVVWm4cKw7icB0d+Tbk7ikXL8HdhBveHp5XOAmCLEsBFaon+fWfFKhicdOhEBPMw 7eBycBxYhxRpDBx1Q9tmjPNTve2Vjr2/qU42xEQ+ncBPPdOYKbJ5hQEXHpdeANjv17 XeBvS85dQd1xw== From: Mark Brown To: Liam Girdwood Cc: alsa-devel@alsa-project.org, Mark Brown , stable@vger.kernel.org Subject: [PATCH v1 3/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_range() Date: Tue, 1 Feb 2022 15:56:28 +0000 Message-Id: <20220201155629.120510-4-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220201155629.120510-1-broonie@kernel.org> References: <20220201155629.120510-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1710; h=from:subject; bh=QTGmCkc8xHsSc4UxccqN8v9eMK0ZjM1hmtWk5qpf5Bc=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBh+VgrYf8FNriLi0uMk58JVTX8BJUYs7WiQ7xNh/dI koeyceWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYflYKwAKCRAk1otyXVSH0LpZB/ 0ZRFFHtp2uv2bLQO3T/zGiXDAcmgEGJZRITphls0zTCdtLdwPhVE+6vDRc70aZdcim9wnvoZoDi0TE cImeaGr11aVqGVitwsd/Osfzvtie2q8yfJXpOciEHWZe6ZfYK6nxYvGOfS4gxo69OJ9OP2JyoDHjNo vr1nibIBP1h1HAo6B+roTYMYKMuN2CcZB6KuFZP9vVTR39aC6chHeCvaOUfmyxXnTFAWyWzAcpGVdX NzBspuFT4cd1NNau2lSsw11tINGl+oArZ4LBwdbkMucFWGmOgiOnNdPhaA4ae19tCTXUcbq+xnmBNH N0WgH7zjbbtkUhTRjm6q4l5PD6dXDy X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- sound/soc/soc-ops.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index f0d1aeb38346..fefd4f34cbc1 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -498,7 +498,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, unsigned int mask = (1 << fls(max)) - 1; unsigned int invert = mc->invert; unsigned int val, val_mask; - int ret; + int err, ret; if (invert) val = (max - ucontrol->value.integer.value[0]) & mask; @@ -507,9 +507,10 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, val_mask = mask << shift; val = val << shift; - ret = snd_soc_component_update_bits(component, reg, val_mask, val); - if (ret < 0) - return ret; + err = snd_soc_component_update_bits(component, reg, val_mask, val); + if (err < 0) + return err; + ret = err; if (snd_soc_volsw_is_stereo(mc)) { if (invert) @@ -519,8 +520,12 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, val_mask = mask << shift; val = val << shift; - ret = snd_soc_component_update_bits(component, rreg, val_mask, + err = snd_soc_component_update_bits(component, rreg, val_mask, val); + /* Don't discard any error code or drop change flag */ + if (ret == 0 || err < 0) { + ret = err; + } } return ret; From patchwork Tue Feb 1 15:56:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 539290 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0276BC433F5 for ; Tue, 1 Feb 2022 15:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240743AbiBAP5T (ORCPT ); Tue, 1 Feb 2022 10:57:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240742AbiBAP5T (ORCPT ); Tue, 1 Feb 2022 10:57:19 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C208DC061714 for ; Tue, 1 Feb 2022 07:57:18 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7CAB3B82EBC for ; Tue, 1 Feb 2022 15:57:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A160C340F2; Tue, 1 Feb 2022 15:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643731036; bh=VnWhYXoSublRCB+1wcOOpYhqio7frWE6T8zFex0MlxI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qyDH9x0rAubhmtN+jqn8UpfmWNRQjRyIlv/UFEuCuh9GuA2OHYdkAPqz0cB5XeWFu iuGD9pJ8JpxZvoPuGMTh3S/Dm6/MLjWcSPQcGao0BrsJf8fQV9LsLXRe3mvNM6bt9x S2+RY+ikcfmg1mE3+k9AhRSxqfQeypflHTZ3d9Qee9dPrXFjNJU28yZzU7WEJPbmx0 UJUxMAvMdJW5wyvHWhpl1l56v38bf3uwHB7yB1MJKwhfxjVK+oUhMHkxpcNEiKNmGR TByrObquwXvGdofawh93oteISlUvrCxv/msUK0SvXHNRW5ZZ1A3M1BE+Cv16R1Jvsy pbCavoMmzQNRQ== From: Mark Brown To: Liam Girdwood Cc: alsa-devel@alsa-project.org, Mark Brown , stable@vger.kernel.org Subject: [PATCH v1 4/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_xr_sx() Date: Tue, 1 Feb 2022 15:56:29 +0000 Message-Id: <20220201155629.120510-5-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220201155629.120510-1-broonie@kernel.org> References: <20220201155629.120510-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1062; h=from:subject; bh=VnWhYXoSublRCB+1wcOOpYhqio7frWE6T8zFex0MlxI=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBh+VgsLu4zMn5YXRfnMlkoi6j6z/SZ9Iy/LLhl7L29 4B/A656JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYflYLAAKCRAk1otyXVSH0IpLB/ 9YQ+9hIYFMiyjlW9PEgtBYLZh8roYtm/kwoGkde9MmPGlh7SxACNvDW/Chh0tEcFkERC0XxyTW3z0S OvzjU+KECDOtlqXho/YTAWdX5dpdVE7TS7xsTH6GHKylJzjDpTjvrEgKpY6NIg0F2SEPkXDZM8eUwl VyWeOXCmlgLqJ86E6+2uwRhvRELkU+KNrrp7cYyiD5OQzvGHyEBa59lyqwO2dhrU9FT8cIO8YNDtgj WkrtJIPqOB65fEltw+w7bC6ylNb7iV0YiAZStnC97dJpM0UoEPxCxASL0ND4+FkKODl2VOe1k/8/Wv 369Vu1zpxlhWaS+cIpKUOQRF79LbcS X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- sound/soc/soc-ops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index fefd4f34cbc1..6b922d12afb5 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -874,6 +874,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, unsigned long mask = (1UL<nbits)-1; long max = mc->max; long val = ucontrol->value.integer.value[0]; + int ret = 0; unsigned int i; if (invert) @@ -886,9 +887,11 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, regmask, regval); if (err < 0) return err; + if (err > 0) + ret = err; } - return 0; + return ret; } EXPORT_SYMBOL_GPL(snd_soc_put_xr_sx);