From patchwork Fri Jul 5 13:46:44 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: 811352 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 D28C714D2BD; Fri, 5 Jul 2024 13:47:26 +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=1720187248; cv=fail; b=SitraL5s1zOy9to9lGptgPEyeJxXPhKHcSSH2sGpqSMnvclVddMxLEmM2IML8yf8huslvfGRtVG1L2a3sV0/KIwC9tiUJAq+sq5ksgOW6y3Ew1D0nZEjgl4F06F8OWc2su/rEBbbz4OS2tkbgDYZC1sk0rJEV5+YomV9yerByOQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720187248; c=relaxed/simple; bh=WA3wpQYMiw+SuvwzzQm8hfOQzI2ldcitSNgjB50H6Lc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=fwG5pQdM0+9PupmUWMNICoMlpNk0jp6xKWgy7jR1eETKWBLzIMMOR8p6/nOLrRB4zSYfPhkxRpIxrQcqQnWL4GN/8lMhrrHUb01TKA7BjeVVKpYwWkm7MKyWlr5F66V4y8ttQOFfol68i1Wc7vuftEHVuqRBehtqWxAEddrvUf8= 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=WLPu8z3s; 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="WLPu8z3s" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lYfpsC7WdcCcxAbFXc6M3XF92GM/6VXvpnVmBK9/DXmqfptKGWL8nPp2eWdws/Vk+GRAxUvkXNjumv1uGO7tNDGHwnqtFbCB4LZ9GQILxRDmNsU+beehR3BCjtIr5y7w0c7zXJCSqw6LdU8knis2YvRkEZNhFDp4SC3y0P+zPr43NnZnSm/PTdJiFXDxah2pNFZTkshQG3SeOSVQQIwKmnZaRXhy9EQztM4+ZvvH3VQ5TG857KieLYIYPGmJYjI1hvVvas2/coxdOISm/ZA4s4KBCTRhEozE2F0v1VMVhkS2y5XToP2IJuLeZV+wgWt2FYoJnXxaragmQX/CFAwe7A== 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=GqXn2Spewu7hks/6PVU+Dt4N+nV0Zeg0eP7GR31+71M=; b=nJ+1fEKiSWsJdRHtzIaW30qygfYyIdjkf3Zszo6IyXEFSvuok7eWIkEcJXBv7hQIdxfY50uQ+w5ZKt8issnGFKrbvNfSrrqhhq7aezxedw/BjA7iFd39uRdKhF2tZ6wc+qOKNvsc+uAy0YkeVLDE9G10b6Nyih6UMCboOVT6gTWgIIF5CxEESAxqMmXaoLiJr787LGW3cMLAg6rpbivbdpadapyBYZv2eX3tngUxSiaUuyUl2Fdo7fmgibuAAU6CcJKYo6BiuhOzKEIlgIPoxb0GdcqOK8Ceq5DfFul0QQZS5TQEv+X+88tuundAsR1tGSQiauSmdhobgDADdRVDdA== 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=GqXn2Spewu7hks/6PVU+Dt4N+nV0Zeg0eP7GR31+71M=; b=WLPu8z3sC1GUqmGsuRULbl2yguAEtWHFhCx8qwDis9/AKOIte7lLj1ETGLaER9QXqiQkYlBribj4gMo7R/IaYQ/34yb4Om2wgY9ylR053hJ9TJ+vxOsBiVTd28dnmiqpjWpgoRJE1pP7cXTO0uo/o6hySHrZOFnI1J4AU+DnDro= 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:21 +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:20 +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 1/4] mmc: sdhci-esdhc-imx: disable card detect wake for S32G based platforms Date: Fri, 5 Jul 2024 16:46:44 +0300 Message-ID: <20240705134647.3524969-2-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: AS4P189CA0033.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5dd::6) 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: 05c9e5d8-9f4e-4f4c-e42a-08dc9cf8fd7c 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?GnIoAFTnM6t5Rgrj3HCXlSt7IGIWJVF?= =?utf-8?q?8hgEII8FSDOchun9dd6aD1RuvMP86kVzOrUPoJb6DYazo6JV91QY2/vh2Xb7v1aPx?= =?utf-8?q?eWEGAfFAwH4L+ftMsWVPNqpNHcKWNX19S9dnrWVBT4RQTIPFbKsfW9Az3mcaf7FXE?= =?utf-8?q?colqB+uJhfA0WcFrJLiX5K2N7BrRKWRkPTOBdpqPcjp4hLYaMg6ImVH14A0PqiKCG?= =?utf-8?q?6GlF7/53SkQB/tsZhOsoO8tzfhkZJwl0yNRIxl/wc4dEcddZkV1l85qJTGj9KKyqh?= =?utf-8?q?z9KpWTnpHky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QxP/7V342NpMwcuq5TY/TzXNtggW3QjzHt56/g8zX6saEvCG+u7psqm1GWnp?= =?utf-8?q?0xKA7r0pSGb7bTE8EoEonEVKoGrsni0hK9ehlzp6hNz5B6qDr27JpcdgD2jqq3jJh?= =?utf-8?q?gzPimfH6a/JvpFBam3X390Hvfn8GwLzcL0Q=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?wanTVKzn+qMhSBHehZiWY8+seIcL?= =?utf-8?q?UBpCp+B/J3f5a66a2tuQMtIaon6rCW9m3NsxNe2PcaeG9T+QTrMA5H0BgzDXA5QCc?= =?utf-8?q?FCJIxYXadxI6HFZueEK4PC2xsqiK8pNzTWbelnryBzs2fKNZt58gEG0oLU+jW1w1t?= =?utf-8?q?pyvOS1Kx7RJUOYFudkHC3UnOLWCAg/HlWOy5cHRZO3F79svDxsUChI+ldiDsFaPgI?= =?utf-8?q?dvhTjmi2uexyOo31TrVqUAjaFq1HhBAuU89eeTrk+Z9UgC1hsvD6GSZlsxroPVZn/?= =?utf-8?q?iKlw3KnHx6VIk6CTAVLl0bqIVoYMGyw5qZoZkVV1m14Z7FbtdQIEFHNYMhF+eeLIv?= =?utf-8?q?hTz3BCom9c31LCJX/9Hz5hGq0aVrjvpRo7TB1U1Crn0Wkw9KYzTSZayGrR8jQEtY1?= =?utf-8?q?9fGSZBVEtyocmkv+sEErQ3dW+RayV5n0P4iwpY+AZk6PzeK7lBTLBUQQ3nMARt5yk?= =?utf-8?q?K/Q8WCG3+37dX7/wFvvGEkRawUASackg1bUPr2sGy0ddSr+yC3IyJlUmG0RGxzaJe?= =?utf-8?q?WNY3m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SDIaJyDEkWBu7Ztrt1IQrc+Z+EhUV9YtQMCHi75FPF0EIbJkFBzfc?= =?utf-8?q?3rC97z0AKWADAooM1C6y4UZchtkEGK32aID4zit4uIM3IDJNDvjfijgPNk+S5+4Z9?= =?utf-8?q?faN13VDq/fdozbjXX7IxsVgCTN7Jvbc9Sg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05c9e5d8-9f4e-4f4c-e42a-08dc9cf8fd7c 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:19.9254 (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: YVOlZxA7dC56B8CAMjFRQatOyd6cvIDzpmXEpQv3kfkwv9DBMAmd/0XlbgGDOiYt0ZEfMDT2+slZ5tHSqlR+sBYQh7Tg+wIrypNZ1FwDz6k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10244 In case of S32G based platforms, GPIO CD used for card detect wake mechanism is not available. For this scenario the newly introduced flag 'ESDHC_FLAG_SKIP_CD_WAKE' is used. Signed-off-by: Ciprian Costea --- drivers/mmc/host/sdhci-esdhc-imx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 40a6e2f8145a..21d984a77be8 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -201,6 +201,9 @@ /* ERR004536 is not applicable for the IP */ #define ESDHC_FLAG_SKIP_ERR004536 BIT(17) +/* The IP does not have GPIO CD wake capabilities */ +#define ESDHC_FLAG_SKIP_CD_WAKE BIT(18) + enum wp_types { ESDHC_WP_NONE, /* no WP, neither controller nor gpio */ ESDHC_WP_CONTROLLER, /* mmc controller internal WP */ @@ -298,7 +301,7 @@ 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_ERR004536 | ESDHC_FLAG_SKIP_CD_WAKE, }; static struct esdhc_soc_data usdhc_imx7ulp_data = { @@ -1726,7 +1729,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) host->mmc->caps |= MMC_CAP_1_8V_DDR | MMC_CAP_3_3V_DDR; /* GPIO CD can be set as a wakeup source */ - host->mmc->caps |= MMC_CAP_CD_WAKE; + if (!(imx_data->socdata->flags & ESDHC_FLAG_SKIP_CD_WAKE)) + host->mmc->caps |= MMC_CAP_CD_WAKE; if (!(imx_data->socdata->flags & ESDHC_FLAG_HS200)) host->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200;