From patchwork Mon Jun 17 01:06:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13699837 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 61388C27C53 for ; Mon, 17 Jun 2024 01:08:26 +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 CA69B84D; Mon, 17 Jun 2024 03:08:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CA69B84D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718586504; bh=PYLjg4Rn9Bh7IeYqQUSM3JfEsrZr2AR86fI3O/cyWWI=; 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=vNnfxkEc1mee7tTcs2rcFs0/NOihrbKbWKh+q5EsPSuPXGcZFtCB391n2F4vNLnkQ VXuUENePDLvkeCu6fXEnsE2yPgFh0tFrmkjBrgmcZn59lRHyTFUDTlLziEEf/WMEyZ Z+DxVx0hY+bJiEJHt7JECTp9RTcKWa+ZCmhLXPRM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 79045F8065A; Mon, 17 Jun 2024 03:07:08 +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 5BADAF8065B; Mon, 17 Jun 2024 03:07:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 696DBF804D6; Mon, 17 Jun 2024 03:07:03 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2062c.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::62c]) (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 A8298F80617 for ; Mon, 17 Jun 2024 03:07:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A8298F80617 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=QWqPz138 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U3R3rVgATSoVz8OlQBrFmeQDDZZFpTYvqmFkYNq6vgbOboEz3MBnMUrW+VslRqO7ZXOK1cY3IVmnqR9eRj9Qysvi193KZBEWuM1QXN7m7w3zVpfN5hDVeg2WFrlvrBR5Vc2X/+vPCYJqXWtSPxoIw0xwx2A3Ac9SNd8MviF5CQ5ikpXkUm22wW7vlNCxbJYAHkT3lGgokojvOU4l7pvclhkoS45A6nqoQ1R6iXyfek+UDh/8XY/+cpJciHejxZNyYEqp6NybLvVb2wrWSrCWLeN/O1vOliRphrRIJbiNTVuN7oJR2/G7+k/s7HAAfcZR943SRBGiUgl/S1i+FU2XSw== 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=YO4A8lsP7ma7Kmz5TkZdLhQzYk8gkkJJXXTmWh7m9sU=; b=SB72rXSxHjmBh7WLkdaK0x/WGZ8xC+nkKj8pd1q7QxUFfy8QG0cMlIxeCj873Mj/2YsC6HrDMrLj5uxPYC9JEzVxIk7OFwuUImoCTFdMZStZdzrK7ahtZGz2TCdgSwPAMBktKZ5ZSZ7oxUHVuVx+xz2qVL945WTL+YFpcD2uduILcHfy+0W7SBlUiAPHpZy5TXjV6cEOmMr1mhuu0LUnCeVvSioN36CPv6ZRw07fz5H/GfWPuJNZJ4Vaxq1qrShKThx0EslJj5jFvsg5k6am5KoPR/jzuQ3Z4QemFjCnTfav0Y9enfi6wtwsaoLM+M79AlqNui6ocnnv5td4NvQ52w== 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=YO4A8lsP7ma7Kmz5TkZdLhQzYk8gkkJJXXTmWh7m9sU=; b=QWqPz1383+WG4kB09Cb6L5T0uN5WsQW6QnenvhSoBdUKaA4H7Q94FFrEvK8a5LEYozrQEHdiF9AaozWy8n/3+ywk2ruL9JmwOhPHBEhuDNxFmzd0iE6r6KQxtWfk3BOTLxdkis2QH49pcr27u9dRAhPd9vc1/DMUiskeUYB9Isk= 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 TYCPR01MB11912.jpnprd01.prod.outlook.com (2603:1096:400:38c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 01:06:58 +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.030; Mon, 17 Jun 2024 01:06:58 +0000 Message-ID: <87a5jks7gt.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: <87h6dss7i3.wl-kuninori.morimoto.gx@renesas.com> References: <87h6dss7i3.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 17 Jun 2024 01:06:58 +0000 X-ClientProxiedBy: TYWPR01CA0023.jpnprd01.prod.outlook.com (2603:1096:400:aa::10) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB11912:EE_ X-MS-Office365-Filtering-Correlation-Id: fd1c9127-c1b2-4e58-290e-08dc8e69c994 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|52116011|1800799021|376011|38350700011; X-Microsoft-Antispam-Message-Info: vjku7oMsFX+fHGkFkVrW53pbGmRnRDW9xcpbxFHcRNqcQLOBufzpn2IwysDM1dlhrt6I5ZXXPQm7qc1a54lQDtOvssEGFzSTXztvgWuits34lm5mrfQ/0a+MYIxcVYFudI2wP8v2FFzXTW6ELsmuW510DAIfWjNW/uA4nTYkFr9yvVRrLgESgTSJ1WiVbV+WG/lUyjV/zuAvGJYeJ1Pg/co0/HkzsWgqT5DxFQcILfTT2gkIKCp3F3lTJK86lVWGwbXSq4au/aukMbMo67O7Pa7hWbM9vly7Vg80txnsaduCvsVsRAhDYJTX7Scv4/uztMi6chnprIs49HmbVqJuZVxFsQPw50iyt7Zy4ffdtLkersSgcO1uZVxZzQyJJaBvbXEFuWYhzLV6xBZCHyx9uJZ0EJYAQSf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:NONE;SFS:(13230037)(366013)(52116011)(1800799021)(376011)(38350700011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: is16zpF+q2rlzb5O6ziOCWg4tReWdBxp7ls65EVj6Kbb4OphI98D+qaiuShTZ6Nmam/PpD2Ix/vZlJTwFI0n6jdJyzuTwtwZWg18hOfzHlH79A8oD54CG6KccKKioNTiVJCtlHN9d6ugHHicanF16cVX2xF05nAfCPOIrAjAcTAyqhDDGkYeOHJylG5yxbnBtd3/8hI1i9cOvsNWpSdNIVvvnJYIh1ln762jgTRHV2cH0AJpkdqM7D5utW5G2p58G9zuuPYPKTatgz4x78hWLfVPoeYD+5B8CQWZLZuWjWHLi621m/cvVUdkkcKGeLk3S8vSf3zj5jri+LNACoD9VsvsDa3MW1n+Hqql4Gx3Y8h9ZDRvq5BbXvc/r5/STS7WBuNbpJFCjma21KMysWyU6XaxeZS17GXY5tI23ioJgON5AQ7a6SywNIzKenzvtoCRzb/mzaF8SIXLJNgaC7zPIbKfw3R6JkdCKNVIj3az8HVNxr1DDdiReD6biokHIJBS+8FGO/X6fdXOGkL9iOn6ZwTtVb7jo30LEHya+zXj6wlyj5bsx8d+bEDhFdxpqj3px+tgHAseFhWFrvh0oD8C8ujCtveL/WeMgCTeXdAVbPdQPT3CIo7iDGzK3X5gTY1vM9PuMJgs7nyvoIVu38y7iUC0hEJLtK4sWTtjwUEa3FBR7HcPokbGkwESLPQ8cy6e8ilfzo5FRdfs3l0HhHoYEtfbDzWU7ROwxGoCkyCh+iM/z/iBCmq2M+Q+bWR9URHKb81wKeGBWaiQ862BdIy2QWCv0F37EZml4srLJtombTjeyj43V/beUAVKHvJaPw6zXg0xITjiEzdnPVTF2UGWV1AvYQ9pfrIPPZFAPM1s823NgY1AjNNXYWG4m44DQQ91OncnMkICcFV8Oqkaixun3uRDes0dQ7SUOCutvwZz3G0BNyEEG76SBKmTtI9vrVXeN7s+o/AOSLDz9UYTzbypI3wPZY7DqtcoykUnQ0FhqMjj8FSWZLW7mhJvYiZSuosaEk7ncuc4WJGnWbsM9hHlrtjocotNpl+qDIbHd1i8PagGv6EO/YXHqCSmmE4Tt8tR2djxqVtZVOz/yUJSZwd4Q83yiCDFXSGC4H4E0umD2z577G7jSgMxGZvvgZ00gpgRtSLIIPhbSM4dJCkEE6sxYmJxbKX6/6aeOFj78rul7n8HtMG6lF/gvrN4QCt08uffcrhQE5PicxVCRpAg8m1OY8K8aHhN75D1foDCl5Mb1jT1QYWemzIIzFIM+ZFkP+nHY/gZBi0sosX5LxF3OLcH/pdSMAM7mfrDvwjKU7nbFdt95d6DMhI9W384IzUtQp0ADzoK7/MrQMOwOq1POq8yv8lQgBTc0IWacnFUqfAk57eYmb7NsSWU0IDa2a8uhkvTsQ35wale2gxQ2RIWugRrAgwNNn7qL7QQhcNsNHDmMD1s+IACE9TIOufAKWOiGz77L6aRNMnIMpQxIbwYuHQMV8/a5tvqJ3g7ea+PkLNxkQLeYpf+I5Gvp9jDA/msRm0yg303EcKmxJLdtHF/6pCjN2JT08yi8fAFJQnFNE7UB8EY8Xl/In1N0b/BeUZuiNiBFbrM7GOr9bwR6yExhOaGG/G6+xG5JfhjucGOxlh2+oU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd1c9127-c1b2-4e58-290e-08dc8e69c994 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 01:06:58.5667 (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: Wm4OsmR9k42ktv2IZIcczNK+hB7cr9iY+r7h/FnvNTk2S5FoK0cD+Q5FPF61DETl8Z7ejyJDsKdwltrvoQOC2ZlCPd6kvAwfUKVCf4XVO5jJoirPYUdsuwiCPztHxEKu X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11912 Message-ID-Hash: T44OVCDKX3U3ZJVZ2K3ZUDQLVNCT2CZ3 X-Message-ID-Hash: T44OVCDKX3U3ZJVZ2K3ZUDQLVNCT2CZ3 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 8eea818887580..abaf3c1719f31 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;