From patchwork Mon Sep 25 11:09:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13397662 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A0E5ACE7A81 for ; Mon, 25 Sep 2023 11:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hmE48uTyhkrnVlJnq6FBRozWHuJQKUUKhDR9WkXrYWQ=; b=mPlmvBYdJHD3Bf nopXW8NqowtOYJJUPy/imaoHLjuvQqlGmIl84HIKpk1AUvz5to83hxG4rLtNYTufs7n5g3YsnPHNS +/EyZPEShF1JjIco0yWB5FFsH/FZ0XNPZPUAgogAx3LWvvwQxEr+KwVcXEc8gXBRKWHbF/BbBbLmk oJoyuEsXN8HENh1X1L7DdFZunrzcAn3eUZMqHfnQvlxI/1FGubsWTiZVRRz6PwuCtAiPnKPA1hjNg r2Qxuu86PC+5lTIfT/tYoUzAaCnq/jJrgxn5QdcnYBADmD/BrS4hFOrk2Jpvx40X9T6yQsIszRsnE gYyCPs+x7Ug61b7kEp5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qkjTt-00E92J-0g; Mon, 25 Sep 2023 11:10:25 +0000 Received: from mail-am6eur05on20617.outbound.protection.outlook.com ([2a01:111:f400:7e1b::617] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qkjTq-00E90y-34 for linux-arm-kernel@lists.infradead.org; Mon, 25 Sep 2023 11:10:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWj5VRNYi1Ubn1EoSnv5McFkN8azhtdoJ3clI7eLE1NOHf/URaayddenNTkF5vWWFaPaJd1er0rrYVtWV0+lt2kRCnm2ZKmSkNluG2AOHrN1YUQYNLNnt+sjomZKjgHjjfEmBRRRGOM6Jij8l4RVEC48YoinEjdIjdPjplkq9/elrGyofr+dw0EG+WHaUogiepS+j6M6eKNtwaWlaXL077duzaAX2FN9quB49dZ33bPKvxwd//Tx342zT/DTfs2Cf7c0dfp521INQPvmB6X8iLlmqDS6qW6Vd1jgXEBiBzy7yQ/Tg4NAMwS9eD70S9DOMUGGDHRkrlGQroVWL+J/7g== 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=PI4uIdIkV9AyG0puYfKz4ztIaAoslrT9fpFWHeY2n3M=; b=Ao+vol1bSAmLTreHQgAmRCNJyrVNykwL0n7fyTgTUxAFREKV7jhO/QCua4MUlqKzI16x4XEEPyFUiRKUM0htQ8m4zNLWLrAdL7qGaizmC1EXf/bFJqE5JC+IhoiirS5NoNm9GPWsAhFAvrvdXEh1hdm9xjSLkqHF/niug7aw+EEyQWPZB3jy7pLNiKFY9IZCZFRz1zdxKsBdi+UJvhqf7bKGDYjyUAFajXdHJ1eOZRdiBT6cZRewmjerDNUKJ38GnP+mOMzsjfIXAlreNHqYRtggxwkHcAjlrlfoB8ibAkNIWfhye5xhpYE8um3Olp2oLEgB7yKe7U/PIbDT5UbtrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PI4uIdIkV9AyG0puYfKz4ztIaAoslrT9fpFWHeY2n3M=; b=UtvSzIEPcPKJiHH8UBLoGELYNzywXhgBBaGT80DTUn0lwtPuZND6OZRyvSN3MIcGB6BqBOQW6eLpBhtzDGLn4YpiYt0KYuSlrVp/EW/F5x0PYjk3gfNu72SyKwaD3SEa6SBSiWIf38pjKjQjyTy8BCYNdgGyJ69pa8HpI17GzGQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) by DBBPR04MB7884.eurprd04.prod.outlook.com (2603:10a6:10:1f2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 11:10:17 +0000 Received: from DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::51f9:b8d2:7ddd:c74f]) by DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::51f9:b8d2:7ddd:c74f%6]) with mapi id 15.20.6813.027; Mon, 25 Sep 2023 11:10:16 +0000 From: Chancel Liu To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, perex@perex.cz, tiwai@suse.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Chancel Liu Subject: [PATCH v2 1/2] ASoC: dt-bindings: fsl_rpmsg: List DAPM endpoints ignoring system suspend Date: Mon, 25 Sep 2023 19:09:45 +0800 Message-Id: <20230925110946.3156100-1-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI1PR02CA0023.apcprd02.prod.outlook.com (2603:1096:4:1f4::19) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|DBBPR04MB7884:EE_ X-MS-Office365-Filtering-Correlation-Id: e90646e2-6d6a-470a-f9b9-08dbbdb7ff47 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C59mhd3rGIjNzXfeK6SNPJL0GTDqg6SQNc0SKdk8iAuyAJd/IeXjV0lerT7bILTrMq/Q63ffoJJAmcIgzzdH/LcJbhkreSIqEOesva1jq5Nx3TcaZq+/Z5QViNUk288+NXj+4Y/sbLWmU0CsSGZKRL207Er0kKqsYjUiWJhB4UZr1iUWt/swVr2C0yq8oyNiSyHNNuGjzoYSxjX99EQitkMJ4vYRoEtPqyLDZ0sia7KmuX2aVPe31Qm6xXBKaHyhadkF4kJOK6pTn77IwJKOkgcTr3a0ub6xIgHg9IbylpZmsPJswlA0R0nJfeAMG5/ynmMRESuQkTDyUXcXnOlYcYQstAkJhStA0QkC8PZugSLAdjXG+2nYnfAcu137rOKNHqdX14xxmjXdp1sIOk/Wx8sa99OCRJoK4WapzDwGiYWUy+97X/Txqocdfhu2Ea6COT/PjrpKQj2KIEvjsgWo8tpJzKGM9uIfN8V2QG+oQZ03/qvfUTy/Nun4/xwDIQ2c/6iTAwv1bGGE2+DRuii13zgu6LTfMgx0NjwBDgB7PaeLBh4ne7MVuXA2J8+p+1ylwW5n/JL942WHrDo4WwJmoiMk581nI6VRbt7TEkjzV7QoNAKZ0TyJIZnpLlodBowT+ZNOoGJUn2lGmFTALKsB2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9498.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(346002)(39860400002)(376002)(366004)(396003)(230922051799003)(1800799009)(186009)(451199024)(6506007)(52116002)(6512007)(6666004)(1076003)(2616005)(66476007)(86362001)(66946007)(66556008)(6486002)(478600001)(38100700002)(38350700002)(921005)(83380400001)(2906002)(7416002)(8936002)(8676002)(4326008)(36756003)(15650500001)(316002)(5660300002)(41300700001)(44832011)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qr5kSPlv5BemCjZD4v2K1E4uJjBvj31h9TKjN9+TGm4XvYdTqCeTx1+ecM5TkSi2CpaG/43Y/86vd/VlWzYFV0cKrDRs6B2FCfzICmaqgqIKsR7V0rfxxx081H+ZjzRzmfyvBFxm1mJqJ33AKk17xKOAr/r0oZw7acEvrUG0rhNOhVSfd64eJAaysHKgaFBXHvtRoVaQ8nV4j93XdSPtxXo/9ABGZ/xnJ+0DgnviDuVVgzekz+fgeRdkMxhLcmwTX7Jiv/3ysyPSl9pH0WXMG4bEnhQ0CVVjfZUZo7umYHYQFVu5HsoK/+M1VDdFdj/i6vBd/WH+3GbsVfzwkEBE15nidblpTmzGYubSsE0QoZrC0wgZGlCu4faPQMgPPah86t/HQvXcvq608FbU6muUbkkzM2IScHQ+ohUQDzVfmBrX1iP0a/7sPJy9L+Y3771xdWCHoWGyTlE7f8KXg7X6kLq/gPb9zHbj2LOgaMYmG4BBGH9mfpplI1qmGnfKURhUhwC9bb2lGFq5J8F7PKtNNimytw5vTlfGhUoJodohSKK1/tuusqCUKHbfV3xjbAT6cUdW2YEbBXME+AeIoZMV+mjTS8jYJzdW4Q1A2CSAOGyBm/W7K2mcro6sgn/z5f9sogS/LD29zkiaeKdaMDKTHQvmleZ868hjFaAghzJqUMwX/xPB+SRPci3PgYezygTdHshji2mGqDcLPzjHJkyMLl8UvUTvk5BtSgIIGjaXTJj0tILu1jViKXQwuivuAP5b12pVOg9Ci0+i56ZemChAAd/AlpaqC9SmL9oLBztyuqBYCivBf0TI+zRLvH3XqtmzBT2AJfM6Eb5PiLfVc5cYZCOhn/1Pf1G9SOrZdaq1+aLy6yBbY1bN3zgRhz0UtCgSNzxrbWyCA05QJCfCyn2xWa264ypaHLHEg4n+FdgSx8kH4wVRiU2P7x5xmz/KFK6JsARNL6cHPiNWCNUsnGXTsBmOYZB1WcqGaaT4FCxtHNm2aH8bDcDHR5JlDD/n73roJUrnGXCQL556IFq5EFcui52JOtqHm78TpEUPBfOEHkaJLTX4E0YZCcpIGd4SHhP3sfsKHNRFX3p27FsAhZGPyDpOQR1/prnVDv8FACXx03LFRBbaw3o74qN3sfZtbdbXhtJ7TSztvZObbCnryN4KSbG6iUrf4QdFzcjnAN0tOeFyHIPDwR9ZusaPDAtcAamdYdYdHILMB+p0WmGcf8HIxBcfXT+7fRDmoJbFrVOxegYqXfIpEcC2gjCT5BmI5sqkyG6U3dnHnyAHUwJLXyjR1cTI9EFab4PwFLaglTbqHEprEU0yROFRtCVpqP7YX0n2wjmdv5Kg5Edetb2y71eU9ZJTf224sRM9/BmMiS0H91BcBYID3DyZlcjc9ojV/l1oxH52zWUHWaRuzqLchYlcgxq6gsweLoUkE6n99sgO+qc3GAdw3aB55bp3u/DZe1dwlnmBM2WpAdioPDkFPI1EP84iS4f3KegwSh55fh+TMmeTh9MbCDFGx16HWp2IT8dVcqcm5zU498NhmMQyMtJck7fE5clEkm8b6oXfBdAEBV8gl/TG867wLob6ic5qdO8G X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e90646e2-6d6a-470a-f9b9-08dbbdb7ff47 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 11:10:16.5136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hGflbsOZg+xOQecSoXbMQK2jsJy0xvAVUiaMpkiI9D7Dp+amvyh2FThd0/zN34FB6A6ux0Ghyh0PpbXhid5yPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7884 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230925_041023_050052_C140E158 X-CRM114-Status: GOOD ( 12.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a property to list DAPM endpoints which mark paths between these endpoints should not be disabled when system enters in suspend state. LPA means low power audio case. On asymmetric multiprocessor, there are Cortex-A core and Cortex-M core, Linux is running on Cortex-A core, RTOS or other OS is running on Cortex-M core. The audio hardware devices can be controlled by Cortex-M. LPA can be explained as a mechanism that Cortex-A allocates a large buffer and fill audio data, then Cortex-A can enter into suspend for the purpose of power saving. Cortex-M continues to play the sound during suspend phase of Cortex-A. When the data in buffer is consumed, Cortex-M will trigger the Cortex-A to wakeup to fill data. LPA requires some audio paths still enabled when Cortex-A enters into suspend. Signed-off-by: Chancel Liu --- .../devicetree/bindings/sound/fsl,rpmsg.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml index 188f38baddec..d8fd17615bf2 100644 --- a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml +++ b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml @@ -91,6 +91,21 @@ properties: - rpmsg-audio-channel - rpmsg-micfil-channel + fsl,lpa-widgets: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + description: | + A list of DAPM endpoints which mark paths between these endpoints should + not be disabled when system enters in suspend state. LPA means low power + audio case. On asymmetric multiprocessor, there are Cortex-A core and + Cortex-M core, Linux is running on Cortex-A core, RTOS or other OS is + running on Cortex-M core. The audio hardware devices can be controlled by + Cortex-M. LPA can be explained as a mechanism that Cortex-A allocates a + large buffer and fill audio data, then Cortex-A can enter into suspend + for the purpose of power saving. Cortex-M continues to play the sound + during suspend phase of Cortex-A. When the data in buffer is consumed, + Cortex-M will trigger the Cortex-A to wakeup to fill data. LPA requires + some audio paths still enabled when Cortex-A enters into suspend. + required: - compatible From patchwork Mon Sep 25 11:09:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13397674 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8BB67CE7A94 for ; Mon, 25 Sep 2023 11:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BuCLacWfk7gFOg99O9NiFj3pxQKwQv8L0jP7+A36hFQ=; b=g7cq3aN9BaUgXJ rM4QgiW07LXzSdLE6IQHZFJSKpqzimuYjq8+QKgk0x2OJLDiq9ESQaMa0b1bB5X3dfHEkYuMwNLMX t4jPdfL60EXjNx2legev1e3g1WPG603baBAOkJJjVGIx/fRYehUXBg310QKaSdPbfLF6Ei5JcxOCn 1jXX+dWvUGyUkPKAv6aiMgYymgrYxUFROpnyAlljqaZ/oAMvLvLmeyA1UtfbJM4U67KZ56SsgSDZM 4KB/vq6KClABVNT5Rh3vR+U4nrhPTUxlk7a00c7ygc5MvjTKXdK69zASgyGrNeNUIerHi7Gs/I4ct T57faG7uhK1ZLChXanmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qkjhd-00EA9h-2I; Mon, 25 Sep 2023 11:24:37 +0000 Received: from mail-vi1eur05on20621.outbound.protection.outlook.com ([2a01:111:f400:7d00::621] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qkjhb-00EA8W-1w for linux-arm-kernel@lists.infradead.org; Mon, 25 Sep 2023 11:24:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CXRGMfvCmoOPbtQ2Vj3fnKFyEON+jqNmhZJ3yZkaVVKtQY0ZVvHKcdfM+15IZb9wTtyKa8Ce3QpeEO6y5i2zf2ejRjastdX7WP+HK/M4ZATeOwGywVURn/H6TpgpmwZx4S0KDrbMFYFxPhVtPUEVMZ5YDZ/g0xR+X2cVK6RsbZyVYhcskAZIr6GHhs/tVSfbZLWI63uZRDQBKbGB/G/gnLCs9olAPRSNJNDob3k8eXxGOXW8DTLs1jAZDZokwhpFBAWunMIJ/2xPE4EduCGmuI/yZuzAkSQ9Ec3EujqqrPVB1XBNaXdgHirFBznu1Rl9UOWgoDRxRhccYGz0sGfIyQ== 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=L815y72ZKLd8Q6n13OC96EtIhZ75mN/FqznbXbkA6rg=; b=oNaJSbE0q5ybNxlPxQiVF/iXv81DulYGLdgLS5Zhq8oZG0Ya7gjx7ZtZfsC0pGxl/g+ZHlAz/awLBTx1NFik+JqwNshKorkiXdNPJXkEijnm4W2qunUd0v+gCmwzYJm7bBx5ngWolx1oNhRzNG5Ppwcl2jeWYZhzxlQ1GuD4GkDLJrA9KElF4xaCY3PcMGLA0Qc04x0Xnmi/Dic3JT0lUS01cpP/KlpwhqvALOm4al0K2jR2JbuzXvAEnuWVYW6IPgT9HbE+Gl4KBeaAwg48aMtpW8VO+D2t3zgGL2bObnzhrrZUDFjkusEbrZaWOKXAQxFu4x/67oabhey7EKIYjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L815y72ZKLd8Q6n13OC96EtIhZ75mN/FqznbXbkA6rg=; b=jZV0UlnSCrBs+12lQi+6ixtLNPrVELeKIEwXYNE5/U0Yss6BGDpCk/wEl74rNsesq1btudEA6JN1ic2BjsM1zvXHJ6K20SazvxnziB9hCDSdJhXiket+Df+fxtZ1XmUr4sHSOGNPA2qwAZEv8Yicu5zv4ykexG94s3a6w4A2Mr8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) by DB9PR04MB9283.eurprd04.prod.outlook.com (2603:10a6:10:36d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.27; Mon, 25 Sep 2023 11:10:22 +0000 Received: from DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::51f9:b8d2:7ddd:c74f]) by DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::51f9:b8d2:7ddd:c74f%6]) with mapi id 15.20.6813.027; Mon, 25 Sep 2023 11:10:22 +0000 From: Chancel Liu To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, perex@perex.cz, tiwai@suse.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Chancel Liu Subject: [PATCH v2 2/2] ASoC: imx-rpmsg: Force codec power on in low power audio mode Date: Mon, 25 Sep 2023 19:09:46 +0800 Message-Id: <20230925110946.3156100-2-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230925110946.3156100-1-chancel.liu@nxp.com> References: <20230925110946.3156100-1-chancel.liu@nxp.com> X-ClientProxiedBy: SI1PR02CA0023.apcprd02.prod.outlook.com (2603:1096:4:1f4::19) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|DB9PR04MB9283:EE_ X-MS-Office365-Filtering-Correlation-Id: d1c4c6e5-a02f-40dd-59c3-08dbbdb802bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v5avw5OyV9OlaVblBXbqOhaRNQ4diBn5eOlnJd12M4cnXftdzswoos9DMoK2X2Oce8YW1rz7LQrs59of+JKN1xhVO0yCRl4oGqqeLDOVn8K4isqLWZcwZn0wNovRIw6cg9yoGxXsep+qAP35vwxg0XElNTxDijSxzFhl/XjeZhVAF81yim3T87PfFyP9rvPR95myBUyiRNBOV3z9+jtL7JUFeO+sQqCDQoDXsh8dVtlNXax58xLStg+c3B0BrLD1exlYhPD6tuMTPCZOVWe+hf3icVoT5OCRjC/xIyCRBQB/0+dck+5TwQjzvdq+lwCiB3Aa7siyxJDYoobSOzSOujDpkh3P0gqScgrqD2fhOZ5kE4EHMTM7UN5NiDB5e11nCNOcXdICRVnvB8kFOng3sF2gIhqH0sJE4EXs7eP0l9mNyUmeswKFi6bgtkcOLgADyTLniTaZDp3PN7lG5lcIGqPZ5Nx8g/kg790uDv/mdMANMY67Frk8IvDSsrpSrmntVzEiDbjVTTmJng5LIXKBid/lMTqyvx93daUmcqt+iPUdz95q2B0oLQIxxaxoSTqiMn42aRfrhBY0inmm6vMq7JMDyx9PeFJueI5rMGJo9M3WCv0CCSokeexP0l/eXxDtzmH6QX2I+Xp5RCZo2mI4ri5LmI1qg9YG7slXfqiXn04= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9498.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(366004)(346002)(396003)(39860400002)(230922051799003)(186009)(1800799009)(451199024)(6512007)(6486002)(52116002)(6506007)(6666004)(83380400001)(921005)(86362001)(38350700002)(38100700002)(36756003)(1076003)(2616005)(26005)(2906002)(2013699003)(41300700001)(316002)(7416002)(44832011)(66946007)(66476007)(478600001)(4326008)(8936002)(8676002)(5660300002)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JXwyA3gz6BSMbZ8vw/AYjIwUpU2hXOc2bOXNeoaAbtt33vqZ2APy02EDre4ZIlCdY/9wiwrbzUzrFDvoO1Q132A6Aj5sAKJCsg1I6v+uX94HV4MYOcEVUQEM55NRV342avmb4mDcg2M0HAH0wkCbooUIPly9SAfTsXD7KyCSkEr1o53cxBzfdcoeg3NHrPMC8PIVZuYoeyD3j17T6s4JDDxC/SX4EhQ7XM7KvtnEhqlUMqtw57Do5F5d5LF/sRuNrCYz4ngTZKRsKY/uuH66l1T3Ll+/rc/fsLY1f4wS+uyI/J8N3p/V92uTJcr5CSRxtosGRMZSrdtiG33ZIDOtaDnTXO3w0F4P4TqLWwJvQ5Lp4IzZLG2fCGqlMtN3LTRYzK/stFy2OrMqPw4RAFjlCotdGMHak7uJYsU5CAKNGinSzip3mErauEhOkplp0GZwojKbGhayDlnphW+w6JENm48w8vqVYENJnH7u20YGCA/s+u96X6eEil899s3g8Z0iIHGFvsdkc/nLmxCNzYwoMslvP1upxUxnIUsa6sOgqQOHXNGvaEE0AhpzK5EHizGV9aYBCC6UclXYYFsMCvU0c0nDGZGZh06jSwKzktHOz0jno2OfNacbk78KRucLEzUjlTefG8IPxgrHeOdJdkUNorKpi/AknbGoGJ01oBEYhj1WZvrEYXQ6hxyw95eA740PvV2qQYH/hZSfrPV+1hyerWZcZky3vwHSiGxeNapl1GrER+uzlnxxHETkS+aWqfhoxtNzTJ8qfTMA1FrC1Mp0zd+Ph8CPiTaHIaVMpzH2MPkppe8OLufxVbMZIwWYxQFTUWlh72nsYZ4I4YTEbB87yskluvZX6OdYKPr8hRptEtd5o5D/fC0XR0h2H295hVTgkq9W65EUnEPqwOOsIBacRL3vRhwX7p+adaT/QjYNw4gzKZGbrH9BE33xlVwTEm/FBpqANgdDPipGxlOOOpSUtAP+RkNjnrbL+nKw7/lDRNKQf50iwXG9C7y6DuGhC4cQEPk7UKABhVe7e+iU3U44oAkV8ktNSLnyn4S0HLq3EYCa4PTbbPKgrBRkYYGTuUc3ViHQ8aaBUqthEvO5KVZBFUZOWzqOzw0AWMY3t2ldTJWRoxHinioaYbNe6M7Yiu9NkVEnNGX84m7n4c3R8WcNmoTbtaKmi2QMYhbZXnueSWQckfuCKj2ZZUDGPG70L5qjluzd01x8ve9SpempZbG3y+fdFJm4Nf9dhwpXGr0rT+R+OOGJXah+DmJ2GM1rD+O6DgPddi6FUoz+GCSsTBjImEjbjWOOkD5gdOQ3B6KfvVwoEHLnbX1mkkZ2C9qyttqkkkCN3XX2iM6Nmd68+e28MXnqBMTgnOm84N3RWVEbKEFzxkmX8Y3V+S9Yoag25Ruwb/i7xAhfHWiZ9tmlyEK0NLL1ZfkYqnxLWsl2qMvMEziNh26ooYv/rbdn2O8P1u1BGq08/z6iVVFJfuOkKQcRhCAaiIxKXvj3/P0Vz6lFLovBZL6Q+gR1Aw4/xOBXg9rRy+TJR7JC/omYGaaDQcTkxh8+v6na78wGs28Z7/qk84VQl5cMzC2DqO4I0qdeheqA X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1c4c6e5-a02f-40dd-59c3-08dbbdb802bc X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 11:10:22.2169 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NbH4X1vt7OH69ZX4SNy4siQhMq68mcYAIkFUz/asOqxkSW3Pnn0ohq/wVBIe738aCiq9XMqwIH+xlFvFC7D1YA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9283 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230925_042435_639209_5748A79A X-CRM114-Status: GOOD ( 15.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Low power audio mode requires binding codec still power on while Acore enters into suspend so Mcore can continue playback music. ASoC machine driver acquires DAPM endpoints through reading "fsl,lpa-widgets" property from DT and then forces the path between these endpoints ignoring suspend. If the rpmsg sound card is in low power audio mode, the suspend/resume callback of binding codec is overridden to disable the suspend/resume. Signed-off-by: Chancel Liu --- sound/soc/fsl/imx-rpmsg.c | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c index b578f9a32d7f..0568a3420aae 100644 --- a/sound/soc/fsl/imx-rpmsg.c +++ b/sound/soc/fsl/imx-rpmsg.c @@ -20,8 +20,11 @@ struct imx_rpmsg { struct snd_soc_dai_link dai; struct snd_soc_card card; unsigned long sysclk; + bool lpa; }; +static struct dev_pm_ops lpa_pm; + static const struct snd_soc_dapm_widget imx_rpmsg_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_SPK("Ext Spk", NULL), @@ -38,6 +41,58 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card) struct device *dev = card->dev; int ret; + if (data->lpa) { + struct snd_soc_component *codec_comp; + struct device_node *codec_np; + struct device_driver *codec_drv; + struct device *codec_dev = NULL; + + codec_np = data->dai.codecs->of_node; + if (codec_np) { + struct platform_device *codec_pdev; + struct i2c_client *codec_i2c; + + codec_i2c = of_find_i2c_device_by_node(codec_np); + if (codec_i2c) + codec_dev = &codec_i2c->dev; + if (!codec_dev) { + codec_pdev = of_find_device_by_node(codec_np); + if (codec_pdev) + codec_dev = &codec_pdev->dev; + } + } + if (codec_dev) { + codec_comp = snd_soc_lookup_component_nolocked(codec_dev, NULL); + if (codec_comp) { + int i, num_widgets; + const char *widgets; + struct snd_soc_dapm_context *dapm; + + num_widgets = of_property_count_strings(data->card.dev->of_node, + "fsl,lpa-widgets"); + for (i = 0; i < num_widgets; i++) { + of_property_read_string_index(data->card.dev->of_node, + "fsl,lpa-widgets", + i, &widgets); + dapm = snd_soc_component_get_dapm(codec_comp); + snd_soc_dapm_ignore_suspend(dapm, widgets); + } + } + codec_drv = codec_dev->driver; + if (codec_drv->pm) { + memcpy(&lpa_pm, codec_drv->pm, sizeof(lpa_pm)); + lpa_pm.suspend = NULL; + lpa_pm.resume = NULL; + lpa_pm.freeze = NULL; + lpa_pm.thaw = NULL; + lpa_pm.poweroff = NULL; + lpa_pm.restore = NULL; + codec_drv->pm = &lpa_pm; + } + put_device(codec_dev); + } + } + if (!data->sysclk) return 0; @@ -137,6 +192,9 @@ static int imx_rpmsg_probe(struct platform_device *pdev) goto fail; } + if (of_property_read_bool(np, "fsl,enable-lpa")) + data->lpa = true; + data->card.dev = &pdev->dev; data->card.owner = THIS_MODULE; data->card.dapm_widgets = imx_rpmsg_dapm_widgets;