From patchwork Mon Aug 28 17:05:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Karpovich X-Patchwork-Id: 718635 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 922CAC83F12 for ; Tue, 29 Aug 2023 14:15:23 +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 BCD7684B; Tue, 29 Aug 2023 16:14:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BCD7684B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693318515; bh=x/M6ySU5jIZDMw4cSAlNzXgk2cE4qlTHPmrb3jfWZnE=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=EHwzpQ/i44Uv1QBHjC1KSuo21FoPcEXmtHOKk0NPfUbprTYc0/VgPxyqoyVb8J9G0 QDPCADlXnG69m/4VHD1Z0/IcJbnuHi94RFJxi1cfVYyV2oxjQzW9M0S/wihV0NfQZU o8jRJhy5+Ok4GvyCMQ7VUSQoctMdCcxMdZeRtktE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 287F7F80155; Tue, 29 Aug 2023 16:13:56 +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 38821F80158; Tue, 29 Aug 2023 16:13:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DF113F80249; Mon, 28 Aug 2023 19:05:54 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 3B72CF80074 for ; Mon, 28 Aug 2023 19:05:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3B72CF80074 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=e4tXq7cF Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 37SFnRVL031069; Mon, 28 Aug 2023 12:05:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=PODMain02222019; bh=u ykMzcWp3pYiVsOXdian8GV2w7tbBQSBO6upZ3H11QM=; b=e4tXq7cFDwRi/L7J6 DZ+HPtyZaysTuPBEF61BIjA/rpHTi5TeJoN0/IvIAKBmoxf4VzQQNfu1LSsF3zGw N8Zv2eTTgJhf56S9HzxJliQ4hVRB+vFrq3oxbxfFZg6IGLgwgYRNV+csg/u8uXbp wGrCgbibwzVu+Jb82UWdu3n2uO0p7RmxdsvmYte3Wodus0eaDiZtOuoBU5/Q4Eux rDCdOOofZ/HKSc/g0Xzofj7JaFQ8cYD/5/RaOlmAq0NkY0wH8EaY9wpexfBDd1w9 H2Y2yz99lpOkU1eQLOI2V64xB18sK/dhdz5Mj+0yF1fjizthn/zVpI0vZ8pfNoOg ow9yg== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3sqdtj2185-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 12:05:42 -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; Mon, 28 Aug 2023 18:05:41 +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; Mon, 28 Aug 2023 18:05:41 +0100 Received: from vkarpovich-ThinkStation-P620.crystal.cirrus.com (vkarpovich-ThinkStation-P620.ad.cirrus.com [141.131.145.49]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 03AB03561; Mon, 28 Aug 2023 17:05:38 +0000 (UTC) From: Vlad Karpovich To: James Schulman , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring CC: , , , , , Vlad Karpovich Subject: [PATCH 1/7] ASoC: cs35l45: Add support for Chip ID 0x35A460 Date: Mon, 28 Aug 2023 12:05:19 -0500 Message-ID: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: aQpetfLelSSChLiugsOYyd42XXhBaNpc X-Proofpoint-GUID: aQpetfLelSSChLiugsOYyd42XXhBaNpc X-Proofpoint-Spam-Reason: safe X-MailFrom: prvs=4604b61042=vkarpovi@opensource.cirrus.com X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: YY7X4ZXDDIL7OUUFSIPKLSUECUMP4MPI X-Message-ID-Hash: YY7X4ZXDDIL7OUUFSIPKLSUECUMP4MPI X-Mailman-Approved-At: Tue, 29 Aug 2023 14:13:52 +0000 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 0x35A460 chip is a different variant of the cs35l45. Signed-off-by: Vlad Karpovich --- sound/soc/codecs/cs35l45.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index 8f480df7f29a..7f116ae97acd 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -1078,6 +1078,7 @@ static int cs35l45_initialize(struct cs35l45_private *cs35l45) switch (dev_id[0]) { case 0x35A450: + case 0x35A460: break; default: dev_err(cs35l45->dev, "Bad DEVID 0x%x\n", dev_id[0]); From patchwork Mon Aug 28 17:05:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Karpovich X-Patchwork-Id: 718309 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 7503DC71153 for ; Tue, 29 Aug 2023 14:16:47 +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 E29DD827; Tue, 29 Aug 2023 16:15:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E29DD827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693318604; bh=wP/4aDIGlTZFXm1GvlTZYtz1Ue3yd2lDjEyGkbyzrQM=; 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=qTGnBqA0ZuhBF/+kA85T3eMkWwTj2WI4Dp5OA6RbnHxtHikkaMk1jedBs6GcvWR0r tDrpoTSdRfGxT4MD8DlJ04/rbG10E7M+Bubg48lsJTddWRZWq/SmXPtc74w9mCOWAf RXOkm8GDIA/9upoRWqDbB5lya1kKgfCGzxgAj9dM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BEAFDF805B4; Tue, 29 Aug 2023 16:14:10 +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 014FAF805B4; Tue, 29 Aug 2023 16:14:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2BC82F80249; Mon, 28 Aug 2023 19:06:07 +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 94227F80236 for ; Mon, 28 Aug 2023 19:05:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 94227F80236 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=AWdihRtS 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 37SF2s70001339; Mon, 28 Aug 2023 12:05:46 -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=p0uDxHTVZhy1LKhRC/uxf/uY5G2QFgt5d7SS4phu6gM=; b= AWdihRtSOJx8P6AhdZJNhpTWKE/U82hXnQy+uTqIcOmeKRvfcyCKnxXJIG8npV5X mX1V9Pbdg4BZMXDaXStjWm71IhXLdTztywAQg3aWZe8llwXBNbYmkzQHfEPqFYIS ZhCrkxSxMiV8AOy2TnXaKKBLqsXA37WWouUvAmrDoqycowy9SpTvnTZkEmt2E7WB KyCk4ueRfQSx6Wh2MV9wQCed///EczRkp1m3StfEMJ+QYsZtyNuhtPwqy1XGSf5x KpoWTm+0pqMBIoKZ04j+fPersA97LHzBr4R8dbizooLWCthicD1nKdVJ595iK3+n wuCBlilA3U+M2TPPIXN4RA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3sqesyae6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 12:05:45 -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; Mon, 28 Aug 2023 18:05:43 +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; Mon, 28 Aug 2023 18:05:43 +0100 Received: from vkarpovich-ThinkStation-P620.crystal.cirrus.com (vkarpovich-ThinkStation-P620.ad.cirrus.com [141.131.145.49]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 4A17011D4; Mon, 28 Aug 2023 17:05:41 +0000 (UTC) From: Vlad Karpovich To: James Schulman , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring CC: , , , , , Vlad Karpovich Subject: [PATCH 2/7] ASoC: cs35l45: Fix "Dead assigment" warning Date: Mon, 28 Aug 2023 12:05:20 -0500 Message-ID: <20230828170525.335671-2-vkarpovi@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> References: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: mYSFR0Zpbqd4aySKef392mOgtTgWBlTh X-Proofpoint-GUID: mYSFR0Zpbqd4aySKef392mOgtTgWBlTh X-Proofpoint-Spam-Reason: safe X-MailFrom: prvs=4604b61042=vkarpovi@opensource.cirrus.com X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: FE6HMIPVRQVFZZSILOME7WQUEZM6RRZY X-Message-ID-Hash: FE6HMIPVRQVFZZSILOME7WQUEZM6RRZY X-Mailman-Approved-At: Tue, 29 Aug 2023 14:13:53 +0000 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: Value stored to 'ret' is never read. Remove it. Signed-off-by: Vlad Karpovich Acked-by: Charles Keepax --- sound/soc/codecs/cs35l45.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index 7f116ae97acd..40fb64904260 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -969,7 +969,7 @@ static irqreturn_t cs35l45_dsp_virt2_mbox_cb(int irq, void *data) ret = regmap_read(cs35l45->regmap, CS35L45_DSP_VIRT2_MBOX_3, &mbox_val); if (!ret && mbox_val) - ret = cs35l45_dsp_virt2_mbox3_irq_handle(cs35l45, mbox_val & CS35L45_MBOX3_CMD_MASK, + cs35l45_dsp_virt2_mbox3_irq_handle(cs35l45, mbox_val & CS35L45_MBOX3_CMD_MASK, (mbox_val & CS35L45_MBOX3_DATA_MASK) >> CS35L45_MBOX3_DATA_SHIFT); /* Handle DSP trace log IRQ */ From patchwork Mon Aug 28 17:05:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Karpovich X-Patchwork-Id: 718311 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 60790C83F12 for ; Tue, 29 Aug 2023 14:15:40 +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 1ABF2A4A; Tue, 29 Aug 2023 16:14:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1ABF2A4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693318538; bh=9VAF3+1261gN9MM0SOp8Lnoh/Y71IVn9ZdHX5US5P20=; 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=YrLbHOffLcJaYLH63Dj01BngQBtN/+pYrK4arIofvgBX1m4bSnw/WuXFhMci+8era /lAFMYlRmfFlWOWDd9EfvScxomrRZRjSIngA4Jjt3E2HOVkRQOZW6InmLXaEzTWFPb MHIzQAsY9EXpJ7JkWeWxvN5Cq9IC3GH7DztLkNcE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 714D4F80536; Tue, 29 Aug 2023 16:13: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 AB01FF8055A; Tue, 29 Aug 2023 16:13:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8B244F80249; Mon, 28 Aug 2023 19:05:56 +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 DBE51F80155 for ; Mon, 28 Aug 2023 19:05:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DBE51F80155 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=o7lFohVX 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 37SF3RKM001527; Mon, 28 Aug 2023 12:05:48 -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=1K7XdmDHh0xz7TpE3lzKGlocX1TExBJDy839St96yLs=; b= o7lFohVXlz0GE1Ki4Gv+yoxFTtnm884TBuIvGrOxnUmfWtMbD4+Fv3nd2MrJNCUP RsWzejBaK8VyGT77JlcIBwUkBxLDV+3VWkhYZOU1Dsz28/7xyVSvS9TpeawfJube nJTcEc28DqfSH5HC2Jt45Sy5Mz8/JOtsxTveeyb1NrjGtCeW5ou15vD6xzQJq6aV 68Z89Ems/hJ0wfuzdUGjOq1+VhcN71wSQP3tzpMuiFaqiNpfkfOyaVoHlD9mkKeY kq6FF4mbJTPOBhjWnXAy3aw3dGuaHKDJ3TmZpB0NZ+1pXapfnvZWoM8OBKyic1QQ muK4QD3k4Db+9iODWbcRgw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3sqesyae6v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 12:05:47 -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; Mon, 28 Aug 2023 18:05:45 +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; Mon, 28 Aug 2023 18:05:45 +0100 Received: from vkarpovich-ThinkStation-P620.crystal.cirrus.com (vkarpovich-ThinkStation-P620.ad.cirrus.com [141.131.145.49]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 9803711D4; Mon, 28 Aug 2023 17:05:43 +0000 (UTC) From: Vlad Karpovich To: James Schulman , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring CC: , , , , , Vlad Karpovich , Ricardo Rivera-Matos Subject: [PATCH 3/7] ASoC: cs35l45: Checks index of cs35l45_irqs[] Date: Mon, 28 Aug 2023 12:05:21 -0500 Message-ID: <20230828170525.335671-3-vkarpovi@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> References: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: wsLEp0sPU1UosyUbVW3CauHt1Ldlwl7o X-Proofpoint-GUID: wsLEp0sPU1UosyUbVW3CauHt1Ldlwl7o X-Proofpoint-Spam-Reason: safe X-MailFrom: prvs=4604b61042=vkarpovi@opensource.cirrus.com X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: ZQ6N23KKLSX4GPALG6WNL3WI43EP6DGJ X-Message-ID-Hash: ZQ6N23KKLSX4GPALG6WNL3WI43EP6DGJ X-Mailman-Approved-At: Tue, 29 Aug 2023 14:13:52 +0000 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: Checks the index computed by the virq offset before printing the error condition in cs35l45_spk_safe_err() handler. Signed-off-by: Ricardo Rivera-Matos Signed-off-by: Vlad Karpovich --- sound/soc/codecs/cs35l45.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index 40fb64904260..2c9b41171a05 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -1023,7 +1023,10 @@ static irqreturn_t cs35l45_spk_safe_err(int irq, void *data) i = irq - regmap_irq_get_virq(cs35l45->irq_data, 0); - dev_err(cs35l45->dev, "%s condition detected!\n", cs35l45_irqs[i].name); + if (i < 0 || i > 6) + dev_err(cs35l45->dev, "Unspecified global error condition (%d) detected!\n", irq); + else + dev_err(cs35l45->dev, "%s condition detected!\n", cs35l45_irqs[i].name); return IRQ_HANDLED; } From patchwork Mon Aug 28 17:05:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Karpovich X-Patchwork-Id: 718634 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 979C4C71153 for ; Tue, 29 Aug 2023 14:15:48 +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 8D37E86F; Tue, 29 Aug 2023 16:14:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8D37E86F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693318546; bh=mn25y2miPTCNRhf+9Rqr9dpAJck7NgwJ35xKbzldkrw=; 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=dI1Y5ccjpZS5tMRi+8HS0VTaT8Ga5l9ohyJPkAfDv9zhMOnSqz4pu0+UM5ImnqIuM kPVJrIXnwMCR+VjZYJYBMvaBW+qD5A9XO21ck+Rp/J8BG7yR7sEzMWuhxc5F/kMLd4 A+Zf4woxf3bABSFhiedCW1ni0il5VuKZfATvFVLI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 51D84F80578; Tue, 29 Aug 2023 16:14:00 +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 05409F80568; Tue, 29 Aug 2023 16:14:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AEF93F80536; Mon, 28 Aug 2023 19:06:02 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 6D40EF800F5 for ; Mon, 28 Aug 2023 19:05:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6D40EF800F5 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=myy0e2WB Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 37SFkJrB027094; Mon, 28 Aug 2023 12:05:49 -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=ZdGIm69kLKV5xF5s2D/i1QP8lshTKZ14+MDHrNSiiKE=; b= myy0e2WBpfeAF7yGN5J6r3u6qRipq5wBohfKJFoQrCODIylrtHSgU42aytECWmVu JC4+FEFSz7XxTgpahEu2wkW1ZJRhS9xCbGtHGrQOWvFz/ZimZDB7onzZWg0wA0mS FVAWYJ6Ma08RC1NjMUDf9H00sfXa7b5euDNQOyPqGfN8Tt2m9abPJ1klUDoXoBS5 h7bD7mDrMKMYhFLP/6iy4b5XjlguvaHWx9QL5sRgs6fT0k5tiXiImFQvIX08yEuj vOEk6rYxo87dpnDU+VgvIHua0z/m1cRSEvXhtaL5xckNVqYcJ8VQQc0ITDFwwvtD TbBVLM20wrxL/dhxMcYR0A== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3sqdtj2188-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 12:05:49 -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; Mon, 28 Aug 2023 18:05:48 +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; Mon, 28 Aug 2023 18:05:48 +0100 Received: from vkarpovich-ThinkStation-P620.crystal.cirrus.com (vkarpovich-ThinkStation-P620.ad.cirrus.com [141.131.145.49]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 1160E357C; Mon, 28 Aug 2023 17:05:45 +0000 (UTC) From: Vlad Karpovich To: James Schulman , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring CC: , , , , , Vlad Karpovich Subject: [PATCH 4/7] ASoC: cs35l45: Analog PCM Volume and Amplifier Mode controls Date: Mon, 28 Aug 2023 12:05:22 -0500 Message-ID: <20230828170525.335671-4-vkarpovi@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> References: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: JmxAy-sKKB0VuiFclBtD2KGrqF7zYe4C X-Proofpoint-GUID: JmxAy-sKKB0VuiFclBtD2KGrqF7zYe4C X-Proofpoint-Spam-Reason: safe X-MailFrom: prvs=4604b61042=vkarpovi@opensource.cirrus.com X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: RQTHUIVEJRJKJ6MRVEH42TTKRSQUXPIG X-Message-ID-Hash: RQTHUIVEJRJKJ6MRVEH42TTKRSQUXPIG X-Mailman-Approved-At: Tue, 29 Aug 2023 14:13:53 +0000 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: Adds "Analog PCM Volume" control with supported values 0 = 10dB,1 = 13dB,2 = 16dB and 3 = 19dB. The amplifier can operate either in Speaker Mode or Receiver Mode as configured by the user. Speaker Mode has four gain options to support maximum amplifier output amplitude for loud speaker application. Receiver Mode has further optimized noise performance while maintaining sufficient output to support phone receiver application. While configured in Receiver Mode, the analog PCM Volume control is disabled and the analog gain is fixed to 1dB. Signed-off-by: Vlad Karpovich --- sound/soc/codecs/cs35l45-tables.c | 3 + sound/soc/codecs/cs35l45.c | 148 ++++++++++++++++++++++++++++++ sound/soc/codecs/cs35l45.h | 35 ++++++- 3 files changed, 184 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/cs35l45-tables.c b/sound/soc/codecs/cs35l45-tables.c index e20c1bc9a687..2e77644f3b0b 100644 --- a/sound/soc/codecs/cs35l45-tables.c +++ b/sound/soc/codecs/cs35l45-tables.c @@ -91,6 +91,7 @@ static const struct reg_default cs35l45_defaults[] = { { CS35L45_DSP1RX7_INPUT, 0x0000003A }, { CS35L45_DSP1RX8_INPUT, 0x00000028 }, { CS35L45_AMP_PCM_CONTROL, 0x00100000 }, + { CS35L45_AMP_GAIN, 0x00002300 }, { CS35L45_IRQ1_CFG, 0x00000000 }, { CS35L45_IRQ1_MASK_1, 0xBFEFFFBF }, { CS35L45_IRQ1_MASK_2, 0xFFFFFFFF }, @@ -156,7 +157,9 @@ static bool cs35l45_readable_reg(struct device *dev, unsigned int reg) case CS35L45_DSP1RX6_INPUT: case CS35L45_DSP1RX7_INPUT: case CS35L45_DSP1RX8_INPUT: + case CS35L45_HVLV_CONFIG: case CS35L45_AMP_PCM_CONTROL: + case CS35L45_AMP_GAIN: case CS35L45_AMP_PCM_HPF_TST: case CS35L45_IRQ1_CFG: case CS35L45_IRQ1_STATUS: diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index 2c9b41171a05..32ecc2ebaf9d 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -169,6 +169,142 @@ static int cs35l45_dsp_audio_ev(struct snd_soc_dapm_widget *w, return 0; } +static int cs35l45_activate_ctl(struct snd_soc_component *component, + const char *ctl_name, bool active) +{ + struct snd_card *card = component->card->snd_card; + struct snd_kcontrol *kcontrol; + struct snd_kcontrol_volatile *vd; + unsigned int index_offset; + char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; + + if (component->name_prefix) + snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s %s", + component->name_prefix, ctl_name); + else + snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s", ctl_name); + + kcontrol = snd_soc_card_get_kcontrol(component->card, name); + if (!kcontrol) { + dev_err(component->dev, "Can't find kcontrol %s\n", name); + return -EINVAL; + } + + index_offset = snd_ctl_get_ioff(kcontrol, &kcontrol->id); + vd = &kcontrol->vd[index_offset]; + if (active) + vd->access |= SNDRV_CTL_ELEM_ACCESS_WRITE; + else + vd->access &= ~SNDRV_CTL_ELEM_ACCESS_WRITE; + + snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO, &kcontrol->id); + + return 0; +} + +static int cs35l45_amplifier_mode_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *component = + snd_soc_kcontrol_component(kcontrol); + struct cs35l45_private *cs35l45 = + snd_soc_component_get_drvdata(component); + + ucontrol->value.integer.value[0] = cs35l45->amplifier_mode; + + return 0; +} + +static int cs35l45_amplifier_mode_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *component = + snd_soc_kcontrol_component(kcontrol); + struct cs35l45_private *cs35l45 = + snd_soc_component_get_drvdata(component); + struct snd_soc_dapm_context *dapm = + snd_soc_component_get_dapm(component); + unsigned int amp_state; + int ret; + + if ((ucontrol->value.integer.value[0] == cs35l45->amplifier_mode) || + (ucontrol->value.integer.value[0] > AMP_MODE_RCV)) + return 0; + + snd_soc_dapm_mutex_lock(dapm); + + ret = regmap_read(cs35l45->regmap, CS35L45_BLOCK_ENABLES, &_state); + if (ret < 0) { + dev_err(cs35l45->dev, "Failed to read AMP state: %d\n", ret); + snd_soc_dapm_mutex_unlock(dapm); + return ret; + } + + regmap_clear_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, + CS35L45_AMP_EN_MASK); + snd_soc_component_disable_pin_unlocked(component, "SPK"); + snd_soc_dapm_sync_unlocked(dapm); + + if (ucontrol->value.integer.value[0] == AMP_MODE_SPK) { + regmap_clear_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, + CS35L45_RCV_EN_MASK); + + regmap_update_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, + CS35L45_BST_EN_MASK, + CS35L45_BST_ENABLE << CS35L45_BST_EN_SHIFT); + + regmap_update_bits(cs35l45->regmap, CS35L45_HVLV_CONFIG, + CS35L45_HVLV_MODE_MASK, + CS35L45_HVLV_OPERATION << + CS35L45_HVLV_MODE_SHIFT); + + ret = cs35l45_activate_ctl(component, "Analog PCM Volume", true); + if (ret < 0) + dev_err(cs35l45->dev, + "Unable to deactivate ctl (%d)\n", ret); + + } else /* AMP_MODE_RCV */ { + regmap_set_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, + CS35L45_RCV_EN_MASK); + + regmap_update_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, + CS35L45_BST_EN_MASK, + CS35L45_BST_DISABLE_FET_OFF << + CS35L45_BST_EN_SHIFT); + + regmap_update_bits(cs35l45->regmap, CS35L45_HVLV_CONFIG, + CS35L45_HVLV_MODE_MASK, + CS35L45_FORCE_LV_OPERATION << + CS35L45_HVLV_MODE_SHIFT); + + regmap_clear_bits(cs35l45->regmap, + CS35L45_BLOCK_ENABLES2, + CS35L45_AMP_DRE_EN_MASK); + + regmap_update_bits(cs35l45->regmap, CS35L45_AMP_GAIN, + CS35L45_AMP_GAIN_PCM_MASK, + CS35L45_AMP_GAIN_PCM_13DBV << + CS35L45_AMP_GAIN_PCM_SHIFT); + + ret = cs35l45_activate_ctl(component, "Analog PCM Volume", false); + if (ret < 0) + dev_err(cs35l45->dev, + "Unable to deactivate ctl (%d)\n", ret); + } + + if (amp_state & CS35L45_AMP_EN_MASK) + regmap_set_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, + CS35L45_AMP_EN_MASK); + + snd_soc_component_enable_pin_unlocked(component, "SPK"); + snd_soc_dapm_sync_unlocked(dapm); + snd_soc_dapm_mutex_unlock(dapm); + + cs35l45->amplifier_mode = ucontrol->value.integer.value[0]; + + return 0; +} + static const char * const cs35l45_asp_tx_txt[] = { "Zero", "ASP_RX1", "ASP_RX2", "VMON", "IMON", "ERR_VOL", @@ -432,9 +568,19 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = { { "SPK", NULL, "AMP"}, }; +static const char * const amplifier_mode_texts[] = {"SPK", "RCV"}; +static SOC_ENUM_SINGLE_DECL(amplifier_mode_enum, SND_SOC_NOPM, 0, + amplifier_mode_texts); +static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 1000, 300, 0); static const DECLARE_TLV_DB_SCALE(cs35l45_dig_pcm_vol_tlv, -10225, 25, true); static const struct snd_kcontrol_new cs35l45_controls[] = { + SOC_ENUM_EXT("Amplifier Mode", amplifier_mode_enum, + cs35l45_amplifier_mode_get, cs35l45_amplifier_mode_put), + SOC_SINGLE_TLV("Analog PCM Volume", CS35L45_AMP_GAIN, + CS35L45_AMP_GAIN_PCM_SHIFT, + CS35L45_AMP_GAIN_PCM_MASK >> CS35L45_AMP_GAIN_PCM_SHIFT, + 0, amp_gain_tlv), /* Ignore bit 0: it is beyond the resolution of TLV_DB_SCALE */ SOC_SINGLE_S_TLV("Digital PCM Volume", CS35L45_AMP_PCM_CONTROL, @@ -1104,6 +1250,8 @@ static int cs35l45_initialize(struct cs35l45_private *cs35l45) if (ret < 0) return ret; + cs35l45->amplifier_mode = AMP_MODE_SPK; + return 0; } diff --git a/sound/soc/codecs/cs35l45.h b/sound/soc/codecs/cs35l45.h index 61135a316df3..16857321d945 100644 --- a/sound/soc/codecs/cs35l45.h +++ b/sound/soc/codecs/cs35l45.h @@ -61,9 +61,11 @@ #define CS35L45_DSP1RX6_INPUT 0x00004C54 #define CS35L45_DSP1RX7_INPUT 0x00004C58 #define CS35L45_DSP1RX8_INPUT 0x00004C5C +#define CS35L45_HVLV_CONFIG 0x00006400 #define CS35L45_LDPM_CONFIG 0x00006404 #define CS35L45_AMP_PCM_CONTROL 0x00007000 #define CS35L45_AMP_PCM_HPF_TST 0x00007004 +#define CS35L45_AMP_GAIN 0x00007800 #define CS35L45_IRQ1_CFG 0x0000E000 #define CS35L45_IRQ1_STATUS 0x0000E004 #define CS35L45_IRQ1_EINT_1 0x0000E010 @@ -167,12 +169,19 @@ #define CS35L45_VDD_BATTMON_EN_SHIFT 8 #define CS35L45_BST_EN_SHIFT 4 #define CS35L45_BST_EN_MASK GENMASK(5, 4) +#define CS35L45_RCV_EN_SHIFT 2 +#define CS35L45_RCV_EN_MASK BIT(2) +#define CS35L45_AMP_EN_SHIFT 0 +#define CS35L45_AMP_EN_MASK BIT(0) -#define CS35L45_BST_DISABLE_FET_ON 0x01 +#define CS35L45_BST_DISABLE_FET_OFF 0x00 +#define CS35L45_BST_DISABLE_FET_ON 0x01 +#define CS35L45_BST_ENABLE 0x02 /* BLOCK_ENABLES2 */ #define CS35L45_ASP_EN_SHIFT 27 - +#define CS35L45_AMP_DRE_EN_SHIFT 20 +#define CS35L45_AMP_DRE_EN_MASK BIT(20) #define CS35L45_MEM_RDY_SHIFT 1 #define CS35L45_MEM_RDY_MASK BIT(1) @@ -266,6 +275,13 @@ #define CS35L45_ASP_WL_SHIFT 0 #define CS35L45_ASP_WL_MASK GENMASK(5, 0) +/* HVLV_CONFIG */ +#define CS35L45_FORCE_LV_OPERATION 0x01 +#define CS35L45_FORCE_HV_OPERATION 0x02 +#define CS35L45_HVLV_OPERATION 0x03 +#define CS35L45_HVLV_MODE_SHIFT 0 +#define CS35L45_HVLV_MODE_MASK GENMASK(1, 0) + /* AMP_PCM_CONTROL */ #define CS35L45_AMP_VOL_PCM_SHIFT 0 #define CS35L45_AMP_VOL_PCM_WIDTH 11 @@ -275,6 +291,15 @@ #define CS35L45_HPF_44P1 0x000108BD #define CS35L45_HPF_88P2 0x0001045F +/* AMP_GAIN_PCM */ +#define CS35L45_AMP_GAIN_PCM_10DBV 0x00 +#define CS35L45_AMP_GAIN_PCM_13DBV 0x01 +#define CS35L45_AMP_GAIN_PCM_16DBV 0x02 +#define CS35L45_AMP_GAIN_PCM_19DBV 0x03 + +#define CS35L45_AMP_GAIN_PCM_SHIFT 8 +#define CS35L45_AMP_GAIN_PCM_MASK GENMASK(9, 8) + /* IRQ1_EINT_4 */ #define CS35L45_OTP_BOOT_DONE_STS_MASK BIT(1) #define CS35L45_OTP_BUSY_MASK BIT(0) @@ -396,6 +421,11 @@ enum control_bus_type { CONTROL_BUS_SPI = 1, }; +enum amp_mode { + AMP_MODE_SPK = 0, + AMP_MODE_RCV = 1, +}; + #define CS35L45_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S24_3LE| \ SNDRV_PCM_FMTBIT_S24_LE) @@ -464,6 +494,7 @@ struct cs35l45_private { bool sysclk_set; u8 slot_width; u8 slot_count; + int amplifier_mode; int irq_invert; int irq; unsigned int i2c_addr; From patchwork Mon Aug 28 17:05:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Karpovich X-Patchwork-Id: 718632 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 D8728C71153 for ; Tue, 29 Aug 2023 14:16:51 +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 0A271DFA; Tue, 29 Aug 2023 16:16:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0A271DFA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693318610; bh=psNKzq++myMPEPkGsB9144QSDGEvn0yYgw6E3WF4hS4=; 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=hLEHOFCng+kXsoMKmLzNQ7qDsr2fsnswDvBrT6HUQs2PcSTgPByNP3+dUTTl5TNxc pcrwV0oL2KXcKHTmPo9tl+zJK+Qn6OzEvf9GRGRD1Z+lZ11pJSQwq4lCnW73/kFQ5Z g1h7e2ZEN1GabAwYJkYzM7719+61xRNCMILfd0Dc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 77329F805C3; Tue, 29 Aug 2023 16:14:12 +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 22012F805C3; Tue, 29 Aug 2023 16:14:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0228BF80236; Mon, 28 Aug 2023 19:06:08 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 8F4ACF80158 for ; Mon, 28 Aug 2023 19:05:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8F4ACF80158 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=jcTH7DKN Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 37SFkYnN027174; Mon, 28 Aug 2023 12:05:52 -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=2tYF2G4WowOVzEZDkxYllLwRJTRxylMzCzkRJWx89mc=; b= jcTH7DKN9MwamkXwDzh8Sek00eQ8hQD5Mt1ZsYuWaThUWlHvdoosXXBAAsH5+P1G 8tPcDhpVDDh2YL/qnJOrAv2lSXtPdQ0f92NBPFKuERJB+GkK6VCRxxvmYkjcSBob aWKd9y8vuEwsY1xoky3m5Pn+4u/q1wN1iW0IWBMrHQNnUn7TyGSswBIPn7+jdUlu zANNNTkDd+9wY7wmcAibVTYmG3mJt4ZV8scrEVNFuetIvePg/+yycUKU+R3hq4sc a3EVCQJl8TqFnXh9gYzoQY3Fh69guCjhjhHy2gWv8UHx0u4Wn2OPeFe/ze77339W OS+dDIAecM96bwyXB6R2Ww== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3sqdtj218a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 12:05:51 -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; Mon, 28 Aug 2023 18:05:50 +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; Mon, 28 Aug 2023 18:05:50 +0100 Received: from vkarpovich-ThinkStation-P620.crystal.cirrus.com (vkarpovich-ThinkStation-P620.ad.cirrus.com [141.131.145.49]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 55F0311D4; Mon, 28 Aug 2023 17:05:48 +0000 (UTC) From: Vlad Karpovich To: James Schulman , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring CC: , , , , , Vlad Karpovich Subject: [PATCH 5/7] ASoC: cs35l45: Rename DACPCM1 Source control Date: Mon, 28 Aug 2023 12:05:23 -0500 Message-ID: <20230828170525.335671-5-vkarpovi@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> References: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 4ENn95ZPXt9wnM_SioXAJese1UIW6AWd X-Proofpoint-GUID: 4ENn95ZPXt9wnM_SioXAJese1UIW6AWd X-Proofpoint-Spam-Reason: safe X-MailFrom: prvs=4604b61042=vkarpovi@opensource.cirrus.com X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: GWM7CAD3SBC66GR54F5HHEV2JOLWDB42 X-Message-ID-Hash: GWM7CAD3SBC66GR54F5HHEV2JOLWDB42 X-Mailman-Approved-At: Tue, 29 Aug 2023 14:13:54 +0000 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: Rename control to "DACPCM Source" for backward compatibility with previous implementation. Signed-off-by: Vlad Karpovich Acked-by: Charles Keepax --- sound/soc/codecs/cs35l45.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index 32ecc2ebaf9d..efd2d6aa3d67 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -415,7 +415,7 @@ static const struct snd_kcontrol_new cs35l45_dsp_muxes[] = { }; static const struct snd_kcontrol_new cs35l45_dac_muxes[] = { - SOC_DAPM_ENUM("DACPCM1 Source", cs35l45_dacpcm_enums[0]), + SOC_DAPM_ENUM("DACPCM Source", cs35l45_dacpcm_enums[0]), }; static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = { @@ -469,7 +469,7 @@ static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = { SND_SOC_DAPM_MUX("DSP_RX7 Source", SND_SOC_NOPM, 0, 0, &cs35l45_dsp_muxes[6]), SND_SOC_DAPM_MUX("DSP_RX8 Source", SND_SOC_NOPM, 0, 0, &cs35l45_dsp_muxes[7]), - SND_SOC_DAPM_MUX("DACPCM1 Source", SND_SOC_NOPM, 0, 0, &cs35l45_dac_muxes[0]), + SND_SOC_DAPM_MUX("DACPCM Source", SND_SOC_NOPM, 0, 0, &cs35l45_dac_muxes[0]), SND_SOC_DAPM_OUT_DRV("AMP", SND_SOC_NOPM, 0, 0, NULL, 0), @@ -539,7 +539,7 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = { { "ASP_RX1", NULL, "ASP_EN" }, { "ASP_RX2", NULL, "ASP_EN" }, - { "AMP", NULL, "DACPCM1 Source"}, + { "AMP", NULL, "DACPCM Source"}, { "AMP", NULL, "GLOBAL_EN"}, CS35L45_DSP_MUX_ROUTE("DSP_RX1"), @@ -563,7 +563,7 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = { {"DSP1 Preload", NULL, "DSP1 Preloader"}, {"DSP1", NULL, "DSP1 Preloader"}, - CS35L45_DAC_MUX_ROUTE("DACPCM1"), + CS35L45_DAC_MUX_ROUTE("DACPCM"), { "SPK", NULL, "AMP"}, }; From patchwork Mon Aug 28 17:05:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Karpovich X-Patchwork-Id: 718633 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 28F10C71153 for ; Tue, 29 Aug 2023 14:16:24 +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 42553DF1; Tue, 29 Aug 2023 16:15:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 42553DF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693318582; bh=RdbFF+Ey67kCYpKElAn3zOG59Y7e4rHt9hklmfLmprY=; 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=Qfqd9V0Vmp0V+puXOHxOvInZOk9ZBZhuGZLj+Le37q61kNY9fcDwMZ0To/1QdHNDY 2CcMf1ye4dSZttSLk7RJze3uGFD3iiFWFYtTXBaWuika49u9hQIkbp2wDkxrLgE+s7 qHGgCXSSUIgJpf82U1r2Q9OrODwDzK8RIxO7yzr4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D74A8F805AB; Tue, 29 Aug 2023 16:14:07 +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 5D6B4F805AB; Tue, 29 Aug 2023 16:14:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5BE85F8025F; Mon, 28 Aug 2023 19:06:06 +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 3C545F80074 for ; Mon, 28 Aug 2023 19:05:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3C545F80074 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=mq8I3sCQ 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 37SF2s64001342; Mon, 28 Aug 2023 12:05:55 -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=emwn8Rh+GiK839KOBaZXWgo02wchBa0++hofCDljvaE=; b= mq8I3sCQVEmNVUdpUtoEkXKsxTwm8b2gszrJ8dTyoJYV42aIeIQvpQm6zibnO5wb 9fYl4b9aC2Ew4ZXbgifu1fLFEfxUtlDBfxwcEDsTwH9D+DpdHKtCas7oDXLWP6FD w2UClyZWxk1HHIqN3Ac+Yi5P6OUWOjV8Hz0YY+RXQTAEYfLVUecGY/Z9Ps+ekVrw CFTd58tyPfokBppENz+Xk4hx+DUXRlVSrNDsW+MjwwVQJyjz6mHzhBN/eMwKBbJu c3mXuZW6WQKUxBqbM3v5IUlxAqJ3IuBCAV0+F2RFbbV/CtP7STmjG41dXanDnh0K PMOtNPWMomtHE4UvUWelNg== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3sqesyae72-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 12:05:54 -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; Mon, 28 Aug 2023 18:05:52 +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; Mon, 28 Aug 2023 18:05:52 +0100 Received: from vkarpovich-ThinkStation-P620.crystal.cirrus.com (vkarpovich-ThinkStation-P620.ad.cirrus.com [141.131.145.49]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id A6A9A11D4; Mon, 28 Aug 2023 17:05:50 +0000 (UTC) From: Vlad Karpovich To: James Schulman , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring CC: , , , , , Vlad Karpovich Subject: [PATCH 6/7] ASoC: cs35l45: Connect DSP to the monitoring signals Date: Mon, 28 Aug 2023 12:05:24 -0500 Message-ID: <20230828170525.335671-6-vkarpovi@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> References: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: qc2UoEWanY0NIkKlynDHo9Ng0q0dSHOU X-Proofpoint-GUID: qc2UoEWanY0NIkKlynDHo9Ng0q0dSHOU X-Proofpoint-Spam-Reason: safe X-MailFrom: prvs=4604b61042=vkarpovi@opensource.cirrus.com X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: A3ZMDAAD5NPCMMFKHY5P456TAVICQW4L X-Message-ID-Hash: A3ZMDAAD5NPCMMFKHY5P456TAVICQW4L X-Mailman-Approved-At: Tue, 29 Aug 2023 14:13:53 +0000 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: Link VMON, IMON, TEMPMON, VDD_BSTMON and VDD_BATTMON to DSP1. The CSPL firmware uses them for the speaker calibration and monitoring. Signed-off-by: Vlad Karpovich --- sound/soc/codecs/cs35l45.c | 33 +++++++++++++++++++++++++++------ sound/soc/codecs/cs35l45.h | 1 + 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index efd2d6aa3d67..6c8f179b9c1c 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -433,17 +433,25 @@ static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = { SND_SOC_DAPM_SIGGEN("VMON_SRC"), SND_SOC_DAPM_SIGGEN("IMON_SRC"), + SND_SOC_DAPM_SIGGEN("TEMPMON_SRC"), SND_SOC_DAPM_SIGGEN("VDD_BATTMON_SRC"), SND_SOC_DAPM_SIGGEN("VDD_BSTMON_SRC"), SND_SOC_DAPM_SIGGEN("ERR_VOL"), SND_SOC_DAPM_SIGGEN("AMP_INTP"), SND_SOC_DAPM_SIGGEN("IL_TARGET"), - SND_SOC_DAPM_ADC("VMON", NULL, CS35L45_BLOCK_ENABLES, CS35L45_VMON_EN_SHIFT, 0), - SND_SOC_DAPM_ADC("IMON", NULL, CS35L45_BLOCK_ENABLES, CS35L45_IMON_EN_SHIFT, 0), - SND_SOC_DAPM_ADC("VDD_BATTMON", NULL, CS35L45_BLOCK_ENABLES, - CS35L45_VDD_BATTMON_EN_SHIFT, 0), - SND_SOC_DAPM_ADC("VDD_BSTMON", NULL, CS35L45_BLOCK_ENABLES, - CS35L45_VDD_BSTMON_EN_SHIFT, 0), + + SND_SOC_DAPM_SUPPLY("VMON_EN", CS35L45_BLOCK_ENABLES, CS35L45_VMON_EN_SHIFT, 0, NULL, 0), + SND_SOC_DAPM_SUPPLY("IMON_EN", CS35L45_BLOCK_ENABLES, CS35L45_IMON_EN_SHIFT, 0, NULL, 0), + SND_SOC_DAPM_SUPPLY("TEMPMON_EN", CS35L45_BLOCK_ENABLES, CS35L45_TEMPMON_EN_SHIFT, 0, NULL, 0), + SND_SOC_DAPM_SUPPLY("VDD_BATTMON_EN", CS35L45_BLOCK_ENABLES, CS35L45_VDD_BATTMON_EN_SHIFT, 0, NULL, 0), + SND_SOC_DAPM_SUPPLY("VDD_BSTMON_EN", CS35L45_BLOCK_ENABLES, CS35L45_VDD_BSTMON_EN_SHIFT, 0, NULL, 0), + + SND_SOC_DAPM_ADC("VMON", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_ADC("IMON", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_ADC("TEMPMON", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_ADC("VDD_BATTMON", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_ADC("VDD_BSTMON", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("ASP_RX1", NULL, 0, CS35L45_ASP_ENABLES1, CS35L45_ASP_RX1_EN_SHIFT, 0), SND_SOC_DAPM_AIF_IN("ASP_RX2", NULL, 1, CS35L45_ASP_ENABLES1, CS35L45_ASP_RX2_EN_SHIFT, 0), @@ -503,9 +511,16 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = { /* Feedback */ { "VMON", NULL, "VMON_SRC" }, { "IMON", NULL, "IMON_SRC" }, + { "TEMPMON", NULL, "TEMPMON_SRC" }, { "VDD_BATTMON", NULL, "VDD_BATTMON_SRC" }, { "VDD_BSTMON", NULL, "VDD_BSTMON_SRC" }, + { "VMON", NULL, "VMON_EN" }, + { "IMON", NULL, "IMON_EN" }, + { "TEMPMON", NULL, "TEMPMON_EN" }, + { "VDD_BATTMON", NULL, "VDD_BATTMON_EN" }, + { "VDD_BSTMON", NULL, "VDD_BSTMON_EN" }, + { "Capture", NULL, "ASP_TX1"}, { "Capture", NULL, "ASP_TX2"}, { "Capture", NULL, "ASP_TX3"}, @@ -560,6 +575,12 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = { {"DSP1", NULL, "DSP_RX7 Source"}, {"DSP1", NULL, "DSP_RX8 Source"}, + {"DSP1", NULL, "VMON_EN"}, + {"DSP1", NULL, "IMON_EN"}, + {"DSP1", NULL, "VDD_BATTMON_EN"}, + {"DSP1", NULL, "VDD_BSTMON_EN"}, + {"DSP1", NULL, "TEMPMON_EN"}, + {"DSP1 Preload", NULL, "DSP1 Preloader"}, {"DSP1", NULL, "DSP1 Preloader"}, diff --git a/sound/soc/codecs/cs35l45.h b/sound/soc/codecs/cs35l45.h index 16857321d945..e2ebcf58d7e0 100644 --- a/sound/soc/codecs/cs35l45.h +++ b/sound/soc/codecs/cs35l45.h @@ -165,6 +165,7 @@ /* BLOCK_ENABLES */ #define CS35L45_IMON_EN_SHIFT 13 #define CS35L45_VMON_EN_SHIFT 12 +#define CS35L45_TEMPMON_EN_SHIFT 10 #define CS35L45_VDD_BSTMON_EN_SHIFT 9 #define CS35L45_VDD_BATTMON_EN_SHIFT 8 #define CS35L45_BST_EN_SHIFT 4 From patchwork Mon Aug 28 17:05:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Karpovich X-Patchwork-Id: 718310 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 244C6C71153 for ; Tue, 29 Aug 2023 14:16:03 +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 60A3F846; Tue, 29 Aug 2023 16:15:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 60A3F846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693318561; bh=r2Vv1bTIl3AR6QuFxlugFXePHBHkY3DhBZC7i1solrU=; 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=E1bevO/UIc2nCjhwe3ZaETKZyzZVnu9J1dMK9zwhJLdxQa6GJWT4JrbFQBoK/W3+g cYnkUOM+87Ufu6alj3LR64qf5GxtrMyPCKpi2Denc1x7qNhVwvR2/zhYDg1E7jIuAJ 6mMbNaar8iCPUd26KSZ5Y6nCYqAU3hJ4WfIROJPw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9F26EF80589; Tue, 29 Aug 2023 16:14:05 +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 60491F80587; Tue, 29 Aug 2023 16:14:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 245AFF8023B; Mon, 28 Aug 2023 19:06:04 +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 9398CF80249 for ; Mon, 28 Aug 2023 19:05:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9398CF80249 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=dZUiNmlM 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 37SF2s65001342; Mon, 28 Aug 2023 12:05:56 -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=SQtnHbRaoAsToR0WVKcLtnqTjexFNX8ZPfFI4KHxdVk=; b= dZUiNmlMFT2l392bl+wfM4XAAkBNs1Wu8sdhMlX3jhdu5RmVCVZXMXTxoeLbluT4 xmVCJ2uIE6ewD3Krps+IZ3MHBzPXWaTKfaGOi1rXKOVnFi8/fWbUEaLsY5Zo2Pyh 5SErI1M6SindS4DIAD2RDpPpYcE6quC+lsIAjQWElqje+SVbsnHWacu5Sq97UJUM umhL21sL8viJVRe0ANQYKZbOU3Re76E+KiIDvUzloJSdU/LGUzSf8pg2GWRk9y+T rX66njkftBaVwuRXN01BUCMR54x3OYU5eYT/o8B5sTVOUDUGGWlrVSpjfR3+c7ez 3XcqlAFXEcUUSebiW0n5jQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3sqesyae72-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 12:05:55 -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; Mon, 28 Aug 2023 18:05:55 +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; Mon, 28 Aug 2023 18:05:55 +0100 Received: from vkarpovich-ThinkStation-P620.crystal.cirrus.com (vkarpovich-ThinkStation-P620.ad.cirrus.com [141.131.145.49]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 06ADD11D4; Mon, 28 Aug 2023 17:05:52 +0000 (UTC) From: Vlad Karpovich To: James Schulman , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring CC: , , , , , Vlad Karpovich Subject: [PATCH 7/7] ASoC: cs35l45: Add AMP Enable Switch control Date: Mon, 28 Aug 2023 12:05:25 -0500 Message-ID: <20230828170525.335671-7-vkarpovi@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> References: <20230828170525.335671-1-vkarpovi@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Drl185civB_IATAnqVR-xX2Ixsxj4doD X-Proofpoint-GUID: Drl185civB_IATAnqVR-xX2Ixsxj4doD X-Proofpoint-Spam-Reason: safe X-MailFrom: prvs=4604b61042=vkarpovi@opensource.cirrus.com X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: BJKGPRLYHNU3UZTSORWKMQ7MQYWMXHHS X-Message-ID-Hash: BJKGPRLYHNU3UZTSORWKMQ7MQYWMXHHS X-Mailman-Approved-At: Tue, 29 Aug 2023 14:13:53 +0000 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 "AMP Enable Switch" is useful in systems with multiple amplifiers connected to the same audio bus but not all of them are needed for all use cases. Signed-off-by: Vlad Karpovich Acked-by: Charles Keepax --- sound/soc/codecs/cs35l45.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index 6c8f179b9c1c..ddbf26f2e73a 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -417,6 +417,8 @@ static const struct snd_kcontrol_new cs35l45_dsp_muxes[] = { static const struct snd_kcontrol_new cs35l45_dac_muxes[] = { SOC_DAPM_ENUM("DACPCM Source", cs35l45_dacpcm_enums[0]), }; +static const struct snd_kcontrol_new amp_en_ctl = + SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 0, 1, 0); static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = { SND_SOC_DAPM_SPK("DSP1 Preload", NULL), @@ -479,6 +481,8 @@ static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = { SND_SOC_DAPM_MUX("DACPCM Source", SND_SOC_NOPM, 0, 0, &cs35l45_dac_muxes[0]), + SND_SOC_DAPM_SWITCH("AMP Enable", SND_SOC_NOPM, 0, 0, &_en_ctl), + SND_SOC_DAPM_OUT_DRV("AMP", SND_SOC_NOPM, 0, 0, NULL, 0), SND_SOC_DAPM_OUTPUT("SPK"), @@ -586,7 +590,8 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = { CS35L45_DAC_MUX_ROUTE("DACPCM"), - { "SPK", NULL, "AMP"}, + { "AMP Enable", "Switch", "AMP" }, + { "SPK", NULL, "AMP Enable"}, }; static const char * const amplifier_mode_texts[] = {"SPK", "RCV"};