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: 811351 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2081.outbound.protection.outlook.com [40.107.104.81]) (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 1A2F8155310; Fri, 5 Jul 2024 13:47:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720187252; cv=fail; b=R/VrF/sdXhv3sxup4GlOvqy8PUVmndlxcg8FM4KGt+a2ZNvkbOfWqmI+ltWUdBqDK+F33iHGNmIuAuOBIcahtk8KkcYD4DCzp1uKSudwsbLsMESFxLQPBqHSmvvKOBJTdOWm+9QzoJqDEGTS5ERzuop/Ph7ilqYzAeEUU7NpFsw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720187252; 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=StZEsPHXveqpgUtzBzGu3lOiWdgV3mBS5VnGfb9wjiVyd1EBzMX4xSaKy3wGpBF5SiheDn7bcuWN5Zr7MqUlBhQS0wAiwRNIP0CALSL2BE16ZElq70omEeVBre0UfIMaGDR+AqYM2fa7bll4S47pYr0op68YdZzoZIbh8xU9yTI= 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=CFHpWrSC; arc=fail smtp.client-ip=40.107.104.81 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="CFHpWrSC" 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) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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+UZ16Rqkvo12X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IK3eICJjG41j4EG2bqobKh?= =?utf-8?q?/5wF2tbk/vAVK+Ek2srrl4TY6cD9jXtJQaBT78yhc8ZPaMo82k/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?j6IKzKJDqqnPH4VMlwBGksuycC9MpqBONsT77jcbbR44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G6nSTbmf5e2n79Z+iNbRdK/+3f?= =?utf-8?q?vrHE7EWB/M/K1zqy1+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 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);