From patchwork Mon Dec 12 08:48:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1714855 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NVwKV3npyz240L for ; Mon, 12 Dec 2022 19:49:17 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1p4eUk-0007JI-5n; Mon, 12 Dec 2022 08:49:06 +0000 Received: from mail-pl1-f174.google.com ([209.85.214.174]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1p4eUg-0007Hc-Jb for kernel-team@lists.ubuntu.com; Mon, 12 Dec 2022 08:49:02 +0000 Received: by mail-pl1-f174.google.com with SMTP id d15so1748706pls.6 for ; Mon, 12 Dec 2022 00:49:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/s4nhSJAu6VCoS6rEQtyW+oPRO4mH6UCy0lSa80tM6o=; b=t0/mGC078Bz4KnRbOklvSso2TeKbY69ZqhUHiLwTO6WVzdAHYY758thHjQj2ijmlT1 zTI9l8HUL5Izz+0WA0CPVMVVClKLL5G/J1LXhEnldDVXCIIoadcFoKlDyLEXd0WMKi27 6fYgfImz8VgOGx65Dm8o3eG1enkoDhGCTz8eBM3PabomGRbjukCgW7CEHj6i6V9ZxSwk EoSps9qguMK4+dKhB9HiQlmbAlE0+W5HEKbbAbazzMVw4LISGzNAGfA3zG6ZkbOrtTNA 3UIzQirFAN8CcbmmXJuo1oLhrIqh/DcF7K7v659LIAM8S9FnvmWlgIll1CcDhvYqDXhu d79A== X-Gm-Message-State: ANoB5pnK7YUs9/pFD9Z/FMTye6hXABFXwbPzpO1f5q52ORLc2tD58Qz1 ndAyhKvSkv9AyaLMtStgUP8sN5SxukA= X-Google-Smtp-Source: AA0mqf7pKaWquKzPcUYlfoHFv1XKXI00c8dq+RLSBo7GTPsmrpZI/+NZN8RcRlKQdSQel8r52hss8Q== X-Received: by 2002:a17:902:ce06:b0:188:bc62:276f with SMTP id k6-20020a170902ce0600b00188bc62276fmr17754487plg.3.1670834940292; Mon, 12 Dec 2022 00:49:00 -0800 (PST) Received: from yewun.. (61-227-116-5.dynamic-ip.hinet.net. [61.227.116.5]) by smtp.gmail.com with ESMTPSA id ja9-20020a170902efc900b001870dc3b4c0sm5732950plb.74.2022.12.12.00.48.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 00:48:59 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 01/12][SRU][Lunar] ASoC: Intel: soc-acpi-intel-rpl-match: add rpl_sdca_3_in_1 support Date: Mon, 12 Dec 2022 16:48:45 +0800 Message-Id: <20221212084856.3252684-2-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221212084856.3252684-1-vicamo.yang@canonical.com> References: <20221212084856.3252684-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.174; envelope-from=vicamo@gmail.com; helo=mail-pl1-f174.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Bard Liao BugLink: https://bugs.launchpad.net/bugs/1997944 Add rpl_sdca_3_in_1 match information. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220920074617.10300-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown (cherry picked from commit e7ff7307bb9aaf157d6bea5807a58673dee94a61) Signed-off-by: You-Sheng Yang (vicamo) --- .../intel/common/soc-acpi-intel-rpl-match.c | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-rpl-match.c b/sound/soc/intel/common/soc-acpi-intel-rpl-match.c index 0b77401e4e6f..9ccf7370157b 100644 --- a/sound/soc/intel/common/soc-acpi-intel-rpl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-rpl-match.c @@ -15,6 +15,20 @@ static const struct snd_soc_acpi_endpoint single_endpoint = { .group_id = 0, }; +static const struct snd_soc_acpi_endpoint spk_l_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 0, + .group_id = 1, +}; + +static const struct snd_soc_acpi_endpoint spk_r_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 1, + .group_id = 1, +}; + static const struct snd_soc_acpi_adr_device rt711_0_adr[] = { { .adr = 0x000020025D071100ull, @@ -33,6 +47,66 @@ static const struct snd_soc_acpi_link_adr rpl_rvp[] = { {} }; +static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = { + { + .adr = 0x000030025D071101ull, + .num_endpoints = 1, + .endpoints = &single_endpoint, + .name_prefix = "rt711" + } +}; + +static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = { + { + .adr = 0x000131025D131601ull, /* unique ID is set for some reason */ + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "rt1316-1" + } +}; + +static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = { + { + .adr = 0x000330025D131601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "rt1316-2" + } +}; + +static const struct snd_soc_acpi_adr_device rt714_2_adr[] = { + { + .adr = 0x000230025D071401ull, + .num_endpoints = 1, + .endpoints = &single_endpoint, + .name_prefix = "rt714" + } +}; + +static const struct snd_soc_acpi_link_adr rpl_sdca_3_in_1[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt711_sdca_0_adr), + .adr_d = rt711_sdca_0_adr, + }, + { + .mask = BIT(1), + .num_adr = ARRAY_SIZE(rt1316_1_group1_adr), + .adr_d = rt1316_1_group1_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(rt714_2_adr), + .adr_d = rt714_2_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(rt1316_3_group1_adr), + .adr_d = rt1316_3_group1_adr, + }, + {} +}; + struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = { {}, }; @@ -40,6 +114,12 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_rpl_machines); /* this table is used when there is no I2S codec present */ struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[] = { + { + .link_mask = 0xF, /* 4 active links required */ + .links = rpl_sdca_3_in_1, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-rpl-rt711-l0-rt1316-l13-rt714-l2.tplg", + }, { .link_mask = 0x1, /* link0 required */ .links = rpl_rvp,