From patchwork Tue May 14 20:05:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenwei Wang X-Patchwork-Id: 13664399 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 DA80EC04FFE for ; Tue, 14 May 2024 20:06:09 +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=UYa+1P4RSCBhCVCSxUC1OhuTzhUuguoyIRlYuaqRdoY=; b=CGK+HVJfgFzlv9 yPRJVCv4QoLzIWstuzKU8QhIn5TSjNAt6DET9wiGXTc6JrsPKJM3QoHIuWmcYBNqon1Noq2YgwMk0 aQ7tFHQ38aq4ov8rFvwlbgffdYM3WWGv7NVoKKWeOkfnbf16S2nCJ2Shvk/JgU1AYRdhzJlIuJ/t5 OgULA+mylpbNYLfeIfl1O/lptEa6aoI4ZsfhJf4NM59vW0PdOwOYo6nYao306ZcgvgBi9Gkzk89YI UzUL22iGjHWsGwY3sh/7Rv9TWd3yqYXCrXC5p2jLQAbNu3I1m6h9zFfSCugX2RISgQikAro/XzQON MNzh72m9NuTax4afyKOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s6yPL-0000000H2IQ-1OcF; Tue, 14 May 2024 20:05:55 +0000 Received: from mail-dbaeur03on20601.outbound.protection.outlook.com ([2a01:111:f403:260d::601] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s6yPI-0000000H2Hl-3I18 for linux-arm-kernel@lists.infradead.org; Tue, 14 May 2024 20:05:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WR37j9yO+H/a4CIwBoYjeTAF3TSmns3OxArDtvwkyqY5AAEDUCV9gNiyMinB71ItVWEKSWfclWTuGYRZRlu7IfVuwnl1HJLNyNonj0qzGt5S8MfsHyqDmJyJxNoZLIvsJgqHtZTBS+RAJnbTUQ0QksOeWhdZoFzoYSKPvm3/gcn4Av9uAjI5Q83VsTNj8Cw3qn/mpO/2QeO1QsLPa7NMSokfDqC93beeR09yBEX6jE+2rrgrGf3Z2sA7HKxj9ki7wEgt/426l7SE63qG7/RfkfYU34dNOCVpYfmI74Z75pDkoonNqIWqnpGCs+8tkpQ2lHKj4Y/V96H7l2Xu1S6EMA== 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=dWao8nhTwDMVhh8chAf/CwxBNxQaZzVpnpgp/+yTgTo=; b=FCVdZL9T5ZWBDsCmTN3cZABQryDadW+v7rcvkD9lxKe6C0Kbqz8EfLbKSENK6l/9+gxYu8ftyqsq9M+ojgjdZ4rQA9DB7+ea5qfmgghuYTVlap/InYacxywJ/NcH5YJRsYbbN5Xz+scFUj5AITl86rL24lA0+f0x8aisb7NtC2KTiEdHAN0uZ7jjK8AU+/3nQ9ANrSfLmVlRiRG5d/gvj5Ospxq0h9yrJJHUQh3v6ohs7rdh5pYCl8CIOqMPpX8QgqiTZrhEb8xzs4Wo6I0gtgOAGNGV1Nl4cUwjG8I0rTZR/amnxU3SP1wl9gSlKdTW4REuqmwWtDqAGZnMnlQ/Sw== 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=dWao8nhTwDMVhh8chAf/CwxBNxQaZzVpnpgp/+yTgTo=; b=qL2L1dBfiwDRXkOLz6VK79cCoBCOwJ30Mbe5N7BMY0LyFkPb21HXHz0HCahLC/JVCQndUetMXbS1wCr9lxr330GWuoUZzPiMOEkAc/DEGJL0efSfD0oK3UdIs2qP+39qgDV2TvS7TJYFBJZvBX8ORMoVcvMFIIiOc/VHyV14eFQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) by AM7PR04MB6807.eurprd04.prod.outlook.com (2603:10a6:20b:104::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Tue, 14 May 2024 20:05:43 +0000 Received: from PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::21bf:975e:f24d:1612]) by PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::21bf:975e:f24d:1612%2]) with mapi id 15.20.7587.025; Tue, 14 May 2024 20:05:43 +0000 From: Shenwei Wang To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Shawn Guo , Sascha Hauer Cc: Pengutronix Kernel Team , Fabio Estevam , linux-pwm@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, Shenwei Wang Subject: [PATCH] pwm: imx-tpm: Enable pinctrl setting for sleep state Date: Tue, 14 May 2024 15:05:34 -0500 Message-Id: <20240514200534.73847-1-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BYAPR11CA0082.namprd11.prod.outlook.com (2603:10b6:a03:f4::23) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9185:EE_|AM7PR04MB6807:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f30f6ac-972c-45ab-094c-08dc74513c4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015|52116005|38350700005; X-Microsoft-Antispam-Message-Info: zDth5/BWnXK0UjbSN42Hg4ZtMGjxBz/R18DS2INtycXj7mkqUp/R/Xpph17+K8nP2muCt1rXUGj5AYjVlMk3h+XXLght3/1r4nvvJY2KYr1tbf95XAenYCrQbmpYok7dGGAflBwa+hpElTN5j2slLZLL24tEonMPP+5dH7WHofY3wIfPahKrf1LqDwy5RNtpR9hpl42UzdF2nRa3grJmNdUdQtMYNIWIAAnxmzsvtp0ii9XzkFq8MUhgfPG3KjuB9ElQ6WuJ/JLj1ij7lHtF6Go6NwHshqnP7jePwBB2YPRe2TcVhX0yYYvfkn5uFTvCv/3pBj014LzXB6QXG/RJAWBNBvh148lar4eaWIIxMz/p3xNHNCXjsXbhh8OB94Z0Yv6c/kQBWbUj7+B6rZ++ugifiWlyYFsyDC+G0XbURhkG1DgdBjydZwwf1NT8rOZcLARmvaU21wqBDmdlT9X8ZtFPCsMyEAXoLGQYZbonZm0dXwKvO6ryMnoRgv+V0mqqwAJ3vZDJ5OvuQkexGgwEW5CKI3aXpZnEbM+xFj/NeopI/s8U0zaAgEOoZLz0MppVmoIHAtK4vn6P7ZnM5MReY6G3rFKI0WI4BSwQZZc364Rp4PjtzRAkrQGonOgz14i9LOpXoePZz2fhsQXBlF7fb2VJVtmJ6I/vHFU7wCfPSXvwofOCIP5AiKH8+j6Yw5c4OwaMF080VPyZOn6McgeFT1yeQzXxGUktS1X7yWtCHRHITvCbj7fthc+2VevhkDgiXE5U7Ggl1l2h3aaibOqqBYpyxxAODQEK9tR3zWe4h3pjjDpqPZ47E2k1l7+sn5TX5wkeNmjEV721J55ghkIN8sAbLIr1tkC75KTr5HKR0irmBr2wkCZDoG06tsEyWymBpwUrSoTenYCKnBUMN1cHt+dT5uJtrYUa7XHmBvuk6FN2MGLksyuaNAB///CCM3aLtjJudAy0KvfIyrgujBv0oUgB0ov0PL/yw6DECkBQ/5TXI0XDGE7MB+uoBMCmjiHyfVqzpQGiQRxi8YOGz+jIu/qWQigUu3QGUENeRjilLZhZTQmX4ex+Bx5eIcmYhOX5aYfutYxXGrBaPMJZYb9gOfF23vwzHYrXxgz2AvUF9LPVf1KtqruKwkLiDkTHRL2T6Y8xu1HXMd0OUSWRxEAy8xu6NOaAuG7pyJ2pKxNe1KxaOToYtLn9NAQs5W/5YweeDABIG4sYoYjS4vRoC4haCGHL6vWDxJ7c8rXWOmspAVXBx2FKC+NVUc1knmAxL2UNtc38/LDKXBv+8DsoYGVFC5dXVSC/kXW/xjVidxPWATXtf4zEA4d9cbh8DCkqEvTJ5Qet1atRTXjrN3fOXCkxwA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9185.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015)(52116005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mXvauGlMbZNXGMSevn3qpjluXdH67GcMe9kuA+SqjHR2QakWBTRkPRaRUwljEbHwdDz/DBT1lUw7bN8RUZ8B5FbJm9fIjBYRHFdv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E032/RJJRuAAASnQ3RPL4R2J8H8+10GXhR6s1P2ArsMuqnxOJwp/FFYGSMBw4mMLFZH8iNBb54cDwq3WpPY3LV0IyB3ao5bQU32eJXcMUlqKFFSZYPJMgkKeHRvhSX33Bd8wPpHPeEbqCfqhDRzWTwe7CJ+lrY8Yh3ZEh6h93wLgFSX+CsTrkXChgqsmFXobGz0WjBs1YX0pXZ/IuIq3Y68z2Lo9CNGo50FyeNF7xuBXd0gGjd6/DqorLmEIknkQJdZwsGdg8SS8CMvmvOCxPYyztNdufMFxOBuJ87eeGmEnggm4CTFPAAywDxvLnSHK+3bSkvhMdJ/gHQ+myPAoCqv00NXZOVnb6lnJTq5SPkr5MeyjXl5EooxpIuKwGB0Yqx+LqceZrwVvA/dIfMg8ruUqtidCQsMvSrPsgbXHL X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f30f6ac-972c-45ab-094c-08dc74513c4d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2024 20:05:43.6329 (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: oq2h85W7ZzKmUON/dli/p7JUb6jd/7lzqhSArfGCyxB+zIBaxmuyI/KK9l/rbhO+GhbBMNjV+scfUW0zgKizrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6807 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240514_130552_912299_BA52A909 X-CRM114-Status: GOOD ( 11.96 ) 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 Apply the pinctrl setting of sleep state when system enters suspend state. Restore to the default pinctrl setting when system resumes. Signed-off-by: Shenwei Wang --- drivers/pwm/pwm-imx-tpm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c index c50ddbac43c8..19245790c67c 100644 --- a/drivers/pwm/pwm-imx-tpm.c +++ b/drivers/pwm/pwm-imx-tpm.c @@ -393,7 +393,7 @@ static int pwm_imx_tpm_suspend(struct device *dev) clk_disable_unprepare(tpm->clk); - return 0; + return pinctrl_pm_select_sleep_state(dev); } static int pwm_imx_tpm_resume(struct device *dev) @@ -401,6 +401,10 @@ static int pwm_imx_tpm_resume(struct device *dev) struct imx_tpm_pwm_chip *tpm = dev_get_drvdata(dev); int ret = 0; + ret = pinctrl_pm_select_default_state(dev); + if (ret) + return ret; + ret = clk_prepare_enable(tpm->clk); if (ret) dev_err(dev, "failed to prepare or enable clock: %d\n", ret);