From patchwork Wed Oct 11 11:47:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13417272 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 5FAE5CD6E60 for ; Wed, 11 Oct 2023 12:03:33 +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=B1EmyAB+miHriH67jrEbmsLtJEv7OwzmbdWcFZxNwNk=; b=AB78jO5te4bB7+ Psk5fSA1EdWivv5lQpah3w8rkFkdGZ32RNnOPLD5kG16EnY2gSS1vy0WJ314ydr03NRIYDELytoTX 2rym3G6WBpV4w1i3lG9SFC+aLWYYS4xFn4J4EoSmEmdDUF7sw23im3SwQ52tbqb1fTXtjcfr98JA6 0y4dUr5xmn4ouNqY9Ad48oH3UZlum5eTmr2yb3w1ZKQmVL3WksOrcj/XNEKHZwRtsx7xtvaf8RfdG 5bahHtCUlmYTx8WpJWHiQjcS64JX8igRHrzxD97BGPl8IVOCcOGItgyyq5wnOs3uZnFPZutxTilo0 Pjwf6h2rZYf8As5UF7nQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqXva-00Fnsg-3C; Wed, 11 Oct 2023 12:03:02 +0000 Received: from mail-dbaeur03on2062c.outbound.protection.outlook.com ([2a01:111:f400:fe1a::62c] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqXvY-00FnsM-2Y for linux-arm-kernel@lists.infradead.org; Wed, 11 Oct 2023 12:03:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uc/ZM1LZ+L0kNoWL8gt9a1IIvkuGz58re6GNqeMbajwupGe0Zuy8yseMsfl/gA1eL0yHh+Ov+5FKES0U71JyRCUpZMBo9/HmnDnZGjKuqTJ92fOUWpUbOgBhh+Nv1Jq5T1IB8G3Whzlu1fZhNN6LRlmH9mGPwHIh9Aodh5J/SIf71AiKkoGtEnENbe4yi6UC1swp+cPKw41L4qElZYO1/sKhZdD+1uvtCEUrrC2Eeyi3uJpbqiTh8sgJ1PFnXXSxo0Xv21WhV8nJuji64opaUiNrvvxakqBWW2XS4/H6+3nRXleFSIFtS1UR9U9wEIvsZiuvM3AOtKEbH+ZjNfR8vA== 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=lZ6K9XQpKYme/J4N/MNWVaFAPGeXREktm84uM0KX4yk=; b=d4J++M7S9l0e/2bdqeUThuQP50cPJf/0N+3nKftBsNLdjH/9HEFfMAQ7ApoYBam2cvacqeqxokw3DouTe6P4anL9zAHnvacOnhe0AefRykMZKD8Eky2w4zlXEyD3n7IosHIlY/v3uqh8e2AIMCsZ4u0Q/mF2SHCH6UE4yAlW/n3VuGq1LC1Jb9CH0oBW5LEpGJaLOuoISIIno1D2EXUxa3A2TarrUz6FKQlOCDmVRldCxS84YG0prshyNggeBHDGFToCkkA8SCdRuwKozaLGMaExaPaLr07oaURPraEFn8v8Cak6rzmvSGrXJN5ajrHZ/RjjyLDc7NiO95OumI21ag== 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=lZ6K9XQpKYme/J4N/MNWVaFAPGeXREktm84uM0KX4yk=; b=eTsC+k3NvYo5wh3edGqFWzjix+HxJKUSY7cO9lau9KRlf7ZwWsSf5CymCDLY1kN5CSTbh0pwgIBTXH9CEUg2KPReOfzzu9BAbhlIr8TLI5AfTwdxJqBN8M+Ijqm64vgsiVsOC5BTTfwgBM5gNM/cx4RVSReNyCcURAyMSZfVRO4= 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 DB9PR04MB8300.eurprd04.prod.outlook.com (2603:10a6:10:243::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38; Wed, 11 Oct 2023 11:48:30 +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.6863.032; Wed, 11 Oct 2023 11:48:29 +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 v3 1/2] ASoC: dt-bindings: sound-card-common: List DAPM endpoints ignoring system suspend Date: Wed, 11 Oct 2023 19:47:58 +0800 Message-Id: <20231011114759.1073757-1-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI2PR02CA0025.apcprd02.prod.outlook.com (2603:1096:4:195::21) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|DB9PR04MB8300:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ffddb9b-51b6-41e3-5655-08dbca4ffcdf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TGi6RzXPOZw9VEdzJk+SWTjRBBck2zK8PGBN1NDlkoHXEddj8/NTgdjYPGGtn65hW6CvyC94NtTOA/C5Y8IkQVfP6fdBjTwWQPu4B8o47t+ibV8vdgMoYbrhQ7zOiZ8xC4qeYuDMYqd0M1S/gAfbxkhU6zuWYdnGFAkRMj9OR57+Cory31p9EMO7pUnZH5rlF/Y/Glcz+G1sVlrbrUrYsLjKaYippzo2hBPt/6//HEHwJ8k9CKt/K6V1fjM9n2pocRE0eKjDDX390yiBsTwxLnIQVLcHlLEbWLc6lYoTrUj2VgLCnY/KTIW35LWvU9H80YLq+pH+T+iWkr9nm5aCRqd+rSbzgZoU+41rW1xsYVnDj7td9z8YpJv9tpN9Lbg0ID3yGKLmC+26ndBh3FDnKeAuGN7XMBfCk30N9OxSxYNhZsvzSXO2ROSB+K2Rc5Rd7NdEwXJS6EbUjm1rWWIg7gwllXWc4HC0SbhIVIFGMZg7qms/nkWd28EIg91jLeLTrWjr1F3xpMUoZTkpJsCHxdLL2SJJqr1n1LhHHDUvL0ND77YpCwQXo09f4qtGNfQSF01U6xvcbUyiB5haKUOCNsM7N7x+3dfsM6fS8FIiqjvqHFIQ4c8VeV5oYjlf0GUMYAmDJPHM+3b5BIPSSqIJ6w== 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)(396003)(136003)(39860400002)(376002)(346002)(366004)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6506007)(6512007)(52116002)(1076003)(478600001)(921005)(44832011)(6486002)(6666004)(2616005)(26005)(15650500001)(83380400001)(7416002)(2906002)(5660300002)(66556008)(66946007)(66476007)(8936002)(8676002)(4326008)(316002)(41300700001)(36756003)(86362001)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DtLkls71WtuLmKETLOiFqazqYpyK97YHzAcvKFLUluTXbZsiW9lvgn9M7ItZJqWJNjWA+aMAhjthmZwFD0j3ucpNATvkPSivjiW8v/Dw3xHAU6tsdD6ovf1q8U+qkkLRanOuHydtU2u19G++Y02ZW9Ae+qj/wnTxtpK2g5bVK0vZKqf0KJS9gh+NpFeLI76ATBO6bHEVsyX8tbu6HUkwU4I5f8haBEDRnF+JVPfWagYffhiVE3GqgDYpISgzWx6WY9f2dBzLgJsaZ0d4tKjnd8BXxgIAOeUEsm76sNtoYNScof/2MceJIEjZV7nyo7VlT4DdT6mGVSEmk/2KeTbjISIV/NIAsmeqrI8Pbkvl8d31GYj4xSHDKCTL1EvQR+f9bBWqZTsjArgg7j2Bu5c2/9awbGlayNQvplhKzwmLPvEOGOcsiegLpUXDGhSnXLg2B/O2zZ8HTMAkQxIPrwhGk1CqHwJ70psWcaC3sa/aeuBDTqHG+XJ21mTSAexEg5yvOsLicUJXmkn/iUZxBMBeZb/hxOyE9KzLibwM228D0DnqEhNU1tWggWUlncDUKlGgRrFqBguzerTswoLrGEeosgevAH96ADakltVhA5nBAUFiK0Vt5VJ4gdwugZmFYN21yPM+msJUd1bhG3Wd4jwEX015nIoAeHo+Hwvrewv5olT930WrhyPPQQNht0ozaFaaGUUMsnVpUQebJTLRv3FTavG+qdKfna/HYeWO2mFEs2YXWcoSBzXmcEIkc4l7TFpY1ArQKj8zpMvuvKBTb4F3qBHKyDg+kmZN5n1N229HvZ7nMw0mRhK07uDhN48wLzWC3tqL5OOkHYANSczy/PthtdkpWW1T32k8Z1SvRxUWlGBSzdnV5WcHZszjzJ8rLgj4weX2zzvcDtu5+7/WUY9w0ui3Fw5Lqrc8RKFF4tJ3IyrHlLWinoz4IQSK3cpoAZATaX2eyDmj6kHFIHIUhYT0v4UID8zfwLeU4FdkhutSUcWhtrjThKT74s0FbPnFCbrutA4C71BV2HoyV17gbIZwsvNSn6QqpScAooR5ux0J4R4dX9NgZwXe9u8hqzAfULaHbOnIUVRWs05MO0cPeUEe01Hu5jwKV29O9QFE5Wkr18iGXt3ku+Jfe+uk4FS9YO7Kch2WKkIlF8yyYqZcbB9UY1JEdZP/4K5uqGN0LiV4cd0j9ta7n6xuXGyDPoofh/YusiywJWrjIFmdFEZl1G4ZjIA2ksJErc8sEInqwkx+5WoMqa++FMZZX77dNz+ARFXgPnlRwMe6JU5PQvaenpeJTyjN1GjbclwxUh6ACa4dPVl5yYppHUc4MoKUpoo2cM7pVNGt7zm92zqdy/fr+pCr3cucgpy+VwWoHLooc8yJUqSd/w+ERQxVx+S+BBUxe/AbgqPkt1KhR61eiie7BCS+U8p5CIli8N4IlPULRDMEdYx12eh5OBbojQREJ+vW1YraxSJbNYNLz1ewl+z+KeSEI+wBALjLsEeX++TlfiNsUoyOVbJaZuuYlSCA9e4DD1/tpA1iMQHE029iCjbSRpFBbOnbT4HdiIGKGuomji1cYJbiwko/zZmSyCU0nryItOFS X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ffddb9b-51b6-41e3-5655-08dbca4ffcdf X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 11:48:29.9277 (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: XbDuxK2PEd1skTdJpWKOMP9VKlZfuTH7YjXDIeD0CmbI9C1eiswAWOyg8LY/Pkt/gV8eBBJ3VLuwaTUvIK/2yg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8300 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231011_050300_849273_5120BB24 X-CRM114-Status: GOOD ( 12.11 ) 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. For example 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. LPA requires some audio paths still enabled when Cortex-A enters into suspend. Signed-off-by: Chancel Liu --- .../bindings/sound/sound-card-common.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/sound-card-common.yaml b/Documentation/devicetree/bindings/sound/sound-card-common.yaml index 3a941177f684..f43147c78651 100644 --- a/Documentation/devicetree/bindings/sound/sound-card-common.yaml +++ b/Documentation/devicetree/bindings/sound/sound-card-common.yaml @@ -17,6 +17,20 @@ properties: pair of strings, the first being the connection's sink, the second being the connection's source. + 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. For example 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. LPA requires some audio paths + still enabled when Cortex-A enters into suspend. + model: $ref: /schemas/types.yaml#/definitions/string description: User specified audio sound card name From patchwork Wed Oct 11 11:47:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13417247 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 65C53CD6E5D for ; Wed, 11 Oct 2023 11:49:05 +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=WFtQ5hCCwkPp05KUjgujtB7VtBpXjd7D53OECCF6oq4=; b=qmZ/r2C3QvBy+y OhkzM1z2LZcNvogiShcD/uHAOM/HpfZUXUxq1IiTQ/DHZ35lqao7zjtMPVHgd4KfLEkd24JG8ps1W Ziy83uNTwmCBL1fVVsV2wBt8Dh/VHfan3+NFaF8N7UZafVJjVPKYFBIya11HYcW1iwbu6N7mUc9NP lIBS6FJ17YpeLQqcTeef2gzzV6icR7J5WNUXWlnL0hgca7NPI/M5LxHRiUSpeaZ3kttzKTmgVEnhn b/HMWT6DMlS78r6t9Sg50m9pM8dDZrTiO35x+Qp1bcThdsaCnWq0aqf3/emk7nqYjhysv/0yn5XjW Xd6s/15UzyWIJ688uG9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqXhh-00FmQ7-2I; Wed, 11 Oct 2023 11:48:41 +0000 Received: from mail-am7eur03on20630.outbound.protection.outlook.com ([2a01:111:f400:7eaf::630] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqXhf-00FmP7-2G for linux-arm-kernel@lists.infradead.org; Wed, 11 Oct 2023 11:48:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VmoXBf3OCpagqAbbVL/nVrDYJDghFVd4Otz8sOhoeDBeaYAeenwiJXChbCtN8DK7ZW+7gsTy55/BTrCI/zVteL2Rmd79l5laVZUnIPT2o7sBTZR333gihmBh/PQDlx38A0Sz1MMYRl/GRLe7/U1NSJj/1ptykiDRJc7wbvMWU7eObJ6Q0NZybB+zwl8wc97XvoHLBL+YIWselul5uxKzS2LDrrXPP2yRg8jaPLAWNF6GfWrgAxxTsRc1fFYTlRGKVDvotwzmHtSDqd+bQaWslsyZccM/wROkD0tJe/FhWzhEYSHSpr+/tCW4Rg3YnI/68q+IWkLT6PxnPFlJ8GMadw== 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=JEyCPyZgpvDOSO3JuNyZDEiyTPUOU88DIYgf377bypU=; b=eDr0GOrqQbzCsSw+DE5ax/2yNCG6Q6DfOmi1WttacHLDJiptBGmmIRSyZHogVvHN96gqzARLkHmXj7MDvgg/YVEg4Q9sXVQzfTJ7lxfCe9HPc5guo+1gQPZ5aorO8wSgdoCefAGY9/nfeKA3YZ/9cGM2vtOgiMUK1KIjP6tYL1w6aHheELWC4gy8tgryj/RCUvLWMxF+n2pyWcnqrpBdzpe5BSgulnKldSCGE0K+vT8ztJ+RsYdiF23GKW4lI6VVHP0Ib2uBHPQnoRtRLAozogVBIZV0LHX42NPtoXhHxm15kzvGPVsEMzQk/zuHfFT+ydSCj0cop9o20hBovvOQZA== 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=JEyCPyZgpvDOSO3JuNyZDEiyTPUOU88DIYgf377bypU=; b=kVU1hys65GSu7GT2rjAqVgMaBkn54msdhiHJl0ojh/It0vcdhsOoKdUwdEu9dmJRHDmKl3HNkq5hnL7qs8C34MK/cMpge7p7Ebo7iBm9MlRMrEnfrECLNgqpVJfc+35Rldodh/KEOOZSIAf5e2xEb3Vcyf2m8WFZeq3JkCo26pA= 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 DB9PR04MB8300.eurprd04.prod.outlook.com (2603:10a6:10:243::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38; Wed, 11 Oct 2023 11:48:35 +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.6863.032; Wed, 11 Oct 2023 11:48:35 +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 v3 2/2] ASoC: imx-rpmsg: Force codec power on in low power audio mode Date: Wed, 11 Oct 2023 19:47:59 +0800 Message-Id: <20231011114759.1073757-2-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231011114759.1073757-1-chancel.liu@nxp.com> References: <20231011114759.1073757-1-chancel.liu@nxp.com> X-ClientProxiedBy: SI2PR02CA0025.apcprd02.prod.outlook.com (2603:1096:4:195::21) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|DB9PR04MB8300:EE_ X-MS-Office365-Filtering-Correlation-Id: 4aaf73d0-a7c7-44ba-f37f-08dbca50004e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iXGJYhJBz1JNhOEZrX1ZOZCrWmh3mEHeeZ2+tvYRHswluru7+9Kav4vEsakfRsjaxw4dghP9mSlo1pc6tuw5uJEl87Wqwwu62EDI+i7ScIzIToY1SOLLU19svbg2mBHO0p4HgD4YNRIdErEvo+CDAq/8pL0eotAnxcYh1wtR4YXRUOPe1WToeMkbMJgHVmagFUCLQ08os/8vXcj3a0s2TZ3uu8Rr9GKI8b1nkVNl3ozjAWvjVyM8EBbW3hm/OFyfy8rKBl9mf4VCvoYUJO5O5etjxnbYw8Bb7d+FaYKuOHpAdsredEoylCTYk4vhYm2EkTodWVTrxpEg0rtNqXST6NHnsErJoXwVhyQ4BrRKAEndaOaFJ4JOh/f2mFv3/0AmvecSyik5VB7JjkRHeXICV4H+PtsSm2a4bAOrR+nGGQoZBJdZutJJhekRa0sR5rX+TrObkBkao4QgXSRqSvjUKzDLksPmzdLLyshYEY4aNKI2HdOm5RdnW86JTff8vWTpMPmbGrZRMNY8Gc3LL9EI8dTS9DrWA7oSGoN0VNyJqUWoOe5mK2UNsbits/TU/adwdjaxT/gqa1n9uvA9kUFkVkrHDPiiEHdmF4GSg3IPPnR6iCJwZnYvvw6VTi6O0gP7x6P6YHUvBWg2HHhPcySLbqbxRKBqHO7EXi20wUgR370= 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)(396003)(136003)(39860400002)(376002)(346002)(366004)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6506007)(6512007)(52116002)(1076003)(478600001)(921005)(44832011)(6486002)(6666004)(2616005)(26005)(83380400001)(7416002)(2906002)(5660300002)(66556008)(66946007)(66476007)(8936002)(8676002)(4326008)(316002)(41300700001)(2013699003)(36756003)(86362001)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tT8uBSan+CMGGBbaQlBRmBodU8ItOjjgVoKimDg20IFS5OI29pFTPB7pF9JRa/bGj6IPEw8Ih2uosUtQ242o38wu3iHk6tVVWYVjV9q6alknzajIXshkXSwwLPNuUR5k5/jh8nE9u1nAUjNlUvzEfZXDfyAwLD1XpkYC/2FE+U56jEIkltrPkYyPX+4MN5tXFQMCp/ZMpwn0fSdDUqBSZcb66WK1TS5ivKm76H8mkbdvZdRnVeup3facm54lKI6jwtzFrKHUMELqH2/n0lFupqogJyyZrVm26yNH1mLnlQn6LTXOBe5jtIg0mmo3aThQLLs3oJpI2eeTfj7J5vJPTSTjNELNKlHfB2Uzx6IJXtIjIz/vkM2XOdiBhdXK9DEUiL8WGKLgFLmikAb54STwcgC3Er7/0uaNkE9Xsm0DAVlEP6K1l15OUW+uiIJAtcm21EBeD+ExD288/PWr+DB/DEiTQMzaZX0qdzKUQg90JUcaX4KvAuWCO+yzHxzDpWzNSBRIOie5ZMs9AYQtt7+1gQK2OSXhFjmd9agVGwNERwQeho6p8+YJEd224qG74/BNp0OHQBSAOu/DWejAvIWRLh3lntLhxVQ06zxgdPGcf8S0IPDt6VLNXHcZq7EW8FqEGwb9U3Onojvx4tyX395HlEt+7XsHQ0pg+EA4Kdx5qlKkOYUh6Jvva3cge26kLG7FKQqEq0mGzhcP9bICyHQEKMUyr+R1bzG9oC7HwAZFK9fyEKHOQeMtiuL8YJ6aObLVker0pjRmGW1n1HbRso0cgXfln48qoOb7LsIiGM5xodf7/3Iil+wr8I0DSX2fmnShBsIRMrQn59jDeIzfLpmDMDsCnG/7xfEDzfnwz5aCemuaBa+VQ1Dtxqy6lh86Ru7BAeFzNUAB/guGlqbpnV0oKBffYMOmztSTfEn9KjW9Sn+X2Da0QN8MKaJldKuYxRzlw78ARlEBqseaRzvcy/RyvObbEPXyhvTi+XE4SpLQMNFdwXZNojPYe0tdy3PdXGMAZpMBSWy4LCA4GVr5T6BUcBQHGUplW5/ZmL8YLGbh34LOBIHd+Jmn4UO7yHJP+eigk2OTMnH43QGsSxUr4vbCv0Fpb943SdUpziMEAnN0QQP+FxG1kKa7meGpTMuU/9FBETyjiZ9Im4jxmQQQI+YgTRTjFOR1BUVDhljaQmB4vpjgFmKfyspHOQ+rgSBxHQYO7FCHqkqGcMGfVpLHh26MHKU935cuX+4lfCOkhbtCWJLV9UodHKAiMecF80YTnbeJ/xQ62EfqbKArduczm0LY9zxgeoJb7/arWCOukOR8Ejg+KmbI9fJYk16c6q6jejYgdoHZdYxqqL+erXT1UiFpFAPPtZyHqXiHyjfhNaRcMXLlWeNM+4OxroOM6ixtab8STgYDC0qQc0a/pLRcCEHDFDfU/ts0TObF7g/6iJrK1H4eC0m0NKGXL6aERcfqmZRDwYKJTBEalzIZBk7VXz5rGZZ8gIF9Nc8FJMZ9LmsugMhCZnttnhqgZNJLEGvKuVQa+AhJtfzOWxu4oU2uJ5Fi4HTkAREgBepKIW35zbo2eSs/d2D1zSiJEpXbWUm57SYW X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4aaf73d0-a7c7-44ba-f37f-08dbca50004e X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 11:48:35.5959 (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: 2F+eTIYlGmO19vSLRM+9hU57kWWgiYcrV6QLTxVHY8rkXGJWwirUnima3FY/616fko8mbw89wSmbe1cjlOhEoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8300 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231011_044839_743148_0288A216 X-CRM114-Status: GOOD ( 15.36 ) 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 "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 a9324712e3fa..2c54c92fb911 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, + "lpa-widgets"); + for (i = 0; i < num_widgets; i++) { + of_property_read_string_index(data->card.dev->of_node, + "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;