From patchwork Thu Jul 4 13:21:13 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: 13723741 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 628931AE87A for ; Thu, 4 Jul 2024 13:21:27 +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=1720099289; cv=fail; b=rhqicZyqIVuNEDlHO1lS///f/M1CB8PwtLSxzk5C2l8sEOF01pV84rDDyHGugsXuUyLRW0y8lUkSKlgTod23ssZhk/GLOEQWvK9uiy5kcuScHgf0WqRpX1fwPoYHKojjwCTEU8yssKi6X+ZcTdDujElhfwN0qnWN0SP0rR3HgCs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720099289; c=relaxed/simple; bh=WA3wpQYMiw+SuvwzzQm8hfOQzI2ldcitSNgjB50H6Lc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=M+dj3VWA2tfw6iTx77Vs/wod3yTGnnJ+RNKTkZSY9bFc9pSu66krd/MAh76M7V19KZ2pf9X2nPW4ivwh2qkEVBVffTEo/APDSDxzHs9uSjbPJmFF/w58C4mX23cPw5MkTA99BSWvH5c2BzIHIWpnhZ/zidG8aYp3s4Kl2vwktx8= 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=SiJpcBEw; 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="SiJpcBEw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oDDwk+4j49Ix0KOlMfDRB8AD2g+U+sUlzxfsKrHFykuhk0WzYzb0zbdQfSKbNdfKWpsef2mrktcBG0v35IGlMSC0ilXNM2JESKqFHjUQFdR8Rifhj3O1UaEN7TDQJOZ9ijq9p/6BTADV6BMQlolAJUtWVxyjiIRcaLwFCVnQiv+PIn+HFgA6XTGUm01HjAQkISmYp+2CkwSBoDRaDCLEy/9TAuJ3jxFMHcsejR+jF29M1IZ1zcaCnFjE1HSfIGwcBZx7kBhLd5dKX7hE7nYsqb6d3iW3/qU8B2s+dyGVYhPXvQRegwGlZieF415HSRQUjnwj7DhBa7AF2gyFPEAIvQ== 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=dRwIt4ZeXwzJn8aZoIkr17oa6XI2OAidqnws+z3tPw7NxUAaMaekn1foNApzc/JpJbEEe3uyiW6RXgc5r9NDzEVRyKId/IiRnndxSld1AsMk8l+y8kR6M+y/jpHP/r8ZjTR3z98mp/r5IlhvNfG1FyOpQOtcEXc29/B9JFvGMRqzzjm2ZfjmCxlzcy45f0Vag0JWApVEDE4rFObN8CebPeoaK4nxOaXYKZ8mopdKZ0bOhKo+jBrZvBFmVBEbJSK1/MxmllR2l/F9PYt/SD2djSO1TxwY7vSQzl1wFtkF+z7daIUlJDUppnxyWiX7UMK8PjXwNESNf4FRT4f0d6FoMw== 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=SiJpcBEwoKeL4rjAKo0JRxE+muCw0pCPANCwNP64JF6Eg0P6coe12ZN/pPgmk7Pj9Zi2VtzGx+rxOKZp/OFLYiOYLkQJdPMgyZXGD2iXO3FxFs7Zwx6TjCxAyiMw8wwQlfCZQQ7F7rW9H0+tof8kYLYT/qw1pcivA4x9sh2L3KY= 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:22 +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:22 +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 1/4] mmc: sdhci-esdhc-imx: disable card detect wake for S32G based platforms Date: Thu, 4 Jul 2024 16:21:13 +0300 Message-ID: <20240704132116.2865864-2-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: AS4P195CA0019.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5d6::6) 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: 991377b0-c2b1-4253-9550-08dc9c2c32bf 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?H3yZnTGxrpoIZNYdZomWyV5d0rWZJh6?= =?utf-8?q?f+DhN5bTpJ9GwzUeeoClsrYn8nqhFdQmq/asGyX+7BimAmHnUUQNoQ/L43xwpg0vl?= =?utf-8?q?Os0eYJj9tWiO70dMF8WrFLKCNGWry5EkXcgwRGsTKnn95VDa1cLzm2p8VaZakdzR7?= =?utf-8?q?EvcNFaoX21MkpACrwZbyLkJd+LpVYQvF8dNjv66VBeXqloCnPsUl6ODghqUDqauSr?= =?utf-8?q?6Af2o57MJX3ORQY7496AQrfmw1fRO6OCGgwha5zCCG05YYUk4vBfgEgVuf6nZYzr0?= =?utf-8?q?/AcU6se2uHs63JiEUDbSzHj4nZ+ahQE77rCoYJffqAa6TIc0c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5TIV1QVcQab?= =?utf-8?q?oYkuB8f4sHZjRQJf7Vwd6bU/kKBy6Oh+cqsWVWrhRZi8Sh9Emwq0m+sboYwRSGvoe?= =?utf-8?q?lCAkX2CU/kbGbHMR+os2/MWapEb/D3kdHlw=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?bBAsedsnfHoKVJTsCZBsUClpVZj6?= =?utf-8?q?BY/GefOvEqlP2KBkXogohlPc/GgEI3IsFoNQHZCRURukcM2xNc0a3E1bvESd9h/ml?= =?utf-8?q?33SfG7h1xEVCjgySByUtq/DoczByyd/zWA7ZqZLddDkAZ8yUs7FvV3zp53hmuUtaK?= =?utf-8?q?WCLdy6BBE2f7iT5yPbp94VrSKIodFVjqrIe7bFslxLC4SkF5X06xvDHunGf4MMan2?= =?utf-8?q?3WAph+upWvcKjjzV1jnMFfK8YJiqXPXokyertTcGDTEOu6YXaLqew0PCWYODufuYO?= =?utf-8?q?8V8QnTVC58Et6fIsZmm0AGWPi6uV/qW8ip27AbU5QwOLnDgVeH1xWm+nL0n3NEqLR?= =?utf-8?q?dLPHa8vWeY+zAL6ZQFeKoRwOSaGjRODKIiHvatPMhsU48RsHMwSK8H7eJ0W95ZA9W?= =?utf-8?q?9CtYGjs1nFNhYUxSIBemuv1sNgEC2nrdVyMuMNOWPBRMbzkVtWCV4Dg084ou8kT9A?= =?utf-8?q?/0EkFVmR6iO6fU8Vqyj3PuPuegEw8esEtY3XinJ9EWKF6E/DZBnNnfiimrTmA/2F/?= =?utf-8?q?M4cYMbvTfBOP6ClIw34gPpsmvlYHc83+8/U1PFLd13aqL7KTWsggClaFdT3e6QBmS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8?q?AdmR9JXjo7YPxAKRuPAhJFymAQs9CRv5WlSSrngnnXEAaZ0go7lo+Pr5XWK3S2ZVz?= =?utf-8?q?Nl4Ee0V7NkF3QN2Y29lejGuBEtabin0OpA=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 991377b0-c2b1-4253-9550-08dc9c2c32bf 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:22.4918 (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: rkiPjsADlbPiyanqKOQOWerqApOoZsQurix2CyF3FJ+qyFioFu8AXeDj+bMtnsAs4HB3CXW+mQf7XT3Vej4HM/RDz5yTwR6uWf8nNemwPB4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10422 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;