From patchwork Tue Jan 23 11:32:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Strozek X-Patchwork-Id: 190874 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp268406dyi; Tue, 23 Jan 2024 03:33:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZQPUMzoKSEC4QKQ5l9Puj72i4ntkQbQfWZ/Q1Y34B32GQ65MsHwsYpP2NDtMv12kex1n/ X-Received: by 2002:a05:6a21:9207:b0:19c:54a7:fb59 with SMTP id tl7-20020a056a21920700b0019c54a7fb59mr1534949pzb.61.1706009600621; Tue, 23 Jan 2024 03:33:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706009600; cv=pass; d=google.com; s=arc-20160816; b=psA0r1FkWyCp7Z9gKlwvih3MkAka8E46Gp9hnwexwfU88XyavL5Wtpcv1i1H9Jigmf 3bzgCewI/yUDcf7yRaw2aMMBy0SRo0lkEcHIkG4Ukf3tUrdefSeRWI54vcs2JQUWKPyq SVWdsYHJIFYu6LekNiT64QT78wxluUhDXAkspf5wWmFJY/8uJDp7fSn3XZwedeMJbsBq EQY1Lv27D0/aSz9PSadPuO9lCsauBXHMkZiyrvHJZ3ZxjRT9SJUUNuZC5brhj8OftDJ8 wYC3UCMbx0NWXCDLy9Khv6UWceZFMy5UHYFruAGvQ8ZOx45ILRHruuco1DaeR7FRfVuv wgVw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=4T+B66DEuygAYHn9hCMdllptWsqq7spVdej7e0tRy2M=; fh=l3o3yoqSIO0R9fcQPothFAp5tw2SANe0ElzizGcDgV4=; b=kQzIBEIddJ+scmxHxAi1Yy+J1O6udgy5zWjWW7Y4bEAabFfnktzg5JpQ7mdmWnrobK 3h2BoePcMrn//DUflSwv1NtgT6kgrbZPR4k5WciO/HPpn6M8XjT2AmW7mYdncqG1tiNO F5jXzrKsOPLTX4K10WsLWIyqhG38a2MHjXsVpMn+sE40u/rdPr2DIhs+WMgr+RbwDEil iPeUfh79PSD4jJ5yIlj9A9smBP/z/ayeClB6jj3gAVNAv/FetAJiKjwlIYMmMaypBmob bQXWL9UG7cXE7TIVYbuECAr05THYQykadqhcNBRi97Qv46XgOtjNJmy0NnSricKKaPlj SJ6A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=E35gdN8p; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-35200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35200-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ci7-20020a17090afc8700b002900b3297dcsi8240055pjb.69.2024.01.23.03.33.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 03:33:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=E35gdN8p; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-35200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35200-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 60093288BB1 for ; Tue, 23 Jan 2024 11:33:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C4095D904; Tue, 23 Jan 2024 11:33:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="E35gdN8p" 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id 01C9E5D747; Tue, 23 Jan 2024 11:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.152.168 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706009584; cv=none; b=YF3cMeUQPuLQ5mRigg/LccwxlT5WpfzqCmOXjgh11zJ0BSoKC1EP+yoG7wqsxZU46fXu1V+wzr2Gc5S78Pk7Y39b6K+/eKgVTkC/OVGtJ089bi03m+bTXl6Ud8T39OtIW0BfEejdty754Ra+g/QW4ijGPab+1ZLxYpE1W1Kuf94= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706009584; c=relaxed/simple; bh=twtRZ2kll5KW9N9kkXciaYDPMJ1u2zhZUwcgEU9uU8o=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jmbOcfWe+jqaLa9R3j8pLjdwoHyc0jOcyV00QSkntgQ3WoIQgYIgc5iLMJDTrVaOsxdvkcL4Ws04Ui1O354cmdk5iwXarCxXditTALh2RyMbK2Qnak/ychzSxRTrMKUu1GiQHEY6PPggKa/IHThJc5HxMo+tWjyU75PTAO2hut8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=E35gdN8p; arc=none smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40N79viZ014543; Tue, 23 Jan 2024 05:32:50 -0600 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=4 T+B66DEuygAYHn9hCMdllptWsqq7spVdej7e0tRy2M=; b=E35gdN8pWEmx9gHs8 lvLUYhxMqWBzgplu1+9LdNkLAGPvfhMO0Ik7tF15yjBaDvhqmz5AKLwFSnqKeoPf DLO6QYJKQjqcNRsI53M3qyfNleTyYCvgmj7vCCKRGU1KI0y8JzIFOvo8oLr8b8Lp TaNujfzpKHa6Qy2uviedcgYStPgyHEaUGm/mRBStMLu2DCtHvA6H0qqX037Wh+23 8AgusId4rVzQpwjAIIiCrCeGVzBit+j4GohmIXBg86XNlr2KE6jNAdfAQKVbdzNB wwufnkUCQN4avlVK0oYOFtC7lZ3Ns3yYqeDR2EH2j+w9ZFN6NUkqfhC2zoJ2mnhz H4FFA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3vrbfpv08h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Jan 2024 05:32:50 -0600 (CST) 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.40; Tue, 23 Jan 2024 11:32:48 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) 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.40 via Frontend Transport; Tue, 23 Jan 2024 11:32:48 +0000 Received: from upx-tgl-008-ubuntu.ad.cirrus.com (upx-tgl-008-ubuntu.ad.cirrus.com [198.90.251.167]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 5642D820246; Tue, 23 Jan 2024 11:32:48 +0000 (UTC) From: Maciej Strozek To: Mark Brown CC: Cezary Rojewski , Liam Girdwood , Pierre-Louis Bossart , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , , , , , Maciej Strozek Subject: [PATCH v3] ASoC: Intel: mtl-match: Add cs42l43_l0 cs35l56_l23 for MTL Date: Tue, 23 Jan 2024 11:32:46 +0000 Message-ID: <20240123113246.75539-1-mstrozek@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: mPrvXXtcJcK4-aJCKt1zKhfeVQHatr58 X-Proofpoint-GUID: mPrvXXtcJcK4-aJCKt1zKhfeVQHatr58 X-Proofpoint-Spam-Reason: safe X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788810348908559459 X-GMAIL-MSGID: 1788880723206948069 The layout is configured as: - Link0: CS42L43 Jack and mics (2ch) - Link2: 2x CS35L56 Speaker (amps 3 and 4, right) - Link3: 2x CS35L56 Speaker (amps 1 and 2, left) Corresponding SOF topology: https://github.com/thesofproject/sof/pull/8773 Signed-off-by: Maciej Strozek Reviewed-by: Charles Keepax Acked-by: Pierre-Louis Bossart --- v2 -> v3: added layout description and link to required SOF topology v1 -> v2: swapped AMP3 and AMP4 prefixes .../intel/common/soc-acpi-intel-mtl-match.c | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) -- 2.34.1 diff --git a/sound/soc/intel/common/soc-acpi-intel-mtl-match.c b/sound/soc/intel/common/soc-acpi-intel-mtl-match.c index feb12c6c85d1..23eaf47b3f24 100644 --- a/sound/soc/intel/common/soc-acpi-intel-mtl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-mtl-match.c @@ -377,6 +377,37 @@ static const struct snd_soc_acpi_adr_device cs35l56_2_adr[] = { } }; +static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = { + { + .adr = 0x00023201FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "AMP3" + }, + { + .adr = 0x00023301FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_3_endpoint, + .name_prefix = "AMP4" + } + +}; + +static const struct snd_soc_acpi_adr_device cs35l56_3_l_adr[] = { + { + .adr = 0x00033001fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "AMP1" + }, + { + .adr = 0x00033101fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_2_endpoint, + .name_prefix = "AMP2" + } +}; + static const struct snd_soc_acpi_link_adr rt5682_link2_max98373_link0[] = { /* Expected order: jack -> amp */ { @@ -554,6 +585,26 @@ static const struct snd_soc_acpi_link_adr mtl_cs42l43_cs35l56[] = { {} }; +static const struct snd_soc_acpi_link_adr cs42l43_link0_cs35l56_link2_link3[] = { + /* Expected order: jack -> amp */ + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(cs42l43_0_adr), + .adr_d = cs42l43_0_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs35l56_2_r_adr), + .adr_d = cs35l56_2_r_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(cs35l56_3_l_adr), + .adr_d = cs35l56_3_l_adr, + }, + {} +}; + /* this table is used when there is no I2S codec present */ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = { /* mockup tests need to be first */ @@ -599,6 +650,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-mtl-rt1318-l12-rt714-l0.tplg" }, + { + .link_mask = BIT(0) | BIT(2) | BIT(3), + .links = cs42l43_link0_cs35l56_link2_link3, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-mtl-cs42l43-l0-cs35l56-l23.tplg", + }, { .link_mask = GENMASK(2, 0), .links = mtl_cs42l43_cs35l56,