From patchwork Mon Jun 17 01:06: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: 13699836 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 DAFEBC27C77 for ; Mon, 17 Jun 2024 01:08:15 +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 1059682B; Mon, 17 Jun 2024 03:08:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1059682B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718586494; bh=pK5e2honpodLkOcYZhrvlZ+Yw0jcYwuTA+gs285Vy64=; 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=uMGOzQge03y9d7TADQCrOun8xK8k7e6HwpI7WAbxd9Fig1hpn9OQYjF8uRaw07jnC j4khd/wGNdr0wym2Avkjg984zsAkcqtk2/0OOHJ+Wba54UkskTTdAeFeCsaOgQJ0bL drNcQzGqx9kn7YpPs6qzLzzXJ14WIfGnmaqlKudo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8BDEAF8063A; Mon, 17 Jun 2024 03:07:06 +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 892FEF8061B; Mon, 17 Jun 2024 03:07:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A8846F80618; Mon, 17 Jun 2024 03:07:01 +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 EDDD9F805FE for ; Mon, 17 Jun 2024 03:06:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EDDD9F805FE 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=QMbCDSiX ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cPlQf6/SBjopypZ1PsKTr4Blk5wrOThpnU9xNTx3PXef9r1H2lNRWkGARPh2uV06GLDfrIwsGQmA0UNVPIRhYLGFctIQh2rO/rDjChMHGRSvgEOTZJGRHGjeQxLi/lRFGjlhU5JUmiVH570xvmq1Nyl+1eNK8X4UkXGiCzgMl2+WaaZwE1ngtIY28E9fJqI4/c+3ud6mO2cQxqIHafZ9RGPIYgxjZkxlo91ET/o6M3W1YAQlyaQfo4tqlE1JLbvdKax5UGvPn+zxorsMYhnk96vHk8enhbZJsSrr9MJEP22RoxXzTgnNGf6narP/rk7FV9NVbkNbRrgmUsgDgmQhzg== 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=oGfX5/2/4wSTeB+Cqt4x76dejymbT9e/gSm9oMdv67ViS1nOQjIXusAObhiQpoa7Fs9SDPlitBe8OF6mm2t/7rFEFn7rObDM4ml9x7tlW1hn1YMxQVt2A6boqLFUqRjMWvdTl61C7zRqpr0P8QXBfuR0cj5aTh65HIuJwDMkCPw8ACxrJ6l0jCMErTUo8d7Yl+yZ47+T5xPOjJcYnswzpIuNtd2HWg+eSWkVxXK9FaW/aoZxX3RsSvcFFt2Cpxra1WhPe1FIcH0s7HbaFsZg1b0af/v0LQYHk2o+6sMyRWGHTBPzFEXRMilipqJJDmYbLDFySKttIRxRyopjPFpg0A== 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=QMbCDSiXfyzv8cOKETyhperg7yN5pvahV94R8joJvGxZgJb6VDmgcs2/z8bhphC65ZaRPpZBt76CDqDPDBeQYFwvWsEc8m4cTVqgeTarWXOIJ2AndjtEAgRMxMTQs+nzJKJ2XNndl53+WNk2FWj7pIqIK+XK29I59Q3183gJzV8= 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:53 +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:53 +0000 Message-ID: <87bk40s7gz.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 4/5] ASoC: audio-graph-card: 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:52 +0000 X-ClientProxiedBy: TYAPR01CA0218.jpnprd01.prod.outlook.com (2603:1096:404:11e::14) 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: b2fd7785-73bc-4f53-af8b-08dc8e69c655 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: 3SMvdZphiD3D4FX+A6SxR9TdF9Lryw6fYWFDKaS53fIDYeYzkIZhZGtu7siQ1Yn1KxcKlrO5N9w6G0eLC8ea2VWIRzd1eX5lCUkfmQIuTrw5PII0nPw5KnNccSDW+YS+qHOUQxjd4evIGHpiqEvCXiKW+hdfXEIx39/owidMEc2QjOaPnoqToEWhXS1fGrBE6AxUormh0HIWHt4zgViNkOL3B3J3pMYEjAsR6k7UMG02QQ/sWJhqkIxY9vwpFh0P1gj+CJL8mOKlNcRNICOvXG0/cydQZrE1dEQ9tJdFe320Hk5jiUUsBZvA1qHtc8jZZr/Gz6e8yMUKYMm8mlZPe5H7NplGoeEu9QxFrfS2q526uJWQlRDM2JaTdGped38HgzVu09PQXxgCqbe2ojPU/oEcUIoK2BFgQjR1SOWn6pA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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: bqQFmNCQHG3NDLt0F14r5utJHYZ2tFqJL4ZeZaG8+b8J2wBG1c4EwAv3XIk3g/mhrCKrcVsAuzd4CfCpOZGrdcEDPjcKGif19uACETPLlnYbdWMOxgxerM/Ee8M/88GqDhYp5Yb+dUkfoyOwZSu6tn5YXzhTBnsxSVPLQ/HqDgDLKvR3cCaUZuUKabNOxVCLVGk9JV2R7mAiGV0/R7KU5H28tO8BcmxJaZYYZz2OIyCWNknTw0JVWhdR1qU0oJkPKwepQDsKns2uRl2ghhwLB2U9vgL+AiCaUNdfvN3XV95dhW8ysg6a5eq9IPTw32YW1owmnlZPx8R7xMkLK8v07syVc0gV3PirirWHUoV+6UevXlPbMxMVrpU1isX087sBlvww0nRg6kyiWsD+e+QG8tMNzY0NV90uvc+sbuhPm04MJYzm1XerPBbwrDRfMG8mzAuI0cgDJbpL4jbXwh+jXFzlFfciAa+VA0WQ196BQX+1ZjPpDzvZIppDGdZf35MW52AUkiZbDJsgkT/otLe7D3g1P9g5/4ibNDhJvAs7jRdALSZS0X/KoMt5jSrilMVN9RQ084K1jijKV3cNo1PmPcZWeeBjXxQCvDRKuO2QcOU3VDZEW1lN9ebT4OG3g5WC4CN4XwkzsbjyTvyYTePkCiDVPuZ3bQm5jOgor00+6RbcZj990YUtPwdAZaTedFCNmT7HuDd60oaIh8ddfV3Y1pnWW/elsXiFVNLx9BQ0Uwdfm27d7Fpwxy1qej3952WQayCi5Ym0P07XConGb5d6OwjEJJPh7p8bf+P0AyQl31QmRJ9evMbdNJ9Jr2Yd+OTz89nfw11vtT6GnxLWuoEL/3EsuKRyNTSZZ8ZUOD5S5oknkZ6KKyQuLMw3+eLrHX2RJeIjsrS1F6p371Pi0RvXb74gob6AV9wmwE0r4dLGi0rGbjAMYI7XW64Iw1uoJJEPVmtgM0FhGoRL1OKGsqbMrpL9yjT2QQYh+Xaqj/VCuSLodh7cUcWb255ovYVQUeSsPGE6XhdX/dvO+LISA0CjSpRa6gskMW3DKsFGYpvTJug3kLMj5O+eiHc3lMWxoLQVEqHnM2UDTSmQnxr9cbu1ABsb1mdCQnXVkyX4j+HMgD1Y6bzKlKVo4Li5gQ4Q/brivRq74e4mBUS5rNPSSjhH/a5vp6NOJmXnO9tdnRNZ2HaJ4d9sazUkmJDLXg8qgLWdZpPvolcWgpFS76JvGdzIAx6JZ5MDkpZmQx9EFf0aly016XO/47cgwHREV0A2dTtACmNxhu9SPslRDkTmPs4IWw7t5EVsK/ojzs9K5nZGEHD1wp7nSmlLvWRKKePbih2mtoALVqRHsVK8hMwEsARIx11dVpdNvCriEmqFSA0S/KtLYQQaVBIabyLu4hfISVG9aJAu+Iujn6VDoVNYPRCkFjfzDTX2cSg9RkwvPssUTdUz7NxbKgsuMmFFvQbLOhcI+0H8e42FGnh8GgsyaLJt2EUQKfdBa4aCH6415dB6g6eCDUD3QpmsSkig+kwDIVxnLD9kYWOgBdc7QCHFOg8eIu0ialff1nTVW21QaoPBVyRkel3NIYNetCVJnZJ096cO1xtIp7TunvxRriUABoxEPM725AasWkMbW5QecgaPY7o= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2fd7785-73bc-4f53-af8b-08dc8e69c655 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:53.0893 (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: KF+4iojU9WQIkQj71o6u6ty2JAn91DBp/xhKQGcdUWjCmxwebYrgez8sVk4sgDvJ7xKLEE/zCp4hPb7Ls6eHUC86S/q3XwW0md8qBbWsm1i99PvOZ/GyrmEuB2B0FNLm X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11912 Message-ID-Hash: LSKRFGAFZQBAFR4F3M54F6CPSXPIYCYT X-Message-ID-Hash: LSKRFGAFZQBAFR4F3M54F6CPSXPIYCYT 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)