Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4081870iog; Tue, 28 Jun 2022 08:36:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s5iHYKk9eYDpJaO1xlSeI8c8ao4uFD7bvi1dzFL558ZWd6TrnN/qE6Gfq5NQExL792OVQ8 X-Received: by 2002:a05:6402:1e94:b0:435:b3ca:148e with SMTP id f20-20020a0564021e9400b00435b3ca148emr24102904edf.356.1656430590656; Tue, 28 Jun 2022 08:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656430590; cv=none; d=google.com; s=arc-20160816; b=JEUA0LjdFxHB1n4mb0tFeLQuZW/tPJyN9mKUYlwQPyI0LW34XIJqu/ABxMXI6DgXM5 tZfdkyUpNw+IXYXz2OvdwoFyHjySMQyyJlsShXPStQkQU7Foyn2py9BZvMDecSDxnH1B Q26vQ/hLRtDfnVfXxq5yObk28iB4Mcn95jPDgrmmu9XyZdZF/bxU9I+nWyozL2MrzIul b9PPL3sg0RAGxZMPxz6/umjtD6hAcenWYNvZOsnLi7ANk3cn0v7uVUonIPJ7HGhVe6iq KRH1zKgfRt8PXxIbyWqevkMNcIqsEuwEu+JNlJARs7RpRghKPRlpHdGtRqTVhEVhIdri QIfQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qyhaVfHovcvNFUdPfDSz8auM/k6b9qsac5a7Z/E95V4=; b=f144VEtxhHa/b9mqWGH7qpFiLgyC+/1EF2ey/5VJwFB+xeA+2lqSfxgLxwjRyFNxP8 IlMtf5e9HaMoYMqkhtR2N8iQtMU+a6adQV/L/KHL4fQCwz9Es/YJ7AGy0EPD+4bZRymX 4BrKy/STOAa4U5iwis9lJBklQi1QyxKHN+bMOBQ5tOwXVV4kHV1krBm9NKnLZI/xx6sc w1mv4dyJalGrDBsMNNX2YErOhohvIiR6Mfv0VuWyAK81GRIhRwzrRnXBdMp3LwKwF2Cu b0L261mqVv/ZWpP2AZ/0E0YMS/4Q2+EvKUdqE+TYJ8pqipwCsKaKtsqSFppZjlVzgfAo unNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=UJqV8ldO; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ej27-20020a056402369b00b00434fff6fe37si13339459edb.227.2022.06.28.08.36.04; Tue, 28 Jun 2022 08:36:30 -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=@cirrus.com header.s=PODMain02222019 header.b=UJqV8ldO; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347892AbiF1PeX (ORCPT + 99 others); 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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 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