From patchwork Fri Oct 27 14:47:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 740747 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 C63CAC4332F for ; Fri, 3 Nov 2023 16:19:50 +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 907E7850; Fri, 3 Nov 2023 17:18:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 907E7850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028388; bh=4sMjpEWPnxTpFeZtEZi9FJ/TO2equr8HTkptmC/bILs=; 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=C/lYOZDWqmQw1RYhgD82I31YnQFj2ONvk2VOD/HPTO4zWKOvxhJvvuphv2rjdT4pe NVDuoGYe+Tgq9KaLSfsANochk8MrW+5H+Pnuy/o8he/SAspLIB+BwGqE2hgMG35esU z3TugeRN4DcTOEAIOs+/B2A55XZgdUIT8lLYwoXo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6F946F80558; Fri, 3 Nov 2023 17:18:09 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0B391F80570; Fri, 3 Nov 2023 17:18:09 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94AD3F8019B; Fri, 27 Oct 2023 16:50:43 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C49D1F8010B for ; Fri, 27 Oct 2023 16:50:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C49D1F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=hRYqv+1Q Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 153589C3343; Fri, 27 Oct 2023 10:50:37 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id 0Kyk5zieHL1z; Fri, 27 Oct 2023 10:50:36 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 8C2189C3359; Fri, 27 Oct 2023 10:50:36 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 8C2189C3359 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418236; bh=u9QYi3UK49RvCOM0jwOPRvXLix0O7m+OZA9DnyWKw9g=; h=From:To:Date:Message-Id:MIME-Version; b=hRYqv+1Q/pQ1cbd7+SYhSx8Cpuy/9YDuFdiVSJRRkXkNRmfGCrSTdEJZivZdC7vH9 rwDN2oPRUSFtlVemGa9QP8QIyKQZeOkv5cNTQa5bplOdY/jzoKXkAAl7m8EHEFNjWy yHW1Bg08HUoS+oLKVqjhQNYuiu+c6syfQUgsNtDcfA5u955kOGmJNzeZF17Uz1JcEB ZTTShp8n65aCBfGMU3oo8tzZRfOrz2SioBEDnPnInM4YkzcWLwXkpkL6S14b0lXgEE uzq/iggRbkgrfZCvIeHzkJ5Ubvi087xGtuZiVIWL+7MmEE32f77tfeKovsr/2mcczH AUjUEOnGRIbMw== 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 GHMkVeD95BLh; Fri, 27 Oct 2023 10:50:36 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id A25259C3343; Fri, 27 Oct 2023 10:50:35 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 01/10] ASoC: fsl-asoc-card: add support for dai links with multiple codecs Date: Fri, 27 Oct 2023 16:47:26 +0200 Message-Id: <20231027144734.3654829-2-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: TV2TKEHEUMOMS2F4PO3PYELUODBYL2UN X-Message-ID-Hash: TV2TKEHEUMOMS2F4PO3PYELUODBYL2UN X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:03 +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: 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_device *pdev) /* Normal DAI Link */ priv->dai_link[0].cpus->of_node = cpu_np; - priv->dai_link[0].codecs->dai_name = codec_dai_name; + priv->dai_link[0].codecs[0].dai_name = codec_dai_name; if (!fsl_asoc_card_is_ac97(priv)) - priv->dai_link[0].codecs->of_node = codec_np; + priv->dai_link[0].codecs[0].of_node = codec_np; else { u32 idx; @@ -823,11 +823,11 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) goto asrc_fail; } - priv->dai_link[0].codecs->name = + priv->dai_link[0].codecs[0].name = 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 = -ENOMEM; goto asrc_fail; } @@ -838,13 +838,19 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->card.num_links = 1; 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 = asrc_np; priv->dai_link[1].platforms->of_node = asrc_np; - priv->dai_link[2].codecs->dai_name = codec_dai_name; - priv->dai_link[2].codecs->of_node = codec_np; - priv->dai_link[2].codecs->name = - priv->dai_link[0].codecs->name; + link = &(priv->dai_link[2]); + for_each_link_codecs(link, i, codec) { + codec->dai_name = priv->dai_link[0].codecs[i].dai_name; + codec->of_node = priv->dai_link[0].codecs[i].of_node; + codec->name = priv->dai_link[0].codecs[i].name; + } priv->dai_link[2].cpus->of_node = cpu_np; priv->dai_link[2].dai_fmt = priv->dai_fmt; priv->card.num_links = 3; From patchwork Fri Oct 27 14:47:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 741083 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 09DDEC4167D for ; Fri, 3 Nov 2023 16:19:54 +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 A40CB828; Fri, 3 Nov 2023 17:19:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A40CB828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028392; bh=HJuiZndxGbPAag6zIg3dcHrfIjZqXYwuX/ooR+96S8U=; 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=M5THOqEexoEOTyeeIvagTMdyynOfjnWhlEO2+eQytM58U6RBIPHNO+YKO8QqshrJz ipe9IBR5LWmOUI0fgXj5180hQbfqDfeh+IwrYMOfyWGYuDUSbHhlw4AgtX8Q/n255x FL+CZXf5NM0j+7hLirh9bwHJ/wzvzFH6/WM+32lc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4B64AF8057E; Fri, 3 Nov 2023 17:18:10 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id AC658F80567; Fri, 3 Nov 2023 17:18:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F045FF8019B; Fri, 27 Oct 2023 16:50:51 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DBB77F8010B for ; Fri, 27 Oct 2023 16:50:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DBB77F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=tABqpWzT Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 8FAF79C335E; Fri, 27 Oct 2023 10:50:47 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id 9_6hwAtN1hrZ; Fri, 27 Oct 2023 10:50:47 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 1769D9C3363; Fri, 27 Oct 2023 10:50:47 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 1769D9C3363 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418247; bh=xSd5bT3VHUf2LmY6gO6QlHovigVpPJKexFn+uptilyk=; h=From:To:Date:Message-Id:MIME-Version; b=tABqpWzT7QoRJ+/QseLqW60z7whlW49uL63GXjwDYbYJpIDIDaORk0Jq8I/zPZame 7sLm7lruGpCs/DstY0RecSmYMu4lNbDQXs4TwFniPgGRB6NPehPJ+9qr8Lo5iqcT8L 3rLSnKWoT5Ch9VlKuKB4fDEFBI3DjXU2V2hMbzEy9qtaArTJfkmml3GhsREacZU1t/ Pw1zFMZh2hqnkq5WgEuZOPqHxbhCrc+cegkaaEmnxwNqDSjsaBnUvEmp3mW604DbQi dpHfeCq5lXds9ooCrngJfhYj/UnwVN6+A0JxI0W1a/OEQuuS+MazWMyqmP/h6YNjlt QiXxDN1iop75w== 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 goheL8HQF4nc; Fri, 27 Oct 2023 10:50:47 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 2AEEE9C335E; Fri, 27 Oct 2023 10:50:46 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 02/10] ASoC: fsl-asoc-card: add second dai link component for codecs Date: Fri, 27 Oct 2023 16:47:27 +0200 Message-Id: <20231027144734.3654829-3-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: NUFN3MLY7MCMBD2ROGSTFIPB5GR77EEU X-Message-ID-Hash: NUFN3MLY7MCMBD2ROGSTFIPB5GR77EEU X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:03 +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: Add a second dai link component for codecs that will be use for the generic codec use case. It will use spdif_receiver and spdif_transmitter drivers as dummy codec drivers, needing 2 codecs slots for the links. To prevent deferrment for use cases using only one codec, also set by default the number of codecs to 1 for the relevant dai links. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index cde31fd38262..a62f26fe9802 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -295,7 +295,7 @@ static int be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, SND_SOC_DAILINK_DEFS(hifi, DAILINK_COMP_ARRAY(COMP_EMPTY()), - DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_EMPTY(), COMP_EMPTY()), DAILINK_COMP_ARRAY(COMP_EMPTY())); SND_SOC_DAILINK_DEFS(hifi_fe, @@ -305,7 +305,7 @@ SND_SOC_DAILINK_DEFS(hifi_fe, SND_SOC_DAILINK_DEFS(hifi_be, DAILINK_COMP_ARRAY(COMP_EMPTY()), - DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_EMPTY(), COMP_EMPTY()), DAILINK_COMP_ARRAY(COMP_DUMMY())); static const struct snd_soc_dai_link fsl_asoc_card_dai[] = { @@ -618,6 +618,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) memcpy(priv->dai_link, fsl_asoc_card_dai, sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link)); + priv->dai_link[0].num_codecs = 1; + priv->dai_link[2].num_codecs = 1; priv->card.dapm_routes = audio_map; priv->card.num_dapm_routes = ARRAY_SIZE(audio_map); From patchwork Fri Oct 27 14:47:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 740746 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 45FC7C4332F for ; Fri, 3 Nov 2023 16:20:20 +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 5BB36822; Fri, 3 Nov 2023 17:19:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5BB36822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028418; bh=oNczte9HFo5bOBvwDZfCH79WRTphw+0kei5hXG7UILY=; 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=jo07EgP4YEGbdBHydy5g032+Q3LcIvIooKvtA1GDfcNQLbNIAMBux2yn+XycX03Gc DQsueZKGzaBgFtPc72AiuFEGl50jGHdSv2cpSQO/215Ia8OJa9j6aUxHi+33Ox5nWb stsjrvRpkjMU9N9xLAgggHZQdtIy776Zx3ODvcwI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E651AF805AD; Fri, 3 Nov 2023 17:18:13 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3DFE6F80589; Fri, 3 Nov 2023 17:18:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8451AF8019B; Fri, 27 Oct 2023 16:51:02 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DACEFF8010B for ; Fri, 27 Oct 2023 16:50:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DACEFF8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=WyJxvDVV Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id AD25D9C3364; Fri, 27 Oct 2023 10:50:55 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id uZgATj-RoTBu; Fri, 27 Oct 2023 10:50:55 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 005DD9C3366; Fri, 27 Oct 2023 10:50:55 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 005DD9C3366 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418255; bh=509RHA07uFY2kq/qe141zWcBrV8/mr1HHQ48cfSaInM=; h=From:To:Date:Message-Id:MIME-Version; b=WyJxvDVVWKTAalzxIU7QRK8ZflXlPxvfxo3MpBf/rd6mKsgfimf7Aoz4Xut8cwwMK Z0frmNZm1iEJyfVH1CjKHxuqrXJc8xC0iWaEdCKtWFM5xIiBM4duUlGJ4d1ITGJDk+ 3vLaG6RdWMWtUv3Cu7gshcRDV/utBbR0KPS9752waOZqQ8qg/7flY3m5CFxMvUoY3J kYXV8WAs9FaGTfR7SiCf3HgyWFqOG7r0jLSzUAcUbH4KpO1fWDyCQRSJO9iASrRv5/ K0KM3tKN/QDxAmh/ji9dYUhDwR0JiG+Sn/RWgs1OQbea0FF28dGXWlrMtmUqE+WRl/ GHp76psbHZtyg== 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 nx1zihdU-E15; Fri, 27 Oct 2023 10:50:54 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 180AB9C3364; Fri, 27 Oct 2023 10:50:54 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 03/10] ASoC: fsl-asoc-card: add compatibility to use 2 codecs from device tree Date: Fri, 27 Oct 2023 16:47:28 +0200 Message-Id: <20231027144734.3654829-4-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: F65Q7OW4M63XKMI7PXCQQOJYXITE4XW3 X-Message-ID-Hash: F65Q7OW4M63XKMI7PXCQQOJYXITE4XW3 X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:04 +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: Add compatibility with the use of 2 codecs from the device tree. It will be needed for the generic codec case. Use cases using one codec will ignore any given codecs other than the first. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 62 +++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index a62f26fe9802..55052da60ccc 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -541,16 +541,17 @@ static int fsl_asoc_card_late_probe(struct snd_soc_card *card) static int fsl_asoc_card_probe(struct platform_device *pdev) { - struct device_node *cpu_np, *codec_np, *asrc_np; + struct device_node *cpu_np, *asrc_np; + struct device_node *codec_np[2]; struct device_node *np = pdev->dev.of_node; struct platform_device *asrc_pdev = NULL; struct device_node *bitclkprovider = NULL; struct device_node *frameprovider = NULL; struct platform_device *cpu_pdev; struct fsl_asoc_card_priv *priv; - struct device *codec_dev = NULL; + struct device *codec_dev[2] = { NULL, NULL }; const char *codec_dai_name; - const char *codec_dev_name; + const char *codec_dev_name[2]; u32 asrc_fmt = 0; u32 width; int ret; @@ -576,21 +577,25 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) goto fail; } - codec_np = of_parse_phandle(np, "audio-codec", 0); - if (codec_np) { - struct platform_device *codec_pdev; - struct i2c_client *codec_i2c; + codec_np[0] = of_parse_phandle(np, "audio-codec", 0); + codec_np[1] = of_parse_phandle(np, "audio-codec", 1); - codec_i2c = of_find_i2c_device_by_node(codec_np); - if (codec_i2c) { - codec_dev = &codec_i2c->dev; - codec_dev_name = codec_i2c->name; - } - if (!codec_dev) { - codec_pdev = of_find_device_by_node(codec_np); - if (codec_pdev) { - codec_dev = &codec_pdev->dev; - codec_dev_name = codec_pdev->name; + for (int i = 0; i < 2; i++) { + if (codec_np[i]) { + struct platform_device *codec_pdev; + struct i2c_client *codec_i2c; + + codec_i2c = of_find_i2c_device_by_node(codec_np[i]); + if (codec_i2c) { + codec_dev[i] = &codec_i2c->dev; + codec_dev_name[i] = codec_i2c->name; + } + if (!codec_dev[i]) { + codec_pdev = of_find_device_by_node(codec_np[i]); + if (codec_pdev) { + codec_dev[i] = &codec_pdev->dev; + codec_dev_name[i] = codec_pdev->name; + } } } } @@ -600,8 +605,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) asrc_pdev = of_find_device_by_node(asrc_np); /* Get the MCLK rate only, and leave it controlled by CODEC drivers */ - if (codec_dev) { - struct clk *codec_clk = clk_get(codec_dev, NULL); + if (codec_dev[0]) { + struct clk *codec_clk = clk_get(codec_dev[0], NULL); if (!IS_ERR(codec_clk)) { priv->codec_priv.mclk_freq = clk_get_rate(codec_clk); @@ -710,8 +715,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->codec_priv.fll_id = NAU8822_CLK_PLL; priv->codec_priv.pll_id = NAU8822_CLK_PLL; priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM; - if (codec_dev) - priv->codec_priv.mclk = devm_clk_get(codec_dev, NULL); + if (codec_dev[0]) + priv->codec_priv.mclk = devm_clk_get(codec_dev[0], NULL); } else { dev_err(&pdev->dev, "unknown Device Tree compatible\n"); ret = -EINVAL; @@ -729,11 +734,11 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) if (bitclkprovider || frameprovider) { unsigned int daifmt = snd_soc_daifmt_parse_format(np, NULL); - if (codec_np == bitclkprovider) - daifmt |= (codec_np == frameprovider) ? + if (codec_np[0] == bitclkprovider) + daifmt |= (codec_np[0] == frameprovider) ? SND_SOC_DAIFMT_CBP_CFP : SND_SOC_DAIFMT_CBP_CFC; else - daifmt |= (codec_np == frameprovider) ? + daifmt |= (codec_np[0] == frameprovider) ? SND_SOC_DAIFMT_CBC_CFP : SND_SOC_DAIFMT_CBC_CFC; /* Override dai_fmt with value from DT */ @@ -749,7 +754,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) of_node_put(bitclkprovider); of_node_put(frameprovider); - if (!fsl_asoc_card_is_ac97(priv) && !codec_dev) { + if (!fsl_asoc_card_is_ac97(priv) && !codec_dev[0]) { dev_dbg(&pdev->dev, "failed to find codec device\n"); ret = -EPROBE_DEFER; goto asrc_fail; @@ -789,7 +794,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ret = snd_soc_of_parse_card_name(&priv->card, "model"); if (ret) { snprintf(priv->name, sizeof(priv->name), "%s-audio", - fsl_asoc_card_is_ac97(priv) ? "ac97" : codec_dev_name); + fsl_asoc_card_is_ac97(priv) ? "ac97" : codec_dev_name[0]); priv->card.name = priv->name; } priv->card.dai_link = priv->dai_link; @@ -814,7 +819,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->dai_link[0].codecs[0].dai_name = codec_dai_name; if (!fsl_asoc_card_is_ac97(priv)) - priv->dai_link[0].codecs[0].of_node = codec_np; + priv->dai_link[0].codecs[0].of_node = codec_np[0]; else { u32 idx; @@ -922,7 +927,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) asrc_fail: of_node_put(asrc_np); - of_node_put(codec_np); + of_node_put(codec_np[0]); + of_node_put(codec_np[1]); put_device(&cpu_pdev->dev); fail: of_node_put(cpu_np); From patchwork Fri Oct 27 14:47:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 741082 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 37864C4332F for ; Fri, 3 Nov 2023 16:20:44 +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 5196DDED; Fri, 3 Nov 2023 17:19:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5196DDED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028439; bh=nmZvfvCQmJIQuYBkRuW+ZIBoal81Kp5gh3EFWgVBhoQ=; 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=eEkV36Hkd6xnAnuoAoxDSpTlRYJZC5ooM77tyCy1o2g+ChrRm+KECiOTrYY6LqPwh /1wCKvQ6AaIK+vX3Q4ptcqGARmghDs6j2NQWHwk73vbI9CbUJndSduQHKDB3w8g6HS EiOrHtjknJT9JgiNKFrWN1XV86sxTv7Qw5PjxJOw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E0F72F805BB; Fri, 3 Nov 2023 17:18:15 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 13947F805B1; Fri, 3 Nov 2023 17:18:15 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 89022F8019B; Fri, 27 Oct 2023 16:51:17 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C851BF8010B for ; Fri, 27 Oct 2023 16:51:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C851BF8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=R+qOkPs7 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id A1DAD9C3343; Fri, 27 Oct 2023 10:51:13 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id H06j7mID1RmI; Fri, 27 Oct 2023 10:51:13 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 08F2F9C335E; Fri, 27 Oct 2023 10:51:13 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 08F2F9C335E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418273; bh=OyCTsIq50BuUIz5Rk08kH3HreKtUkex4dOgSEou+5JE=; h=From:To:Date:Message-Id:MIME-Version; b=R+qOkPs7XXFZaxDLbx7TxQO37BXqysJe5mNsAUy+5WeVFq3W3u/RHLXGSNep0P3Oj o2zYiJmU8s9dAAZp4/3gK2hS/c+k/IP2rbtSgBKS96o+rzuIthxG0e0OsaINYolnPD qRbo/TeislCb15/xdtihB+aI1PzwaSoFx5+tmpnJgnFsFAmPsMCRY4Kmr4ExEXCgRK c++CRd7433laJDYPHALO4j4kiuLoAOrPSB06A1jXUlhqNnMo9B+ZxwJWgy0DhVsY39 rjjouYcEhRlpGFRzkYck2Ya6SiiPmVsYUP5USW3hUu1bV+DD1PY1MIhLRw+bl6rOIw P1qU0stX55gUg== 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 yG-0o4FiOVON; Fri, 27 Oct 2023 10:51:12 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 1D8159C3343; Fri, 27 Oct 2023 10:51:12 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 04/10] ASoC: fsl-asoc-card: add new compatible for a generic codec use case Date: Fri, 27 Oct 2023 16:47:29 +0200 Message-Id: <20231027144734.3654829-5-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: 2Q5S64HAM3MI4KJHTZDYIU5V3MSCGKA2 X-Message-ID-Hash: 2Q5S64HAM3MI4KJHTZDYIU5V3MSCGKA2 X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:04 +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: Add the new compatible "fsl,imx-audio-generic" for a generic codec use case. It allows using the fsl-asoc-card driver with the spdif_receiver and spdif_transmitter codec drivers used as dummy codecs. It can be used for cases where there is no real codec or codecs which do not require declaring controls. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 55052da60ccc..64f6bcf04720 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -550,6 +550,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) struct platform_device *cpu_pdev; struct fsl_asoc_card_priv *priv; struct device *codec_dev[2] = { NULL, NULL }; + const char *generic_codec_dai_names[2]; const char *codec_dai_name; const char *codec_dev_name[2]; u32 asrc_fmt = 0; @@ -717,6 +718,11 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM; if (codec_dev[0]) priv->codec_priv.mclk = devm_clk_get(codec_dev[0], NULL); + } else if (of_device_is_compatible(np, "fsl,imx-audio-generic")) { + generic_codec_dai_names[0] = "dit-hifi"; + generic_codec_dai_names[1] = "dir-hifi"; + priv->dai_link[0].num_codecs = 2; + priv->dai_link[2].num_codecs = 2; } else { dev_err(&pdev->dev, "unknown Device Tree compatible\n"); ret = -EINVAL; @@ -759,6 +765,12 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ret = -EPROBE_DEFER; goto asrc_fail; } + if (of_device_is_compatible(np, "fsl,imx-audio-generic") + && !codec_dev[1]) { + dev_dbg(&pdev->dev, "failed to find second codec device\n"); + ret = -EPROBE_DEFER; + goto asrc_fail; + } /* Common settings for corresponding Freescale CPU DAI driver */ if (of_node_name_eq(cpu_np, "ssi")) { @@ -816,11 +828,21 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) /* Normal DAI Link */ priv->dai_link[0].cpus->of_node = cpu_np; - priv->dai_link[0].codecs[0].dai_name = codec_dai_name; - if (!fsl_asoc_card_is_ac97(priv)) + if (of_device_is_compatible(np, "fsl,imx-audio-generic")) { + priv->dai_link[0].codecs[0].dai_name = + generic_codec_dai_names[0]; + priv->dai_link[0].codecs[1].dai_name = + generic_codec_dai_names[1]; + } else { + priv->dai_link[0].codecs[0].dai_name = codec_dai_name; + } + + if (!fsl_asoc_card_is_ac97(priv)) { priv->dai_link[0].codecs[0].of_node = codec_np[0]; - else { + if (of_device_is_compatible(np, "fsl,imx-audio-generic")) + priv->dai_link[0].codecs[1].of_node = codec_np[1]; + } else { u32 idx; ret = of_property_read_u32(cpu_np, "cell-index", &idx); @@ -950,6 +972,7 @@ static const struct of_device_id fsl_asoc_card_dt_ids[] = { { .compatible = "fsl,imx-audio-si476x", }, { .compatible = "fsl,imx-audio-wm8958", }, { .compatible = "fsl,imx-audio-nau8822", }, + { .compatible = "fsl,imx-audio-generic", }, {} }; MODULE_DEVICE_TABLE(of, fsl_asoc_card_dt_ids); From patchwork Fri Oct 27 14:47:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 740745 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 6CDEFC4167B for ; Fri, 3 Nov 2023 16:20:49 +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 7AB8EDF6; Fri, 3 Nov 2023 17:19:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7AB8EDF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028445; bh=FvxH5GPEMJEVyDzetblKmOwn1pCBtisZhSSYxCUv+l8=; 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=H++hMn88TS5nKb2nSUFvkKHbP4bE5p1xYPCcGARR3NXL7L5X377tSRmtlhw191yCn YguFDr7iIs+Jj5bVK+0oT2Y4GvSC9fdKWMsd7O2IPXLj006EtcJmcyPNm+meXnTb8Z hTtn6m1sb6Cdv+vUnRLqLxoOdXG0u3rjzKTw73bI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E9219F805C2; Fri, 3 Nov 2023 17:18:16 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 5CB1BF805BE; Fri, 3 Nov 2023 17:18:16 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1CB46F8024E; Fri, 27 Oct 2023 16:51:21 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CC056F8010B for ; Fri, 27 Oct 2023 16:51:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CC056F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=aQOjTCk7 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id A535B9C3367; Fri, 27 Oct 2023 10:51:17 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id GDOt_IpZWaTR; Fri, 27 Oct 2023 10:51:17 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 361E59C336A; Fri, 27 Oct 2023 10:51:17 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 361E59C336A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418277; bh=8HGoMHANb/tdPqN6PKDlYl4GEq322Al+vUqvK5oUFQE=; h=From:To:Date:Message-Id:MIME-Version; b=aQOjTCk7HgfnzqMBnpl8ZvySGmSZk+IBB0SY0ZvtxMcc3oYPxOOyvyZ707qRvtsB5 OADAaB2eDmToJdO8XLwVOE4EFMkRCr5q1tQ1Ua9irCqCOtC1BwBpaOafTvAq2CQtQR XqbJ28cwp6nLJMcbxgNs1p7odvLLntm1V9Ut1xk9FknQgljdrIiitq45ODEfLJEwWl ALL/a+PIDOZpuA43d6djVjkGZooeiEYj626QDrz4F8Aiwtira1FrPWShWgy+l7ncIt 8ngXx3pJayDbJnku3VQ+nAfgURxGV3OOtplFsoqsppTIpoQb0/PQGR8j8dj8xX5q2H H1Bl45BDVe/pw== 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 IgMBJNhPjrbM; Fri, 27 Oct 2023 10:51:17 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 4E0D09C3367; Fri, 27 Oct 2023 10:51:16 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 05/10] ASoC: fsl-asoc-card: set generic codec as clock provider Date: Fri, 27 Oct 2023 16:47:30 +0200 Message-Id: <20231027144734.3654829-6-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: ANBI7N7VP4SIA3F5IAB2DA2EMH6FKETO X-Message-ID-Hash: ANBI7N7VP4SIA3F5IAB2DA2EMH6FKETO X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:04 +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 default dai format defined by DAI_FMT_BASE doesn't set if the codec is consumer or provider of the bit and frame clocks. S/PDIF DIR usually converts audio signal to an asynchronous I2S/PCM stream, and doesn't consume a bit or frame clock. As S/PDIF DIR and DIT are used as codecs for the generic use case, set codecs as provider of both bit and frame clocks by default. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 64f6bcf04720..61c0fd97cde3 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -723,6 +723,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) generic_codec_dai_names[1] = "dir-hifi"; priv->dai_link[0].num_codecs = 2; priv->dai_link[2].num_codecs = 2; + priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; } else { dev_err(&pdev->dev, "unknown Device Tree compatible\n"); ret = -EINVAL; From patchwork Fri Oct 27 14:47:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 741081 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 68D63C4332F for ; Fri, 3 Nov 2023 16:21:08 +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 77C71827; Fri, 3 Nov 2023 17:20:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 77C71827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028466; bh=SHXuxzFvYXcvhYeUZbkXSLDg70K2FX2H323uPwjGRYo=; 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=FsI06XwbmbUQEqjDSI8al9wgX3Tg4UaHC1T+tbYV1M/yQMsHg4OGevnhKITD8S9H7 Ew1rnwExJel9pUE4VwVD7AoX/+pFyyrOFjx0cpDfhu4hDqUXEhFBnbbJDeAgm5xwRC e4T6edEV8HGaiG6f3ZKD6HvoWZYFAzTom51M1OJY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49E4BF805C7; Fri, 3 Nov 2023 17:18:18 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id BD79BF805C7; Fri, 3 Nov 2023 17:18:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C3DA3F8019B; Fri, 27 Oct 2023 16:51:26 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 85185F80165 for ; Fri, 27 Oct 2023 16:51:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 85185F80165 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=B141Uhok Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 30AC49C336E; Fri, 27 Oct 2023 10:51:23 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id Huc8k3_z90CZ; Fri, 27 Oct 2023 10:51:22 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id B92679C336B; Fri, 27 Oct 2023 10:51:22 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com B92679C336B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418282; bh=MZJUJ3iJ5MYbHjsiC7F4cSgtWodH6jOKqbrvkgZ1L1k=; h=From:To:Date:Message-Id:MIME-Version; b=B141Uhok3q9Qpjr1uNI1fmgs1kNoDsNhgKgj1cYeFL1IdNkKPrxGNMif7DCzOnvCl I1btVlXMEnNaQgcQUUF58IplClMmLx2LpcEV+KA5M/Wgzj3a27lTBWCTZZWvs9YACt JDmvS4DwBgvmkblVxPjdYHhFyA/kO+v1U/YphkTMGwIk379yzUhfcOPGqcuEvUTosE 6Tvopk/OhZWJQZNq+EASvUvU4fjv+gm9JWSnTNs+VLvIvA50tnETX1eyeC52RdNeFA VDZMOZfbhrZMI3XSdbB9a1S/MAxqRsFqTXFvNV+C3HyJRSxS7YlSHAkeFnoOTjoMTg UwhO9yt3KDH2A== 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 FTEtwwnXJj5Y; Fri, 27 Oct 2023 10:51:22 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id C92909C3364; Fri, 27 Oct 2023 10:51:21 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 06/10] ASoC: fsl-asoc-card: add dts property "cpu-slot-width" Date: Fri, 27 Oct 2023 16:47:31 +0200 Message-Id: <20231027144734.3654829-7-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: INUJYSEH5IBO6C7CC43OBTXQZTXQAXO7 X-Message-ID-Hash: INUJYSEH5IBO6C7CC43OBTXQZTXQAXO7 X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:04 +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: Add new optional dts property "cpu-slot-width", which allows to set a custom TDM slot width in bits for the CPU DAI when using the generic codec. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 61c0fd97cde3..42aa6ec306ec 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -724,6 +724,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->dai_link[0].num_codecs = 2; priv->dai_link[2].num_codecs = 2; priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; + of_property_read_u32(np, "cpu-slot-width", &priv->cpu_priv.slot_width); } else { dev_err(&pdev->dev, "unknown Device Tree compatible\n"); ret = -EINVAL; From patchwork Fri Oct 27 14:47:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 740744 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 17F1DC4332F for ; Fri, 3 Nov 2023 16:21:30 +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 46F21850; Fri, 3 Nov 2023 17:20:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 46F21850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028488; bh=XsboT4HNcQ3ZzHcrswYQ2ksVaBO8+ngBzvAUjrEK0/8=; 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=JXl6JDH3zu5GjxuoYeIoyZY8svYQ/kMhY1aw6coLgByH/ROn/e50OWeEe0Rvg1Nkh qjnxOLSAI1O6Yo0JDMNKLp0tz5AniNQBZag8xbH+SyNGvgxsiJc25x55Zy8OeEhRzz iLAsh294XELpmTDuAigyaLz4VRHI9IjkutwGnn6I= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C9C68F805D4; Fri, 3 Nov 2023 17:18:19 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 2519AF805D4; Fri, 3 Nov 2023 17:18:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4D087F8024E; Fri, 27 Oct 2023 16:51:32 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1A4C3F8010B for ; Fri, 27 Oct 2023 16:51:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1A4C3F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=RhjzaTw1 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 289FE9C2CEB; Fri, 27 Oct 2023 10:51:29 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id FrhUlf_yiKeA; Fri, 27 Oct 2023 10:51:28 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id AE7089C32B7; Fri, 27 Oct 2023 10:51:28 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com AE7089C32B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418288; bh=bKh+j9cXLMKw0jNzwJmWNtMG76B/OuOpmMi6Ul19JWE=; h=From:To:Date:Message-Id:MIME-Version; b=RhjzaTw17auuih2a2DVycN1PdeDxsi+bbQVwPP7dUbXRbIfJ+rA/3qp6T9yhm8DUS VU7FLMQxw45YKKks9nvb70jHw/bOrUFsS7FjCFh0bQ2Jv2KP6bw07KMdVMKFZR3BGG w0CSGck8I098qzyTxs8BI7Rr2/3YGa3WvETJnb/tp4u25wiNuiGKgOe+4624QGj9DN ZIBCACthQjZx6pZ04pYUovL+4EW6CMp5JwP5Yr/RJzGYC7zpp3gEdvjkajCwv+TVmY M13hDP+r2ymB3qyBaWjHstf7bZy61q3xYkmm2wgXoIBKaxPrp/iKwiSLCc/LRgQmGP 1lZRv9QpQ7hvA== 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 j6QvIyBx4ULb; Fri, 27 Oct 2023 10:51:28 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id C575C9C2CEB; Fri, 27 Oct 2023 10:51:27 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 07/10] ASoC: fsl-asoc-card: add dts property "cpu-slot-num" Date: Fri, 27 Oct 2023 16:47:32 +0200 Message-Id: <20231027144734.3654829-8-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: 7223FSSWNWYHQAGXYKABFW6KR4I3WJM5 X-Message-ID-Hash: 7223FSSWNWYHQAGXYKABFW6KR4I3WJM5 X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:05 +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: Add new optional dts property "cpu-slot-num", which allows to set a custom number of TDM slots for the CPU DAI when using the generic codec. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 42aa6ec306ec..110ac20ba699 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -725,6 +725,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->dai_link[2].num_codecs = 2; priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; of_property_read_u32(np, "cpu-slot-width", &priv->cpu_priv.slot_width); + of_property_read_u32(np, "cpu-slot-num", &priv->cpu_priv.slot_num); } else { dev_err(&pdev->dev, "unknown Device Tree compatible\n"); ret = -EINVAL; From patchwork Fri Oct 27 14:47:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 741080 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 542B3C4332F for ; Fri, 3 Nov 2023 16:21:41 +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 374D2E7C; Fri, 3 Nov 2023 17:20:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 374D2E7C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028499; bh=UP/9drExS8fAuscAxAl5GRZmI4xCn7Vu0PFERBpp+W0=; 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=uJ/Hm8chLj3P0LdubKbJnumzjlJ4p8+q+eLXP3A5VtlzOMwlinEE5CKyIU9NXfPg4 c4PFdTAz85pCr7rbdECRs/0KNNs569cGd31wsBgymfIsOuy8Cw9ygcOOYgkgCp+YYq PPySTgUOhfM9Aw2A+cfvqy38lV+/ONF/q0P49Opo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0F0F1F805EA; Fri, 3 Nov 2023 17:18:22 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id ACCDDF805E3; Fri, 3 Nov 2023 17:18:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 06775F8019B; Fri, 27 Oct 2023 16:51:41 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E95F0F8012B for ; Fri, 27 Oct 2023 16:51:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E95F0F8012B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=ZH+4NGBa Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id C01139C3360; Fri, 27 Oct 2023 10:51:37 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id WQmEYoUuGfVf; Fri, 27 Oct 2023 10:51:37 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 54CF39C336D; Fri, 27 Oct 2023 10:51:37 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 54CF39C336D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418297; bh=nl0YulySiATwjTvA0VLz2JxXUBsEu6JEtg/wdtc6mow=; h=From:To:Date:Message-Id:MIME-Version; b=ZH+4NGBa9tctVP8j27i1NLviEVpSUs5Jz9eggW1g4r/MAkCfvmIQ+l/N5z+vt1x1Q R/IMVD7+KTQP4oBptwUyIQOM96tHgUuH69xBbiQgmPJ6i6l/vNQ3YLexD+To2aK9sY W4cPQSwWmqShohD8bQEppufFH0d20ryzNHk1dt2fPy9jSb0rLa/r3v10dqUhzCpW1p 4kygC6bX99dosNFgz4yAlp8Nq1gf1vmOqZ3JDpfsqpfUv/TXUo/303F8y+BmkpSioR UKyX7RD2m5MwG+2tAmilWI/4y0mVk2seEeDFT2GoJkvHOVKdYpCUwDY68J92mJ/7rc P9UZvmlC70XDw== 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 Rb96CskQxhYI; Fri, 27 Oct 2023 10:51:37 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 6B65F9C3360; Fri, 27 Oct 2023 10:51:36 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 08/10] ASoC: fsl-asoc-card: add dts properties "cpu-sysclk-freq" Date: Fri, 27 Oct 2023 16:47:33 +0200 Message-Id: <20231027144734.3654829-9-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: 65A2OV6P5YDYWCO5ZF65AMLGHYYPMARQ X-Message-ID-Hash: 65A2OV6P5YDYWCO5ZF65AMLGHYYPMARQ X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:05 +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: Add new optional dts property "cpu-sysclk-freq" to set custom sysclk frequencies for the CPU DAI with the generic codec. The way values are used is up to the CPU DAI driver implementation. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 110ac20ba699..902715d63add 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -726,6 +726,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; of_property_read_u32(np, "cpu-slot-width", &priv->cpu_priv.slot_width); of_property_read_u32(np, "cpu-slot-num", &priv->cpu_priv.slot_num); + of_property_read_u32(np, "cpu-sysclk-freq-rx", + (u32 *)&priv->cpu_priv.sysclk_freq[RX]); + of_property_read_u32(np, "cpu-sysclk-freq-tx", + (u32 *)&priv->cpu_priv.sysclk_freq[TX]); } else { dev_err(&pdev->dev, "unknown Device Tree compatible\n"); ret = -EINVAL; From patchwork Fri Oct 27 14:47:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 740743 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 E9C43C4332F for ; Fri, 3 Nov 2023 16:21:56 +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 51118E0D; Fri, 3 Nov 2023 17:21:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 51118E0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028515; bh=FNu+1AnrmlxsFu2HV9acIQL4ZDudprqY2GQB8XEp8x8=; 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=vJOAp4iRnN13XYd9AKRJi0f77ZDyXtaMVYbL5obF0t02RLGP36GcRsRTj/p2Eephk FS+9pZFyOPQnCnd+L5IvK7Scs4JzkIF9cR0d2WlflSYFUhiv2gaPOK00xSVhRQufRn E25kaply2CNMuWn37BH89E3iuCWoSnvAV0v/BSI4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8746AF805E4; Fri, 3 Nov 2023 17:18:23 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0468FF805EC; Fri, 3 Nov 2023 17:18:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BC199F8024E; Fri, 27 Oct 2023 16:51:45 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 85342F8010B for ; Fri, 27 Oct 2023 16:51:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 85342F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=sqf9/8kT Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 367DD9C3375; Fri, 27 Oct 2023 10:51:42 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id JfYuZ1zci4dt; Fri, 27 Oct 2023 10:51:41 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 8DFAB9C3367; Fri, 27 Oct 2023 10:51:41 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 8DFAB9C3367 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418301; bh=nLZYT2bDMPIo8y7Bz9/t6RKWLBDETCcRAE09S4VvPEo=; h=From:To:Date:Message-Id:MIME-Version; b=sqf9/8kT7gUJqjPHOAt3IS/eEqE3y38gqJT6jVEh6cgrjvhjzB+diTVkLsBocz9up AklzS3Tze4T26cwP2nTtCfqxP8uIMwlZcMXmPDpUfmgzyTofML0TSlLnkCuVw90KVH FXl6wlHsl6YBE6vlZ8vQ5QmAU4bkJOmtxfB36J7ytvSxpIDAPR0REjuoeiZbaoSYVO 1JqsvJ3IcrwBqsUB6WjqFy8afKK1Y+UHYQC8dASHOQZAdzJvxvDno9LktT4dxze2IK dPG3DwvEpuDsVRgJRbgxDzjWQEaCVCXgzQjEaiddYf1TTm5UwFpUSVzLqjn+28SMRo i7tBoPu+LDACg== 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 2BA_u2Ct8qAc; Fri, 27 Oct 2023 10:51:41 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 9CA619C336F; Fri, 27 Oct 2023 10:51:40 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 09/10] ASoC: fsl-asoc-card: add dts properties "cpu-sysclk-dir-out" Date: Fri, 27 Oct 2023 16:47:34 +0200 Message-Id: <20231027144734.3654829-10-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: QI5USTF5KMJ4XW5COTY2K6TGD4V7OWIT X-Message-ID-Hash: QI5USTF5KMJ4XW5COTY2K6TGD4V7OWIT X-Mailman-Approved-At: Fri, 03 Nov 2023 16:18:06 +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: Add new optional dts properties "cpu-sysclk-dir-out" to set sysclk directions as "out" for the CPU DAI when using the generic codec. This can be set for Tx and Rx. If not set, the direction is "in". The way values are used is up to the CPU DAI driver implementation. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- sound/soc/fsl/fsl-asoc-card.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 902715d63add..4c44b4422614 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -730,6 +730,12 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) (u32 *)&priv->cpu_priv.sysclk_freq[RX]); of_property_read_u32(np, "cpu-sysclk-freq-tx", (u32 *)&priv->cpu_priv.sysclk_freq[TX]); + priv->cpu_priv.sysclk_dir[RX] = + of_property_read_bool(np, "cpu-sysclk-dir-rx-out") ? + SND_SOC_CLOCK_OUT : SND_SOC_CLOCK_IN; + priv->cpu_priv.sysclk_dir[TX] = + of_property_read_bool(np, "cpu-sysclk-dir-tx-out") ? + SND_SOC_CLOCK_OUT : SND_SOC_CLOCK_IN; } else { dev_err(&pdev->dev, "unknown Device Tree compatible\n"); ret = -EINVAL; From patchwork Fri Oct 27 14:47:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elinor Montmasson X-Patchwork-Id: 741079 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 7E5AAC4332F for ; Fri, 3 Nov 2023 16:22: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 51235DF1; Fri, 3 Nov 2023 17:21:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 51235DF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1699028537; bh=o8JQysd/JZOnDrTABNRgpwZo/7aUN04KPooA2CRnuLc=; 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=A2Gs1cSEGXj1hDWLPQNIQaIN3SsqrRpOqDTZiMOlGknXPHTcCApiT1iEbLPHpt2Ld em74vbHDbR4ZLPZldJka8PNrm0hYxR43JI7z+Kxty+YeeMKG2Nw2qtwxXmOAmkz+Kx /OdbyuY91JCLiY5Ej0mOUuMhpe2y3VlFpfatisY0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 92C54F8055A; Fri, 3 Nov 2023 17:20:10 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DDC5BF80537; Fri, 3 Nov 2023 17:20:09 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B761EF8019B; Fri, 27 Oct 2023 16:51:50 +0200 (CEST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0668EF8010B for ; Fri, 27 Oct 2023 16:51:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0668EF8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.a=rsa-sha256 header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=nZP1ASwX Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 147729C3343; Fri, 27 Oct 2023 10:51:46 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id rUDogE_3mM6o; Fri, 27 Oct 2023 10:51:45 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 701E09C3376; Fri, 27 Oct 2023 10:51:45 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 701E09C3376 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1698418305; bh=gKwzk+vvqTgoX4YzWIt1F4jA+IvQZyd5fgEw+5A6Hrk=; h=From:To:Date:Message-Id:MIME-Version; b=nZP1ASwX2dIaGJd4cGJHNCmoNSXIvi1aIbKyulFqsYUCegVWcEYdJh2NMgQsFfsR0 A4zHk+cWLUaj6e8FJGpAySYZCIFjivt5B5qVUb+OCJ0BAhBBhKpilxpHjnqaWg+ItO 3vPvLbtbiGO81hA+RJ+IYEQX/KejNQoB0yKP4wWoUkcUkxxbopvCK5ZIV3Is+1KT+Z 6efnlKt/d3I74mW5YFT/4ACDTjkf2FF4k2PGGK5IcCP+/eqNWIhhniYoSrEI46QRHb O35we+jrAwSZF+MXTxTwlyJBEnfGk3KurVx5h8vIwCbmqA6d2crY11mNrDB76cnE0T ZeWY8PqXPA3KQ== 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 4AQ0ATc-K0yT; Fri, 27 Oct 2023 10:51:45 -0400 (EDT) Received: from gerard.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 7D9049C3343; Fri, 27 Oct 2023 10:51:44 -0400 (EDT) From: Elinor Montmasson To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, broonie@kernel.org Cc: elinor.montmasson@savoirfairelinux.com, alsa-devel@alsa-project.org, philip-dylan.gleonec@savoirfairelinux.com Subject: [PATCHv2 10/10] Documentation: fsl-asoc-card: add documentation for generic codec case Date: Fri, 27 Oct 2023 16:47:35 +0200 Message-Id: <20231027144734.3654829-11-elinor.montmasson@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> References: <20231027144734.3654829-1-elinor.montmasson@savoirfairelinux.com> MIME-Version: 1.0 X-MailFrom: elinor.montmasson@savoirfairelinux.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: N3WX2TBGIY3W4IVYGJU6CK6XJDVGDYA6 X-Message-ID-Hash: N3WX2TBGIY3W4IVYGJU6CK6XJDVGDYA6 X-Mailman-Approved-At: Fri, 03 Nov 2023 16:20:06 +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: Add documentation about new dts bindings following new support for compatible "fsl,imx-audio-generic". Some CPU DAI don't require a real audio codec. The new compatible "fsl,imx-audio-generic" allows to use the driver with codec drivers SPDIF DIT and SPDIF DIR as dummy codecs. It also allows to use not pre-configured audio codecs which don't require specific control through a codec driver. The new dts properties give the possibility to set some parameters about the CPU DAI usually set through the codec configuration. Signed-off-by: Elinor Montmasson Co-authored-by: Philip-Dylan Gleonec --- .../bindings/sound/fsl-asoc-card.txt | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt index 4e8dbc5abfd1..274319bf7ff7 100644 --- a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt +++ b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt @@ -17,6 +17,9 @@ Note: The card is initially designed for those sound cards who use AC'97, I2S and PCM DAI formats. However, it'll be also possible to support those non AC'97/I2S/PCM type sound cards, such as S/PDIF audio and HDMI audio, as long as the driver has been properly upgraded. + To use CPU DAIs that do not require a codec such as an S/PDIF controller, + or to use a DAI to output or capture raw I2S/TDM data, you can + use the compatible "fsl,imx-audio-generic". The compatible list for this generic sound card currently: @@ -48,6 +51,8 @@ The compatible list for this generic sound card currently: "fsl,imx-audio-nau8822" + "fsl,imx-audio-generic" + Required properties: - compatible : Contains one of entries in the compatible list. @@ -56,7 +61,11 @@ Required properties: - audio-cpu : The phandle of an CPU DAI controller - - audio-codec : The phandle of an audio codec + - audio-codec : The phandle of an audio codec. + If using the "fsl,imx-audio-generic" compatible, + give instead a pair of phandles with the + spdif_transmitter first (driver SPDIF DIT) and the + spdif_receiver second (driver SPDIF DIR). Optional properties: @@ -88,6 +97,21 @@ Optional properties: - bitclock-inversion : dai-link uses bit clock inversion, for details see simple-card.yaml. - mclk-id : main clock id, specific for each card configuration. +Optional, relevant only with the "fsl,imx-audio-generic" compatible: + + - cpu-slot-width : Indicates a specific TDM slot width in bits. + - cpu-slot-num : Indicates a specific number of TDM slots per frame. + + - cpu-sysclk-freq-rx : Frequency of the CPU DAI sys clock for Rx. + - cpu-sysclk-freq-tx : Frequency of the CPU DAI sys clock for Tx. + + - cpu-sysclk-dir-rx-out : Boolean property. Specifies sys clock direction + as 'out' on initialization for Rx. + If not set, default direction is 'in'. + - cpu-sysclk-dir-tx-out : Boolean property. Specifies sys clock direction + as 'out' on initialization for Tx. + If not set, default direction is 'in'. + Optional unless SSI is selected as a CPU DAI: - mux-int-port : The internal port of the i.MX audio muxer (AUDMUX)