From patchwork Fri Jun 7 04:15:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 802638 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 563C5C27C53 for ; Fri, 7 Jun 2024 04: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 4BD09844; Fri, 7 Jun 2024 06:20:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4BD09844 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717734066; bh=pK5e2honpodLkOcYZhrvlZ+Yw0jcYwuTA+gs285Vy64=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ShJs+j0r5fK88UU+mmIfhaaEeP2Jrl658BlK9waQJO4JgsKQl/xVRN7Qqrrjtz4Lq Vy5iugN7/IV0hp3r+M5e0Og/Hdd7UuCSpZNLIiHdJne42OX2Fjw4DKZiWLy8d1muhP 3ciXxYTXo/KsXfskxcz8GpzejCgE59e0H/iW8Gc4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3A2AFF805AD; Fri, 7 Jun 2024 06:20:34 +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 4C734F8058C; Fri, 7 Jun 2024 06:20:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3E3D3F80171; Fri, 7 Jun 2024 06:16:28 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::60e]) (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 A9E0CF804D6 for ; Fri, 7 Jun 2024 06:15:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A9E0CF804D6 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=Q25f5Jif ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZQ+WPlEiwWupbLycrkzAYXghdl9+dqPn0fiM3CIIAP0ytHdgkk9mtO4AQSR2O1blgP/c+EvybSt8tVUX3t5sNe/mt8SZXn7Oo5LQkUrqvFYX6cTipYxVQC9KMq69A+nIfwJLZnJxy2nCFDjeUyHmu+QgAsVffBGYTf26XflSjPlBL+X6Hg0j2rghWmNPk6W9G8bQVv6r87WAP2MGAFFEvBV4aFCAR+MFShuh6gF7al/zFoXe9czfro1KOm5VOgkxn+oONZE105KN2hbXVpZ8YuJ+/GxXy1eyRkZWzSC2tEgJULC0g7a1Q9r2Qfz48I2D/YhK/hmq52a+iujjzcyu/w== 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=3Ghxl4FQQlA0M7odY6cDxw9s0H2+Aloz5BBJ+3hM8bU=; b=l42YeaScvPc34ozUOpWQwwVbvnp7tSk8/Dl0zIYkaeZqYDN1C1yaECdS5AFjzGRjrcp/Frg2kI/IP47DK+8GXeZGiJW8eNHAinhsMq0vsskGlvJuGV3DggtblAayr0KXxG7CKWmcUizQ76MYV3KMqVoBsc1qlWm+P/XAUwiUxaUlQRVVuSN7BYp8uJJBycqmp5qvVFPhG3XTdS4/z/R43hibKYJypetxL4G+40INnY+Nd1BR7gpl3ob/tzzhdTpSpAtxLjZAl17hKnO0wZLVGE4zgyLSIiWYiXTZcDfvr+frAgryVoMSxtDyr16UKQPRoNw5C7jLEYju3YIXKrPFbw== 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=3Ghxl4FQQlA0M7odY6cDxw9s0H2+Aloz5BBJ+3hM8bU=; b=Q25f5Jifp1N2rIKl/OWZbzyAp4vPhjJkY83S9AD4uWDIOQ6ls+m0mhWEE8oC43GSsN5VlgMNeIdbTP6MPyTn8LQo+XmDGyRUWFNfPBTi384CZCeHb403ZvRuJvkW1/5gceKkDC7dj7Q08NYQxNTJAIZj6zuwt6gMT5Cvx4OZBh4= 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 TYCPR01MB8206.jpnprd01.prod.outlook.com (2603:1096:400:103::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 04:15:21 +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.7633.033; Fri, 7 Jun 2024 04:15:21 +0000 Message-ID: <87plsts813.wl-kuninori.morimoto.gx@renesas.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Linux-ALSA , devicetree@vger.kernel.org, Maxim Kochetkov In-Reply-To: <87v82ls82e.wl-kuninori.morimoto.gx@renesas.com> References: <87v82ls82e.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/5] ASoC: audio-graph-card: add link-trigger-order support Date: Fri, 7 Jun 2024 04:15:20 +0000 X-ClientProxiedBy: TY2PR0101CA0038.apcprd01.prod.exchangelabs.com (2603:1096:404:8000::24) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB8206:EE_ X-MS-Office365-Filtering-Correlation-Id: 25b1171a-4d43-4e5e-7c53-08dc86a87255 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|366007|52116005|1800799015|376005|38350700005; X-Microsoft-Antispam-Message-Info: EEos2EhYOpM8M+rc89lTLEDQNJGeOXurGyQf3fU6DtFKh67YvIUpzdxCTz5TMbUgNqmCMvWl28Z9sboLNZBzDACIXIeYr4IzUXSKw7xkDTb56757tWpSjXTVPr/0dR6K/8fsCpsGyPPdKW+y3Tl8yi/cLEWeNwXKLcOcO44ScnTrObAEhOX+OEiobnYgfiiDT45EqfpY3nFX/CoCom0MFXW6R3mP8H9txvVE3RvTghIPwPB57JAAwCfMNbtlppQMKpcqdzyu6EWsDPKt9vIxk7b+wFffma+R/Dprrepuc88kL8K7+bGdXh5TG7YWqzkNRbx+/aMQJ9HS5/gyG2tGs5MmUJ+3H4aQLtbBbwWxg3St1qwjKmVPLAd0wM9CsNF7KUGyl9gBwm7YSRcwDksd7433VUqq/MTfDQ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.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(52116005)(1800799015)(376005)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wH3lyoJvwi/EQDjdVfzWdT1tm6pOu2Uo2i2Jp3zg6HdGlMdlu1pk9L15up6tS5fATBsDlhp+3s36YKpq+7/w8ZKDM26EsBUCkMkfTBSjGVGvifdUtHgL6WbaPfeb6ReVYG7QR34/gos/vnXPwfHpWrIjn/Bp4lb3o6CUbbjWOH9fhMxOnht/68UbsZi3Aht0IPPqoqt45jmrr7hvd26cB1rW9QUCQQ4KSbKMkYWghI+ixU+IzNfafQO49Fku2kIK9ZlyW1T0r/a+xURP2O6P7khfYTATbyn42YjzET82EWREYQQyTDaBUTAw+YxctiWKJwbZ/C0V5T6avyF3aLMj21te1pYfGgFguimr+SizG2D6ZS34f5oPExPI9n7POGhYzIk2cgWaCdwKwO7nGgkk7/Yh+w92xh5wXyisThtD08yKd1fALvzkh1M1IZSP34oYeV69ybjesfznrFGktK5SgQ6Xw6GKXEjmaktORfASt0Tkpwmi92CHn/5KXgon4A6mW+zao0HVR6gkleS6G+oybYquWBOS3C8QZ2PFy4A02Plt9RJrzSfXlAqN6TOdbdEXqnBK1TwD7bId3TJbu3W0Gw9Ou+8I5RY+0Qh56NDjNVUuFH0zz9phUhT9zuKB/H/+sCdBmstnNX29lZ7ztVerOcKdYClfd+rz7aePQjaJpVawKrMdyqsVQ3DeMU7l+ac/z3R+hTy+lwkijetH/vtDYKCq9oqZDKt8K+PzoOlQTw43MLxEB26+6APyPcVXcS6nvK2Lzc1KeNboRTaPNcyir6oL5NyDu4A9BjZDighTYx0DgVzg+PPl7Hl5hD1ahjEe8bbRBqELCa6aMrGYlsr6tOAQVDZnIGGfooqKj3i1p+fqwJaA7vnHlymqmVc/ROSQ1ZqzQo5EBZYMYPqV9C291xLbEGDsUL1ei6mnd2JXoBXCCrQ6gpkMK3Uo60ZJoMM/D3SLZ8sfWtuQIkdHCDUt/aRM2bXuOWr0npdBRgWImRCqHJW50YVusUkfyb7xZhLNV/Byo30FgHfwQ6UKv4Ka/i/rF84/MFqsb4LiY85hkSlagIEmDiZEGUw7UR+A+6vjFkzbH2Bt9wZT3k7j+pRfFJN+XSsqPW5dVjTOc295ICohxFO6eS+bPeSNdlD6jqiJUr1w84kQ29uEaGpQ+UlK4cDT3N0pSq7G4OC3k8gQimUhqUXjQmpgN+8Ds0AoNeX2gY14U+W0wt17/Vp7Bl/fSa3QFWjU5gqzlgvgPa0e0CeLVCku5KfJnymhcI0wjrhxoxnq3jDozjmyMoDfCkBpbLw1BZq5No3TRKIj3g5Sv8jrt0T9LtInaoEMmsGKpEkLSr881+5Fwf7knMjRUAyEnDKgoCpoJ527h4t1UmXuMtyjA1LmeIfGq2hLBuAR8ZhPjgIEX0eKolHKR/SxfBfA2t40rXcS+LdrqsX84zqpsmb6inxnAKV84DcviGkqywXyrbuQ0uH+evM3tlTF1DNZfsg+LvLl34cFTb1T5mfF/2s693/UG7VkAt7SZkQPMALNZwdp4S1hD3NZXpicGETM61l5IE83Dh/KxFcBLwPstMYV6CCbbFn2JOsE/L53c3EFUG1Q/9WpwYzwXWGMJgNbKjC6FAGhI0MFHJvpTqJxbCg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25b1171a-4d43-4e5e-7c53-08dc86a87255 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 04:15:21.1191 (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: whLDE1hY6bvq3dv86JeN9aGPC5EroLM1PNQUz+KRtHSOcaZGhppdMk3FJ6+dzkAJhu3jo5kNa87vOouJTimhmWtLufZN0tdZ5ucSU3fEtIhmqLLDz6pQTJnxJUnb0Ngr X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8206 Message-ID-Hash: LVJPOJPT4CCXVFWP4D4QA3WDJATEAR25 X-Message-ID-Hash: LVJPOJPT4CCXVFWP4D4QA3WDJATEAR25 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 Card still not yet support it. Let's support it. Cc: Maxim Kochetkov Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 7b981aa8690ac..acf7d92d21e60 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -143,6 +143,8 @@ static int graph_link_init(struct simple_util_priv *priv, struct device_node *port_codec = ep_to_port(ep_codec); struct device_node *ports_cpu = port_to_ports(port_cpu); struct device_node *ports_codec = port_to_ports(port_codec); + enum snd_soc_trigger_order trigger_start = SND_SOC_TRIGGER_ORDER_DEFAULT; + enum snd_soc_trigger_order trigger_stop = SND_SOC_TRIGGER_ORDER_DEFAULT; bool playback_only = 0, capture_only = 0; int ret; @@ -165,9 +167,20 @@ static int 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, top, &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); + 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->init = simple_util_dai_init; dai_link->ops = &graph_ops; if (priv->ops)