From patchwork Mon Jun 17 01:06:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13699833 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 D81A2C27C53 for ; Mon, 17 Jun 2024 01:07: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 C8754823; Mon, 17 Jun 2024 03:07:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C8754823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718586438; bh=DatrdndK5atfZAPf1zpAbPKhhuy5a6f2H8f52vptbaY=; 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=VD/YGjsN04m4q38tOHp5jvZZ1ZD6Dot2DSAxrruMh7gtNPm8/KL/++pFsbN7p4Ky9 pSM8n0dT7n1ff8CkmTQxZ/HeCnyxlxADI8WkL3mzZMmrEYJ/13QIgAc4g0OAr+GkgG TUcCQIgBi20W2NJkFJwRC8qc/eXZ1d/MHce6b/60= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B18B5F805DF; Mon, 17 Jun 2024 03:06:46 +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 4ADEFF805D2; Mon, 17 Jun 2024 03:06:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5C815F80588; Mon, 17 Jun 2024 03:06:42 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2061c.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::61c]) (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 226F8F801EB for ; Mon, 17 Jun 2024 03:06:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 226F8F801EB 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=o/p1fzZa ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b3DoIV3R1KTYN8g4s0wjsoE2xaR06Ip+xDoNL+KaLEfFPSW0o3/Ce/XrvXMNWUvb/NEJCVluFfgH4sga3P0vLGSNRDiTv3DUmNGbep46Qf2P85S+WMqMn4qq9Cwb1YRLMGssThJlQn3qrFslbIliJW06QhLlwK6JfuU37XJBXR9hziy9hGNRqxB9xJI0hITZi9tSDRKO5ykNQ9RzinWB1CNAHMg0EGZddiHMCU9rLr54k2sUGUmrtfahU6lbEYqh7aps3E1wi1cnMgIWVDDDE+2kFDbAqPt+qVwgZ2Dh5Nh1vQa0ApLrakE5PQi8cqj1jpkUwWrvx7loEU8Im06LtA== 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=rrmMI/8LoEKlLvdzR5pryoS4zouS6yTC1zJV2fbdnec=; b=hnFqHJ1/qpDtw0abLZpIEQGBGsVYPdZWto6oW9np7soQaYMTfyOkOMFPSvHuQ9vvuzwlEgAm4d9WtaVw271XeWn0GkqTY+qSCwa5gtg7RGyjqQwd0tPnAeyb5Lv6u/cFmaZ0YVlHzigDVrg8LkT1mVWHFW7q/Pz3SBBtyqx1cbOWnQvE6LWI0O37M80Qa7h+e+y9AOjivx83L9lxTeZKiEor2a6IinKwQb5Q54RZalo4j/sNXM33NLkAYIJ0sUOyqZe1uoJPftoni7TWOGpgT4eVkBWf2pTLtD6TA3HR7PlEIps72Aa+iXZ4lP3H+2EOcEeAgAncsi/4LKkCnRFsjQ== 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=rrmMI/8LoEKlLvdzR5pryoS4zouS6yTC1zJV2fbdnec=; b=o/p1fzZaKzJa8ouSWgF++kJlN1jkdRI+njzFPVH5j1NtPxhls2NrL6oBwh+6iXwlAigwy4a6Fuq3yyDeoPqFqy6/f4X7OhS2P7tOeTxwZJvkswvPsUTneUuX4Ln8LWpRG/pqDQRwwofrdga/jwHZ40Pdfo9AYdCJo/Bg2bALfD8= 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:33 +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:33 +0000 Message-ID: <87frtcs7hj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 1/5] ASoC: audio-graph-port: add link-trigger-order 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:33 +0000 X-ClientProxiedBy: TYCP286CA0237.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c7::15) 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: 75157ea7-f242-4c5b-a0b8-08dc8e69ba97 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: HTmI50HJMKNE8eA+NWdnA+R4f0/W1pNnnJW06/Tj+vEm4c4u4AHFIBgqBnIJIdHsjG3xCgyH2qrlLic9OuvbxaHXZgr1wjg4LRZAUC/5n0f6X+i8mXO3uklWx2iiAj25aeYjtmnE4DT6bknmwVd+9zu5HbBdDk9CS4IG5ku3zSZrc4O62RmRUVbFAs4+WH84Pk9QvWxcAEeeGnfs5BdU4/x5xNRD/VA0IzIjPlSjwNE2IjKtWKStCJlspRiPt8c38p1/LvgMJ0QZm6ABnWlEwXnnfhBgAM/WfDGn3F5X8+DqlF6OnVmW7CsT4Pea5BnNh9VqYhONDjt21kE03IDXVs1YtkScFNuvnvD6hZephgZShcGlUmoSiSM97rpZ3IPyg/NOtuKDZ0YF55DG5SGBVf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prod.outlook.com;PTR:;CAT: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: FEyMkam6Jdbts6xkqvm9jcc2MFCX1at/MPSv9RDlXEI7bD4lgdVftLukZ2p96kSglaGTY4KVnVo8TNwp50T22VdIQ8gtVu1FZER07JR68NFfTe3fzNqZhnzNBz1ihUyFMsWHkDm6Xr8a1m1cjjsI6kP8ogdySDVl2FS7nfFOJsiAqs4PY6JkQw/5F922KFcZ9q8nFom0pEAq1qcv+anFytU+InjTgA9DYKeslOSd6Wv1fjSbkpE4/GYl5WkyaxHAWEV3wQduTC1jFPksl38T+MEC7gmIfVFt9E9NBY3ljt/mQrTpLMmTTYsbxr0dVmIk8orM1uOwSfeD2CIOrSNqOc1Dhfhva4e4yIU9LabSBd3uzjPuRYNer6jBfIJZrqaU8LXUkLzft+5saoAD8hrEmGDE0sanyB0wwhLdsAv8gTzuhe3EWxNsDYghGeeX+kegOj+UjhRG9iZsxfzoBIcMYEoWSj6UJn2HLODZEnY8GIAn0CYYkWles+ks7AQ/IZzilOoQFOpX4ZnLFkXk/oyrFShv3KeQ79QQDy4+ks23uUo2rBMVJfFyzOWlF9Y1RMfnSXglyfmuOS960rB0LUFlkqM1P/r7UyPLapkEChwIvKHeBDwqSYhj3pkPvSmZZljVnt/xFHym5/cIJ+Yb8KnqDouHBIqvQAruBGT0IsBMGLkQVkYbyR2/hawibvrsxlzAwibS4XPJRzHo58wPwYTT98jsf476Es3lY9EiVjsqovImtJ852QrEZFTa6apB/Dz2/NhEkNLfOzRUEcyiOlGZ9hmrJt/CQY4NypYI2qeKjTrt5sqiXiYXvE+/3QEQLkGwQ7f4wQy1mNvkOSoo7h4R4B6pZ2NYMdYM+XOI0CQ0l0neXPT6KhZHqWB4OXTW0XmmLJlFqD9ToJxA9xiyDvQqKWk6zetujM2/qQTu0Ryh7R32BuRjJ8gCO5HAFKjRR3VFuQ8Vsh/PdPT1jebRZX/UfrKx3pa2qA4HaA668cH07kt6dxrkJRwt8is7n9xUMgCi2wDCHkgk02dhCprq39OU8eb0kVylzpdIm89XNgc5Meq0K9x6zzLWFfzK90p9PHTxIDMGeIJT3UiZXOMobCr8ZIX3uVHqPI4dhYPA6YrTSOznT1BqXiD7ScWGnvLNJdlK3GkOk31tOeNXpSpYMSk5IWPY2UayfLhIjyw+sUTp+XKITqCQ1hzqzvDXbmHCSflroxzUSiPRaTe6/xVvu6GnHKzg0tQDi2m3i65//8oS75DBQBJlatzP339Op+x5PqFMUJOdAujYD7gs1pRNJHJ+DjtlSATQtqfBOGw3JyeeNzQoJ+HyMdzA3PcTf9m7rh13GaRk0zWa4DDdJizzlixJDZIhSvfAnGQBSc15U5eNCvl9UUWBd3N4k+Qk4Z7cxDRduVDnMvzg81b8vljZnkRLKoiMIR98TmDuwhz6e19s+sJf2LRZQ2xt0jLOwszDrUS04r14h3TaQ5NtBFeSzsTsjxlaL26RWlXn1VKsoTwsjMnxNaOID8uxa3VrZXNkd0OV1wRHWp2VEPQcfJtmE5PEGOPaUeMlkAr6AkWytqeVM6g1SRLdn9dzT1wXpKyuAYfinaS4r98ZqYp7RHlL2aS7dsqm5YAIJ4FxuqgnmOTp+gQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75157ea7-f242-4c5b-a0b8-08dc8e69ba97 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:33.3645 (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: O9E3LYWiRy//CEqFqU/ielSE2wlsKbJgC6ZcbCrkWqpfqt9BW1l9QGl2twxg4e2/zI+8AXMQy7B/KNwRv4CAT5K2hBkLKNPgwMdnYPXi7Ut7zqFQQ+e85vGuT+x1uEee X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11912 Message-ID-Hash: B4ZKSNOZ4NKBECBANUTQPNLBOSZOKSU5 X-Message-ID-Hash: B4ZKSNOZ4NKBECBANUTQPNLBOSZOKSU5 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: Sound Card need to consider/adjust HW control ordering based on the combination of CPU/Codec. The controlling feature is already supported on ASoC, but Simple Audio Card / Audio Graph Card still not support it. Let's support it. Cc: Maxim Kochetkov Signed-off-by: Kuninori Morimoto --- .../bindings/sound/audio-graph-port.yaml | 9 +++++++ include/dt-bindings/sound/audio-graph.h | 26 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 include/dt-bindings/sound/audio-graph.h diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index 28b27e7e45de6..d1cbfc5edd3ac 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -25,6 +25,15 @@ definitions: capture-only: description: port connection used only for capture $ref: /schemas/types.yaml#/definitions/flag + link-trigger-order: + description: trigger order for both start/stop + $ref: /schemas/types.yaml#/definitions/uint32-array + link-trigger-order-start: + description: trigger order for start + $ref: /schemas/types.yaml#/definitions/uint32-array + link-trigger-order-stop: + description: trigger order for stop + $ref: /schemas/types.yaml#/definitions/uint32-array endpoint-base: allOf: diff --git a/include/dt-bindings/sound/audio-graph.h b/include/dt-bindings/sound/audio-graph.h new file mode 100644 index 0000000000000..bdb70c6b7332f --- /dev/null +++ b/include/dt-bindings/sound/audio-graph.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 + * + * audio-graph.h + * + * Copyright (c) 2024 Kuninori Morimoto + */ +#ifndef __AUDIO_GRAPH_H +#define __AUDIO_GRAPH_H + +/* + * used in + * link-trigger-order + * link-trigger-order-start + * link-trigger-order-stop + * + * default is + * link-trigger-order = ; + */ +#define SND_SOC_TRIGGER_LINK 0 +#define SND_SOC_TRIGGER_COMPONENT 1 +#define SND_SOC_TRIGGER_DAI 2 +#define SND_SOC_TRIGGER_SIZE 3 /* shoud be last */ + +#endif /* __AUDIO_GRAPH_H */ From patchwork Mon Jun 17 01:06:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13699834 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 8614FC27C77 for ; Mon, 17 Jun 2024 01:07:37 +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 2F458A4D; Mon, 17 Jun 2024 03:07:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2F458A4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718586455; bh=sM2/TEsKsgQY7U2Ye16OVj3oJI7EvHOe4wd2woO5SLw=; 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=bMdA2jqhM7z/rGAlE9sbQ+jgWw8ow0fp7r6+jRQi/7ovfe6ScGhwUmRHTCoxE5dqX 5WZTZG1vNVpj1Sp0dXyeUOm0KIbscMSK/nB1dJaJb6m3fRgbN5YntZ+A3kvDRfq6WI +NkhD23MWkNu2gmhgjByTf7n/tPdQJR6qG5uJE/8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2FB2BF805E8; Mon, 17 Jun 2024 03:06:54 +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 A5BE9F805E5; Mon, 17 Jun 2024 03:06:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C2C92F805E4; Mon, 17 Jun 2024 03:06:50 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20606.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::606]) (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 09097F805DA for ; Mon, 17 Jun 2024 03:06:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 09097F805DA 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=YqjHfMS5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=meLACtGGaJhgBmMRb+C7WRdEvWkB+UiGugHwxCh0Y5iQVjbED65OnUm4ZrGMpdYODHnLLDrPzJrs11b4FQ+/C3GzlkLUwLorIGZ7/6pg0ywLhayBMHoQG1Zocy2iD1yxfH4AGyStX3TmPxv2iunFXJeh+5kQfHkvxWssnLtMKMoh8ORt36EyytpFWGyi/XjS4Oa01NA1Gs84ZDPGGPKYgXLzBkQ/GwzWOmW1s5Izy2Gqg3guc6UW7pRbVysloFw7Ma/fxisvqyjUQ+6iuAXV+KKREhYaRINC/FvF0rGCwk5p6ydlqaOyKzckCxvaHw52GaBnWJ20quWyREYEgNaFZw== 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=nx5CGNB8VEr2Dp4JAbHvU0049Du3/hPPWcfh8ch3oT0=; b=nHw5MbmF59eLxDqCo6AlfF2J8vXJV5mDBD+ISbXND6aEJrEDcU5BDet5F+3xCwzbpHDZuf/YUtQO5CO2sOLyWcVGBBJv8W217OBzDW+dzIpFWlyyuXb+0AiEw53mJJx1q+FeP+GslBm0Ihdr2BndZI8yA4esPfegtGSrJEiig6bZ7zhDobEGjUXV743YcTblWjYgPmp5EkOAEJuvSxXf/9EFwe1anB59iyF18IdiaEV0Oxe9ktr9YqgLwbsVbQlo1fytS62llemZe2qUKgzSCayA/IhaiJuWGHO+kIYOkvwP2tcYfBX0lQQMAj1LrmAqgbkIUw6MwDjY5BR3ONs11g== 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=nx5CGNB8VEr2Dp4JAbHvU0049Du3/hPPWcfh8ch3oT0=; b=YqjHfMS5NhTNeCP/gqLVMMRMEUnmn4D5J9HO4rbNtiQHOJpaX+x+hWBZLYWK686POWxJcQKeVBt1Lx3vw+7/ULE/fjfRAGUbaMAqe8mnQsehuWR8E8C+y90u2k5U4kq4T3dRJu35/itV0nPnLklSTX/iYxvqZq8d+nhpJDfHNWQ= 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:40 +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:40 +0000 Message-ID: <87ed8ws7hc.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 2/5] ASoC: simple-card-utils: 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:40 +0000 X-ClientProxiedBy: TYCP286CA0013.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:26c::20) 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: 184b21b4-0744-4bbd-412b-08dc8e69beec 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: nfsXrpIYc+lZxxYyNelpEI3dat/6IehvW+PUndSZCTHZc7IcLo+GYuiewNao/ZrD7hR1iBHLO7DlpznCtXRQXwSOiRX2Q+m8KDQ/8uzhCpxFqfjJVzPJ2wsLrCv7UW6ESj2dG7n1u13LBPkeAepPmZTDedW6VshWtfqWsZyfFor7Tl81mvk55mwumIOrEfQEBQvp37yIN9MUC0LPKq0GOnCnNKHyprg0E2bs2h07jc7qanuSDmfaxDvt7vGHM9nzSkheWiidxgntZOlkIPGeaDeTKmIceieK+upBH84A3dVrkv3JlN3pUh+367TQD1Se8lHLQjAqNI2wVlP7NL8jxKexD7fG75LzH7zzytPopRntjhwPw0x0qeI26v/bx73HCfI/ay5OgPLCOxCQlB8W7y6+60ThncOexa5/CNpMDCSpJFiI9k77UYAzxaobf4IkQbspTl2t2xawaxhJ8+xr4cDWnPhRpQ30fEA/Tq816owBSeFHdkanu4NVuWarkhHzkTYFku7hmA4BdNWEuYtvyqLcCdb5xLG0bkmZ1jP1A7TXzwL/14SerCS1DoiXcNQYWTQF4b2bhjeCRIoDYXJ/RHAcQYdO855xfDva2zuaGF+rY4AOa9DWt+4Xgklqo7P/upHHLLHtDeHQu24TK7B9h17v5B3y8nDCJ6fhISXmqASABr8rcQOKcvvDNDb4BdkYsBl+Ri+2K+XUXsHnyvq9hcHapRY2AOLyrvj+FVswUlixToZl6fX4AiloQAdHkKtDii2Ucs/hq4IMFo+EpJ+dejxJ/Iv3TQhpoqG/tnONJl08GDxbDTsUT2Fvvc3XwOWjPylThHFpMY/7dDHO832gPIhv5ZS2KfbTLoClQrTEUHdC6K0xVvWpBsjLyRBd+2Nu8cGuMcz+b6aODrdN6lPXHFoJquWoCu9xDJMFiNqv/DhdYzCdY3YnnYME4BymCZxOCkVYSwNS+Qt9CQ5pcbuYX7Dm4Z13uu1cUHqck6LKNOhbIOtaW8dwMwW1zY4m/OkCKnutf/yp6xMvcBKWBNjkVccrcCBvSO7ugckeMugCjkytt2J1P0gYk1hvvj8uzrHuJZGEKBAPovqXenoCRfpeECN+1L/RznIZMhEBQM0a9B2PwYFxRoTKPw2BddB4fDZAaKmfCDL9T/saCJovseYQbLTt8v7bxMENgjvRTIaY7vAH6S2DlaBG5Yg6MjZ8eFaTSHVTjDKCflT91onl753fcARrbiMB1KNGuN/YXbHWjSrBNNsOagR5I7xPyPV9ZCoTEIUS92bhM6cTgEPkfb9ki07KA/EdbHPOWzsq0n+I7P8MIG/V3Rh3vXUWIQsnF3/kL3rz5h5xFSdeTqeDybw3txBrzG2Bn559POlS252EKXI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT: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: GTJQlY71hRyg3/tOyVwJh+dyCUzBUjcVK+ZIErlz7dfPItBA4ld76jCVJg3KVqXedChDSqyrOsjIkZkLEwKhmz5mFewD1QxuP9cVWtLGw3jvUvjcxOgA1Bo2EeGYKD1hFdw3T9CBsxer7WDVeouv0D2o/PJStcUE9XRqTmWzcul+8v+T0nXRAarSjxjrtC2BPyhgt1o0ZY2jt/Z9SAFGxdL36d5oeVEKQpHBXaZchiuor7ZYCzhAs0nQiHr8t0DVTB4x5Ler90bJHzbQeVATdBNRHfF6cA/8mP+5kKNqO8Ptjqcql3jqaqyseUvJBLMsJPLg0wvJdJk8rUZ2kmVIvslypH53j+5bEq/L0jwJvayGq5y65aqxdTMOuctL0WPz+jPTfiEwY8Pp5YHhdU0FK4ZPQV9CTUTO3OWoJgzZ9b8MMvSJ/hVMH4LLaMOeof80IufXVMAS+VPqduzh8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Nphl59ZKzrocOzYKUcPzGb/oFe0pyhMftGiaCrZFHj8YDMpKJBryuk14VyVGd7Lvb4qbP1ba4yM/MPzLYV5QA98aq2gRPnKbsRl+jwRKE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 184b21b4-0744-4bbd-412b-08dc8e69beec 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:40.6616 (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: pQgfb18K+3S84haoiTEorL6pQ8Su6ZyXX5Zs+rVv/K9yjWRreXbMEDD78WhyqjwtQBEmPokRjA1i33HIw+NYMmcWPchzGDKxMKGE4IXLRTBHwJnz3tkxk+IDFhcQpik1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11912 Message-ID-Hash: BJDCDKT7LCT6HZFYTWJNO4YCDL2ELQPW X-Message-ID-Hash: BJDCDKT7LCT6HZFYTWJNO4YCDL2ELQPW 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 Simple Audio Card / Audio Graph Card still not support it. Let's support it. Cc: Maxim Kochetkov Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_utils.h | 4 ++ sound/soc/generic/simple-card-utils.c | 71 +++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 0a6435ac5c5fe..3360d9eab068d 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -199,6 +199,10 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep, void graph_util_parse_link_direction(struct device_node *np, bool *is_playback_only, bool *is_capture_only); +void graph_util_parse_trigger_order(struct simple_util_priv *priv, + struct device_node *np, + enum snd_soc_trigger_order *trigger_start, + enum snd_soc_trigger_order *trigger_stop); #ifdef DEBUG static inline void simple_util_debug_dai(struct simple_util_priv *priv, diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index dcd0569157cef..a18de86b3c882 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -4,6 +4,7 @@ // // Copyright (c) 2016 Kuninori Morimoto +#include #include #include #include @@ -1156,6 +1157,76 @@ void graph_util_parse_link_direction(struct device_node *np, } EXPORT_SYMBOL_GPL(graph_util_parse_link_direction); +static enum snd_soc_trigger_order +__graph_util_parse_trigger_order(struct simple_util_priv *priv, + struct device_node *np, + const char *prop) +{ + u32 val[SND_SOC_TRIGGER_SIZE]; + int ret; + + ret = of_property_read_u32_array(np, prop, val, SND_SOC_TRIGGER_SIZE); + if (ret == 0) { + struct device *dev = simple_priv_to_dev(priv); + u32 order = (val[0] << 8) + + (val[1] << 4) + + (val[2]); + + switch (order) { + case (SND_SOC_TRIGGER_LINK << 8) + + (SND_SOC_TRIGGER_COMPONENT << 4) + + (SND_SOC_TRIGGER_DAI): + return SND_SOC_TRIGGER_ORDER_DEFAULT; + + case (SND_SOC_TRIGGER_LINK << 8) + + (SND_SOC_TRIGGER_DAI << 4) + + (SND_SOC_TRIGGER_COMPONENT): + return SND_SOC_TRIGGER_ORDER_LDC; + + default: + dev_err(dev, "unsupported trigger order [0x%x]\n", order); + } + } + + /* SND_SOC_TRIGGER_ORDER_MAX means error */ + return SND_SOC_TRIGGER_ORDER_MAX; +} + +void graph_util_parse_trigger_order(struct simple_util_priv *priv, + struct device_node *np, + enum snd_soc_trigger_order *trigger_start, + enum snd_soc_trigger_order *trigger_stop) +{ + static enum snd_soc_trigger_order order; + + /* + * We can use it like below + * + * #include + * + * link-trigger-order = ; + */ + + order = __graph_util_parse_trigger_order(priv, np, "link-trigger-order"); + if (order < SND_SOC_TRIGGER_ORDER_MAX) { + *trigger_start = order; + *trigger_stop = order; + } + + order = __graph_util_parse_trigger_order(priv, np, "link-trigger-order-start"); + if (order < SND_SOC_TRIGGER_ORDER_MAX) + *trigger_start = order; + + order = __graph_util_parse_trigger_order(priv, np, "link-trigger-order-stop"); + if (order < SND_SOC_TRIGGER_ORDER_MAX) + *trigger_stop = order; + + return; +} +EXPORT_SYMBOL_GPL(graph_util_parse_trigger_order); + /* Module information */ MODULE_AUTHOR("Kuninori Morimoto "); MODULE_DESCRIPTION("ALSA SoC Simple Card Utils"); From patchwork Mon Jun 17 01:06:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13699835 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 68537C27C77 for ; Mon, 17 Jun 2024 01:07: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 99C07845; Mon, 17 Jun 2024 03:07:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 99C07845 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718586472; bh=ci2e8BhC06wNWgK0fAI1KKHphl1PBB/WgtgVi6i4VGM=; 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=XXe/7nPbW+D0kjTTQ0lBxtTZ1ECNvTN2U7v+TrGfXQZJolWKkcZ8ZfrHbVYFcM8vp D5P0jZwVDs7GSjjCO/Mea2up5mRrPYPzSLBz4uzsTJNc7SnksPliASAAteLOl8dOFw QEeQL6PW2Fi8QJYomOvSBQtiDIb3p39GTH1RRTQc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5B50DF805FB; Mon, 17 Jun 2024 03:06:58 +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 0860FF80605; Mon, 17 Jun 2024 03:06:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D9739F8058C; Mon, 17 Jun 2024 03:06:52 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20606.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::606]) (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 48001F80266 for ; Mon, 17 Jun 2024 03:06:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 48001F80266 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=XH2Bdval ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZ+tz96gEj09hvvjUI9rmV8OjP9gt1kgGTPEGfg+TA9jWZvIpwBoCnHydrZcda4jyEXxPdLRbqigYFLn0miCiduqFSIVTNLM4BaLCrx4xbOy3EENXwsBNpqqpinCMnzhKSscktF+lP0bRi17IiGphk1+ArmI7aRPQTtFjNdVf2Dp/h7TSJM91b8QNTmLtfWJtPu1fhgXUz3Bf0RLDfs9TL1dl7FfDCVq3Hy+eRDlWEK7zakbW1IcZG45aqqnLO1ipR7HODYgUo/fl29m3+jo/XVhPocaxx25xA1rP0i5EaAjpCcjS0wuz8xCyDvS20phgxhUzT0YyeTGNrIWD+cBvA== 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=6SR6qFu6vbCQG93VqEgo+PjdR3MVFfB3wgIXqBfrre4=; b=KEvT6Kooih23UN58gDkvuXcWNMx32vmPEobpVX9msopuoGrNtgd4k6d+g4ZMNZ6+RLFRadMrZ+WxlM3nRqM3sDcmcVsNhExnYRDPiPQ8Tb44nwGqdh+1vkOZI29iKwC7GM1RmAM1PY0LkmAaK6Jcn27kyVK+NNFXXJNqw5crIr7ukTU2WZdQk7UoKUEWknU7nyFlAQs+xCeB7Y0/IgKR1MGVgvDCioYV46eRkDrkdOLFX76bMUm9zshnULQjXN11YRbmm8mkcsNvlPN+msJFFhieQ5M1iFrh+Zf6jUCwQJIqv0oZFXQPmSlB0F/GtRDDZUc3v+azpg3W+YYL1mp6hA== 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=6SR6qFu6vbCQG93VqEgo+PjdR3MVFfB3wgIXqBfrre4=; b=XH2Bdval23GzOxCg6e0TNjsompg8lMcLgJJUBzEjbjxXoyEHJr8e7d4tBb1bfWeQPrAnlry9yAH97GDNIr30HeQVOEwxc0kVRiBZcmOTYPjM0utinKaatHwCR4Mm5cnxcLcwIaeAUuZEQhYPTIVJv5nBZJ+p+lQYhbF/jwPAbfA= 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:47 +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:47 +0000 Message-ID: <87cyogs7h5.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 3/5] ASoC: simple-audio-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:47 +0000 X-ClientProxiedBy: TYCP301CA0045.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::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_|TYCPR01MB11912:EE_ X-MS-Office365-Filtering-Correlation-Id: cced4fb8-6167-4947-e203-08dc8e69c2e5 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: TVGjVoiolRHLZMWB8yG9R8Xvwj5OKzfavFPC7ZiHcvG5GpQYy9xJ6fkS3ICfSy3JzLNJJQ0Ug5O4kht0f15ONSH3lemezXNs34NZmkFXnmh1wK9eRCfd+nRowfaAfcmUBBAVzlceW50IefYOV0uaV+aiG+/VxKFz5nwy4XHX0JmobH4dt6Mf327zvptoHPDsVpTfAyOaqIHcqBrLNl7ntEuhlRb/evRtMmYI5jnAchaQbke193sAj6as8lBB3lbCLGXXIlXxfSL3Acr3a5EipzWomBiXufN+neTFFaXXZJ+IrPVoNo57ch7AAW04QjmJeWF8gQ0/RoCZfGPkndzlgvO+c1OaC0M7cqJnq7mHkwwYDg5r6L4Hc0gPiWkOKameNDANylJU5r4GUkoR3962eZNfjMrm4Ygbyv9JS73aKiKohhqpsovB+fYabqVUI5qjwKFuAZiAMSr81jeqMR3ah9oEYt6b/HJnZq9LLFyDihkwro0/HSI++PzKBN2HfgXWKSUe4HnzF6KG0Fh/iRPX/MhYsNNi2CnOjmblAkwH4ap0oa4vDjWrLNJP1sMjM2Lo6vEbet5+71XkX9suQ5VV2b2xlvCXKEs77g59vmRMS2H9IO+ad2TgS2WxqWQJHm1GKzTIdu4hejakewS9PaFM2mW3FOD1hdD7Z3XP8OKYyop13BCZGgn5owwh3owDrHEskicr11BWJlrkbob8Im31Sz93Q8tHd49IfBbnhfwyJy90n89Nk13s8hK43dPiyvdtpmTd+YGZQ55Et9oF2Kh4IWbVseJtAmF0Y3RjoX8aDIFki9EzkfJUCWn7vr8jNltMVIGDGbkAayGkZC7OQ9t7gB9Q0XQWY3dTFFPi7moF/hEHVN8iJwxwBVTbndBddICPRiik8IbKqYcZ3KH/G4C3QjWeMLTsfiraKajdBBEneYlUx7IHLkwzX5uvxnNeffCxiadnElbng2PT3zx6YT2kSG4Y3EgDB02dqgLvUgQKUw7XkZIG2+LoKnV5hZSwpWb3wnQoOL/NjP+W7wq0ZnTVhmPEAAWssAinisOta8FGTb21LioF0klfBT9LT3M2jIvXzhf5NlL2ZvuWP5gYpFX0au5c+IVaVt6EQbkG4UVJZB2XRxxvCSHJYV8DYVutkdMk4+pQUlN0AczAoYGBjy1mra8PEtk4/nsPENUKG7qzrwAaaJ8a3ln/iWu+B3IGpHYveTlgBxJ079f8A9XXvcxgbr5kufGYOifBAkeqwSB+2US5gO5P3Coi++gz2BKJzj8zoXlPHl9OH+7ZlvufxnvmJbF8OCUi0OD6gzgQQYaaJQ4WL9ce4fnrV82u9O5+eGKjrZNLa37dj77xIDy1fu9tWz2TB0ZKmwBMj/zMpF8Tad0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT: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: Cx/CmmqOZLlm9YSLR1192i1gtQhAg9RuUbNjkRBVSZq9mLdi5Bf4fLlfxiUukQ3wX0qbo4EBFJVWzijPSeCTFSFoJo2fXnEoMvShbPcljBegscw5d6zRt/+xwwFa9eV1jMr3mnBLcniWZ0RVPo9kgyNWmcp7VBB0dg6od4sHztC5ic/G4PV4i00x2q+NEHCOrGAILC4c4AwTMKmJhh2SUR17/BdcXM0Up/iOMchtRzXc3pm5cVAf51Depf/LDEQ8coW0k7pkLrI3muV7pfu1m8P4/ufuB4W8qKDht2T10IcaUK1Ram2YaQueMRnE7Ci5DIj1SbFkF/2CllYPqXgGNoqodsL56zLdh3ZOZ/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TwVIzMk7UlJHlhyHql0D/QnDHfPCHHcBO5eGiimGIwU0etOourQh+WvE97n1EOrTUlu2o0G7zVkYvuv9CnQdRehzpJKhCJsRPA+kVOC/irmvIAgkyvXNx8sxb/oio+tgj19TMxYXRYvk0PMAIvzFESv71FClVMr0F32Lq6k7qTWujrv8ilTvTlL07b4N9umgfntjs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: cced4fb8-6167-4947-e203-08dc8e69c2e5 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:47.3261 (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: dxqFNvs3jT6HOOxeq5VLu9m4JArQM/TU8aib0TCa2gXCn90mwGn/XTFlDArijAWFdN4NKmNfO8g8iZAph3sJsKvx5kdQ0/PzaYQSxtZXxIt+KBwwAFUzxJXSLgs8UJSO X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11912 Message-ID-Hash: BK2MFH6BBFQ3GEAZFGGTUG4MSWSWT45C X-Message-ID-Hash: BK2MFH6BBFQ3GEAZFGGTUG4MSWSWT45C 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 Simple Audio Card still not yet support it. Let's support it. Cc: Maxim Kochetkov Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 2de5e6efe947f..edbb6322e9be2 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -176,6 +176,8 @@ static int simple_link_init(struct simple_util_priv *priv, struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct device_node *node = of_get_parent(cpu); + 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; @@ -198,9 +200,17 @@ static int simple_link_init(struct simple_util_priv *priv, of_property_read_u32(codec, "mclk-fs", &dai_props->mclk_fs); of_property_read_u32(codec, PREFIX "mclk-fs", &dai_props->mclk_fs); + graph_util_parse_trigger_order(priv, top, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, node, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, 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 = &simple_ops; 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/oEcUIoK2BFgQjR1SOWn6pAXA4AGgNaS1mG8+oO+2rJGofI9/IuCTTGa6lPCaGu30z2QvY2BpP4P4J3CUfNh3kzp2FjYzrjeMphvCl1b77T2iI6ESaFuXbGBoKM9OLEALDt1jT0A/IIb7Lw9mMTZhbwr+Sg0VVb8fUcvrRlILunQ5594qeaWaFiNDoV+hb8s0Gc+EnIt6n6bY/Na7Ux1d7Qk8AqQFIXNBKLuPeqsarUKFBIZveQxKMtXNoUL97uaeW7YFScAU5EEeUeKtg462R7nc6dJI+1ireKHbzhLE7UkxGgwag8fPU2lVbPASB2hIqiXzR7TuihFXdtK5CMqge+wZAy0kH3KAMJmKAvR8aRL03Had2aANO/yNdkbnZQm5cM+UXnwu7uMkehXVK7GbepGGl1kCbH4sCN6vb5Bv4ZhUX9lo4lRgdZCEDL6Ha+/+sEueYQLc+SvESemlyu4V3qQl/V3LrSPFqKf3wiwLOA1KBEHgt1XJg3pJVMxCrjv/FAgaAbKrvb2G2MXQsO+kcOmx77PGGOd45eHLv4MciYJomQtIrQ1H6fwYPPyfG+9HFuNQ6Pd8zoTmP7zEYMIyDNuFCXmnmLXWkaz1ChkcECDwKJpx0RNNOwqWUQqVn1G+zEv+mW01LTOHI148GSgiCGiHlWIbleNQFfit+yOtn79ZQdG7PpHvBuPMvpM342dLxHjgsEXn34V/kyY8q5BjDO1T8zuZiqiuFwk6RyyLXcEqjqm/r8eVBQaByxWTVW54JstV+S5a7IMoFoMbcMBlPMwG35RVrWeYiK/kDBTJMrVOuF1//uEoYU/P7GXaos4WC86mDjyP4fq9qjIfkM5FjwGB1WZ5gr3Xoju0MW4v4D55/XfJQ57tLmzmzHhQASaZmgjUZkVMtym97LunNaV3/yNZ3uQIZJuwjmmJxUyXz16XB4usp41Egzjfbf/ypJsZ3EeFh3YZRL93Bnk0pt7DbI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT: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/mhrCKrcVsAu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gQ4Q/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) 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/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p6AEWjQKuolxTntHK9RFN3WrteJGfwQoqI7g05RiQ1LujF/kQ8orz8SiKa67tUA+yz3vCj6BkG2Iu40hOuoW0t5zdY2K6Ua+4yB2Cothrp5w8dVdasRjslYVAmzQhhq/5eMHG9VQIAkYyHYg8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT: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;