From patchwork Thu Jul 4 13:21:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 13723743 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010026.outbound.protection.outlook.com [52.101.69.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 986B21AEFC7 for ; Thu, 4 Jul 2024 13:21:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720099293; cv=fail; b=kROd2gTO182pjJ4KYAnYFkKXnYw3Co+w2IDTD7ffu0SqcR9yhWn2Bv8pqdfSYMfQSeWoULFdCjPHT6dW+VXfz9jU568so1Pv5XEh8FrluToUNbn4CiBHjEZOjEnFP7JL0PRUhsyUk3PTiRvionU6gPPKEtsDXqWiMLQTGvW7RQM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720099293; c=relaxed/simple; bh=DHhLXjxTs+NypUB9/UxERUOxX/LU6zaGoJtJE21AofE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=t2dMxqsl8yrBF7sKtwXvfiIWeKiWlfKEL7OTAq04npg+4qVS8vpcpQrOPz/PowLhCPGfs3szt2O/QUQ8k5OdHTUf6Aposp3cEp10Zeb6XBOj4OnvQMOi0orOTLg78BLN05OS+QtpBgpkMavbAKK2SwgbdE0hDXfBLN+rsy0fSj4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=gXCJDmMM; arc=fail smtp.client-ip=52.101.69.26 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="gXCJDmMM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eKc2gnVbfWzChcVdz1MOUzt0RlTlR8wpK6lMZ76VItQTF/sOLBysuziX2XOf2h0eY4xC0/+h5sdyLq2DBYHeqbtyMWDbTWIA2vyLSCWHYr5ds/nY2ufQsHZ9nCi70eT3fPXrgBdms/pheFouKVDCoxFAlPaogqkoCTKOg11tJdraZGeANxSHoUypAa4mIl/03j3Jm2B7CC7OXIjaWvW7/Ofo37UMAY4N68i3kxU+0S/7ngClbIO4mVBw4vgzN9pFhslGaxMx+wGUPBT+xcCSVfedgHeyNgY/JUavGA4zUeZipLpGyCdPL+BejlH8qkWgfSOZDg7yYHgOYrcfHI87vQ== 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=ie0YXJX2Bvg4TKelBnye9VZQ0FcISBb1iXosv/lsNZxfdWMV6OoWV2aSo2icI67Ci/BOcRxab93+48GOWR1QH03DZE8oywX7j7sb6QlemTl8aO1DsnviICPkxpDsG9uNA0LkTq5+YnL4j5pl9Xc1lI16jJEWfwmwpxRicG2beinonUMhRiJ/2NO8SblV0w1xf3tgiV3cTUQXSVObBAdhT84SVth3lk7Kr8NHeBkEUpwD8iVtCP8YEyZTYSU4FEPDBEwybL2pkQw0aWFBHaPRu74BkMNM+A2IZjDlfHMG97/YTfDdd8LCUa5zFgzKQQq3dg1ib0B8+454K1X4OsQRAg== 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=gXCJDmMM6Fec/egtK4ut1osJw0SucdoHs99IqErtQyx1yOUqc9NcoMi7PI5Mgdpbu30BIxc8zeRhOp7JwRy7U+lg9u+QbZquftvoBkCFdMd9Tk8fewviowbK/3WyizPZttT9BODSRiW6IZ9w94tKARqOr26suf9TstzyWxzO5to= 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 PA2PR04MB10422.eurprd04.prod.outlook.com (2603:10a6:102:417::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Thu, 4 Jul 2024 13:21:26 +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; Thu, 4 Jul 2024 13:21:26 +0000 From: Ciprian Costea To: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Haibo Chen Cc: linux-kernel@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: Thu, 4 Jul 2024 16:21:15 +0300 Message-ID: <20240704132116.2865864-4-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704132116.2865864-1-ciprianmarian.costea@oss.nxp.com> References: <20240704132116.2865864-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AS4P195CA0025.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5d6::20) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|PA2PR04MB10422:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e41fc90-fb7c-42ed-27c7-08dc9c2c34fd 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|376014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?IqGIKIHM6Q4mL31EFkhZ5OPLYSZRvTn?= =?utf-8?q?NY78E+6/QaljOssLi8KBKFKm/XuqQwOTBUtF7KmRcHhmWGjLunyRY1dltaRNY6biw?= =?utf-8?q?PjspaecDw7DimmyMbt07Xh4t7tek7VGnpQzmuZ9uc+WG8J+VE6S9rQ5/Tshc+Got4?= =?utf-8?q?2T54tQeHHj1cCtkgI5gSLqMdEgEEHoTEm5ufkNIEv2uMwrbI2kNYo6jPa1l+RBldV?= =?utf-8?q?QFbYtBUGnT6gTsG7knP5e/zVdeRV1uiuQtl4kVFxZ11/B3Agu0zfwPKwNKgI/6vbl?= =?utf-8?q?YOz2O1kOIOJvJPvZJDmWOk5nD+NK2a3EQ7OnPg5orh9m25O5AWZ48+zePmSS5v2K8?= =?utf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?q?W7XmNUlTyWaUPJmhp0f/HBa0yj3jICOHgY+5GPE6rLGmyP+jKiLD0uHMmDXFfUVC6?= =?utf-8?q?1wtqX9tjdavw1CfA0xhTRQybj37WPaZ1Atw=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)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?BJ+qdG98qnxBmsN1giQcXeu9xY8p?= =?utf-8?q?SfybOPouTT232Eqnka4UvvvzNaDdiSHbaJCqBVt2+0f8xQID4OQgho5eOgmrYNprz?= =?utf-8?q?chDtlU1ba08vY4WxwZIUG4wbZ5IdogJ8lNkt0w/XHJscklZB528b+x+4YYukVo/3r?= =?utf-8?q?oQDmivfXyL7OHeqULVo+YRyfLmcEiOpDN8KyEpcbRwpPklSScReLZqcNPLGV1sq91?= =?utf-8?q?Jmohm4Lc2SV+vRrXdVvWM/3RYuFJ7JeFHY/T/tasvkgcgGhgFbpX05Mwv7/auGXEY?= =?utf-8?q?i5CUo0/kRCqQNYG3Ywe60HN54VhD2g+jwPbe4RSNY2qj9ht8YXc3KD1jJEXhZuXoY?= =?utf-8?q?tbgpKszoeOlOIT3e4I78N363JtHNce2mfwsu3I5QDjjCRrFrf1D5vOQ57X296CFYP?= =?utf-8?q?M18HqaNnyUwld1Z817Z81txKZ7QgDlWuIHZh5x1OMm3wEMSCYq+YdrR0IhQAqa6qf?= =?utf-8?q?Wahli2FVvFcvGWXyC8/+hASKazSpB3JTSWt8PGtzb6c9ciOrWm2O2B5MvaBaooPRd?= =?utf-8?q?6OtpuaCmxpz0QzvNyf0skec06vyVe601A5S3qDtS9aP8PqoGsgWdJ8dDQfvYdy0NL?= =?utf-8?q?Ex69KTzS53/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ucujvPWB0p79wb3ob6Na8raBxuQeVR1BofhAw+rvxee08cwCjC9ARSnAH?= =?utf-8?q?YY9ZSartKCj4yZ151a0pf5w0fxRVCHlesA=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e41fc90-fb7c-42ed-27c7-08dc9c2c34fd X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 13:21:26.2563 (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: LeAFio8L14y3KPezoaauJSbRPsZGiNaM5r1NNU6Lcft7U+gklvJl1N8Mz7szJOllPioxb9N5Cg8o8FlWyUiIcNe4Nf8m+nxXzWKVfScP9i8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10422 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);