From nobody Sun Feb 8 16:29:41 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECCA71F4C97; Thu, 15 May 2025 15:31:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747323109; cv=none; b=Fvux4efCa8BEyjG/6hqI++7b8U+39Z7MREwAxPRDK1inp+XrlNT0U/6FiK8uFkjYTCoM1D7nLl9ftpF5tt6VEZx0BaH0mSCi4yexW0CaCJf46NA3nR2Ux6zdatmskBAewCWjKJ8K7GNYuyDjT5r5ZwtwJEDEtxpmbcD+brZiRkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747323109; c=relaxed/simple; bh=gkYTuJlPPWBN0Mo/59Z5vPhiz9LzDHrqOhq+Ztyl3S4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Lx9wkldr1g7fzQS2zBRC7iUY9/yNJ6Rrm0YUUj58Sfh4iiXLlbB9xvJrjd23QXUrlVS6Cv3eKvs/pFU5AGbpA+lxREgdKj6DyqVWZs9Dopzx7x/hkx2GOlOc+YDutveyZDHiKT/hUlE+8y/KaSQhSsjkzAENnxGGKKnJKgRHTc8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W9Q3OVNL; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W9Q3OVNL" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3a0bdcd7357so909022f8f.1; Thu, 15 May 2025 08:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747323104; x=1747927904; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+UMNOScS/nLhEASnWiqg2pAIhCiCnLz2QSJ+NCAvmKU=; b=W9Q3OVNL2qQabAaZ5izfjk5ghRv8Ppu6hXE/tMZRKC71Bk30N6Ahgnc3YPiQnqd9Qo P4zZty3VNtwLt4nJfM6lm8O/+sV7qjuzYFjZazbNuyYCx+baZ/c3csXAjyX9qZ0qSAuR U36+EUJOb+YNAOJTikoRFb14AafgVYE3alK9lVlgv0Uc2CFu0B8zaxzQgvtFjL082nh6 hzNT7YsrcMlpNmEND9JKKhEUYP8Wfa3dGUUwQ//SG+emx4b82Uw4L4HOQ/fdtDaYWKuz t3V9iN7E5isC0K6XDK9IaEt6RA4MAlaq6qe00p+YG1d1hvzceiqMo7krBuU6yA7C5eg9 qcJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747323104; x=1747927904; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+UMNOScS/nLhEASnWiqg2pAIhCiCnLz2QSJ+NCAvmKU=; b=GetuN+wwJ3H13oJfRupPaNqxS78BLMsiJWmDdvoN+iwqfJTHjb4nsEodHMcBHJxLgn Vczt1FLiJEb47UhgA+SllNXYMjgqBe2SbmPeYWNs3eYdjpTKKkNpIRfdnaJoiRkHAVbL XyIQvepoGI4KUSLrZkg8loSOjwb3kQRF60VGSxg8xafsnJxx6BK6hrMFD2SXgiAJqAKx pe8GkIDZyMimcaefdzCsNsCw033U0pMYRm+JIGdpG8UzpTM3H3ACdGKYbrB64WzmzqLx 3s5AUh7jpTgBF7vsauZO6KhMb9H6C/XLoXJYgbxRhnosIcNd/X0radHLpGBzaYfHzCf8 ldqg== X-Forwarded-Encrypted: i=1; AJvYcCUPRteV7hks2XdaLB/UHRML6jVy4CKvVWFjws0iePjIa/HAPpmMquH3J0HZPO7ZUKVikZNuG6SJRG7WIA==@vger.kernel.org X-Gm-Message-State: AOJu0Yyugvcfsy36YBxdh6iHH0JHe171anf2AH6sb6j7ysd+AK1iaNIf q1tsq6l+pZTfZLE/cuD1Yk79D4eOwpYXKdTArPi9q3Y8yhpUsjj/XaSa X-Gm-Gg: ASbGncvMmNRYFDkqMnPRkwGOjGBSi3zXycHjN74IUQi8ZLeasZnP+xeOfRngJiZMTyC C+Pb/o4ibPmAMsjuOTI8omQCGOnVZCjDilI/odG+ArFBX/xF6f6pAS+XQY9BCuux9zL4EyTSjtn Ou0QuEZBkuEdfvX0i/yRVtLmO6yPTI4Xv5TknwqAenY9BkqQg36X9QDVcL6m5BprpvFtCPf6pzS CXD0/tfNvF+n/4ZhNG0OgaFWjo35AawDUXeBg8VWVbfixu1Q/ckEtWmyoaH0qxXVSODpAbWRCNu zPJDeJXvhuvHa+2Y/il8TKcqDIeRcFKwyREsDwejZT96bxjNIz16is/reQtcu82Bwh2bOqyzZ3U jkVL1X1urhDXG X-Google-Smtp-Source: AGHT+IFCWv7sS0o5RLMAYzy00EVXOEEzZ8epBiVhzCbLF/WOtKr85X0xxKEIvVfQ/4cmLc4GelQZfg== X-Received: by 2002:a05:6000:2012:b0:391:31c8:ba59 with SMTP id ffacd0b85a97d-3a35c808b6emr237791f8f.4.1747323104135; Thu, 15 May 2025 08:31:44 -0700 (PDT) Received: from playground.localdomain ([82.79.237.69]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a1f57ddfd6sm22617986f8f.4.2025.05.15.08.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 May 2025 08:31:43 -0700 (PDT) From: Laurentiu Mihalcea To: Mark Brown , Kuninori Morimoto , Jaroslav Kysela , Takashi Iwai , Liam Girdwood Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org Subject: [PATCH RFC 1/3] ASoC: re-introduce disable_route_checks flag for OF routes Date: Thu, 15 May 2025 11:31:26 -0400 Message-Id: <20250515153128.147457-2-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250515153128.147457-1-laurentiumihalcea111@gmail.com> References: <20250515153128.147457-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Laurentiu Mihalcea The "disable_route_checks" flag was previously removed via commit dd2395162c07 ("ASoC: remove disable_route_checks") as it wasn't being used anywhere. Re-introduce an OF-specific variant of the flag: "disable_of_route_checks" as this will be used by audio-graph-card2. Signed-off-by: Laurentiu Mihalcea --- include/sound/soc.h | 1 + sound/soc/soc-core.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 1fffef311c41..e76da038557d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1077,6 +1077,7 @@ struct snd_soc_card { unsigned int instantiated:1; unsigned int topology_shortname_created:1; unsigned int fully_routed:1; + unsigned int disable_of_route_checks:1; unsigned int probed:1; unsigned int component_chaining:1; struct device *devres_dev; diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 67bebc339148..b14a52d6f550 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2245,8 +2245,16 @@ static int snd_soc_bind_card(struct snd_soc_card *ca= rd) =20 ret =3D snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, card->num_of_dapm_routes); - if (ret < 0) - goto probe_end; + if (ret < 0) { + if (card->disable_of_route_checks) { + ret =3D 0; + dev_info(card->dev, + "%s: disable_of_route_checks set, ignoring errors on add_routes\n", + __func__); + } else { + goto probe_end; + } + } =20 /* try to set some sane longname if DMI is available */ snd_soc_set_dmi_name(card); --=20 2.34.1 From nobody Sun Feb 8 16:29:41 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2032A218AD1; Thu, 15 May 2025 15:31:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747323111; cv=none; b=arK6+Tj5kr19qDNX2sweyUS6XP2JB5R/ScZlEOROjL5NvPwa+04+sxiovd7GDZb2R+RbzDkdM5dNHNB8m/69Gp0YTC6SDsy3mAiebq1lv4hNBhmwUoxFU/S7NvtdLquwTKBp/y2zgpo3JtTxcAclY6YcC/UF89eQfFpTqJQS2vg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747323111; c=relaxed/simple; bh=cBcgA6HaHPPzitiZFs5MpdNT1DsZGeK49EqlZ838GW4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CK4E7Ki2GgR4miJzxA7euwDCx18Eh6bnh+34ECvMFYxuVsw3UjDDmqyGbKHtpZ1o834/F9LhHyPLBFYjYxFOotMaQcg19APva0MATLNpCd01k8Mtw0exnDIupB/gtTy+8Eto4jfW/n0qTEx0+3G99ieHXX3+GyCzL/EphN7gjAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ht/VAvjS; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ht/VAvjS" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3a1f8c85562so743534f8f.1; Thu, 15 May 2025 08:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747323107; x=1747927907; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zLwt1FYr5148j46Ognfh7L/rr/DYcwJpTHHhc/HKIDE=; b=Ht/VAvjS+WAxE77GPqGlHovshM53IgTdR5a6Nl90QghLtl3LAw2/KKBkZVESOZdCOI mQbFFw/8TfYjmHGtdbYnyRaKPJbQcDiQw/Cl0nvIjhZ1YLT2vSEQUz3bQK+iHJI8r8Us sYShSuY8kCS+R9uQqFPK38SQDAbkDnXrKV1wHq2P2lgfefN2Ghv311f5hdplT9Mphk3T li/Fa8kzj1mjLXn1G1AwDI9TDUz62bp7of7VFI5ZU7r557HeqIa8k7Co1wUrCKLFceMY 5WF7lPqMnOQdO5SyW5MZLmIYHq3GuFfqa68kMaizyO7owAEqT0JYEL+6H9/bHBWePOEe 8BxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747323107; x=1747927907; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zLwt1FYr5148j46Ognfh7L/rr/DYcwJpTHHhc/HKIDE=; b=K+EZ+WqZWrd6XJrS9ieUSIMeyApLVyM8z9jp51bQYnBexbVjGHhD3fjUKeyov87AmY eflj4rqbXdqZsMo0jh/uhCVXa7826SJ99Th7cjRSjM0Djpli4oPYx+jh8EpPJrFvszZI q3MxNNVeNBSbKgEscS4FwAV9S8EpmLKmdiniADrYfj+SGoit0GRScgrqjrEDtplrPbPL 2tP4nhKWpmfVi0OrVGMfWWJSoEPiWHAbyhA7KCeyl+2bAAYiXpn55cP6G2AeDESPBmCD y9Ybz2W3Jn9YWDVDjF540fpfpFszVxwHwOBEUdmviUj+MDZF2hfWlq/CsPw4d7thh2LC ahEA== X-Forwarded-Encrypted: i=1; AJvYcCUsAW9KwwSWM+H25PgPsfNAz6/6R1gmZk5zxZtUp51xLPBu4qDz7cLqea6ivJxJg4IXd54/im+nuv9hHA==@vger.kernel.org X-Gm-Message-State: AOJu0Yww/Es80PHukLuASHgLs3A9oQxbXefqoibcZblMKMatoHO55oYR 7cQ45fclALcf+y5O1iVXQAMIlfhMGznDuQXUBj3tpvwAzQo+kqboL0brLg03Jg== X-Gm-Gg: ASbGnctRKHj0GlTjuUttwWeIiS957Aq7pZBSdS+K526ife9v1C+Ot3gfU+pP+U5da54 i2LWsdgGsOwPFvlVvwRGyx5xRpQrjt3ldHb9keYqBwgI0nnIEGBfk+sKlavJTSrzbcmdZ+09yTF 1V0li6CGoLRrxEVCmRM/502wEmvvYefYsgJv0aBukOi7i7zsiTBfjG4EGzDYw3k5J04QcfD1xZX hYOVe9WY0+jdbdmSwd7+eaUvy1Y2ix7smVFmnbAuxgi0uRFEIUEJDlHbUIZbPV6qm1jNSn3VheP k2cq1aENg65CdxW/FgIbSFNsoBl+FtvX9ptgxJMnrgVoVwWbwoNkkr4rwo+gaPu3ujNj+nuyMvW mW93n4/gGqEKV X-Google-Smtp-Source: AGHT+IH0wGJLDv1W3mr3bnOAu3g6WQKXYCFawYw6lfyfiAOXYmec3iDNTpos/eCVj6uQMs5qojigDg== X-Received: by 2002:a05:6000:400f:b0:3a0:bad4:1247 with SMTP id ffacd0b85a97d-3a35c8203fdmr274011f8f.15.1747323107204; Thu, 15 May 2025 08:31:47 -0700 (PDT) Received: from playground.localdomain ([82.79.237.69]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a1f57ddfd6sm22617986f8f.4.2025.05.15.08.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 May 2025 08:31:46 -0700 (PDT) From: Laurentiu Mihalcea To: Mark Brown , Kuninori Morimoto , Jaroslav Kysela , Takashi Iwai , Liam Girdwood Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org Subject: [PATCH RFC 2/3] ASoC: audio-graph-card2: support explicitly disabled links Date: Thu, 15 May 2025 11:31:27 -0400 Message-Id: <20250515153128.147457-3-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250515153128.147457-1-laurentiumihalcea111@gmail.com> References: <20250515153128.147457-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Laurentiu Mihalcea An explicitly disabled link is a DAI link in which one of its device endpoints (e.g: codec or CPU) has been disabled in the DTS via the "status" property. Formally speaking: OF_LINK_IS_DISABLED(lnk) =3D OF_NODE_IS_DISABLED(dev0) || OF_NODE_IS_DISABLED(dev1); where dev0 and dev1 are the two devices (CPU/codec) that make up the link. If at least one link was explicitly disabled that means DAPM routes passed through the OF property "routing" can fail as some widgets might not exist. Consider the following example: CODEC A has widgets A0, A1. CODEC B has widgets B0, B1. my-card { compatible =3D "audio-graph-card2": label =3D "my-label"; links =3D <&cpu0_port>, <&cpu1_port>; routing =3D "A0", "A1", "B0", "B1"; }; CODEC A's DT node was disabled. CODEC B's DT node is enabled. CPU0's DT node is enabled. CPU1's DT node is enabled. If CODEC A's DT node is disabled via the 'status =3D "disabled"' property that means the A0 -> A1 route cannot be created. This doesn't affect the B0 -> B1 route though as CODEC B was never disabled in the DT. This is why, if any explicitly disabled link is discovered, the "disable_of_route_checks" flag is turned on. If all links were explicitly disabled the sound card creation will fail. Otherwise, if there's at least one link which wasn't explicitly disabled then the sound card creation will succeed. Signed-off-by: Laurentiu Mihalcea --- include/sound/simple_card_utils.h | 3 +- sound/soc/generic/audio-graph-card2.c | 231 ++++++++++++++++++++++++++ 2 files changed, 233 insertions(+), 1 deletion(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_= utils.h index 69a9c9c4d0e9..3fde0314dbb2 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -132,9 +132,10 @@ struct simple_util_priv { #define SNDRV_MAX_LINKS 512 =20 struct link_info { - int link; /* number of link */ + int link; /* number of available links */ int cpu; /* turn for CPU / Codec */ struct prop_nums num[SNDRV_MAX_LINKS]; + bool disabled_link; /* true if there's at least one explicitly disabled l= ink */ }; =20 int simple_util_parse_daifmt(struct device *dev, diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audi= o-graph-card2.c index 5dcc78c551a2..92774361a688 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -1269,6 +1269,226 @@ static int graph_count(struct simple_util_priv *pri= v, return graph_ret(priv, ret); } =20 +static bool single_port_device_is_disabled(struct device_node *port) +{ + struct device_node *port_device __free(device_node) =3D NULL; + struct device_node *ports __free(device_node) =3D port_to_ports(port); + + if (!ports) + port_device =3D of_get_parent(port); + else + port_device =3D of_get_parent(ports); + + return !of_device_is_available(port_device); +} + +static bool multi_nm_port_device_is_disabled(struct device_node *port) +{ + struct device_node *ep, *prev =3D NULL; + struct device_node *remote_ep __free(device_node) =3D NULL; + struct device_node *remote_port __free(device_node) =3D NULL; + struct device_node *remote_device __free(device_node) =3D NULL; + + while (1) { + ep =3D of_graph_get_next_port_endpoint(port, prev); + if (!ep) + break; + + /* first endpoint is special because it points to the remote device */ + if (!prev) { + remote_device =3D of_graph_get_remote_port(ep); + + if (single_port_device_is_disabled(remote_device)) + return true; + + prev =3D ep; + + continue; + } + + /* first get the remote port associated with the current endpoint */ + remote_port =3D of_graph_get_remote_port(ep); + if (!remote_port) + break; + + /* ... then get the first endpoint in remote port */ + remote_ep =3D of_graph_get_next_port_endpoint(remote_port, NULL); + if (!remote_ep) + break; + + /* ... and finally get the remote device node */ + remote_device =3D of_graph_get_remote_port(remote_ep); + if (!remote_device) + break; + + if (single_port_device_is_disabled(remote_device)) + return true; + + prev =3D ep; + } + + return false; +} + +static int graph_get_port_endpoint_count(struct device_node *port) +{ + int num =3D 0; + + for_each_of_graph_port_endpoint(port, it) + num++; + + return num; +} + +static bool multi_port_device_is_disabled(struct device_node *lnk) +{ + int i, ep_count; + struct device_node *port __free(device_node) =3D NULL; + struct device_node *port_ep __free(device_node) =3D NULL; + struct device_node *remote_port __free(device_node) =3D NULL; + struct device_node *ports __free(device_node) =3D port_to_ports(lnk); + + if (!ports) + return false; + + for (i =3D 0;; i++) { + port =3D of_graph_get_port_by_id(ports, i + 1); + if (!port) + break; + + /* N CPUs to M CODECs will have the endpoint count > 1 */ + ep_count =3D graph_get_port_endpoint_count(port); + if (!ep_count) + break; + + if (ep_count > 1) { + if (multi_nm_port_device_is_disabled(port)) + return true; + + continue; + } + + port_ep =3D of_graph_get_next_port_endpoint(port, NULL); + if (!port_ep) + break; + + remote_port =3D of_graph_get_remote_port(port_ep); + if (!remote_port) + break; + + /* + * if one port device is disabled then the whole link will + * be disabled, thus we can stop at the first disabled device. + */ + if (single_port_device_is_disabled(remote_port)) + return true; + } + + return false; +} + +static bool normal_port_device_is_disabled(struct device_node *port) +{ + if (graph_lnk_is_multi(port)) + return multi_port_device_is_disabled(port); + else + return single_port_device_is_disabled(port); +} + +static bool _dpcm_c2c_link_is_disabled(struct snd_soc_card *card, + struct device_node *lnk) +{ + struct device_node *ep __free(device_node) =3D NULL; + struct device_node *remote_port __free(device_node) =3D NULL; + + ep =3D of_graph_get_next_port_endpoint(lnk, NULL); + if (!ep) { + dev_err(card->dev, "port has no endpoint\n"); + return false; + } + + remote_port =3D of_graph_get_remote_port(ep); + if (!remote_port) { + dev_err(card->dev, "failed to fetch remote port\n"); + return false; + } + + if (__graph_get_type(remote_port) =3D=3D GRAPH_MULTI) + return multi_port_device_is_disabled(remote_port); + else + return single_port_device_is_disabled(remote_port); +} + +static bool c2c_link_is_disabled(struct snd_soc_card *card, + struct device_node *lnk) +{ + struct device_node *ports __free(device_node) =3D NULL; + + ports =3D port_to_ports(lnk); + + if (!ports) { + dev_err(card->dev, "C2C port should be child of 'ports'\n"); + return false; + } + + for_each_of_graph_port(ports, it) { + if (_dpcm_c2c_link_is_disabled(card, it)) + return true; + }; + + return false; +} + +static bool normal_link_is_disabled(struct snd_soc_card *card, + struct device_node *lnk) +{ + struct device_node *cpu_port; + struct device_node *cpu_ep __free(device_node) =3D NULL; + struct device_node *codec_port __free(device_node) =3D NULL; + + cpu_port =3D lnk; + + cpu_ep =3D of_graph_get_next_port_endpoint(cpu_port, NULL); + if (!cpu_ep) { + dev_err(card->dev, "CPU port has no endpoint\n"); + return false; + } + + codec_port =3D of_graph_get_remote_port(cpu_ep); + if (!codec_port) { + dev_err(card->dev, "unable to find remote codec port\n"); + return false; + } + + return normal_port_device_is_disabled(codec_port) || + normal_port_device_is_disabled(cpu_port); +} + +static bool graph_link_is_disabled(struct simple_util_priv *priv, + enum graph_type gtype, + struct device_node *lnk, + struct link_info *li) +{ + bool link_disabled =3D false; + struct snd_soc_card *card =3D simple_priv_to_card(priv); + + switch (gtype) { + case GRAPH_NORMAL: + link_disabled =3D normal_link_is_disabled(card, lnk); + break; + case GRAPH_DPCM: + link_disabled =3D _dpcm_c2c_link_is_disabled(card, lnk); + break; + case GRAPH_C2C: + link_disabled =3D c2c_link_is_disabled(card, lnk); + break; + default: + break; + } + + return link_disabled; +} + static int graph_for_each_link(struct simple_util_priv *priv, struct graph2_custom_hooks *hooks, struct link_info *li, @@ -1291,6 +1511,12 @@ static int graph_for_each_link(struct simple_util_pr= iv *priv, =20 gtype =3D graph_get_type(priv, lnk); =20 + if (graph_link_is_disabled(priv, gtype, lnk, li)) { + if (!li->disabled_link) + li->disabled_link =3D true; + continue; + } + ret =3D func(priv, hooks, gtype, lnk, li); if (ret < 0) break; @@ -1325,6 +1551,11 @@ int audio_graph2_parse_of(struct simple_util_priv *p= riv, struct device *dev, if (ret < 0) goto err; =20 + if (li->disabled_link) { + dev_info(dev, "detected disabled link(s) - route creation may fail\n"); + card->disable_of_route_checks =3D 1; + } + ret =3D simple_util_init_priv(priv, li); if (ret < 0) goto err; --=20 2.34.1 From nobody Sun Feb 8 16:29:41 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2D8C218AD7; Thu, 15 May 2025 15:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747323114; cv=none; b=e9WG7m8JuWhx0phZrL1GXOae2d/SfYQvCNAL+SXcm0Mko5ANSU0WrhK86uFX6kY86bWSo+gt7tLo/WrhmBIeNilisCsBGNSNxYVV586bn0oxoTv2wyd4mU3UFyN1cmpobEnW0D0HAdyx088QFWUb2817tG4KcP8ATpR9/VT82+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747323114; c=relaxed/simple; bh=1tSHlI+nBci4m0RN/w9tw57gf3bV63lMA4x/xrf1GSs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=m1C8zD3mSqWs2vX8Ru+a1QFvTquqhvjpJ6G90CndeZLZJyQEOvcpvEFdWvPHgt/rl7UB5Lr8KXFVfmYNePA5VIRFqhphMvIG5dOTj1k2suPWLp/MpC3R423eK2mLXTLBjB6sDjMRkcT+AXFpU5Th9KCSX9V94PGwUVJBYiEK194= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZYepqzXz; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZYepqzXz" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3a0bdcd7357so909106f8f.1; Thu, 15 May 2025 08:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747323110; x=1747927910; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UE3pPQa7RYxSqG0xcc+yUD/C1a5whAflL40nHxeJ4Tw=; b=ZYepqzXz14Z1BxCnmMwkE5DueISqbdrxhnhoVqhY8drADmFV6RZPqQX8cQ2RoR9EVw 0Hyhk4P7e3icS2ety8/u6hmcA0ExiWjy47OaA3BXgNZd1q1r50KDDrVXqKPVwo2pFuui iwsEZlGla8M3K0RrPkvkJjbVNi3mZRhtEF7SE3MwVZsWWNuGuYbUCgcFh8tMVwdwjdkI GDuBHGzDPBrkhUrAoXpTN5b+FVGfjIJFB4elDBUf0tpr8dhBVeqgJOf8E0fLnr3os1Kp Oi5MULz3GXAcZm4IK10Ic70eRosbZD3GqCteP20PE3laxFWw/m+RPnVDEV+TIm88+dI/ 9//A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747323110; x=1747927910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UE3pPQa7RYxSqG0xcc+yUD/C1a5whAflL40nHxeJ4Tw=; b=FrKbPAkdRnzgtqWG6el/ZcwSRqCI70GofebgaSbpZlxsCKW0nlXCWST/Pn7IpYLyqA AXdyuV0wba0ZWcAmAbhB7HbMm9vWdylAfgab/NY+rsdMsDopY8vWEvENvG2UvZdvWTRq UwLhb/zBdcgQo70f25An22D5a4B/jIlGouY4l7XhnKJYpHYgRFAcm3IhRreTGYholef7 cnc2JyYqp0HXTYL0xAYctmCnv6ulAQDcKizesYbgsXYRRfYEirIGP+5rDn+cMRz8K/7I hUjT7TT5YFIO3ZcJJuaTQlIzrlBd4peChYsNNHQeEmgNjw04AZ1UVpBmt/szQfNtL28v eWXg== X-Forwarded-Encrypted: i=1; AJvYcCWVXorWBH5f2L4JYEe1pDLRpNIiI4nd44gIg8RE5osNBuoMoxKhCeXz5cPrLgHx8AgMJ+KyYPeDGC+S6w==@vger.kernel.org X-Gm-Message-State: AOJu0YzoqmwiVyzHMMb3zlIQ0dPcsvxuijkyjqzzI/n4rxS26/rGXwKe tWGRPC5Mj16pN+sKR+vkH6Ek7cayq+T+VEugbtY70nGKM3qhcSq8nBy4 X-Gm-Gg: ASbGncuEynzYgx8h1WoFQXey150IZm7gdgmrIq12d197Wj/d8z7eNZT67biuXr3kUYk N1OEoGYs8UYktC2A+StvPlmkza/HRrg91U/5oASjf0vAoQaxMOJBIpd1ef1WcvZ00H5WAV3S2sr 0vgLmrvyXRgE0dYYIzSj8mcd7EGMzy8GrOPi3EbsOAQPkOwoGvZ4Lbve9Xpm8VtK1I+WthTqH99 8ub03nwDYN51qj7Uvg7dF5ex36/hTVIbot7mmhUs9RJMBGgphDgSV2qBuaxieab1YYeLABpsvuX EbA+BGRv38S0DEkOyST/YhSb4EFvk8zG5JoLD3mB+p+7+101K4bfJvMBemZeY1QbJSL8nOp2mPC 8pn3ZzzSC5+9gyIZrYOonOvM= X-Google-Smtp-Source: AGHT+IHjZCDZ6X7uCXmCTwKcA3S9L8UAxdVvJv9GcjufeKxyXRw+jZM3Rrul+srFFu3g+04o590O1g== X-Received: by 2002:a05:6000:2af:b0:3a0:ad55:c9f2 with SMTP id ffacd0b85a97d-3a35c808d10mr301467f8f.1.1747323109660; Thu, 15 May 2025 08:31:49 -0700 (PDT) Received: from playground.localdomain ([82.79.237.69]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a1f57ddfd6sm22617986f8f.4.2025.05.15.08.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 May 2025 08:31:49 -0700 (PDT) From: Laurentiu Mihalcea To: Mark Brown , Kuninori Morimoto , Jaroslav Kysela , Takashi Iwai , Liam Girdwood Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org Subject: [PATCH RFC 3/3] ASoC: generic: add more sample DTSIs for audio-graph-card2 Date: Thu, 15 May 2025 11:31:28 -0400 Message-Id: <20250515153128.147457-4-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250515153128.147457-1-laurentiumihalcea111@gmail.com> References: <20250515153128.147457-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Laurentiu Mihalcea Add some more audio-graph-card2 sample DTSIs meant to aid in testing the driver's capability to parse explicitly disabled links. To conclude that the feature works correctly, all audio-graph-card2 samples need to work as expected. This includes the custom ones: 1) audio-graph-card2-custom-sample1.dtsi 2) audio-graph-card2-custom-sample2.dtsi Signed-off-by: Laurentiu Mihalcea --- .../generic/audio-graph-card2-sample1.dtsi | 278 ++++++ .../generic/audio-graph-card2-sample2.dtsi | 878 ++++++++++++++++++ .../generic/audio-graph-card2-sample3.dtsi | 486 ++++++++++ 3 files changed, 1642 insertions(+) create mode 100644 sound/soc/generic/audio-graph-card2-sample1.dtsi create mode 100644 sound/soc/generic/audio-graph-card2-sample2.dtsi create mode 100644 sound/soc/generic/audio-graph-card2-sample3.dtsi diff --git a/sound/soc/generic/audio-graph-card2-sample1.dtsi b/sound/soc/g= eneric/audio-graph-card2-sample1.dtsi new file mode 100644 index 000000000000..ce0098a160a6 --- /dev/null +++ b/sound/soc/generic/audio-graph-card2-sample1.dtsi @@ -0,0 +1,278 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2025 NXP + * + * audio-graph-card2 simple link test scenarios + * + * IMPORTANT: + * + * 1) DO NOT use this alongside the other test scenarios as the + * node names are not unique across test DTSIs. + */ + +/ { + /* + * Testcase 00 + * + * DESCRIPTION: test simple CPU-CODEC with no routing specified. Each + * endpoint device has only one available port. + * + * TOPOLOGY: + * + * CPU0 <---@----> CODEC0 + * CPU1 <---@----> CODEC1 + * CPU2 <---@----> CODEC2 + * + * CPU0 =3D> ENABLED + * CPU1 =3D> DISABLED + * CPU2 =3D> ENABLED + * CODEC0 =3D> ENABLED + * CODEC1 =3D> ENABLED + * CODEC2 =3D> DISABLED + * + * RESULT: + * - sound card creation should succeed with 2 explicitly disabled links. + */ + test-case-00 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-00"; + links =3D <&simple_cpu0_port>, + <&simple_cpu1_port>, + <&simple_cpu2_port>; + }; + + test-cpu0 { + compatible =3D "test-cpu"; + + simple_cpu0_port: port { + biclock-master; + frame-master; + + test_cpu_0_ep: endpoint { + remote-endpoint =3D <&test_codec_0_ep>; + }; + }; + }; + + test-cpu1 { + compatible =3D "test-cpu"; + status =3D "disabled"; + + simple_cpu1_port: port { + biclock-master; + frame-master; + + test_cpu_1_ep: endpoint { + remote-endpoint =3D <&test_codec_1_ep>; + }; + }; + }; + + test-cpu2 { + compatible =3D "test-cpu"; + + simple_cpu2_port: port { + bitclock-master; + frame-master; + + test_cpu_2_ep: endpoint { + remote-endpoint =3D <&test_codec_2_ep>; + }; + }; + }; + + test-codec0 { + compatible =3D "test-codec"; + + port { + test_codec_0_ep: endpoint { + remote-endpoint =3D <&test_cpu_0_ep>; + }; + }; + }; + + test-codec1 { + compatible =3D "test-codec"; + + port { + test_codec_1_ep: endpoint { + remote-endpoint =3D <&test_cpu_1_ep>; + }; + }; + }; + + test-codec2 { + compatible =3D "test-codec"; + status =3D "disabled"; + + port { + test_codec_2_ep: endpoint { + remote-endpoint =3D <&test_cpu_2_ep>; + }; + }; + }; + + /* + * Testcase 01 + * + * DESCRIPTION: test simple CPU-CODEC with no routing specified. Each + * endpoint device has one or more available ports. + * + * TOPOLOGY: + * + * CPU3/P0 <---@----> CODEC3 + * CPU3/P1 <---@----> CODEC4 + * CPU4 <---@----> CODEC5/P0 + * CPU3/P2 <---@----> CODEC5/P1 + * + * CPU3 =3D> ENABLED + * CPU4 =3D> DISABLED + * CODEC3 =3D> ENABLED + * CODEC4 =3D> DISABLED + * + * RESULT: + * - sound card creation should succeed with 2 explicitly disabled links + */ + test-case-01 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-01"; + links =3D <&test_cpu3_port0>, + <&test_cpu3_port1>, + <&test_cpu4_port>, + <&test_cpu3_port2>; + }; + + test-cpu3 { + compatible =3D "test-cpu"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + test_cpu3_port0: port@0 { + reg =3D <0>; + + test_cpu3_p0_ep: endpoint { + remote-endpoint =3D <&test_codec3_ep>; + }; + }; + + test_cpu3_port1: port@1 { + reg =3D <1>; + + test_cpu3_p1_ep: endpoint { + remote-endpoint =3D <&test_codec4_ep>; + }; + }; + + test_cpu3_port2: port@2 { + reg =3D <2>; + + test_cpu3_p2_ep: endpoint { + remote-endpoint =3D <&test_codec5_p1_ep>; + }; + }; + }; + }; + + test-cpu4 { + compatible =3D "test-cpu"; + status =3D "disabled"; + + test_cpu4_port: port { + test_cpu4_ep: endpoint { + remote-endpoint =3D <&test_codec5_p0_ep>; + }; + }; + }; + + test-codec3 { + compatible =3D "test-codec"; + + port { + test_codec3_ep: endpoint { + remote-endpoint =3D <&test_cpu3_p0_ep>; + }; + }; + }; + + test-codec4 { + compatible =3D "test-codec"; + status =3D "disabled"; + + port { + test_codec4_ep: endpoint { + remote-endpoint =3D <&test_cpu3_p1_ep>; + }; + }; + }; + + test-codec5 { + compatible =3D "test-codec"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + test_codec5_port0: port@0 { + reg =3D <0>; + + test_codec5_p0_ep: endpoint { + remote-endpoint =3D <&test_cpu4_ep>; + }; + }; + + test_codec5_port1: port@1 { + reg =3D <1>; + + test_codec5_p1_ep: endpoint { + remote-endpoint =3D <&test_cpu3_p2_ep>; + }; + }; + }; + }; + + /* + * Testcase 02 + * + * DESCRIPTION: test simple CPU-CODEC with no routing specified. The + * CPU-CODEC link is disabled. + * + * TOPOLOGY: + * + * CPU5 <---@-----> CODEC6 + * + * CPU5 =3D> DISABLED + * CODEC6 =3D> ENABLED + * + * RESULT: + * - sound card creation should fail since all of its links are + * explicitly disabled. + */ + test-case-02 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-02"; + links =3D <&test_cpu5_port>; + }; + + test-cpu5 { + compatible =3D "test-cpu"; + status =3D "disabled"; + + test_cpu5_port: port { + test_cpu5_port_ep: endpoint { + remote-endpoint =3D <&test_codec6_port_ep>; + }; + }; + }; + + test-codec6 { + compatible =3D "test-codec"; + + port { + test_codec6_port_ep: endpoint { + remote-endpoint =3D <&test_cpu5_port_ep>; + }; + }; + }; +}; diff --git a/sound/soc/generic/audio-graph-card2-sample2.dtsi b/sound/soc/g= eneric/audio-graph-card2-sample2.dtsi new file mode 100644 index 000000000000..0bcbf2a46b79 --- /dev/null +++ b/sound/soc/generic/audio-graph-card2-sample2.dtsi @@ -0,0 +1,878 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2025 NXP + * + * audio-graph-card2 multi link test scenarios + * + * IMPORTANT: + * + * 1) DO NOT use this alongside the other test scenarios as the + * node names are not unique across test DTSIs. + * + * 2) The test topologies used here are adapted from + * "audio-graph-card2-custom-sample1.dtsi". + */ + +/ { + /* + * Testcase 00 + * + * DESCRIPTION: test disabled semi-multi link + * + * TOPOLOGY: + * + * +-+ + * TEST_CPU0/P0 <-@--------> | |-> TEST_CODEC0/P0 + * | |-> TEST_CODEC0/P1 + * +-+ + * + * TEST_CODEC0 =3D> DISABLED + * TEST_CPU0 =3D> ENABLED + * + * + * RESULT: + * - sound card creation should fail as all of its links are + * explicitly disabled. + */ + test-case-00 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-00"; + links =3D <&cpu0_port0>; + + multi { + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* SM link port */ + port@0 { + reg =3D <0>; + + smcodec0_port0_ep: endpoint { + remote-endpoint =3D <&cpu0_port0_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + smcodec0_port1_ep: endpoint { + remote-endpoint =3D <&codec0_port0_ep>; + }; + }; + + port@2 { + reg =3D <2>; + + smcodec0_port2_ep: endpoint { + remote-endpoint =3D <&codec0_port1_ep>; + }; + }; + }; + }; + }; + + test-cpu0 { + compatible =3D "test-cpu"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + cpu0_port0: port@0 { + reg =3D <0>; + + cpu0_port0_ep: endpoint { + remote-endpoint =3D <&smcodec0_port0_ep>; + }; + }; + }; + }; + + test-codec0 { + compatible =3D "test-codec"; + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + codec0_port0_ep: endpoint { + remote-endpoint =3D <&smcodec0_port1_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + codec0_port1_ep: endpoint { + remote-endpoint =3D <&smcodec0_port2_ep>; + }; + }; + }; + }; + + /* + * Testcase 01 + * + * DESCRIPTION: test semi-multi link with explicitly disabled CPU. + * + * TOPOLOGY: + * + * +-+ + * TEST_CPU1 <-@--------> | |-> TEST_CODEC1/P0 + * | |-> TEST_CODEC1/P1 + * +-+ + * + * TEST_CPU2 <---@----> TEST_CODEC2 (ACTIVE) + * + * + * TEST_CPU1 =3D> DISABLED + * TEST_CPU2 =3D> ENABLED + * TEST_CODEC1 =3D> ENABLED + * TEST_CODEC2 =3D> ENABLED + * + * RESULT: + * - sound card creation should succeed with 1 explicitly disabled link. + */ + test-case-01 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-01"; + links =3D <&cpu1_port>, <&cpu2_port>; + + multi { + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* SM link port */ + port@0 { + reg =3D <0>; + + smcodec1_port0_ep: endpoint { + remote-endpoint =3D <&cpu1_port_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + smcodec1_port1_ep: endpoint { + remote-endpoint =3D <&codec1_port0_ep>; + }; + }; + + port@2 { + reg =3D <2>; + + smcodec1_port2_ep: endpoint { + remote-endpoint =3D <&codec1_port1_ep>; + }; + }; + }; + }; + }; + + test-cpu1 { + compatible =3D "test-cpu"; + status =3D "disabled"; + + cpu1_port: port { + cpu1_port_ep: endpoint { + remote-endpoint =3D <&smcodec1_port0_ep>; + }; + }; + }; + + test-cpu2 { + compatible =3D "test-cpu"; + + cpu2_port: port { + cpu2_port_ep: endpoint { + remote-endpoint =3D <&codec2_port_ep>; + }; + }; + }; + + test-codec1 { + compatible =3D "test-codec"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + codec1_port0_ep: endpoint { + remote-endpoint =3D <&smcodec1_port1_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + codec1_port1_ep: endpoint { + remote-endpoint =3D <&smcodec1_port2_ep>; + }; + }; + }; + }; + + test-codec2 { + compatible =3D "test-codec"; + + port { + codec2_port_ep: endpoint { + remote-endpoint =3D <&cpu2_port_ep>; + }; + }; + }; + + /* + * Testcase 02 + * + * DESCRIPTION: test semi-multi link with one explicitly disabled codec. + * + * TOPOLOGY: + * + * +-+ + * TEST_CPU3 <-@--------> | |-> TEST_CODEC3 (ACTIVE) + * (ACTIVE) | |-> TEST_CODEC4 (DISABLED) + * +-+ + * + * TEST_CPU4 <---@----> TEST_CODEC5 (ACTIVE) + * (ACTIVE) + * + * + * TEST_CPU3 =3D> ENABLED + * TEST_CPU4 =3D> ENABLED + * TEST_CODEC3 =3D> ENABLED + * TEST_CODEC4 =3D> DISABLED + * TEST_CODEC5 =3D> ENABLED + * + * RESULT: + * - sound card creation should succeed with 1 explicitly disabled link. + */ + test-case-02 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-02"; + links =3D <&cpu3_port>, <&cpu4_port>; + + multi { + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* SM link port */ + port@0 { + reg =3D <0>; + + smcodec2_port0_ep: endpoint { + remote-endpoint =3D <&cpu3_port_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + smcodec2_port1_ep: endpoint { + remote-endpoint =3D <&codec3_port_ep>; + }; + }; + + port@2 { + reg =3D <2>; + + smcodec2_port2_ep: endpoint { + remote-endpoint =3D <&codec4_port_ep>; + }; + }; + }; + }; + }; + + test-cpu3 { + compatible =3D "test-cpu"; + + cpu3_port: port { + cpu3_port_ep: endpoint { + remote-endpoint =3D <&smcodec2_port0_ep>; + }; + }; + }; + + test-cpu4 { + compatible =3D "test-cpu"; + + cpu4_port: port { + cpu4_port_ep: endpoint { + remote-endpoint =3D <&codec5_port_ep>; + }; + }; + }; + + test-codec3 { + compatible =3D "test-codec"; + + port { + codec3_port_ep: endpoint { + remote-endpoint =3D <&smcodec2_port1_ep>; + }; + }; + }; + + test-codec4 { + compatible =3D "test-codec"; + status =3D "disabled"; + + port { + codec4_port_ep: endpoint { + remote-endpoint =3D <&smcodec2_port2_ep>; + }; + }; + }; + + test-codec5 { + compatible =3D "test-codec"; + + port { + codec5_port_ep: endpoint { + remote-endpoint =3D <&cpu4_port_ep>; + }; + }; + }; + + /* + * Testcase 03 + * + * DESCRIPTION: test disabled multi link. + * + * TOPOLOGY: + * +---+ +---+ + * TEST_CPU5/P0 <- | | <---@----> | | -> TEST_CODEC6/P0 + * TEST_CPU5/P1 <- | | | | -> TEST_CODEC6/P1 + * +---+ +---+ + * + * + * TEST_CPU5 =3D> DISABLED + * TEST_CODEC6 =3D> ENABLED + * + * RESULT: + * - sound card creation should fail since all of its links are + * explicitly disabled. + */ + test-case-03 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-03"; + links =3D <&multi0_cpu_port0>; + + multi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + ports@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi0_cpu_port0: port@0 { + reg =3D <0>; + + multi0_cpu_port0_ep: endpoint { + remote-endpoint =3D <&multi0_codec_port0_ep>; + }; + }; + + multi0_cpu_port1: port@1 { + reg =3D <1>; + + multi0_cpu_port1_ep: endpoint { + remote-endpoint =3D <&cpu6_port0_ep>; + }; + }; + + multi0_cpu_port2: port@2 { + reg =3D <2>; + + multi0_cpu_port2_ep: endpoint { + remote-endpoint =3D <&cpu6_port1_ep>; + }; + }; + }; + + ports@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi0_codec_port0: port@0 { + reg =3D <0>; + + multi0_codec_port0_ep: endpoint { + remote-endpoint =3D <&multi0_cpu_port0_ep>; + }; + }; + + multi0_codec_port1: port@1 { + reg =3D <1>; + + multi0_codec_port1_ep: endpoint { + remote-endpoint =3D <&codec6_port0_ep>; + }; + }; + + multi0_codec_port2: port@2 { + reg =3D <2>; + + multi0_codec_port2_ep: endpoint { + remote-endpoint =3D <&codec6_port1_ep>; + }; + }; + }; + }; + }; + + test-cpu5 { + compatible =3D "test-cpu"; + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + cpu6_port0: port@0 { + reg =3D <0>; + + cpu6_port0_ep: endpoint { + remote-endpoint =3D <&multi0_cpu_port1_ep>; + }; + }; + + cpu6_port1: port@1 { + reg =3D <1>; + + cpu6_port1_ep: endpoint { + remote-endpoint =3D <&multi0_cpu_port2_ep>; + }; + }; + }; + }; + + test-codec6 { + compatible =3D "test-codec"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + codec6_port0: port@0 { + reg =3D <0>; + + codec6_port0_ep: endpoint { + remote-endpoint =3D <&multi0_codec_port1_ep>; + }; + }; + + codec6_port1: port@1 { + reg =3D <1>; + + codec6_port1_ep: endpoint { + remote-endpoint =3D <&multi0_codec_port2_ep>; + }; + }; + }; + }; + + /* + * Testcase 04 + * + * DESCRIPTION: test multi link with disabled CPU. + * + * TOPOLOGY: + * +---+ +---+ + * TEST_CPU7/P0 <- | | <---@----> | | -> TEST_CODEC8/P0 + * TEST_CPU7/P1 <- | | | | -> TEST_CODEC8/P1 + * +---+ +---+ + * + * TEST_CPU6 <---@-----> TEST_CODEC7 + * + * + * TEST_CPU6 =3D> ENABLED + * TEST_CPU7 =3D> DISABLED + * TEST_CODEC7 =3D> ENABLED + * TEST_CODEC8 =3D> ENABLED + * + * RESULT: + * - sound card creation should succeed with 1 explicitly disabled link. + */ + test-case-04 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-04"; + links =3D <&cpu6_port>, <&multi1_cpu_port0>; + + multi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + ports@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi1_cpu_port0: port@0 { + reg =3D <0>; + + multi1_cpu_port0_ep: endpoint { + remote-endpoint =3D <&multi1_codec_port0_ep>; + }; + }; + + multi1_cpu_port1: port@1 { + reg =3D <1>; + + multi1_cpu_port1_ep: endpoint { + remote-endpoint =3D <&cpu7_port0_ep>; + }; + }; + + multi1_cpu_port2: port@2 { + reg =3D <2>; + + multi1_cpu_port2_ep: endpoint { + remote-endpoint =3D <&cpu7_port1_ep>; + }; + }; + }; + + ports@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi1_codec_port0: port@0 { + reg =3D <0>; + + multi1_codec_port0_ep: endpoint { + remote-endpoint =3D <&multi1_cpu_port0_ep>; + }; + }; + + multi1_codec_port1: port@1 { + reg =3D <1>; + + multi1_codec_port1_ep: endpoint { + remote-endpoint =3D <&codec8_port0_ep>; + }; + }; + + multi1_codec_port2: port@2 { + reg =3D <2>; + + multi1_codec_port2_ep: endpoint { + remote-endpoint =3D <&codec8_port1_ep>; + }; + }; + }; + }; + }; + + test-cpu6 { + compatible =3D "test-cpu"; + + cpu6_port: port { + cpu6_port_ep: endpoint { + remote-endpoint =3D <&codec7_port_ep>; + }; + }; + }; + + test-cpu7 { + compatible =3D "test-cpu"; + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + cpu7_port0: port@0 { + reg =3D <0>; + + cpu7_port0_ep: endpoint { + remote-endpoint =3D <&multi1_cpu_port1_ep>; + }; + }; + + cpu7_port1: port@1 { + reg =3D <1>; + + cpu7_port1_ep: endpoint { + remote-endpoint =3D <&multi1_cpu_port2_ep>; + }; + }; + }; + }; + + test-codec7 { + compatible =3D "test-codec"; + + port { + codec7_port_ep: endpoint { + remote-endpoint =3D <&cpu6_port_ep>; + }; + }; + }; + + test-codec8 { + compatible =3D "test-codec"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + codec8_port0: port@0 { + reg =3D <0>; + + codec8_port0_ep: endpoint { + remote-endpoint =3D <&multi1_codec_port1_ep>; + }; + }; + + codec8_port1: port@1 { + reg =3D <1>; + + codec8_port1_ep: endpoint { + remote-endpoint =3D <&multi1_codec_port2_ep>; + }; + }; + }; + }; + + /* + * Testcase 05 + * + * DESCRIPTION: test N:M (CPUS:CODECS), N < M multi link with disabled co= dec. + * + * TOPOLOGY: + * + * +---+ +---+ + * | | <---@----> | | + * | | | | + * TEST_CPU8/P0 <- | | <--------> | | -> TEST_CODEC9/P0 + * TEST_CPU8/P1 <- | | <---+----> | | -> TEST_CODEC9/P1 + * | | \----> | | -> TEST_CODEC9/P2 + * +---+ +---+ + * + * + * TEST_CPU9 <---@----> TEST_CODEC10 + * + * TEST_CPU8 =3D> ENABLED + * TEST_CODEC9 =3D> DISABLED + * TEST_CPU9 =3D> ENABLED + * TEST_CODEC10 =3D> ENABLED + * + * RESULT: + * - sound card creation should succeed with 1 disabled link. + */ + test-case-05 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-05"; + links =3D <&multi2_cpu_port0>, <&cpu9_port>; + + multi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + ports@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi2_cpu_port0: port@0 { + reg =3D <0>; + + multi2_cpu_port0_ep: endpoint { + remote-endpoint =3D <&multi2_codec_port0_ep>; + }; + }; + + port@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi2_cpu_port1_ep0: endpoint@0 { + reg =3D <0>; + remote-endpoint =3D <&cpu8_port0_ep>; + }; + + multi2_cpu_port1_ep1: endpoint@1 { + reg =3D <1>; + remote-endpoint =3D <&multi2_codec_port1_ep1>; + }; + }; + + port@2 { + reg =3D <2>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi2_cpu_port2_ep0: endpoint@0 { + reg =3D <0>; + remote-endpoint =3D <&cpu8_port1_ep>; + }; + + multi2_cpu_port2_ep1: endpoint@1 { + reg =3D <1>; + remote-endpoint =3D <&multi2_codec_port2_ep1>; + }; + + multi2_cpu_port2_ep2: endpoint@2 { + reg =3D <2>; + remote-endpoint =3D <&multi2_codec_port3_ep1>; + }; + }; + }; + + ports@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + multi2_codec_port0_ep: endpoint { + remote-endpoint =3D <&multi2_cpu_port0_ep>; + }; + }; + + port@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi2_codec_port1_ep0: endpoint@0 { + reg =3D <0>; + remote-endpoint =3D <&codec9_port0_ep>; + }; + + multi2_codec_port1_ep1: endpoint@1 { + reg =3D <1>; + remote-endpoint =3D <&multi2_cpu_port1_ep1>; + }; + }; + + port@2 { + reg =3D <2>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi2_codec_port2_ep0: endpoint@0 { + reg =3D <0>; + remote-endpoint =3D <&codec9_port1_ep>; + }; + + multi2_codec_port2_ep1: endpoint@1 { + reg =3D <1>; + remote-endpoint =3D <&multi2_cpu_port2_ep1>; + }; + }; + + port@3 { + reg =3D <3>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi2_codec_port3_ep0: endpoint@0 { + reg =3D <0>; + remote-endpoint =3D <&codec9_port2_ep>; + }; + + multi2_codec_port3_ep1: endpoint@1 { + reg =3D <1>; + remote-endpoint =3D <&multi2_cpu_port2_ep2>; + }; + }; + }; + }; + }; + + test-cpu8 { + compatible =3D "test-cpu"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + cpu8_port0_ep: endpoint { + remote-endpoint =3D <&multi2_cpu_port1_ep0>; + }; + }; + + port@1 { + cpu8_port1_ep: endpoint { + remote-endpoint =3D <&multi2_cpu_port2_ep0>; + }; + }; + }; + }; + + test-cpu9 { + compatible =3D "test-cpu"; + + cpu9_port: port { + cpu9_port_ep: endpoint { + remote-endpoint =3D <&codec10_port_ep>; + }; + }; + }; + + test-codec9 { + compatible =3D "test-codec"; + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + codec9_port0_ep: endpoint { + remote-endpoint =3D <&multi2_codec_port1_ep0>; + }; + }; + + port@1 { + reg =3D <1>; + + codec9_port1_ep: endpoint { + remote-endpoint =3D <&multi2_codec_port2_ep0>; + }; + }; + + port@2 { + reg =3D <2>; + + codec9_port2_ep: endpoint { + remote-endpoint =3D <&multi2_codec_port3_ep0>; + }; + }; + }; + }; + + test-codec10 { + compatible =3D "test-codec"; + + port { + codec10_port_ep: endpoint { + remote-endpoint =3D <&cpu9_port_ep>; + }; + }; + }; +}; diff --git a/sound/soc/generic/audio-graph-card2-sample3.dtsi b/sound/soc/g= eneric/audio-graph-card2-sample3.dtsi new file mode 100644 index 000000000000..b96da5b5d6d3 --- /dev/null +++ b/sound/soc/generic/audio-graph-card2-sample3.dtsi @@ -0,0 +1,486 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2025 NXP + * + * audio-graph-card2 DPCM/C2C link test scenarios + * + * IMPORTANT: + * + * 1) DO NOT use this alongside the other test scenarios as the + * node names are not unique across test DTSIs. + * + * 2) The test topologies used here are adapted from + * "audio-graph-card2-custom-sample2.dtsi" + */ + +/ { + /* + * Testcase 00: + * + * DESCRIPTION: test DPCM links with CODEC disabled. + * + * TOPOLOGY: + * + * **** + * TEST_CPU0/P0 <---@----* * ----@---> TEST_CODEC0 + * TEST_CPU0/P1 <---@----* * + * **** + * + * TEST_CPU0 =3D> ENABLED + * TEST_CODEC0 =3D> DISABLED + * + * RESULT: + * - sound card creation should succeed with only the FEs being + * created. Attempting to play a song on any of the FEs should + * result in an error since there's no BE attached. + */ + test-case-00 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-00"; + links =3D <&fe0_port0>, <&fe0_port1>, <&be0_port0>; + routing =3D "TC DAI0 Playback", "DAI0 Playback", + "TC DAI0 Playback", "DAI1 Playback", + "DAI0 Capture", "TC DAI0 Capture", + "DAI1 Capture", "TC DAI0 Capture"; + + dpcm { + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* FEs */ + ports@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + fe0_port0: port@0 { + reg =3D <0>; + + fe0_port0_ep: endpoint { + remote-endpoint =3D <&cpu0_port0_ep>; + }; + }; + + fe0_port1: port@1 { + reg =3D <1>; + + fe0_port1_ep: endpoint { + remote-endpoint =3D <&cpu0_port1_ep>; + }; + }; + }; + + /* BEs */ + ports@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + be0_port0: port@0 { + reg =3D <0>; + + be0_port0_ep: endpoint { + remote-endpoint =3D <&codec0_port_ep>; + }; + }; + }; + }; + }; + + test-cpu0 { + compatible =3D "test-cpu"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + cpu0_port0_ep: endpoint { + remote-endpoint =3D <&fe0_port0_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + cpu0_port1_ep: endpoint { + remote-endpoint =3D <&fe0_port1_ep>; + }; + }; + }; + }; + + test-codec0 { + compatible =3D "test-codec"; + status =3D "disabled"; + + port { + prefix =3D "TC"; + + codec0_port_ep: endpoint { + remote-endpoint =3D <&be0_port0_ep>; + }; + }; + }; + + /* + * Testcase 01: + * + * DESCRIPTION: test DPCM links with CPU disabled. + * + * TOPOLOGY: + * + * **** + * TEST_CPU1/P0 <---@----* * ----@---> TEST_CODEC1 + * TEST_CPU1/P1 <---@----* * + * **** + * + * TEST_CPU0 =3D> DISABLED + * TEST_CODEC0 =3D> ENABLED + * + * RESULT: + * - sound card creation should succeed with only the BE + * being created. + */ + test-case-01 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-01"; + links =3D <&fe1_port0>, <&fe1_port1>, <&be1_port0>; + routing =3D "TC DAI0 Playback", "DAI0 Playback", + "TC DAI0 Playback", "DAI1 Playback", + "DAI0 Capture", "TC DAI0 Capture", + "DAI1 Capture", "TC DAI0 Capture"; + + dpcm { + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* FEs */ + ports@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + fe1_port0: port@0 { + reg =3D <0>; + + fe1_port0_ep: endpoint { + remote-endpoint =3D <&cpu1_port0_ep>; + }; + }; + + fe1_port1: port@1 { + reg =3D <1>; + + fe1_port1_ep: endpoint { + remote-endpoint =3D <&cpu1_port1_ep>; + }; + }; + }; + + /* BEs */ + ports@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + be1_port0: port@0 { + reg =3D <0>; + + be1_port0_ep: endpoint { + remote-endpoint =3D <&codec1_port_ep>; + }; + }; + }; + }; + }; + + test-cpu1 { + compatible =3D "test-cpu"; + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + cpu1_port0_ep: endpoint { + remote-endpoint =3D <&fe1_port0_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + cpu1_port1_ep: endpoint { + remote-endpoint =3D <&fe1_port1_ep>; + }; + }; + }; + }; + + test-codec1 { + compatible =3D "test-codec"; + + port { + prefix =3D "TC"; + + codec1_port_ep: endpoint { + remote-endpoint =3D <&be1_port0_ep>; + }; + }; + }; + + /* + * Testcase 02 + * + * DESCRIPTION: test DPCM links with multi BE with CODEC disabled. + * + * TOPOLOGY: + * + * **** +---+ + * TEST_CPU2/P0 <---@----* * ----@---> | | -> TEST_CODEC2/P0 + * TEST_CPU2/P1 <---@----* * | | -> TEST_CODEC2/P1 + * **** +---+ + * + * TEST_CPU2 =3D> ENABLED + * TEST_CODEC2 =3D> DISABLED + * + * RESULT: + * - sound card creation should succeed with only the FEs being + * created. + */ + test-case-02 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-02"; + links =3D <&fe2_port0>, <&fe2_port1>, <&multi0_be_port0>; + + dpcm { + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* FEs */ + ports@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + fe2_port0: port@0 { + reg =3D <0>; + + fe2_port0_ep: endpoint { + remote-endpoint =3D <&cpu2_port0_ep>; + }; + }; + + fe2_port1: port@1 { + reg =3D <1>; + + fe2_port1_ep: endpoint { + remote-endpoint =3D <&cpu2_port1_ep>; + }; + }; + }; + + /* BEs */ + ports@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + multi0_be_port0: port@0 { + reg =3D <0>; + + multi0_be_port0_ep: endpoint { + remote-endpoint =3D <&multi0_codec_port0_ep>; + }; + }; + }; + }; + + multi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + ports@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + multi0_codec_port0_ep: endpoint { + remote-endpoint =3D <&multi0_be_port0_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + multi0_codec_port1_ep: endpoint { + remote-endpoint =3D <&codec2_port0_ep>; + }; + }; + + port@2 { + reg =3D <2>; + + multi0_codec_port2_ep: endpoint { + remote-endpoint =3D <&codec2_port1_ep>; + }; + }; + }; + }; + }; + + test-cpu2 { + compatible =3D "test-cpu"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + cpu2_port0_ep: endpoint { + remote-endpoint =3D <&fe2_port0_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + cpu2_port1_ep: endpoint { + remote-endpoint =3D <&fe2_port1_ep>; + }; + }; + }; + }; + + test-codec2 { + compatible =3D "test-codec"; + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + codec2_port0_ep: endpoint { + remote-endpoint =3D <&multi0_codec_port1_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + codec2_port1_ep: endpoint { + remote-endpoint =3D <&multi0_codec_port2_ep>; + }; + }; + }; + }; + + /* + * Testcase 03 + * + * DESCRIPTION: test C2C links with codec disabled + * + * TOPOLOGY: + * + * +---@----> TEST_CODEC3/P0 + * | + * +--------> TEST_CODEC3/P1 + * + * TEST_CPU3 <---@----> TEST_CODEC4 + * + * TEST_CPU3 =3D> ENABLED + * TEST_CODEC3 =3D> DISABLED + * TEST_CODEC4 =3D> ENABLED + * + * RESULT: + * - sound card creation should succeed with 1 disabled link. + */ + test-case-03 { + compatible =3D "audio-graph-card2"; + label =3D "test-case-03"; + links =3D <&c2c0_port0>, <&cpu3_port>; + + codec2codec { + #address-cells =3D <1>; + #size-cells =3D <0>; + + ports@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + c2c0_port0: port@0 { + reg =3D <0>; + + c2c0_port0_ep: endpoint { + remote-endpoint =3D <&codec3_port0_ep>; + }; + }; + + port@1 { + reg =3D <1>; + + c2c0_port1_ep: endpoint { + remote-endpoint =3D <&codec3_port1_ep>; + }; + }; + }; + }; + }; + + test-cpu3 { + compatible =3D "test-cpu"; + + cpu3_port: port { + cpu3_port_ep: endpoint { + remote-endpoint =3D <&codec4_port_ep>; + }; + }; + }; + + test-codec3 { + compatible =3D "test-codec"; + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + codec3_port0_ep: endpoint { + remote-endpoint =3D <&c2c0_port0_ep>; + }; + }; + + port@1 { + codec3_port1_ep: endpoint { + remote-endpoint =3D <&c2c0_port1_ep>; + }; + }; + }; + }; + + test-codec4 { + compatible =3D "test-codec"; + + port { + codec4_port_ep: endpoint { + remote-endpoint =3D <&cpu3_port_ep>; + }; + }; + }; +}; --=20 2.34.1