From patchwork Wed Jun 12 06:02:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 804211 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 BD4ACC27C53 for ; Wed, 12 Jun 2024 06:06:40 +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 1A09FDF9; Wed, 12 Jun 2024 08:06:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1A09FDF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718172399; bh=CG5rkXwSml2V7XW4YbD8DjDUSkwUwpblteGsQVI1Mvg=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bE54dV6cp8p9z08B1/fTKHsKLsN0f7nQxJGzc/tsUYTXJwe88ehaTyCuvHMr3PvNb KcA9a5bOwtJiY740bmbRkpQoXWOIShzm3XrRea0sW2bVrjZ2LixKX048IpuKG9soop 3oIdZXjPgdWv3Q+wPEmo83oa14s4GGWbPWs5OwEs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A068EF8065A; Wed, 12 Jun 2024 08:05:12 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3FC6CF80655; Wed, 12 Jun 2024 08:05:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6B9DBF8057A; Wed, 12 Jun 2024 08:03:01 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20607.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::607]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 10252F8010C for ; Wed, 12 Jun 2024 08:02:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 10252F8010C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=Bz/uNI3w ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KjIv5GmNiNYb/BZYrf8ciROGGnmOvqSP1g3OcH10v5Zq3gkZqMngbrlzHxMoC7xDnIGyiUX9aXl3GDLeLy8HiQFPF67APgv91T7jJjIiuuqTXMn2gMbuXYUr6glwMLFu+DZmL6PUS/jEMSIWcDYg92y0EX6JpCGQzoqzwCL5r8LAMgu/V8LDYfdO3lCAC/0Pdyn01kUwJYIgOp4sTQcOP/YZly1kePENIK31+NfpSsmM7RoYbMpXlDR9ya+PAwkCBmWZJKdzh8dLKnxgJWXsbr88znv6G4y37GXk+AdalJd+Ak3LUs40TB6PqF3MVcny3oYQAfX+8k4DnGU3KA1qUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1b7P5PleKYRpayNOEiYp3U7P9vb+s9/6lWLV1YpAKY0=; b=Y5ztQnMSt7fN0mSppbsJ5XCYTOnU2jN+3u0RBx/sWb0YwUmO/rA7t+tQzEtJKg0brOTypkc8ihwIVXuozp8RiLN8IYzX/E6MpFeRoEBgvVfkcayf55AsVK9Xv4vLfVAW2JNIDqmCvuBnNKmDrgSYEaACs5B6h2DiOtCxTtsK9Jpk2vx4GJvYcDt2C03vxjJQ0fYeNTlGCmOhQfOCgT+2gZj5jsgzKZIbVmljcZf9uLnLSI+arVQcd8CGIaSYhw+mmtZy221MTj33J3/+yQph3sMaJW4x3HoU8F8LzcaXQsEijQ/c4kAYEykvyhbQOkkpzmPffVLo9GabOOj1YmBIQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1b7P5PleKYRpayNOEiYp3U7P9vb+s9/6lWLV1YpAKY0=; b=Bz/uNI3wF9nkhBBuwRPb3b65SaiCHjpZ+7lCZIViNgAPKPdxuZK93UQ1YY+Jt8OtwpSW6h9UN/5yUx8u4FKqb78K325RUpwUyp9iX/UZ1D/tBPYQ/kenLXtU2Tw5jdXlGzo0zNVoqRtFZfa4cw+oJVUAQK3QDGjGYHp2VPQdkMM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB8904.jpnprd01.prod.outlook.com (2603:1096:400:16c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.39; Wed, 12 Jun 2024 06:02:52 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7677.019; Wed, 12 Jun 2024 06:02:52 +0000 Message-ID: <87msnqzoj8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 5/5] ASoC: audio-graph-card2: add link-trigger-order support To: Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Linux-ALSA , devicetree@vger.kernel.org, Maxim Kochetkov In-Reply-To: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> References: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 12 Jun 2024 06:02:52 +0000 X-ClientProxiedBy: TYAPR01CA0222.jpnprd01.prod.outlook.com (2603:1096:404:11e::18) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB8904:EE_ X-MS-Office365-Filtering-Correlation-Id: c61a6b22-616e-48a4-f99a-08dc8aa54ba0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230032|1800799016|52116006|376006|366008|38350700006; X-Microsoft-Antispam-Message-Info: zfs7Mj/6hGrNfXgXr4xUwQEtzoPBJvLAb6IXZZwwmIlOFMgNlOu/qnZshP+6fieBiEToYBpRZK/L75hCvFUkC6CFvdEyma/BSnktrnxTFIY3ZWKsgUvUfKs37ufN2DBy1S06ecHH+sr8Sq5V2bVXfw30B8vMY4yhxVwVw+Lrfz1+6v4dCQgxoxwzCE7qY1fxiKWlBYb2b5w+IXlNE+50DZ9N8q7gnb4B1SvQzQBEY147MNAcXKXN8SBt1ibBDqViI1A2Szdtth/W05XMsLDYw0W73lh9zaLnoJKn1SWAQ++YoXuTWOrIOukp/WoeOF50K05SzlKLTFGnRUILVp46Zb9NvQEW+GjiBu/rDjPx3vT8zBPIyEdbmJkiWpRuwAK9Q2ZicFSaySyxcqx/PN6dEicOn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:; CAT:NONE; SFS:(13230032)(1800799016)(52116006)(376006)(366008)(38350700006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RU3yjsm1u2VunMLI+X/2eNSSnvkKznimAqD6MxwibDSzBkNnmQ2gxPE8sXB4BVyZuiJK9IkrpDh8mQ968DgEYQx7UEdSCDpL3h/eySJhni8VWGvCZiNsMfwkwJvCsOdo4YGWiPrE1RywiyDQLc5BaQMi1SVVEfqo0+GafsovndJV0KHDCFk1vqotv+GDl8qNida7xI1NCKCFfz2dAPXjExw84ZefzpIcr9vupdL8tDUDjasYQCfrSxjTyQ2Iz5bivswycLrFLA2QT6jJwAodvDEMweC2Y1gUc1smRDRicu6X6VF2aZaWiHoY2W9CKLxqk1bAI/9hYDJvPlUTNs5ueJEfnxLFXJxigcivoZJn/Yp/6pWyS2DxmKV+eYnxPytTmdBEKWIny9seg1WDXvwTokOroL1R7/ESSViyUi5G/18kRTfAludjLDRHFeVaT4FoBNKWA+hgEZXxHbtclEYME1KmAcqvMyYWnBz8dxKQzgHZCBZB4po34Xjl53dbQvkeA2O+RC6KxI0VL33W+U2gCrwljROngIvvXqAYsI0DKcgMiMvLO8M9bhnF/kr3sBixdnYvv2wTyET0wrUZvhBDFyhG9jtXaCXheZqo+9uMBaMbNfXMJXQQQoAe6Ur1xrtJUMsQWyVYH2Zl7f/nyrPPwPH2j0RLGwW6fPY6nVq5/S6O5/EAevhDObuNanwnMTPSuWG3XHfj239yPUT5ay/NRGNWJAcm5HcCke1Vh02/F8aKmKa06q8aJyoivM13lcOR1RmQG+Tn5H5upkRtdA15DO9hi32o7McHaerI+f7xDQKqzjkwTk49wNMbkkQ3PuHsIHgrsAl1WoBnqm2nuIwJM6jgonS/Q8RjVhLjwz9jP7bYmrwmqzNnV1jWnGh7hD4iAA8DKXARtYbUUtJ6f5UrWQ+mhAqI4kA9R+D8iB0qa6s2jWya04fKa8+2eprSZvPJGO1OntQoK2TpV5WeRzLHxY/caC/8yCmRk7vZvjXzbv2TGObWGnG5p2Ki7h1eAV3//CUeutsZ6JNMMVn4p3VZvXwmIYnP2Fo0l9OCEbpCIy980NTizXv/QpaQxCT6mx2S1SF7/6xR2IU1DZdvtZ4xR0ICehcosjFOYUUtzx4jqoxkgeGzAjG1+q4WbuX9gsKm8AFx6VfPhMscjCYTtvX5L2KeStIj6x0yTcxFOMv1m1+uPaeXSGqcUN/LLf6dq4Y7uYdx7n3j58kEVFoWBO7/MiACFe2Om5NYV04VaxBceFJZ/OvoEYwZqA2lS95yidKAuG/3YfW/jGP0vxmWzr6cDwmq2/SH6DABItXBGmxt0zRDrISrVDz2ah+MkyrAYZ1BX3Dgutx7oWw/WWPVFwlOJBSLlYHK4gu6+7+rDjq1jbl7G0SKQXtAuEaOiTUJiui5ZsCngHiD/2bDdG+hjtb6EjaViRsk+d56J8w8e9W0IrssyIAWaLO77RDjePqnsQbuZ5aWgc2gjZlrepPAfGPXi/Wm8m/G7NtSlYlN24XRhm4rTYxABYOoJjvntLbLzUJ08LTqWe/qS/ol08cxvv8AOobNWAOyw0sRD/DsoZWGvk4IH465SaxE+q+XLQBduFd06FALxUggw+0I90n9+7dWb7XK+I1d8fTe/WoLH+LdjBk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c61a6b22-616e-48a4-f99a-08dc8aa54ba0 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 06:02:52.3786 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SeWPdOtTc2aEiaOen5vWNmZvYrk+8mDaqIZIrusZmBGJcl+oqyOXZ3O5hGR0Ko0sUuB3YAAJ0NXuLbbc7CSbWysGFwt1PpbkzB49mKOY6x5dHvGj3RURQFD37qUMA67X X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8904 Message-ID-Hash: J2BCI3KJIGCRJL7KKJMZZ4WIJ72CNL7Y X-Message-ID-Hash: J2BCI3KJIGCRJL7KKJMZZ4WIJ72CNL7Y X-MailFrom: kuninori.morimoto.gx@renesas.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 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: Some Sound Card might need special trigger ordering which is based on CPU/Codec connection. It is already supported on ASoC, but Audio Graph Card2 still not yet support it. Let's support it. Cc: Maxim Kochetkov Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 8eea81888758..abaf3c1719f3 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -759,6 +759,8 @@ static void graph_link_init(struct simple_util_priv *priv, struct device_node *ports_cpu, *ports_codec; unsigned int daifmt = 0, daiclk = 0; bool playback_only = 0, capture_only = 0; + enum snd_soc_trigger_order trigger_start = SND_SOC_TRIGGER_ORDER_DEFAULT; + enum snd_soc_trigger_order trigger_stop = SND_SOC_TRIGGER_ORDER_DEFAULT; unsigned int bit_frame = 0; of_node_get(port_cpu); @@ -806,6 +808,14 @@ static void graph_link_init(struct simple_util_priv *priv, of_property_read_u32(ep_cpu, "mclk-fs", &dai_props->mclk_fs); of_property_read_u32(ep_codec, "mclk-fs", &dai_props->mclk_fs); + graph_util_parse_trigger_order(priv, lnk, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, ports_cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, ports_codec, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, port_cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, port_cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, ep_cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, ep_codec, &trigger_start, &trigger_stop); + /* * convert bit_frame * We need to flip clock_provider if it was CPU node, @@ -818,6 +828,9 @@ static void graph_link_init(struct simple_util_priv *priv, dai_link->playback_only = playback_only; dai_link->capture_only = capture_only; + dai_link->trigger_start = trigger_start; + dai_link->trigger_stop = trigger_stop; + dai_link->dai_fmt = daifmt | daiclk; dai_link->init = simple_util_dai_init; dai_link->ops = &graph_ops;