Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp66781rdh; Mon, 18 Dec 2023 04:43:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdiIYsKjh4HYW1+r9d4D9pUPSSAad1zJxYgqeCeabgexCoKRlJ+zJaMEvGcXnTNqi/P8gH X-Received: by 2002:a17:906:289:b0:a19:a19b:55be with SMTP id 9-20020a170906028900b00a19a19b55bemr7457747ejf.78.1702903401132; Mon, 18 Dec 2023 04:43:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702903401; cv=none; d=google.com; s=arc-20160816; b=TBOwpl2Sqz2vK86Yc1ef6Uc53qDp/8TEMwq4cfp/SBW3fJJkC2s9J4bhviPGnK1AaM prxrVBJcNHAFkc0w8RiQe0wuBUbs0Z/5X7+Wc8TE/gVPUfXU2BcES4f5sC+hN0QZVGul 9WEjwMPO+7SDBVq3bKN20loo0zhBS5a6N8Ev7PngTjlzL8whLltqAI1MTT0SXVoDmwzN LnVlPLe5UV955FjC7pDcz08uisjFgE2C1flemXgguaVVrcMiENbyjrXYOmhy5qza5Zt8 TrRoTNNkwNQ6x3QYXQERa6U3dUkuC+5yU/+NaAiJ+AI12yz1692EnLTF/M7XgCOzLew2 w69g== ARC-Message-Signature: i=1; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=u9QYi3UK49RvCOM0jwOPRvXLix0O7m+OZA9DnyWKw9g=; fh=tQDBYMLxw9pGRS61bl22/5Nh3Impw3/NQWSQ0aEjqug=; b=RIm7RvpDe0XUb0CoyNCVgsCjlS4scBeiVsHHZwQ7MHgsed3yeIz3rtA4uWEGfuCAGR y9gNuetdvEZtZMHEtSrbN9UXEGWkAcR7BevCvolNPebNffJxW/L5FzAAEatgwK72tFWM jAVj5yO+tzLM5QoXTt2xvt4xFIJud5FyPRU0NgbAJQjW/b7aQhUSoKV7D1UvFxxvWqrH veeuVd64Pn2H5EOZF717bLl6JogLnE1Rie8xnbcQkue/y4WhGFpGimOFVZyc3MsZtkCm qsDaWQHptbjXs5ZB2JBj6tUsodljtyynX5bD1fFJFafYxHvZCI4PU6CJ2P3pLd6YclrG VdjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=UI24YBub; spf=pass (google.com: domain of linux-kernel+bounces-3589-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3589-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p13-20020a170906228d00b00a2353a1f41bsi988100eja.751.2023.12.18.04.43.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 04:43:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3589-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=UI24YBub; spf=pass (google.com: domain of linux-kernel+bounces-3589-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3589-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id B36EF1F225E6 for ; Mon, 18 Dec 2023 12:43:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E48707FBA3; Mon, 18 Dec 2023 12:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="UI24YBub" X-Original-To: linux-kernel@vger.kernel.org Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (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 B5B657E579; Mon, 18 Dec 2023 12:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id C33D39C3645; Mon, 18 Dec 2023 07:42:38 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id Kh6SC-Fsoi_x; Mon, 18 Dec 2023 07:42:38 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 5E1DE9C3F1C; Mon, 18 Dec 2023 07:42:38 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 5E1DE9C3F1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1702903358; bh=u9QYi3UK49RvCOM0jwOPRvXLix0O7m+OZA9DnyWKw9g=; h=From:To:Date:Message-Id:MIME-Version; b=UI24YBubofICoggQzbeSMr0uvYktWGel5+4Si71HbI0s+U5MBrINJ2tp2Hi7vqSkl I1BFb5hTeBLJ88Fo8styxXAPVU9AhKmd/f4TkYi9YhKhZTWTl7EduBAIzz3S8P9g9h mjircdeZiQHZfh9snTFR1UYorBV+m1BjQiImgBAvYkJhfV7Sp20s7cI0+zWtAzDiHF tERB0EBuABQFKX0H14ik9js1nqPMtxg1T3DnB39BQA2GCnxFu3pfkihpiu9K1OcjQE pCkF77NBkuyWX9chk7MEokrAD0wq8UdgFN7TKdPo0+hhVQ+f8sz2WOxfCVdvU9OLax BXiMzq2pjziUQ== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id wzya-KG1c6eG; Mon, 18 Dec 2023 07:42:38 -0500 (EST) Received: from gerard.rennes.sfl (unknown [192.168.216.3]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 5B84E9C3645; Mon, 18 Dec 2023 07:42:36 -0500 (EST) From: Elinor Montmasson To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Jaroslav Kysela , Takashi Iwai Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, Elinor Montmasson , Philip-Dylan Subject: [PATCHv3 RESEND 01/10] ASoC: fsl-asoc-card: add support for dai links with multiple codecs Date: Mon, 18 Dec 2023 13:40:49 +0100 Message-Id: <20231218124058.2047167-2-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231218124058.2047167-1-elinor.montmasson@savoirfairelinux.com> References: <20231218124058.2047167-1-elinor.montmasson@savoirfairelinux.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 Add support for dai links using multiple codecs for multi-codec use cases. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.= c index 7518ab9d768e..cde31fd38262 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -809,10 +809,10 @@ static int fsl_asoc_card_probe(struct platform_devi= ce *pdev) =20 /* Normal DAI Link */ priv->dai_link[0].cpus->of_node =3D cpu_np; - priv->dai_link[0].codecs->dai_name =3D codec_dai_name; + priv->dai_link[0].codecs[0].dai_name =3D codec_dai_name; =20 if (!fsl_asoc_card_is_ac97(priv)) - priv->dai_link[0].codecs->of_node =3D codec_np; + priv->dai_link[0].codecs[0].of_node =3D codec_np; else { u32 idx; =20 @@ -823,11 +823,11 @@ static int fsl_asoc_card_probe(struct platform_devi= ce *pdev) goto asrc_fail; } =20 - priv->dai_link[0].codecs->name =3D + priv->dai_link[0].codecs[0].name =3D devm_kasprintf(&pdev->dev, GFP_KERNEL, "ac97-codec.%u", (unsigned int)idx); - if (!priv->dai_link[0].codecs->name) { + if (!priv->dai_link[0].codecs[0].name) { ret =3D -ENOMEM; goto asrc_fail; } @@ -838,13 +838,19 @@ static int fsl_asoc_card_probe(struct platform_devi= ce *pdev) priv->card.num_links =3D 1; =20 if (asrc_pdev) { + int i; + struct snd_soc_dai_link_component *codec; + struct snd_soc_dai_link *link; + /* DPCM DAI Links only if ASRC exists */ priv->dai_link[1].cpus->of_node =3D asrc_np; priv->dai_link[1].platforms->of_node =3D asrc_np; - priv->dai_link[2].codecs->dai_name =3D codec_dai_name; - priv->dai_link[2].codecs->of_node =3D codec_np; - priv->dai_link[2].codecs->name =3D - priv->dai_link[0].codecs->name; + link =3D &(priv->dai_link[2]); + for_each_link_codecs(link, i, codec) { + codec->dai_name =3D priv->dai_link[0].codecs[i].dai_name; + codec->of_node =3D priv->dai_link[0].codecs[i].of_node; + codec->name =3D priv->dai_link[0].codecs[i].name; + } priv->dai_link[2].cpus->of_node =3D cpu_np; priv->dai_link[2].dai_fmt =3D priv->dai_fmt; priv->card.num_links =3D 3; --=20 2.25.1