From patchwork Tue Sep 19 10:31:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13391138 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 F0E00CD54B2 for ; Tue, 19 Sep 2023 10:34:19 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CAE7FE7F; Tue, 19 Sep 2023 12:33:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CAE7FE7F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695119657; bh=l09yDGcnzXEeClNs/xS4QqbqsXVO9LM/UmCa6wNknfA=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=nqBhLPx0TWBAbuIV/khuA9X1Nw/F14DCHN5L2xzIJljS7ZgwVgWSDqts6gYjXrPVf kt7XPxkGCnKUvsQYvRbhs1vUXjIccvIblLJ8VKW0pERo83SEzPgvlAjHruIM61jaoy Yua+bvCEYtS4e9/T/GwOnNaJB5httPp1mdvWeLwY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8EE80F805C0; Tue, 19 Sep 2023 12:31:46 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 230D5F805C1; Tue, 19 Sep 2023 12:31:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 32CE2F805B4; Tue, 19 Sep 2023 12:31:40 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E1D56F80551 for ; Tue, 19 Sep 2023 12:31:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E1D56F80551 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=dVKV51Ha Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38J4RRCa031661; Tue, 19 Sep 2023 05:31:19 -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=ny+kWn1OMlivpfvutLz7uBLYoUEzNwaJVd7DQn728FU=; b= dVKV51Havk5/WNH/QT+i0Vnpw9LMTidMz8S21LCVuuyuDgAZl54feif4sUlfc0T7 xM3CMZPE3a4EhHX1AZPZj+MACubTZJLaHrN0WIXOYoaZxeUw7wvDVjFQyU53CSX0 Mm/iKKB2FkqgXqrXOytr4JgVRIcHT/+ncgQ6mrfBjT2xfUcvTFtqr1Uh8xuUjW58 cNu5LEQ75vNmPi3FGVjbOY/9T3ZF1U1XbuWjSkOUqz5fMrHK6+XkKKmUrI97fSXE Ea9AXn5hfgfIF2N3OCG8ZfEgdeko6TQQGG6tx/3FB52ARKzDMjsXfl2Twqu4LF+e OqTse3kp9QX2K5aw66QTqg== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3t59ry3p1h-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 05:31:19 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Tue, 19 Sep 2023 11:31:16 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Tue, 19 Sep 2023 11:31:16 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 594983563; Tue, 19 Sep 2023 10:31:16 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 1/5] dt-bindings: ASoC: cirrus,cs42l43: Update a couple of default values Date: Tue, 19 Sep 2023 11:31:12 +0100 Message-ID: <20230919103116.580305-2-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> References: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: adsKyA2nt2mWX-skmmLzAT8VMQg0zPlt X-Proofpoint-ORIG-GUID: adsKyA2nt2mWX-skmmLzAT8VMQg0zPlt X-Proofpoint-Spam-Reason: safe Message-ID-Hash: SSYKCCKP2MR7FDBGX7HAUUJSQWE2TQBS X-Message-ID-Hash: SSYKCCKP2MR7FDBGX7HAUUJSQWE2TQBS X-MailFrom: prvs=4626caf035=ckeepax@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The bias sense is being enabled by default in the driver, and the default detect time is being dropped slightly. Update the binding document to match. Signed-off-by: Charles Keepax Acked-by: Rob Herring --- Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml b/Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml index 7a6de938b11d1..4fa22fa70ace5 100644 --- a/Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml +++ b/Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml @@ -83,7 +83,7 @@ properties: Current at which the headset micbias sense clamp will engage, 0 to disable. enum: [ 0, 14, 23, 41, 50, 60, 68, 86, 95 ] - default: 0 + default: 14 cirrus,bias-ramp-ms: description: @@ -97,7 +97,7 @@ properties: Time in microseconds the type detection will run for. Long values will cause more audible effects, but give more accurate detection. enum: [ 20, 100, 1000, 10000, 50000, 75000, 100000, 200000 ] - default: 10000 + default: 1000 cirrus,button-automute: type: boolean From patchwork Tue Sep 19 10:31:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13391157 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 1441FCD54AF for ; Tue, 19 Sep 2023 10:35:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3CE3BE91; Tue, 19 Sep 2023 12:34:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3CE3BE91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695119730; bh=6F4ggMJ1W0fTmojN6EFM4umQJ1WShp6yjsPysO+2JKw=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=W7CSkRszoomFkMbG2AX7x3s14nKFFKLstvIhlBT5AGQhHEtOg+s1WICBmWJRj+pOL o5f3ey4CZodx3sMbVTv1OEqnG3/aKW4Lvee84WVRY4mil9qPJU4hdbbavOECV5tZVL iThISikcOX2+DMr/lMFuJUOSzpy/MMIt5eq6/zA0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44453F805F7; Tue, 19 Sep 2023 12:31:58 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CB3BDF805F9; Tue, 19 Sep 2023 12:31:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 973F2F805BE; Tue, 19 Sep 2023 12:31:45 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C89F1F80494 for ; Tue, 19 Sep 2023 12:31:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C89F1F80494 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=gj0IaAdg Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38J4KMBx022193; Tue, 19 Sep 2023 05:31:18 -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=XWaDlUm1G2+lS5Ldj7tMDOZUpoSf6T1n5pH2Bcq1VbM=; b= gj0IaAdgfDJwXjEaX/MNjQEs6BVcWvypoLElxQRWDKIo+5ksxEsmxbWXMXloamot bRyBA0owMAMuYcIC9tePcnFBTOBQXf6ldA50X3CsEhbKlVGHb8xr0NyIFv2o1u+y 5fY0cSrAP2Yb5ovcGGD+VUp6k1bgGBkoOKbJBSSLHTMQq3BZywpciAq2QD4ADZV+ TCEa2h4SA+qTTYbXsWxD4ZVrS48i3XLvh0GufePH5P3mvwUAZbjDIwjiQcuulcGL jzLLTDUoi+izjgkHcLaAJe34k3NYbvmuAR5VBg0AES4jVS3LttLRsGqswff4mYq0 4/yT6voj0ACNHuwBLZusUw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3t59ry3p1j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 05:31:18 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Tue, 19 Sep 2023 11:31:16 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Tue, 19 Sep 2023 11:31:16 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 687AA11AB; Tue, 19 Sep 2023 10:31:16 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 2/5] ASoC: cs42l43: Lower default type detect time Date: Tue, 19 Sep 2023 11:31:13 +0100 Message-ID: <20230919103116.580305-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> References: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: Vb5_nkygpPqi3BLsPa2oIiMbceG1AAnS X-Proofpoint-ORIG-GUID: Vb5_nkygpPqi3BLsPa2oIiMbceG1AAnS X-Proofpoint-Spam-Reason: safe Message-ID-Hash: TEQGGNVOLV65CPGWSG4HDUK3ISJELLIT X-Message-ID-Hash: TEQGGNVOLV65CPGWSG4HDUK3ISJELLIT X-MailFrom: prvs=4626caf035=ckeepax@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The current default is a little excessive, reduce the pop on insertion by reducing the time a little. The new value of 1000uS is still pretty conservative. Signed-off-by: Charles Keepax --- sound/soc/codecs/cs42l43-jack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs42l43-jack.c b/sound/soc/codecs/cs42l43-jack.c index 92e37bc1df9dc..7008e50eded96 100644 --- a/sound/soc/codecs/cs42l43-jack.c +++ b/sound/soc/codecs/cs42l43-jack.c @@ -110,7 +110,7 @@ int cs42l43_set_jack(struct snd_soc_component *component, priv->buttons[3] = 735; } - ret = cs42l43_find_index(priv, "cirrus,detect-us", 10000, &priv->detect_us, + ret = cs42l43_find_index(priv, "cirrus,detect-us", 1000, &priv->detect_us, cs42l43_accdet_us, ARRAY_SIZE(cs42l43_accdet_us)); if (ret < 0) goto error; From patchwork Tue Sep 19 10:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13391154 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 C268ACD54AF for ; Tue, 19 Sep 2023 10:34:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2DD37E97; Tue, 19 Sep 2023 12:33:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2DD37E97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695119682; bh=zCHigkz5qOmu6rN79FyQw65XeVR/xpE7sBdujr8tkVc=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eW/MEEnz281ZnVbVhphMmEtA/W1vLqfUQPu/WBHOdy/tq2ZXPetni+qJNq2O1K+k6 qXaoz526fcnA6eBChOXO4X/qIuEeSbiFYPJJbx5yce4dLOEDjSg3U2MPlBp0khLVxg bAbOpN9BQXcbku/SWbU+fKIkJoasdnuzjwyrIROU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 724CCF805CB; Tue, 19 Sep 2023 12:31:51 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D23CDF805C9; Tue, 19 Sep 2023 12:31:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BF983F8055A; Tue, 19 Sep 2023 12:31:41 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0381DF8047D for ; Tue, 19 Sep 2023 12:31:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0381DF8047D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=iZPbnpn2 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38J4KMC1022193; Tue, 19 Sep 2023 05:31:20 -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=MbOsx33jbJnId1a0yXiSgaIvJzBImpYmPhK8ywUm6mE=; b= iZPbnpn2LtAtBzFPymC+b0xXoKy46tWczjE36zRaO7kKIF0uDC3IbHTRTYF7MltF z7Um84RLthPa6T48jYqweFK5t1ivVTDZ79ZzNpcm1fmkrmp/JLTeZgEzW/+2GX5B Ho6Zq9TzTqY65Ob6D1Y9LmkkhKg9nB9Xp1Zsj+rg4JoSumdzuMhnQDm00L5722U1 /TYm47D4/eXelP236gxtL/jluDS329O7jxRwtcQfcdwY2GEWBOBzOFslZXCAwERh sLWQ0L7x/V3V7xQ93r3HM6kMlZgHazCGsqo0QPMwzn/uFbnUE8cRpPNrZh1PM48J ThK+wwGURS8c7abuVvfqMQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3t59ry3p1j-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 05:31:20 -0500 (CDT) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Tue, 19 Sep 2023 11:31:16 +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.2.1118.37 via Frontend Transport; Tue, 19 Sep 2023 11:31:16 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 77FEC3575; Tue, 19 Sep 2023 10:31:16 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 3/5] ASoC: cs42l43: Enable bias sense by default Date: Tue, 19 Sep 2023 11:31:14 +0100 Message-ID: <20230919103116.580305-4-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> References: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: E7BJ5zT0d4cvrFZhzOkZSQth-GatEada X-Proofpoint-ORIG-GUID: E7BJ5zT0d4cvrFZhzOkZSQth-GatEada X-Proofpoint-Spam-Reason: safe Message-ID-Hash: HTELTYBQZT5BH77S2IWFYBWBV62LMEPD X-Message-ID-Hash: HTELTYBQZT5BH77S2IWFYBWBV62LMEPD X-MailFrom: prvs=4626caf035=ckeepax@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Improve the default pop performance on jack removal by enabling bias sense on the least sensitive level by default. Signed-off-by: Charles Keepax --- sound/soc/codecs/cs42l43-jack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs42l43-jack.c b/sound/soc/codecs/cs42l43-jack.c index 7008e50eded96..7bd7cc1779506 100644 --- a/sound/soc/codecs/cs42l43-jack.c +++ b/sound/soc/codecs/cs42l43-jack.c @@ -127,7 +127,7 @@ int cs42l43_set_jack(struct snd_soc_component *component, hs2 |= ret << CS42L43_HSBIAS_RAMP_SHIFT; - ret = cs42l43_find_index(priv, "cirrus,bias-sense-microamp", 0, + ret = cs42l43_find_index(priv, "cirrus,bias-sense-microamp", 14, &priv->bias_sense_ua, cs42l43_accdet_bias_sense, ARRAY_SIZE(cs42l43_accdet_bias_sense)); if (ret < 0) From patchwork Tue Sep 19 10:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13391155 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 EB73ECD54AF for ; Tue, 19 Sep 2023 10:35:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1F667E8B; Tue, 19 Sep 2023 12:34:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1F667E8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695119699; bh=oNIfn8PTiNAtFaKe2i09mRBXultjqQqs6Kem5Nb7VTo=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fVcHafaZXTR+ZIS3wu2fZ9seNA8LXrjBY6h7YI0aHLYQtxNh8ALNAKmG9r5kFm20p g/NBGw2Kr+Mc5BdQaPtejBb1zMyLtpN4k8OXLc5WVsog/rjVtkSbodi6jb8UwnKfNI 7oKwlkR55yraeWq2HBKko9sGKQ0eXCBjzZRz8Qv4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 47543F805E6; Tue, 19 Sep 2023 12:31:54 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id AC64CF805E5; Tue, 19 Sep 2023 12:31:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3F7D4F80558; Tue, 19 Sep 2023 12:31:43 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F052EF80552 for ; Tue, 19 Sep 2023 12:31:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F052EF80552 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=ofYTe7h0 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38J4KMC0022193; Tue, 19 Sep 2023 05:31:19 -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=MiZQzycTDUQoJWH55mk/Jeqxw7RC6OuM/QCFkp1lvYU=; b= ofYTe7h0Iz2s217vf/cFglEOqScUeaG/FAONW3+oIEytwMsSJsMjRqvospiD+uma nss+dhKwXY50LpzYkHf3P1CVy7YynEJ1yiWduqHwfF7LqEtWRubPuQpzJXbHveW8 V2/54xODHTrHvTwmTrIAAmEW8jy/9JE5vcc/0dUzeaF5R9EHTNeImHUe5Qx74Qmw sY+qFXOu6Lh8aZboXB3vvLQ2nEn8nXwYoRG0OKoghXBJ6uSFPoJ2Q4h0s8JJfDDL /crGOD9j5SxmN58LLpfCe00/kxCpWf1ss/0+AGR8by1t6SSTKW+qHqmfHPu6ykTV 9eKiBl1t3xEzdLfW6sOzIw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3t59ry3p1j-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 05:31:19 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Tue, 19 Sep 2023 11:31:16 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Tue, 19 Sep 2023 11:31:16 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 8922F11AA; Tue, 19 Sep 2023 10:31:16 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 4/5] ASoC: cs42l43: Move headset bias sense enable earlier in process Date: Tue, 19 Sep 2023 11:31:15 +0100 Message-ID: <20230919103116.580305-5-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> References: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: Y1BOLuZk31NAxN4HfatWPb8P8N_FcpLZ X-Proofpoint-ORIG-GUID: Y1BOLuZk31NAxN4HfatWPb8P8N_FcpLZ X-Proofpoint-Spam-Reason: safe Message-ID-Hash: X4YQ5ZQ76KQENHR2NAKE62UL3KEP5V4O X-Message-ID-Hash: X4YQ5ZQ76KQENHR2NAKE62UL3KEP5V4O X-MailFrom: prvs=4626caf035=ckeepax@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Currently the bias sense is enabled along with the button detect, but this has two problems. Firstly, the detections themselves arn't covered by the bias sense, potentially resulting in pops and secondly, the sequence of enabling/disabling looks like: enable bias enable bias sense disable bias sense disable bias When the bias sense is disabled but the bias is still on the clamp is removed and a pop results. Fix both of these issues by moving the bias sense enable/disable to be along with the bias itself. With a resulting sequence of: enable bias sense enable bias disable bias disable bias sense Signed-off-by: Charles Keepax --- sound/soc/codecs/cs42l43-jack.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/soc/codecs/cs42l43-jack.c b/sound/soc/codecs/cs42l43-jack.c index 7bd7cc1779506..66923cf2fdaff 100644 --- a/sound/soc/codecs/cs42l43-jack.c +++ b/sound/soc/codecs/cs42l43-jack.c @@ -250,6 +250,15 @@ static void cs42l43_start_hs_bias(struct cs42l43_codec *priv, bool force_high) if (!force_high && priv->bias_low) val = 0x2 << CS42L43_HSBIAS_MODE_SHIFT; + if (priv->bias_sense_ua) { + regmap_update_bits(cs42l43->regmap, + CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL, + CS42L43_HSBIAS_SENSE_EN_MASK | + CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK, + CS42L43_HSBIAS_SENSE_EN_MASK | + CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK); + } + regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, CS42L43_HSBIAS_MODE_MASK, val); @@ -267,6 +276,13 @@ static void cs42l43_stop_hs_bias(struct cs42l43_codec *priv) regmap_update_bits(cs42l43->regmap, CS42L43_HS2, CS42L43_HS_CLAMP_DISABLE_MASK, 0); + + if (priv->bias_sense_ua) { + regmap_update_bits(cs42l43->regmap, + CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL, + CS42L43_HSBIAS_SENSE_EN_MASK | + CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK, 0); + } } irqreturn_t cs42l43_bias_detect_clamp(int irq, void *data) @@ -318,15 +334,6 @@ static void cs42l43_start_button_detect(struct cs42l43_codec *priv) regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, CS42L43_BUTTON_DETECT_MODE_MASK | CS42L43_MIC_LVL_DET_DISABLE_MASK, val); - - if (priv->bias_sense_ua) { - regmap_update_bits(cs42l43->regmap, - CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL, - CS42L43_HSBIAS_SENSE_EN_MASK | - CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK, - CS42L43_HSBIAS_SENSE_EN_MASK | - CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK); - } } static void cs42l43_stop_button_detect(struct cs42l43_codec *priv) @@ -335,13 +342,6 @@ static void cs42l43_stop_button_detect(struct cs42l43_codec *priv) dev_dbg(priv->dev, "Stop button detect\n"); - if (priv->bias_sense_ua) { - regmap_update_bits(cs42l43->regmap, - CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL, - CS42L43_HSBIAS_SENSE_EN_MASK | - CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK, 0); - } - regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, CS42L43_BUTTON_DETECT_MODE_MASK | CS42L43_MIC_LVL_DET_DISABLE_MASK, From patchwork Tue Sep 19 10:31:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13391139 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 D5F47CD54B0 for ; Tue, 19 Sep 2023 10:34:26 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 35372AE8; Tue, 19 Sep 2023 12:33:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 35372AE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695119665; bh=TBV7VBlbSg+AyI9gJvcQKM0umpAUUUn/foxc0duA4lM=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qyoLzAA2Okuo2xISsEB9m/ySCnB/RUF09eDuDakglUESqDVWesND1JJli8DEhF2CF xiGobikcFzYkDYtu+sTCOqaDi+0Lqz3Xl8+w6iGVCRlxaGcId2auRdnIVD+y62Lm7Z ztTwuLS7H5GN/t+u6NUceqLL8xCqY5LB5bBjdhr8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8957FF805D2; Tue, 19 Sep 2023 12:31:48 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id F0B1AF805C8; Tue, 19 Sep 2023 12:31:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F0BDCF805A1; Tue, 19 Sep 2023 12:31:40 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0C0DAF80558 for ; Tue, 19 Sep 2023 12:31:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0C0DAF80558 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=q+X/DsTj Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38J4RRCb031661; Tue, 19 Sep 2023 05:31:20 -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=Owv3MGKxi43WD2sBuhitoE9k62iaoJnCTY7E9ZslEyc=; b= q+X/DsTjY0qdwFjSHgLivZRNEuPSlguJo7x6uRQ6ECsiu4QPFfqWrjtklP82gsIX 5p2zdlpZRVoLCdmCE96G71TIFLzBKQ0TRYvAyssYwS6Op2QIbbO1HDdp+WmP3gra oOWAUfqTUr2L/yS8tJWv7wn8C/RT61jKlerAwbPfclECAp/Dkg5j2Rko0hsP8TNf xzH/n8z5LO998/leyKpNkthpRugIG2n2UCHObDUGpHwAsXx0svpk1rHDiKKdgoiu VovEjXiNNlwGYBnD2xPaJ2f2Aanv9kI+hJ6zlZJbUH3r/U22iffUFxz5FAAPYWeb 51Tm6AQQhfBiqI1zYhxNzw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3t59ry3p1h-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 05:31:20 -0500 (CDT) 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_256_GCM_SHA384) id 15.2.1118.37; Tue, 19 Sep 2023 11:31:16 +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.2.1118.37 via Frontend Transport; Tue, 19 Sep 2023 11:31:16 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 97D92357E; Tue, 19 Sep 2023 10:31:16 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 5/5] ASoC: cs42l43: Extend timeout on bias sense timeout Date: Tue, 19 Sep 2023 11:31:16 +0100 Message-ID: <20230919103116.580305-6-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> References: <20230919103116.580305-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: TBnGqPNena2gfzHQHpLl-HTcDJpprhtk X-Proofpoint-ORIG-GUID: TBnGqPNena2gfzHQHpLl-HTcDJpprhtk X-Proofpoint-Spam-Reason: safe Message-ID-Hash: ZCILIU6PRIXCPQDE4KS76J3RW37FUPL2 X-Message-ID-Hash: ZCILIU6PRIXCPQDE4KS76J3RW37FUPL2 X-MailFrom: prvs=4626caf035=ckeepax@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: For very slow removals the current bias sense timeout is sometimes too short and unclamps the mic bias before the jack removal is properly detected by the tip detect, causing a pop. As bias sense should be tuned to deliver very few false positives, increase the timeout fairly dramatically to cover all but the most exaggerated removals. Signed-off-by: Charles Keepax --- sound/soc/codecs/cs42l43-jack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs42l43-jack.c b/sound/soc/codecs/cs42l43-jack.c index 66923cf2fdaff..861f9ee671cdf 100644 --- a/sound/soc/codecs/cs42l43-jack.c +++ b/sound/soc/codecs/cs42l43-jack.c @@ -290,7 +290,7 @@ irqreturn_t cs42l43_bias_detect_clamp(int irq, void *data) struct cs42l43_codec *priv = data; queue_delayed_work(system_wq, &priv->bias_sense_timeout, - msecs_to_jiffies(250)); + msecs_to_jiffies(1000)); return IRQ_HANDLED; }