From mboxrd@z Thu Jan 1 00:00:00 1970 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7193C433EF for ; Thu, 14 Jul 2022 04:37:51 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2B7511A22; Thu, 14 Jul 2022 06:37:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2B7511A22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657773470; bh=qkcI0ibRvlGXIrDjkDBd+8nMkl5CVlAV+udAK+KaoWo=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fk+YouDfwibC8TNSELCdkvVunUiTELsYIjTao5dkwQe5YZ0pVpWkIRRNdWxS93K5U 2CJ3n6Tef/HdICk6KZXf/PO1jWKken0bt8dArw2u0Cr3f5AxNwlUD+YkBI7BudMsre WZ2B8dyxzBRooFeDXphgUvsVBu9nSHMNib0475SE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 41A3FF806E9; Thu, 14 Jul 2022 06:26:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 12147F806EC; Thu, 14 Jul 2022 06:26:02 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 768ECF80689 for ; Thu, 14 Jul 2022 06:25:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 768ECF80689 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pAkpsrz1" 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 0762E61ECE; Thu, 14 Jul 2022 04:25:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF85DC341CD; Thu, 14 Jul 2022 04:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772756; bh=qkcI0ibRvlGXIrDjkDBd+8nMkl5CVlAV+udAK+KaoWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pAkpsrz1FbT9k3H6dWQLoxBA8ykPnX2f+irL8WGjbsnwgVlmF07qvK+q/8swUAj7v ZHY9DENte2uZ9LU8egyadidX9nxz993qAdd2omsnsWQmHy8lEvXQeU2BaiBiKdp2k0 CDyoPqHq/97dVaOo3l3foaNvK1vG8Wn1hK2nGALSU+RpBfH7BPJlOYi9sxaq4rJNUr uCS6ocuZZQp+0c+06iH6fo3AasnsZzh79lS7nyB9HLu/2pWO6FK0EugOJqN7bjIil3 T5Grpy+t8oOQR17rOQ+qHGt/4bGDFfz3iPfyGztXVpwgdzffGDnzynA5zBb9EhkQVe Cn7NzHi8SWilw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 07/15] ASoC: madera: Fix event generation for OUT1 demux Date: Thu, 14 Jul 2022 00:25:32 -0400 Message-Id: <20220714042541.282175-7-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042541.282175-1-sashal@kernel.org> References: <20220714042541.282175-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Sasha Levin , alsa-devel@alsa-project.org, Charles Keepax , patches@opensource.cirrus.com, tiwai@suse.com, lgirdwood@gmail.com, rf@opensource.cirrus.com, Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Charles Keepax [ Upstream commit e3cabbef3db8269207a6b8808f510137669f8deb ] madera_out1_demux_put returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/madera.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c index 680f31a6493a..a74c9b28368b 100644 --- a/sound/soc/codecs/madera.c +++ b/sound/soc/codecs/madera.c @@ -618,7 +618,13 @@ int madera_out1_demux_put(struct snd_kcontrol *kcontrol, end: snd_soc_dapm_mutex_unlock(dapm); - return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); + ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); + if (ret < 0) { + dev_err(madera->dev, "Failed to update demux power state: %d\n", ret); + return ret; + } + + return change; } EXPORT_SYMBOL_GPL(madera_out1_demux_put); -- 2.35.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 1D1BFCCA486 for ; Thu, 14 Jul 2022 04:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237124AbiGNEes (ORCPT ); Thu, 14 Jul 2022 00:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237030AbiGNEd2 (ORCPT ); Thu, 14 Jul 2022 00:33:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE9D23A4AF; Wed, 13 Jul 2022 21:25:59 -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 39A8BB8237C; Thu, 14 Jul 2022 04:25:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF85DC341CD; Thu, 14 Jul 2022 04:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772756; bh=qkcI0ibRvlGXIrDjkDBd+8nMkl5CVlAV+udAK+KaoWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pAkpsrz1FbT9k3H6dWQLoxBA8ykPnX2f+irL8WGjbsnwgVlmF07qvK+q/8swUAj7v ZHY9DENte2uZ9LU8egyadidX9nxz993qAdd2omsnsWQmHy8lEvXQeU2BaiBiKdp2k0 CDyoPqHq/97dVaOo3l3foaNvK1vG8Wn1hK2nGALSU+RpBfH7BPJlOYi9sxaq4rJNUr uCS6ocuZZQp+0c+06iH6fo3AasnsZzh79lS7nyB9HLu/2pWO6FK0EugOJqN7bjIil3 T5Grpy+t8oOQR17rOQ+qHGt/4bGDFfz3iPfyGztXVpwgdzffGDnzynA5zBb9EhkQVe Cn7NzHi8SWilw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Charles Keepax , Mark Brown , Sasha Levin , rf@opensource.cirrus.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, patches@opensource.cirrus.com Subject: [PATCH AUTOSEL 5.10 07/15] ASoC: madera: Fix event generation for OUT1 demux Date: Thu, 14 Jul 2022 00:25:32 -0400 Message-Id: <20220714042541.282175-7-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042541.282175-1-sashal@kernel.org> References: <20220714042541.282175-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Charles Keepax [ Upstream commit e3cabbef3db8269207a6b8808f510137669f8deb ] madera_out1_demux_put returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/madera.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c index 680f31a6493a..a74c9b28368b 100644 --- a/sound/soc/codecs/madera.c +++ b/sound/soc/codecs/madera.c @@ -618,7 +618,13 @@ int madera_out1_demux_put(struct snd_kcontrol *kcontrol, end: snd_soc_dapm_mutex_unlock(dapm); - return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); + ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); + if (ret < 0) { + dev_err(madera->dev, "Failed to update demux power state: %d\n", ret); + return ret; + } + + return change; } EXPORT_SYMBOL_GPL(madera_out1_demux_put); -- 2.35.1