From patchwork Thu Aug 31 16:20:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Karpovich X-Patchwork-Id: 13373814 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 7FB1AC71153 for ; Mon, 4 Sep 2023 12:35: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 1F13DAE9; Mon, 4 Sep 2023 14:34:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1F13DAE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693830917; bh=578qe9EQhP1dmtri/FEcsdHpn2WVT2mwvnOzor0BDIg=; 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=bdCKjQWiVSss4BcbJaoHUaQXc/ecy7waSfYKqPKIs5awpyzXkT8zgqqRue3/FAJuI IXm+HkKK76tRzgQGTKmaKqMm7zBV3hBKJXjQ4u5AJi6etBoWC9ASSvjp6C27JITYNj VqbT8w24rMeqNOvUAc5tOpivooeJAJwpDh6aO0N4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 676F3F805B3; Mon, 4 Sep 2023 14:32:47 +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 8B516F805B3; Mon, 4 Sep 2023 14:32:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4CF48F80155; Thu, 31 Aug 2023 18:21:10 +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 9FF8CF80094 for ; Thu, 31 Aug 2023 18:21:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9FF8CF80094 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=RGSjDTnN 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 37VF9lpT009908; Thu, 31 Aug 2023 11:21:03 -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=KxaoXeqFYIEnZu6KbS/zohWD3joz0j1CP25czl4VYXE=; b= RGSjDTnNIyn6AtnkVYwc4q1qn6bYWmLGJtU5HELrxujRwRS4egMBi9KYpUuR+g4I /D488KbYcO6Lli3yI/hXkt195klsJErRgOrLYioNPQK0ut2TdMWnUQNNbHhtqIit TmmiFkkgTUQtDhD7mz8Ic+iOaqSEbmeskJS7rw291d3yoq+H/vpNKpByN7936kbW UeyisHDo91Wua3h5CSjGIHeeUsppNJiGMZ+lyMjtdjyvw9MG87qX2H31485zlv8o k5nXLS2KDzVNXgYkHVpCXN3PDQQ0j+300meBUgAMkdKo8Tt3cPRw+JhXzbOmzqzx zuBeGhtUZFbcR8oH6Bo3nA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3sqesyep1v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Aug 2023 11:21:03 -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; Thu, 31 Aug 2023 17:21:01 +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; Thu, 31 Aug 2023 17:21:01 +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 38A3911D6; Thu, 31 Aug 2023 16:20:59 +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 v3 4/4] ASoC: cs35l45: Add AMP Enable Switch control Date: Thu, 31 Aug 2023 11:20:42 -0500 Message-ID: <20230831162042.471801-4-vkarpovi@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230831162042.471801-1-vkarpovi@opensource.cirrus.com> References: <20230831162042.471801-1-vkarpovi@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: T-Wdx9XIUGTEFpyL4cYYEPwKN7DCtJqQ X-Proofpoint-GUID: T-Wdx9XIUGTEFpyL4cYYEPwKN7DCtJqQ X-Proofpoint-Spam-Reason: safe X-MailFrom: prvs=4607c60d60=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: M3VWEYOM6L6YPQCUPX7ZYPT5DBBBKN6C X-Message-ID-Hash: M3VWEYOM6L6YPQCUPX7ZYPT5DBBBKN6C X-Mailman-Approved-At: Mon, 04 Sep 2023 12:32:37 +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: Ricardo Rivera-Matos --- 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 4abc922ef210..f8646de20c36 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"};