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 EBD14C433EF for ; Tue, 28 Jun 2022 15:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347920AbiF1PeX (ORCPT ); Tue, 28 Jun 2022 11:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347897AbiF1PeT (ORCPT ); Tue, 28 Jun 2022 11:34:19 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 015732C656 for ; Tue, 28 Jun 2022 08:34:18 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25SAsNkX030341; Tue, 28 Jun 2022 10:34:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=qyhaVfHovcvNFUdPfDSz8auM/k6b9qsac5a7Z/E95V4=; b=UJqV8ldOTGgfeQEjFYWJ47AqgEe9XvT33xyITVNJSRFRa4C90Ys1AGdMG0thCDuacLRo h+BcUhP6rv6/zhNS6hFqZSinFFUDDWNY665PtwBUam505dgSufanKawtUfZ3yy61k/3A mZNHS/C0AIjjNaHSMB0afmjcgf2yunMy+PPq4/ykY+0CR/08jLvELDpWJcfaySaJbj+Q D1EY0UF1nXk/ANbSk9t4j/XriHJvTr49fBLUMv3Ur6EByM4ywaOZr/rq6KH57Pfk3ev2 MTO49/olZpCpJ9LP6wguenitfcD32AwBaYSokVuSJ6pHqYs11KW+CAvqxf+Kwa8VXfNc aQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3gwxsq437w-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 28 Jun 2022 10:34:11 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 28 Jun 2022 16:34:09 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Tue, 28 Jun 2022 16:34:09 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 4F36A11D1; Tue, 28 Jun 2022 15:34:09 +0000 (UTC) From: Charles Keepax To: CC: , , , Subject: [PATCH 3/4] ASoC: cs47l92: Fix event generation for OUT1 demux Date: Tue, 28 Jun 2022 16:34:08 +0100 Message-ID: <20220628153409.3266932-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220628153409.3266932-1-ckeepax@opensource.cirrus.com> References: <20220628153409.3266932-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: BDhhhikloElbRkz4LhSBnEMk8uGmNTpk X-Proofpoint-ORIG-GUID: BDhhhikloElbRkz4LhSBnEMk8uGmNTpk X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cs47l92_put_demux 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 --- sound/soc/codecs/cs47l92.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs47l92.c b/sound/soc/codecs/cs47l92.c index a1b8dcdb9f7b7..444026b7d54b3 100644 --- a/sound/soc/codecs/cs47l92.c +++ b/sound/soc/codecs/cs47l92.c @@ -119,7 +119,13 @@ static int cs47l92_put_demux(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; } static SOC_ENUM_SINGLE_DECL(cs47l92_outdemux_enum, -- 2.30.2