From patchwork Fri Jul 5 13:46:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13725181 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 C0E0DC30658 for ; Fri, 5 Jul 2024 13:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type: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=pualSqx0gdiGLDlFTYGFBmBq39trV+/C9DQoWAo688s=; b=noWrLg6tXmlW66+fDmN6XlMH0C YegDFJujRGMp+jWv7e7ysxSgAr2ZiWc9uc9xDPquNZA7/CspwhyljZuis98jSnqtVgvcbJMNi+Cms yiK82koDoLN+/iX3bg1w9XUPwSoxBGTksfLwe9A5RayWOzKxNZ3pFUSLrEttwi3iucWvJ4PJ3Z6Oe F9NMj7UwhQ3O5Rs/myKquJJ2sV4ot/He9mIEDnjMP56iCsA4PKcV1hANEszzT2bvKYaO62yriEn0M cPyqf9/nM4foyxqPPGjP88O1jDMajJaYKLCo/UwS5V2ZK9G2yb4j99yXoFGxI9Px3EZxmS2qq5GV4 p93sQRCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPjIM-0000000G78l-2iwj; Fri, 05 Jul 2024 13:48:14 +0000 Received: from mail-dbaeur03on20600.outbound.protection.outlook.com ([2a01:111:f403:260d::600] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPjHe-0000000G6ss-3FdO for linux-arm-kernel@lists.infradead.org; Fri, 05 Jul 2024 13:47:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T72ARCGWlxNelJ8EKgHR3PQ8rhg0E1wLvNfqBdi/6FiJkAI8z14ZLdOA/H90bL5BmD7KXFVF0fal70DIgN0xZiyarStCnI0j5OMjSo8it9MJupZdWZbHqIfSq/xY92hMD0ll/haCbsM7Y/vQC8/tih5vf4biz6Jg4iTQWibwspAC81qqSKkHQq3nG8PXvKd8pxsyWFTY0g9+GDMbkQBAqS6OnUVyUZWWlQaimkyak2xLUBEc4OltTbditn+uOlXQAwWscTudTvYp+D/yZUl4t19A9iN67scmXDvRLQa6eptjlGz4t+IsPjXLCABJQ9ag6VAmYXbP4vZY7j/msy0QuQ== 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=pualSqx0gdiGLDlFTYGFBmBq39trV+/C9DQoWAo688s=; b=bDQG9eOGEtArib/7Aps5EvxZ5vjA+8NV1avsGYRqbbsaOhQrxqKdY1WFoNXzZkCCDNwgHoi3JLkIRf0lTTLTxmFmkoX/f6rOHlYfGj4ejgNPdSZP6evuqSYhva2qxulpU+rzeKKArmTGEU1fHLdI9izs47HaTh9YYUa4wzgf0Jq7Zp0QNnfQIr27eoCrWkTLVcBYHd1RZhbrJWCd4HlHZzCwOhdEZ+5p954+EnchkXHSelp9WtQBSykTDWUuz7iRDqumxgVXqWHoCvuzBn1Ka1v+8Dy8A1ligFziDyY+nfbEM3tYBwizKij/u6OzKJLTyVZAMReHSgCFLDITnygtAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pualSqx0gdiGLDlFTYGFBmBq39trV+/C9DQoWAo688s=; b=CFHpWrSCqHmb15J2m5hkxChr7/dXOBbPA+rRlcYNS3Iq6Y8zecLxanWP9vM0R1FB0oPdhv5ljkPy989n7FaGjA2AiPwsqm1F8Kb8Tws9kONOMWwHpnDiR23Ele1YFWctZaMJZ1dcC/1/8URTY4Z0IZmz6RdLlwDr1jOMnxjedUo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) by GV1PR04MB10244.eurprd04.prod.outlook.com (2603:10a6:150:17b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.30; Fri, 5 Jul 2024 13:47:23 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%5]) with mapi id 15.20.7741.027; Fri, 5 Jul 2024 13:47:23 +0000 From: Ciprian Costea To: Haibo Chen , Adrian Hunter , Ulf Hansson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, s32@nxp.com, Ciprian Costea Subject: [PATCH 3/4] mmc: sdhci-esdhc-imx: add option to not change pinctrl state in suspend Date: Fri, 5 Jul 2024 16:46:46 +0300 Message-ID: <20240705134647.3524969-4-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240705134647.3524969-1-ciprianmarian.costea@oss.nxp.com> References: <20240705134647.3524969-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AS4P189CA0031.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5dd::11) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|GV1PR04MB10244:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e69419c-1c03-4325-f445-08dc9cf8ffad X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?7Jey+Btje8QgfmW7Xl3xAAMg3XufImV?= =?utf-8?q?cKcjRyX8Rqb/50k2PdNTR5oQZFCMvvAEq8hfnRw0f9FqsNYUB2Cn99E0tFDrntgXA?= =?utf-8?q?yxTH6YOg/ycIb2SffuvKZ9jMuGVBKrdU6lG8W2AIdd2kHA7dT0NS3YAgyGbica58A?= =?utf-8?q?GzSLZkXbSp93Fgmgyb0K66DAskQPIqSypPOA50P4GPDoWmEjGDKdTRi8KegxA9eGl?= =?utf-8?q?jB/aluD3GQff2nMgmpquTMMvugbi5Ojmd7dc7IwYRCjmut/VOeopAKQGcE+9sON+P?= =?utf-8?q?XW/nLm1wyuYV8Waxh+UZ16Rqkvo12X9z5AKWxLAy2OzIZ2+cs4y3atl4bipxP0+nc?= =?utf-8?q?ju3N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rl4TY6cD9jXtJQaBT78yhc8ZPaMo82k/V58xgbaEeTj4YX?= =?utf-8?q?UHlJezHMszsYCbVqWXDnf5mwdE5JjKNq7BA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9251.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?XAR/iarg2wAG7lBE0i4RZ4oSILGT?= =?utf-8?q?VMGrn98gifBYCX59dpvRCmXnVCLmpMbWmyfuG7VHD5TkSBKGpe0O8mrSQ1KvTIxio?= =?utf-8?q?TSHUcL+NdspTOsfTpXdYj/655gVczxJYeAaO7YQUg3/Ki/qgeov5bl3iGsDv7WV2g?= =?utf-8?q?zqI+4VbO4OG+kzqBxrWocGDC0TVWi3s09yP62wjBxOEaWVyBs9kZm8iQNn8D5hCA3?= =?utf-8?q?NVd13vWk6z5nVvOtWdl7Z071ONq3Mu1eP/3sVoODm4yNMTHo20f7yGWjJ8qxswBgr?= =?utf-8?q?f4WdQ2DDeI7Ntl78kfryNZ6nN00zx9qgl4IoUx0uY+k26xnNBfsXsfQ+uNLPIzghX?= =?utf-8?q?pOmmxTbQQQZEyIXgc0dPtCTDt8QLCN4T1bU7IODt6HXl6rGmLKGs2MeotX4UkpP5v?= =?utf-8?q?lUHnRoosEVTcBq0XuibcF0/ugRECXFip6aT0HHo9a2/b5LUuCZixhKexkQrVbQS70?= =?utf-8?q?C+yyE3pY0UWMSYiOsSo+yqo2fUTedY0GI6mnwLFDyTTGnGrctJZ4GmDhO7cc9oRnq?= =?utf-8?q?j6IKzKJDqqnPH4VMlwBGksuycC9MpqBONsT77jcbbR44Ckv/9FOuzv07gj76wKo+s?= =?utf-8?q?CI+JIUlqBkundAY4v9z2IR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1zqy1+sb3thsNH2IsDH7SDO6bkuuPajQVgSlP6SLURR25aJDqdDct?= =?utf-8?q?bcbWGHMDEqRt5nmSYUGFCCqrNObK/IYU+A=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e69419c-1c03-4325-f445-08dc9cf8ffad X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 13:47:23.6643 (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: Dqc21iBKpbjT6eEJ+LsQGgFLBvKIDS59pzgpLOzfNEVdOmYORFEZUBzxGMfSEPvgS69XXGO7BZ/xba6V00f72YebqnQbEDXrsyLAD8LaD9I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10244 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240705_064730_829382_9A8333F6 X-CRM114-Status: GOOD ( 14.01 ) 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 On some boards such as S32G based, changing the pinctrl state in suspend routine may not be supported. For this scenario the newly introduced flag 'ESDHC_FLAG_SKIP_PINCTRL_SLEEP' is used. Signed-off-by: Ciprian Costea --- drivers/mmc/host/sdhci-esdhc-imx.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 8f0bc6dca2b0..c3ff7fccd051 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -204,6 +204,9 @@ /* The IP does not have GPIO CD wake capabilities */ #define ESDHC_FLAG_SKIP_CD_WAKE BIT(18) +/* The IP does not support transition to pinctrl sleep state */ +#define ESDHC_FLAG_SKIP_PINCTRL_SLEEP BIT(19) + enum wp_types { ESDHC_WP_NONE, /* no WP, neither controller nor gpio */ ESDHC_WP_CONTROLLER, /* mmc controller internal WP */ @@ -301,7 +304,8 @@ static struct esdhc_soc_data usdhc_s32g2_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200 | ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES - | ESDHC_FLAG_SKIP_ERR004536 | ESDHC_FLAG_SKIP_CD_WAKE, + | ESDHC_FLAG_SKIP_ERR004536 | ESDHC_FLAG_SKIP_CD_WAKE + | ESDHC_FLAG_SKIP_PINCTRL_SLEEP, }; static struct esdhc_soc_data usdhc_imx7ulp_data = { @@ -1884,9 +1888,11 @@ static int sdhci_esdhc_suspend(struct device *dev) if (ret) return ret; - ret = pinctrl_pm_select_sleep_state(dev); - if (ret) - return ret; + if (!(imx_data->socdata->flags & ESDHC_FLAG_SKIP_PINCTRL_SLEEP)) { + ret = pinctrl_pm_select_sleep_state(dev); + if (ret) + return ret; + } ret = mmc_gpio_set_cd_wake(host->mmc, true);