From patchwork Wed Jun 12 06:02:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 804213 Return-Path: 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 07FDAC27C53 for ; Wed, 12 Jun 2024 06:05:34 +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 DF2BBE0F; Wed, 12 Jun 2024 08:05:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DF2BBE0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718172332; bh=Jkvxk5qGQTgtDT6+nbHaEAV+YldxBfCT9a8QCPLghAg=; 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=clqVmS33A/H76CX5GreFeBwtKLjU4KW1MqVRjbIOpNqXGqb7UgTWg2Z+4GeFQ6Bxq st1koIq1WCpAu2q9oXvsC9xTYc2KLj4zssFAxv/cixYqP17VnzHSqD7bGZWO9ztQzJ DBsEaUyY+Ff9qyv0I8yMUir/tvm8KA1bjNqxc/cA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B5852F805C3; Wed, 12 Jun 2024 08:05:02 +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 CE0DBF805C0; Wed, 12 Jun 2024 08:05:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 56D11F8057A; Wed, 12 Jun 2024 08:02:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20612.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::612]) (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 106D0F8010C for ; Wed, 12 Jun 2024 08:02:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 106D0F8010C 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=I/4Ge35N ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mga25p0j+4qmbQvXQYIgpPtOW6b5F12XPiu63IG9MOgjymy8m4U4hIOjElnSSrzQAVlKGd65JCxKsy9i5fYD4nwWZ+OlE5Xa4pfH47v0dMX1Cv0iOAW9B2axyNPYns8cis1aggRy9mBvD9s1cG52Gn85FtjLLnidY5SxU5XbmieOJjREmC8rmgYpKHSaisGSqp9y2qVO1aTxtDqV/GaJW7RwPRxvPDEzllAcsnr2rMLq3ou+DRdY7rbXvyhZ8wEUc1UWmBihYny3p3CrD5+bJLsYjEFhYlcl79F0yZsDgBsDxjIwX+eAvj6g3knRDexCP0ca0x19/2ln4lctsSr9oA== 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=xZeNIf5GSuaRxxSoIIiPp7r0gMrRMEz9oNiV239Enww=; b=iQsxlz5W4mWcvdh1uOPhUoaY4hzcjn5PlF9r1Wa8yiO6TNhO+3osARR1ugLtdbvEbr6xFFLmrznJttG50Ni21jkbr9jyRtqaN1dbzulmENn+kfc9ZPQlRaUFYOUPksH4mKtfkS5PEDQnzSow5X83jMAWMrO/aHwitqNKoGucMV6dHyqeNUCVp5wqmSSi/HWPYS230IqK86E6hkYt1SqLcfvbfDlJOwPrqA+l/hW6D8AMeEPLqDV7CDqvzS/7c4rwlWAuHyJ2z4F1Q8LwuIx12T4izkMh55C3V9B/OWfA5N2K2Ib9v/SGACIH1TmzRV+dwq56vSzX1Wde0d6seX8gHw== 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=xZeNIf5GSuaRxxSoIIiPp7r0gMrRMEz9oNiV239Enww=; b=I/4Ge35N9scgXD49OuVxxU5cUqRWGwI3pe554zyDppQ4/duIIjWNIeiMURphr8qi//QL00dbKfVFrpIckYbeVscAZFyHiH//WPL48Jbu6rumFWUx91zBbeQQDTXgp6fmccob39VQgEE2P/e5hwVtOc05E/24HZlreeURIKkMftQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB8904.jpnprd01.prod.outlook.com (2603:1096:400:16c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.39; Wed, 12 Jun 2024 06:02:26 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7677.019; Wed, 12 Jun 2024 06:02:26 +0000 Message-ID: <87sexizojx.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: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> References: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 12 Jun 2024 06:02:26 +0000 X-ClientProxiedBy: TYCP286CA0235.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c7::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB8904:EE_ X-MS-Office365-Filtering-Correlation-Id: ba11f17d-41e6-4b24-3833-08dc8aa53c4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230032|1800799016|52116006|376006|366008|38350700006; X-Microsoft-Antispam-Message-Info: Cb5LeZ/HBws/MC3Gjq9hEVAjkoJNfg/HdmLIubd8AQhP2DNM1QTLMIhlb+E/Spfr1cpxwjad+aTdIRAn0934/pFTtD8/PxstqjeT/ObyUtkmPjqVxsL2GStoRHwcYIbTOT7j08/72MNBL+EkIvI7Q8oIdHIT64riWW8hKnge/6D0TTV1kp2pEhe3eg3ONmu4Aoc8FPEROVWY8ea26dsbzwZ5BETTMvTeiYS2jGFS00hJF7hGjaKJBD0wPeuVLdHaSSROqRMhLPC2oeFqXAq6/u+J13hMSzss4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benQXHvKkA0th8Aw1vD1CI= 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:(13230032)(1800799016)(52116006)(376006)(366008)(38350700006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Gf1Rkdrzl/mCZfRyu6rHoRcbcx+b6rZKMlP4oVHT9YKw1eZ9aGkTvOyMkn7tCupIaxVEf8b82uoP1Pg0nTTRyt13ez8wyk9XVLURQ+3ucQUmeiMGiklM1eAmdKmcs3p5xyuEqSFke0Zgl18h0Hd3fFyUFHZU6ZjGecOsLjKsMkmxL+nLWNvDNlaOAf1V1yD65fzkHs0A4qTNSE8vVfjVwzht+zOSKRU3EpCQggVGph0PwLe97X/iFjYr9wUQnEbY6QVRUetGGHULO05TZZsKAKSyeJnuetVZpfiBh2SEbmOqB/8p43OPU+xWYO7PEWiCJBg72aOxQX41zbku4B3yXRxwwbK+twe0lV0hnXCUEz5snphYqFoN5Po+1FWAdN5wQuwPDplcFAV6tbLAm9McvSUBvro8x8XB/S0fnG8F/I6qPWHj9+A8oi1MwwZ1beK7+tSxYp0GkHNntDM5v2XnuRq6Z/XtAdTwqYJEzhWfAv0kP2l/WSz+D/PVirqoLXnonzBtW9k1ID6HazeJ+eOe3ovD0YnyqM1yBEcCvwWBVsqFqk4vHHIcrimA0gFr5fSlaZ4M/6B2mU4synsnmxsxp60Xd4owKH3a97BCEgGwN6uH4NvUXWBd5H2qaSom4tl8jvlVKhbCUMNuG9oYYKDN+Smx659S6X+achxuKgOy2EZhgFu5WeirDA7jLRDIbM+b0px8laDY/CY5Vh1fKqELt/kz0en1JlJe4G1vB86nazhoDtY78lB4G+nZaym0rbov/WH0DiAm19EC/d40xX+xXI349jcFTFks3juPLQlJEsgzfRftskiDNLFrERPXdAKgXOM0CJBvBuCPO0FdrEr6heFsLn9EDTJunCK9SDDheG2kninM0euzl4mMQpJab2xd3jvN9a96Nc5B9LiA7cDh+G+SPZtwIsXtR5hDXaY0tBO0OlA7WlCuuit2Grp/x1gdf0yaper3dU+oquToTIBeUlOh42XDqDu+h5J+81zBIjfsvP2DS/SuzKxTThvrXPjkj14w0EaW+YR5x/U4aPMaZBkhQ6agqlQlRXCsJNjmBUMzIvlLH0YI0rkJ905cnMrXid+8jiP2qaoqQmkViuj6YlqWDntpFuuRx39Q2PnJ7978vjyxNzEyI5TSfXypeJ4ydE5xbST6OOoWxxMdQwLTnfGcffGt7wyKqbUQuWcTCFuUeDHdVyllI7uPpiuqp3panX4hZkPGz5UbCBAFm3E5ndQsh57JDOB9qDUCa859a7JkWYgmiWY7mlOLkosn23oEgADmJJZND1cjDaS1a8UL0tg87sxhBNbdxUfJsksHHvQUemkvQMz5BMm5kswCVCgU4DQiKD92XRReMpZVe4/wb3w9bQZKjoekBUTZ+9bhaNb7I2/oRTvnTs05mH7HMyox6mqgFc9WdxKPufy/tiM880UOv+r/t15FBYP84CxplIUZHbQIGexXKiGzQYAxdzkhw6/nwG7FF8MvEy3qTuNbkIl5yQfMsQZQ5ky/f9e2kBF0k71AUcPZ5ZtNFtyQW5Cr4j61L8118mkWD9bYQV4yZ+QBcPppEQ7JJeNPGV3oQ3nRcX1oAdnSF7Z/wgTFN9gbsCppWhWESzWfza9f1HpOEqRP+j44ucVA/aN/W43uMcA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba11f17d-41e6-4b24-3833-08dc8aa53c4e X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 06:02:26.6541 (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: kxSGJnF+ta4dfjCD4ILk0nqUTFRkky8SujT4po3GWI7kWJH/H6S0grdukQYP+XWoWAjKYcG+0Ez9Nit7C+jfemaeu+LasWmbw3yRnIVHB0imSM/E2wjAdsko+xY2gvBl X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8904 Message-ID-Hash: EKQ5IYPFUQKI52IE5AVSTPOCRFVXVK5Q X-Message-ID-Hash: EKQ5IYPFUQKI52IE5AVSTPOCRFVXVK5Q 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 28b27e7e45de..d1cbfc5edd3a 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 000000000000..bdb70c6b7332 --- /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 Wed Jun 12 06:02: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: 803511 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 584CFC27C53 for ; Wed, 12 Jun 2024 06:05:56 +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 B7597E69; Wed, 12 Jun 2024 08:05:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B7597E69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718172354; bh=Sdd925GnaWtulHOIQbrbeV4+oZkYL3aNFymK47iC38E=; 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=PBiuwsciJQ42i7ElEYPeAUWmQ0/i2PsqbkZ1e5Tyh7PJW2SDbYy2okPRLXavs3RjJ PEFXcQezIhpAnh9jQkhLgQaHWcfwsNwdL77Lj12twhuJUYfINuaM0lYcwEcrEXkraT 7lSVE+g+jNAlvz6UUZ4WkZwGQXO9RlHgClWctgxk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D6A9BF805E7; Wed, 12 Jun 2024 08:05:04 +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 26C83F805C2; Wed, 12 Jun 2024 08:05:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 56E28F80580; Wed, 12 Jun 2024 08:02:45 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20611.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::611]) (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 635C1F80578 for ; Wed, 12 Jun 2024 08:02:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 635C1F80578 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=oiyk8OC7 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PFPSfROeu70kzlrYl+TUy0rwZOu7YHeiNGjcGpesBP+zNDjnxjxiAtkR0++RHngUNAEx+r4o+BA+plNqQup+9wguCss3Bp94i2enNFD1QTWC/dH4DCJNKRG4mAI/r2mSTOAHVSAFrbLoT4O4m2u2fRoahk4T94IsOuHUj2eyTs1Lod21xM2obnanCWFZ/FHvcr+lzL9dS5KT05r20RkU/FjFHnazm3TO2jL4kp/quHoFE8/XYaFJuKT4aCJ6iDV4InzCo52b46ICbHbOEefR5Yh4BSvoyDkDOLcq8Eo/Coy9bnXRP2j0SKxL3xutiXGP++jNsH7NZnFOyeu/eFqqrQ== 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=kiYl7d41HDAbIrguH0qlm3Y73PIq+mA7LAU6aGRR/Gc=; b=j5qFb1vHOHd3P5RjMd0gdUlk/a3pkZMGOg7vkwr1+ruxe0Ts8+KLKtzMw2ZX6ayNUOo2s/m9T3H6gOm5JEEu6XWPfA81WdQ/N5efuOuf2FWZ16kBiGFXQ0UsDO9e8I5jqjgMHvFTPwOvhDij1xN1YQbiPMvQKMT8EHkoJ0W3z0qU65TxOp5AhbYbbAib7sNcSFsVd0ojAxYLVu0IzIMElJluVdL3H4qzrlNZDWvuadM53336O+iZLX1SWcBuic5TFCMnMgMfepEjNDHxbY4UGzTJIYUIL5uBalbJ8PhMFCqL12s1KREpVqk/l7oeiAeqFYpPS2llp97flvdQw3dH0A== 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=kiYl7d41HDAbIrguH0qlm3Y73PIq+mA7LAU6aGRR/Gc=; b=oiyk8OC7DemS+gKIvzUE+3XGK922ed1wpmK05H0cniiEMjv7YA1/XHMEiJS7ndQPOhiHrRI5yg0ynkCtE9H0KIz5toMeoJqdblKrAF1PXQmZ6VvTnQ9GR2fdWHSkajES6E2SDdRznLa+mz2rcNIs+ytXC7htTRx+OBi1fsOxQ5Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB8904.jpnprd01.prod.outlook.com (2603:1096:400:16c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.39; Wed, 12 Jun 2024 06:02: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.019; Wed, 12 Jun 2024 06:02:33 +0000 Message-ID: <87r0d2zojq.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: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> References: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 12 Jun 2024 06:02:33 +0000 X-ClientProxiedBy: TYCP286CA0196.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:385::7) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB8904:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f515733-c1ff-491d-9fb2-08dc8aa54060 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230032|1800799016|52116006|376006|366008|38350700006; X-Microsoft-Antispam-Message-Info: nHPyVK7696YDwYnRcqLDrMRZ8PFxpg9vYIHdWtbTSAoiHWPWTq0ZQv14tGWrNtJyhc42840MGbnQNk3d4NtGVXo0Zck0CHXIxs2yvHRruFDupHyk6RcoChXGCuWkoqBMlYu3OJkvKS5oGEzeIYOzLsqy4YOuU4iXhrboNG8lJve5JxNeFCASfIOXJfdt4UC6vX9oXKro3QHDFkIFUrBOFNTZc2LDTADmHDpItj5liOzs4eiUjqk5z3fCCLUUko/RE2oRSo1jBHYVmFLA5+JVQw3/t+5qMn3YXwwfbh4uVlmosVYD5u3hgXttvfv0Vt7hfeUQbpvEXe1PGwcqYWZvYPlyVGEx6XphcnDRvZ3X/lm8fUh0ozJ+5HgGsiU7KxDXw/U1tVue2cQJq6fy8nmtReJ7pip7EKKDZDcQmM/JnMdybDrEAa4IZyJLo8Bb+Uc8H6IBgrLroVaTqcLszTZTwJrEQyUo/HYE9nQSWhnfhwtMbDJcS5iy4NIVqHROu01x3+iRAGQ9sPXt/Xsp1rBpRdbrSS+7L7/ivB5a03qVhYSebdRCnY4YOJh9QPhkE16JO8xW10Z2CMLTWAW1LOYOt6TKOHRYN1xtzK479nLx+iTgBh124nyapgaMo+bITT9AE3/OzlpWXSTylbyMrYyevQTldl3tfMtqQJYIWpnQdA1YTaP59epl1QoVuptjWIsmYxaxr1Vx299V6hZcLFSdlLthMD3vlFn+IlXKzQA2DZF81qxob3YzQcPbW0u6+0CjiWc3lt2WOX2WhCOPXKZ9aNb7GBpog/msH6XS8lknUVZNSlajkANHAywQ80a//t23D9hv3xmyc06CCTAfAfdriR/eXqDbAKoAgYm+UHzDxuiHMVnQOP7QVBGkDTR0musw7aeJUdVueE7vO0B6HgMYYNov5ZApoNcNIWQeAFZ0ORJ/GS4f8DBMP0DIQ1eKnhawIgkYlOYi4571ecAVv8nmGTOpPk8r+dDuSHYT7zcaGb8ZQynOgIxkqG8R5qRYQgrIkT6WA0ChF1m2wy9TATsmPeCJsctEd+HXxOEhw3cDgeAPc3eQBGkyYK0WAV4wzziyGGJzl4eEzloOk0NwZHNJ0hgyzttIeL58aYydjzY1z5LEzpeh1VwjF163ShBLTae30i4D+L0SwFMkfhOQ8AZMRVB5iDcEYHfAiEspkpt6wtgmdY1yy3agxIi7525q2Z/XIvx1uGBBsVoGTqOE/lEYs74fkeDptnAWAgHr/1bBIbBktuQesCYK6SPVS0tApOcGO0GW1fB2hOea9mqsailJ/byutq24LK3lLvPhIyNt+P36tVFBJW9jBeWKyuKvRhNYPZz1c0jQHblDHAGEG67OKzqVeaJvEmK4ufcI0RRxW8M= 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:(13230032)(1800799016)(52116006)(376006)(366008)(38350700006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b22dcz9UsyDV7QZ6llVGr2U3C3GYXh535yR2qHGG8LcE1Y/QWNnx5uuZNX3YmVliZ75kDr9T7L3C42IwiRO6Sjp/GBdzuO6/MopeWwdkrtkDs0iEgS5pzq3ncMuwoNEZqL1CdTDDdjPxqUZuyxM+m5b6qnk4pd3xDA5BLfwudI3xnEiSA1zoZilFJC245OBmBP08nZbv5/bWD85BcR4ujE4qm0FoNIlPCx+HCT+7DtSG5PpYKhm9Shwy448MZ2kaC27EP0dUHtW3XZxxhxmt4ZyVAL18SAyMPBoafFRjL+2pktccW1foGRFN2+TiFj0/6/vIX856y7FTLBgULRaTC7f0/NTqy9diveUCbbpCsflNyjRhREjS9rIrwTiARELWrt5gQBbJYyJt+Uzyf3N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vvgrQlrwetVB2p9nrdpvrLi+nrMQ8zEvujdgBPkUYRtGcTVucCpZyV6d0F/g/bG4ag9bKf2K+NSIpinr74cMTGbWutKHWgYl0alXeiRILU1vO76NVa9gqyaQbMeLEy2d73az1YeEo9AS8UFDN9OVe+oMZobq4T6UBk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f515733-c1ff-491d-9fb2-08dc8aa54060 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 06:02:33.5387 (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: vtvctE8WMXark+7fweCjCBxi2rcjviN36DSvjSMLMHGnbsNGG8AelDG6t97ZFVBR23Gc7QkUWmEYtmLhqVgsxOP16SEuqD1C59uzf+lBgd7mWiQiHL6roA3RMK062Grh X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8904 Message-ID-Hash: 5IJAN4QLFHPBN7D5AEM6XTSPBERKKNJF X-Message-ID-Hash: 5IJAN4QLFHPBN7D5AEM6XTSPBERKKNJF 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 0a6435ac5c5f..3360d9eab068 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 dcd0569157ce..a18de86b3c88 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 Wed Jun 12 06:02:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 804212 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 3CD0CC27C75 for ; Wed, 12 Jun 2024 06:06:07 +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 8FBB0B76; Wed, 12 Jun 2024 08:05:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8FBB0B76 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718172365; bh=3EW9dNf5NF06cNQGonaVOuZPe0mNYsi+P1abcOWgGD8=; 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=QgUbMF67rP4j2vJP/EFzDDAamIulNxyVq8aaJqaNs6uVAqrebasJbv9cuPC/x8avn XX/2EIJPPnfBmQUY0swOhzSHIKj+rZK4SJwSFeUVOAWOk6A7ki38m44Ja4Llc0ssyL Br6U8wD64e5uiau51D2MZvfydeu+HVscn3M9BGKI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 93129F805F2; Wed, 12 Jun 2024 08:05:07 +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 20E41F805FF; Wed, 12 Jun 2024 08:05:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 85957F8057A; Wed, 12 Jun 2024 08:02:47 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20611.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::611]) (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 E4051F8010C for ; Wed, 12 Jun 2024 08:02:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E4051F8010C 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=dzctuwN/ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FjxgymXAtUk/+fkyiVHZMfDhSrpWqn1vL4Q63qPSov9eGqbljN+xOoKNZX/3zqWxs6ewXG6iadKAjIpDGG7B+PM1+XJefUXVQaarFvNkMiqjXhkJzQubL6Thygthjs/nqeuJ0Ws69ysh/DLvjsHJwM7/74FtMDz9FrIuaWg1PL8RT0cb2W0te5dGm2/k7JFnKjj5DqirppxWAPj7nSsYHa/KE/X+Zwez5fGamQ3ZlWcW7KJf7kuRlEW9RVbGDl5GqbbFmt3VPsNqifqX3MiAGnvAQa+fkgB+O8RLUDZyMP3WT7DeKzkldT+TPFbQTo+QFmlw5lS2csFfeJPlrhmyow== 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=+ua9SBa4i5DU9XCDa9aFkiKerkdkc+Gepgx6SDA1CGA=; b=Otv4JnhN2qn2m6M/HInDDYMX7QsUBg6uf1UZTtQKjfFqfZ6Fs6EWC5g1NKQu7q9EpXvlxLPeW7fWPjH6tUUOL/mK4mD4SFOzvOavayiw0pIZR5iwOGOKHdOEKh/ZJHtqBy+vbJ40Zbyqw0QusOBeiUi1cqkjMEJHHzIabadiiyzQvPVC3sP7BCEH84F3Eq4Z2aYmV9ChKTJ705Q8KkrzUN85vJtPd5a5+BLW2XilsfRXQ8gtdP8t4oKwZbmGTR0vRcU9Z3j76yPk3qVLqOvtNxPB+Uqtvb0RVMWzhi81fL0Z/SHYgNf/7cZSfb/hKAcG2Bg/tlti4eWe/GGFceLt8Q== 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=+ua9SBa4i5DU9XCDa9aFkiKerkdkc+Gepgx6SDA1CGA=; b=dzctuwN/iE04ZQHMiw1jhGJ4c8+ayrZSf+/Nh1mspGTJe2YWja8StdkQt5g8tPV6hRslTpf9g3TQo5Ln8FQa/ErL4PPwiJ5BJMkDpOL1yeYnpvWRSwRDhCYmdSeIhnL9l+OFFdHCVFy0MmBhjawEF6SJO6/lHqGLGPvtTYrgtfs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB8904.jpnprd01.prod.outlook.com (2603:1096:400:16c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.39; Wed, 12 Jun 2024 06:02: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.019; Wed, 12 Jun 2024 06:02:40 +0000 Message-ID: <87plsmzojk.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: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> References: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 12 Jun 2024 06:02:39 +0000 X-ClientProxiedBy: TYCPR01CA0130.jpnprd01.prod.outlook.com (2603:1096:400:26d::18) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB8904:EE_ X-MS-Office365-Filtering-Correlation-Id: 186719eb-af88-4237-19c2-08dc8aa54447 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230032|1800799016|52116006|376006|366008|38350700006; X-Microsoft-Antispam-Message-Info: ztYWgbz4p83Px1WABNcHvTyatVkV0MXUt8xl7+pwvpTDmq3AyC/U90oHQ+6EzTaVrcAY8aneBk9OL6tZMjfWdN+w4qVLTO5e3Nem1YQ4wpIWLCfoLxk4ksgNtIKWdoZHUbJTbt2hr1qdHX+9ak1cdtIRP+ugUWnmGjCAnNm5An+soVrxLPbn2vNQoOQEgoSfrOFSoxpEZiuSR+f88hJL2/86tupY6jmhbpFXhO+3U7xThIIrjMWiUawtK293GkE78PcvcaPt7yAz+hDf9XCEgHU5/5qbCTG8PW05a0WljNiftTMYQARlxlrdRcdLpKb0e1XXo4PyQMiMi5vvjTbR9AS/XaM8q2PGRpScSY+vV7B9Ifa9NGthXH3IUtdSVlvRj6POKOiUNwLoSR6GkWukDPVPmss2rQMlD7oGSEAeDGR3hFshP47DRy98C07xDLVAVZiBcDu4PgD0fPHOmrLBclZY60znhOCitqiqlqtY/SP0ZXv7OyPEB2Kci0LEHnHmezRYYE0FpwyinZUr5N86f319sJAFGkqE+u7oCeQVzJF2oOeMK5raSSPflzlJJ/2bYpfwe5exyqCv8kYMoRTZQpXprKmJ7Ixj/gGDYf1Qg/e0AUK64HpkPVg18rxNStz/uzHNScqu/J20uv1DM/OdcWuhUAbpfU3lA5F9c2DAkYkjKrQbGgYeG83jWc6Aw5/yMrkuo5OzZbNnnQHxQiubdWgtKOszuhNdiMhnTfxMoTlpsr4+JOP7rPUdAjsDeYQa+HzgzOrghGOKMvLSOW+Sl0IIm3mZfwJZAsyVzMwdyHPY/jkjTuaLGTi39Qfz0NLmfKxTq2g7n993CbztnfSOWQ/+cV72HdL0RvAZy/+w4qfETrog5CFikAQMQc5SVfouYPSL49JS1nx9ndt53vP+bCoGN50YdgWh5H1cBw71TjBn9q7vfx9n8hlyga28VnRu6FjFFgPyoLmxNKjXO+16mPsiryjr6WPNa1HGMApxGrBIojam1bH1lZIECsQpufwwHYWMtfcHluDymPql1m9KwXJN0ISN8aInO4X/83x/ZJxPGeh0q5BYkEPD8vvuDZuAsTAnh3TcKEveP4lLUGwPuNEeEmUK/2tynDb7S/g8TWtPr9aqOBbk3wLYmw+2e+Srs6QKbaJaDebJglcfxbLhAWSrJqVScG8GhE/DwYHaffGijVlbHtzfjGlxtPBOpfsRkHqsgXsDr8leHjlkRQdkV0X59Hu3foXuVUkeFwpzAuA5kXeSRxSHSGuQ+3a81dLP9ysVagM/jtZrzKnHT7xJfz7jdsM0+iI/ijHNS4ar4/LrbSuDqcenJY0eFx4ZhqnNlyxFvjFaSoolkbDETMgHB18ftzvbqQbaInLAtVUT6J8= 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:(13230032)(1800799016)(52116006)(376006)(366008)(38350700006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jkbOrkqibHyzSxC2S2RKUi9NL4SdFwX3xfT1qM/z7j902NnLGmOAUMnZ44ecoXK+6Wct71voGjbX4t3zaviKKrKw6CrCywTYgRFPSOptPvVZD1p0c/gHSusGoTYoZMfqTIEkV5awsoY/hBVARRBIFfi3tlHqd97O3KS6zQi38h5yZrMd/isKn3VruIKveBISiLNevV8xzjejNlf+l9GZ85sodxBHTwI1PTEbwyeQvSfLwPBxWecoAazZ/p51WYu62W4oFiPeJMTWkujBkT3RTfFzbpSjSfdqZV5EzoxMd2KAryXmqDLHLZ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1qJx+Lx1U/yVe7piBczheOzPGnzpr3fYFOl1Z8bd6T2Zkz0iY+t4030ycH/rJdqrlHWBXz0p1lMrNp6AwJxRSBknzvXRJYfAMlcoBf75+U467kbdgZgNcyBuDg3bvIXWJPRgq+breFX89ZMrKrse9I1BLJIPQsaDUXyBL80eH16r92t48k5kEWJDLpyoCPp1/me71uVbf8doyc4t/S6puvJUL0NRYQ4vK8kh7SugpMUKb8EgUx6K98nvbsoJeM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 186719eb-af88-4237-19c2-08dc8aa54447 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 06:02:40.0398 (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: zEPOPGUQPBxLxGeSlfM3/1WlUl5n7U7PjtfGhmVSY2dpXn0b36A4l+mFbcTPE9+b3aEdAhItvGQAiofD/JZ76ySfMsuqDaUrYEyKYJ163tRQc1i3mzPX05dNFAqPOHjW X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8904 Message-ID-Hash: H2LIPIXORHHKNIQG3P43N4L37RNLCAEL X-Message-ID-Hash: H2LIPIXORHHKNIQG3P43N4L37RNLCAEL 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 2de5e6efe947..edbb6322e9be 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 Wed Jun 12 06:02:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 803510 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 33BE9C27C75 for ; Wed, 12 Jun 2024 06:06:24 +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 D25F983B; Wed, 12 Jun 2024 08:06:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D25F983B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718172381; bh=bGODSZsly7uXMKsJjx4h8b2yNvbaR9i10pAouZ3sPwI=; 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=hInf9XmOwIHtHPG9B0A7VPsl7vBMHofntYqvwqnIZ8X9IxygC8rh6cBFPlvKq1IKY Ok+00mI856vVB8jpQrBi4Xlvbcsdtb4ay+w0UIPJc7yd0YtFYxc109FyYiIp+BHB6n /yhaONt652HkBrtG7sFnUNohY/p9oK0ZJlxQ7qWg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 35C4DF8060E; Wed, 12 Jun 2024 08:05:09 +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 9E5D3F8061E; Wed, 12 Jun 2024 08:05:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C763FF8057A; Wed, 12 Jun 2024 08:02:54 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20618.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::618]) (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 36D8EF80578 for ; Wed, 12 Jun 2024 08:02:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 36D8EF80578 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=EkrZo3Ch ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvKqSe/FHhrW29eMSEDUFbN5lBf0UYY59Kod3JhUeMeKtYxKQdM7jBnk1fDIB1FFOYF0fqZxoKJubjUOf7jNEbcZ5tBPz0FPbyO2NGkajQd+2EmrrugC/xMelAEyj95a3XoD6npelqiq4D2386iG9i5obo9dXrmSIPnLg5uTwxBcjjB3okMPRfZNmol4wSOhawjQASnSr4j3liIgLVWjDU68KG2OVPG3142WhnZDMLQ7ENKzCaIK2qhVS7E+QPxd/AGlafBCx7Q+7HMjNjpZ7Dd70kIvq+gOxxEokENmpXdluw4XK45BePhffcpJKVt+Ql66CHl4aZPDuBqJVgZh1A== 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=jjjER+N5Iop9vTIxPQ5Iti+usnyJaBCsY/O02Uh0CnA=; b=k50ZcvB7GGiGlr/YzuCfTK8kXPySOEn48tGEPefZHA3Pi1FNmbK6dONK8WIShmGlj1D5k1SzKBhLPrgRVads7LcH75dmZ/Sh+rYcu5WgvrFsYKTEYVYIZWGebdGzsq1+ZqTLBFtnbVjz4klB2rgsR+N3mqpEa+CHwTAzSrMh+9VWxVyAfu60Xvc2+UlUTbbWzWvUlplSxaM4HglcbHQT71Om9ZqGUIF1wKnxbHeDvW/P3PkACT36EAUg8u5ZwFL13Ul3vrIMu2M9jslt13VsUIojCkQgElXvRXoBjRR7pS6POvACJr9Zg8ATE1LMz5tzElmiCDyAxIKdpL3Ll4y0Xg== 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=jjjER+N5Iop9vTIxPQ5Iti+usnyJaBCsY/O02Uh0CnA=; b=EkrZo3Ch/b4YKTNNFMzoXfbEhcMo/7pLDXoP58ntBSp6tpApf8lMskt/tOWV8cRHO0VWCxiUs3EYghbxN7MFccm6J6f81ilzX6cpVTUopcN+EPnPgP+TWe8faJi+k9sIKbyAFbFsrH1cmWm35lEkHQC+L4r9lXzIdaLf9PDOYtk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB8904.jpnprd01.prod.outlook.com (2603:1096:400:16c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.39; Wed, 12 Jun 2024 06:02:46 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7677.019; Wed, 12 Jun 2024 06:02:46 +0000 Message-ID: <87o786zojd.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: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> References: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 12 Jun 2024 06:02:46 +0000 X-ClientProxiedBy: TYAPR01CA0119.jpnprd01.prod.outlook.com (2603:1096:404:2a::35) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB8904:EE_ X-MS-Office365-Filtering-Correlation-Id: fdb69577-3e17-4366-3157-08dc8aa54824 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230032|1800799016|52116006|376006|366008|38350700006; X-Microsoft-Antispam-Message-Info: 2leNkcqaXUDdqReG8k5TqdRN7SXXEIXgfVuWcQqbE6qg3H/RKFbhUSWdpKBOM+qwozjflQ570IwnZefBoM7xlhrGhPxKTq2w7vkMdqlECGcCorNHgb3x/wf8G4pUeYFGIrzw84V7wIIdCNhz+zbRv2mOlZq/+HHnOxfySGzt0EuP+voRdpSrkyzP6DMGZiCYW3TFK5Gx/zm7KBDEp3gqUEFXMKSMz/pw46EStgya4q8E4qCkVcs6c54jbhkIFY8xBzvQiSxPeq/100ZM/+4G+CDKKq83lJxShj3xVxLlce367bVlsU9TbQSY3hZsGkR2CY+ZQhMoKnHqv5vdEDyCe4gNnQ9D/rWkE/YQzwbQGZjpDQozHkdwL4EAIVwGeoTpHX9GtB+ypqmZdsK7eaFcDQq219dsot5OWiwR185OJE7IZQymPG43Nuti768M9MroqgYROsOB296lot5APo7VFtObxeM/1aUvti4HsGcgDWTfkErv47xB3GZ66DAlU52cHmFrG+6X2/fcohCgHI6bQWAjVGU9u7sdWV+qS6jdpw/oC09kcuHmVL88uZJl5nk7R6FWOkUT2lR++kIQ5cwCncQ1bC1tis5ObUJBBK9qs7U0hs+zsJuO4Cx6KgfjAXI7kn8XpuymqzGsk5LDAaG6SaECgQHdjVJVlpweNK33W+7HHNcvdhfAoro9Sye+92mPyZPVwQ3cwnfphrIuacxqdEDfIQv9HVUbqF1jxk8i1hQwUub809Z6dghJUWIbqlSSR2Q36RDrQMw+/p7nay4XS8W6cFZ9q6pRHzP/EhQ7/NuTKMOZ8Jv14wXyI9fQA+8u7NmvrGOe0o7/wG3c1Ey8hoZ5MRGC2cW/heQK8ftMlLUs51IF0EqO4MUa8y6La/ZRQGY9nNRbx1+1TFainwzQ1xx6+t+O21npY2gaQHjiwrVTT+niNBPviVcwrcqoKx7YtYEjKgjgZtAegCbl+AQ1dxI++lIg6M7MtvNIi+LKI2oDO9r6UJAxwbNdyo5D7PjCrFqDKJpyc09CgLXM6orofZlAzN1dZUApz1LKADFzQcSVpjGBDhLJjZqZ32MgE4LYBbiCrUZu0EqStCj91CT2fEwUiSQJBMMDis4JbRHykcylSHciEC/bKY6FhT83YY3d9AcbJaJyhCMTAl6XD681JIqriQ5Y/3Xx6YQW8tEnl5F7q9OgBaSrw/FEC0x6luFcD+tQfF0OPmVOZkn2q5oM7L/xHF8wRwnSVMogN3jDZl2838IcLOWr8QzQgOCmy93ZBf3zTi1w0zNpcLluw8vGUmoaaM2owgSoc8ymfArjGJBzUzLqwMttMn7vqGPVUzqEQsKz8N55TqDwXkahZiTvxjSSKLqkzGdkNYycUtOhcN8= 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:(13230032)(1800799016)(52116006)(376006)(366008)(38350700006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N6EuH+PMkiZOD6DDYChANtrbjufpQo5d3FoMjjDyXac5ukAY+RBHw1pjs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qVmt3bzIYTTSuoBhSgaUwSGFYE2dv+VxXtugMIfEmOPyaymtuC50rAC7xcAx6J71GT9xy76Dk9VewIQz7NL2y658W6uq/RHOFRzNv6OV8iYA9WKdw/TcTPLwXvSHLtdXxmJZFSpb/Dqg7TKUJSAtUMsl5VDylq7huDJHG56rJq4I9fZGT7t0nLBrM79nnyQvK4zzuQBCKyiOrM1Z4w0W2E3xblBbPOKK71GEUuF4Bh5Te8DK4j2KWfDADwMT5GuV9uCGeaaxLvAdokiSzxJ9i+c4T520ueowAa8Dj1A6P8Tt68UxjlqpDp9sOSv9D6L8H1NXQk/LD4d6Sg92gGvnPS1iAoABxhk1iYSPSkhlfmHlUcr9La2rhe4qliLWXWexZ/+mSM5y9qYzh121dXNL8FwLDo7RacShRAz+1H1TfboyavquaK0y7pnqVa2MzW4Ja/AnGZ5JnGBvnrQed3CRuxY/40s6F82amxN13Kmn7OU8UFsxXISWvtGXTuJNvQuE+m+5u+qVtBo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdb69577-3e17-4366-3157-08dc8aa54824 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 06:02:46.4985 (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: MGovwLHz5KIyFPPbPKsiaIX46YwFIHx3IRH+dO+2GEC0ToqvKeicx8YOvnHBFrlANnzTmi7dAb2tZMq926nJT7u3k6Ux8yIqKeLADYbsqcinka9ap9qeIltGFBpsmdB4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8904 Message-ID-Hash: YBY66DPUC2L55EPRNC3S7CTAHARUXKM4 X-Message-ID-Hash: YBY66DPUC2L55EPRNC3S7CTAHARUXKM4 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 7b981aa8690a..acf7d92d21e6 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 Wed Jun 12 06:02:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 804211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD4ACC27C53 for ; Wed, 12 Jun 2024 06:06:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1A09FDF9; Wed, 12 Jun 2024 08:06:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1A09FDF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718172399; bh=CG5rkXwSml2V7XW4YbD8DjDUSkwUwpblteGsQVI1Mvg=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bE54dV6cp8p9z08B1/fTKHsKLsN0f7nQxJGzc/tsUYTXJwe88ehaTyCuvHMr3PvNb KcA9a5bOwtJiY740bmbRkpQoXWOIShzm3XrRea0sW2bVrjZ2LixKX048IpuKG9soop 3oIdZXjPgdWv3Q+wPEmo83oa14s4GGWbPWs5OwEs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A068EF8065A; Wed, 12 Jun 2024 08:05:12 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3FC6CF80655; Wed, 12 Jun 2024 08:05:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6B9DBF8057A; Wed, 12 Jun 2024 08:03:01 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20607.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::607]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 10252F8010C for ; Wed, 12 Jun 2024 08:02:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 10252F8010C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=Bz/uNI3w ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KjIv5GmNiNYb/BZYrf8ciROGGnmOvqSP1g3OcH10v5Zq3gkZqMngbrlzHxMoC7xDnIGyiUX9aXl3GDLeLy8HiQFPF67APgv91T7jJjIiuuqTXMn2gMbuXYUr6glwMLFu+DZmL6PUS/jEMSIWcDYg92y0EX6JpCGQzoqzwCL5r8LAMgu/V8LDYfdO3lCAC/0Pdyn01kUwJYIgOp4sTQcOP/YZly1kePENIK31+NfpSsmM7RoYbMpXlDR9ya+PAwkCBmWZJKdzh8dLKnxgJWXsbr88znv6G4y37GXk+AdalJd+Ak3LUs40TB6PqF3MVcny3oYQAfX+8k4DnGU3KA1qUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1b7P5PleKYRpayNOEiYp3U7P9vb+s9/6lWLV1YpAKY0=; b=Y5ztQnMSt7fN0mSppbsJ5XCYTOnU2jN+3u0RBx/sWb0YwUmO/rA7t+tQzEtJKg0brOTypkc8ihwIVXuozp8RiLN8IYzX/E6MpFeRoEBgvVfkcayf55AsVK9Xv4vLfVAW2JNIDqmCvuBnNKmDrgSYEaACs5B6h2DiOtCxTtsK9Jpk2vx4GJvYcDt2C03vxjJQ0fYeNTlGCmOhQfOCgT+2gZj5jsgzKZIbVmljcZf9uLnLSI+arVQcd8CGIaSYhw+mmtZy221MTj33J3/+yQph3sMaJW4x3HoU8F8LzcaXQsEijQ/c4kAYEykvyhbQOkkpzmPffVLo9GabOOj1YmBIQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1b7P5PleKYRpayNOEiYp3U7P9vb+s9/6lWLV1YpAKY0=; b=Bz/uNI3wF9nkhBBuwRPb3b65SaiCHjpZ+7lCZIViNgAPKPdxuZK93UQ1YY+Jt8OtwpSW6h9UN/5yUx8u4FKqb78K325RUpwUyp9iX/UZ1D/tBPYQ/kenLXtU2Tw5jdXlGzo0zNVoqRtFZfa4cw+oJVUAQK3QDGjGYHp2VPQdkMM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB8904.jpnprd01.prod.outlook.com (2603:1096:400:16c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.39; Wed, 12 Jun 2024 06:02:52 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7677.019; Wed, 12 Jun 2024 06:02:52 +0000 Message-ID: <87msnqzoj8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 5/5] ASoC: audio-graph-card2: add link-trigger-order support To: Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Linux-ALSA , devicetree@vger.kernel.org, Maxim Kochetkov In-Reply-To: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> References: <87tthyzokk.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 12 Jun 2024 06:02:52 +0000 X-ClientProxiedBy: TYAPR01CA0222.jpnprd01.prod.outlook.com (2603:1096:404:11e::18) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB8904:EE_ X-MS-Office365-Filtering-Correlation-Id: c61a6b22-616e-48a4-f99a-08dc8aa54ba0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230032|1800799016|52116006|376006|366008|38350700006; X-Microsoft-Antispam-Message-Info: zfs7Mj/6hGrNfXgXr4xUwQEtzoPBJvLAb6IXZZwwmIlOFMgNlOu/qnZshP+6fieBiEToYBpRZK/L75hCvFUkC6CFvdEyma/BSnktrnxTFIY3ZWKsgUvUfKs37ufN2DBy1S06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JHxDu/MsvHGg5IeR5yyiVN1Eal6Rz9D4zA9+jnp+PHtqzwn+wyMayJ0q/1SknompSaY/JYP3zDUdM8+dKBAzuzeoN8NaZV1WeZiABOCrwSt9v9wT4qIDVTJfBdQBouG7GdJNO+8ZUTpQXHmON/LKT/37N2YRymsLedcVZyOzLUQcM= 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:(13230032)(1800799016)(52116006)(376006)(366008)(38350700006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RU3yjsm1u2VunMLI+X/2eNSSnvkKznimAqD6MxwibDSzBkNnmQ2gxPE8sXB4BVyZuiJK9IkrpDh8mQ968DgEYQx7UEdSCDpL3h/eySJhni8VWGvCZiNsMfwkwJvCsOdo4YGWiPrE1RywiyDQLc5BaQMi1SVVEfqo0+GafsovndJV0KHDCFk1vqotv+GDl8qNida7xI1NCKCFfz2dAPXjExw84ZefzpIcr9vupdL8tDUDjasYQCfrSxjTyQ2Iz5bivswycLrFLA2QT6jJwAodvDEMweC2Y1gUc1smRDRicu6X6VF2aZaWiHoY2W9CKLxqk1bAI/9hYDJvPlUTNs5ueJEfnxLFXJxigcivoZJn/Yp/6pWyS2DxmKV+eYnxPytTmdBEKWIny9seg1WDXvwTokOroL1R7/ESSViyUi5G/18kRTfAludjLDRHFeVaT4FoBNKWA+hgEZXxHbtclEYME1KmAcqvMyYWnBz8dxKQzgHZCBZB4po34Xjl53dbQvkeA2O+RC6KxI0VL33W+U2gCrwljROngIvvXqAYsI0DKcgMiMvLO8M9bhnF/kr3sBixdnYvv2wTyET0wrUZvhBDFyhG9jtXaCXheZqo+9uMBaMbNfXMJXQQQoAe6Ur1xrtJUMsQWyVYH2Zl7f/nyrPPwPH2j0RLGwW6fPY6nVq5/S6O5/EAevhDObuNanwnMTPSuWG3XHfj239yPUT5ay/NRGNWJAcm5HcCke1Vh02/F8aKmKa06q8aJyoivM13lcOR1RmQG+Tn5H5upkRtdA15DO9hi32o7McHaerI+f7xDQKqzjkwTk49wNMbkkQ3PuHsIHgrsAl1WoBnqm2nuIwJM6jgonS/Q8RjVhLjwz9jP7bYmrwmqzNnV1jWnGh7hD4iAA8DKXARtYbUUtJ6f5UrWQ+mhAqI4kA9R+D8iB0qa6s2jWya04fKa8+2eprSZvPJGO1OntQoK2TpV5WeRzLHxY/caC/8yCmRk7vZvjXzbv2TGObWGnG5p2Ki7h1eAV3//CUeutsZ6JNMMVn4p3VZvXwmIYnP2Fo0l9OCEbpCIy980NTizXv/QpaQxCT6mx2S1SF7/6xR2IU1DZdvtZ4xR0ICehcosjFOYUUtzx4jqoxkgeGzAjG1+q4WbuX9gsKm8AFx6VfPhMscjCYTtvX5L2KeStIj6x0yTcxFOMv1m1+uPaeXSGqcUN/LLf6dq4Y7uYdx7n3j58kEVFoWBO7/MiACFe2Om5NYV04VaxBceFJZ/OvoEYwZqA2lS95yidKAuG/3YfW/jGP0vxmWzr6cDwmq2/SH6DABItXBGmxt0zRDrISrVDz2ah+MkyrAYZ1BX3Dgutx7oWw/WWPVFwlOJBSLlYHK4gu6+7+rDjq1jbl7G0SKQXtAuEaOiTUJiui5ZsCngHiD/2bDdG+hjtb6EjaViRsk+d56J8w8e9W0IrssyIAWaLO77RDjePqnsQbuZ5aWgc2gjZlrepPAfGPXi/Wm8m/G7NtSlYlN24XRhm4rTYxABYOoJjvntLbLzUJ08LTqWe/qS/ol08cxvv8AOobNWAOyw0sRD/DsoZWGvk4IH465SaxE+q+XLQBduFd06FALxUggw+0I90n9+7dWb7XK+I1d8fTe/WoLH+LdjBk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c61a6b22-616e-48a4-f99a-08dc8aa54ba0 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 06:02:52.3786 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SeWPdOtTc2aEiaOen5vWNmZvYrk+8mDaqIZIrusZmBGJcl+oqyOXZ3O5hGR0Ko0sUuB3YAAJ0NXuLbbc7CSbWysGFwt1PpbkzB49mKOY6x5dHvGj3RURQFD37qUMA67X X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8904 Message-ID-Hash: J2BCI3KJIGCRJL7KKJMZZ4WIJ72CNL7Y X-Message-ID-Hash: J2BCI3KJIGCRJL7KKJMZZ4WIJ72CNL7Y X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Some Sound Card might need special trigger ordering which is based on CPU/Codec connection. It is already supported on ASoC, but Audio Graph Card2 still not yet support it. Let's support it. Cc: Maxim Kochetkov Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 8eea81888758..abaf3c1719f3 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -759,6 +759,8 @@ static void graph_link_init(struct simple_util_priv *priv, struct device_node *ports_cpu, *ports_codec; unsigned int daifmt = 0, daiclk = 0; bool playback_only = 0, capture_only = 0; + enum snd_soc_trigger_order trigger_start = SND_SOC_TRIGGER_ORDER_DEFAULT; + enum snd_soc_trigger_order trigger_stop = SND_SOC_TRIGGER_ORDER_DEFAULT; unsigned int bit_frame = 0; of_node_get(port_cpu); @@ -806,6 +808,14 @@ static void graph_link_init(struct simple_util_priv *priv, of_property_read_u32(ep_cpu, "mclk-fs", &dai_props->mclk_fs); of_property_read_u32(ep_codec, "mclk-fs", &dai_props->mclk_fs); + graph_util_parse_trigger_order(priv, lnk, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, ports_cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, ports_codec, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, port_cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, port_cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, ep_cpu, &trigger_start, &trigger_stop); + graph_util_parse_trigger_order(priv, ep_codec, &trigger_start, &trigger_stop); + /* * convert bit_frame * We need to flip clock_provider if it was CPU node, @@ -818,6 +828,9 @@ static void graph_link_init(struct simple_util_priv *priv, dai_link->playback_only = playback_only; dai_link->capture_only = capture_only; + dai_link->trigger_start = trigger_start; + dai_link->trigger_stop = trigger_stop; + dai_link->dai_fmt = daifmt | daiclk; dai_link->init = simple_util_dai_init; dai_link->ops = &graph_ops;