Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4373880imw; Tue, 19 Jul 2022 05:34:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tFY6sPmrvb0o+yxv8u33cK/ndDzjIqw89s597RewvVEyVrieOVWkiNAqYOnrLhO8iLx8Nz X-Received: by 2002:a17:906:5a6c:b0:72b:561a:3458 with SMTP id my44-20020a1709065a6c00b0072b561a3458mr30826808ejc.114.1658234085727; Tue, 19 Jul 2022 05:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658234085; cv=none; d=google.com; s=arc-20160816; b=f4lvz1wSBEjhK6kEKbwSRHcqPh4W8OVZvwH7a0XugCn4i+/wKSRVEYc/9DOSw63NZG /bAOVxfRsq8TgB+dIdNIgnNWPGPElrhEyZmz6SSKYsFJQww/F1TFGdnfRGszSbnXhQ2M 1sHSTkzrYmWMIG65BSlhMxEugAc9RWEfpwz4qy9dPQWG1JUkVHzDLhajc+xYA4OSF9n0 wym7buKicHfeMtc3TINmlT8PVRvtrhDxsDYOmq8+mV66tAb1pQ6Xbj9VvzjPjg2qWBl+ SOEapao0+rlIULbE3iX4VWMljhj1ksEE3Tgcw1haRasRxqHCXm6TDO1HxrNR50T+wn0j aORg== 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=IdKeu0sd5Muw0wrDc+SIq1WA8mzqyxkqCv7aqFneHWU=; b=eYZwuAtz9MGKFixFA5FKpNeevTowPSQ9Q9dBpdOafi+6AaIeKTzIfqk7L0fF5mmkuO 69qFepmxOZFnM1NDf3Yu634mU0IgI85V1Xc7GXhAypN3IJKoLJmiZNC0bOwre3mICYW9 SRliFPLt0vuFUnVzWUUT7gw6EANzgUpIxwV+O1bxiPe3D85P2WJODptb5B1Spixklbla AF6sHVKMDdWR+6fe5MmqlQk4FGNjpq8QLe3ko2/pF64qRrJCKfFxqZ9cNIOlwb+izJg9 1riFmtZeplhZD6O+li+tlv2qBSAfbC55rdvAsNiEz6PreSy7L8cSxyFdAonpNrpSevon Zkew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iQGIXaCx; 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 l11-20020a056402254b00b0043ad7ac3be3si20234697edb.543.2022.07.19.05.34.18; Tue, 19 Jul 2022 05:34:45 -0700 (PDT) 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=iQGIXaCx; 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 S240097AbiGSM1V (ORCPT + 99 others); Tue, 19 Jul 2022 08:27:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239761AbiGSMZf (ORCPT ); Tue, 19 Jul 2022 08:25:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8834509F6; Tue, 19 Jul 2022 05:09:57 -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 66083B81B2E; Tue, 19 Jul 2022 12:09:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7F3FC341C6; Tue, 19 Jul 2022 12:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232596; bh=qkcI0ibRvlGXIrDjkDBd+8nMkl5CVlAV+udAK+KaoWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iQGIXaCx/jrYi65MGaILnCsz0tCvFpldAPFUR/gL9E0wlCrD2GdYBCkXkjWJBdWhj +pgIsYcPUf/P63A3iYBDab1NrG4YMh5JRu5f5TgyLrKz80idxz7NzzbDb/T3MfZxao SCqP4WrakFZJp9u+3vaT9Ayuvzv5xoUuzXcK3DD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.10 094/112] ASoC: madera: Fix event generation for OUT1 demux Date: Tue, 19 Jul 2022 13:54:27 +0200 Message-Id: <20220719114635.881124227@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@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.8 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 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: 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