From patchwork Mon Jul 8 12:10:16 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: 13726538 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2040.outbound.protection.outlook.com [40.107.249.40]) (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 295B7143C7D; Mon, 8 Jul 2024 12:10:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720440638; cv=fail; b=QXJOiw3YJEW3DC6iOcXf3zRcrkiPP2JbV20wP1BgvnaXEwxO20z+VvNyhTCOUvpAZMvYL3Ky+PP2FnJdcig1NLOHiwfQ5jrNzEiRn+U6U/GhNHaLtb/lyQo2q3Ve7N8QwmfIV5ec7CRpEfzOs5nDgj0kMbRb+wg0BgzR7+40vek= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720440638; c=relaxed/simple; bh=WA3wpQYMiw+SuvwzzQm8hfOQzI2ldcitSNgjB50H6Lc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=lQL06NufP42zHGduCeBqXDLLq83tC19KJaPzoLOKjU+M8ec7rxZpKkGO+BiDeZV+/V5IRYKaRSaue4+ayi29pbLXzKsJHwwykcVD5BdWh9bpOY/15vkKIXBon6+ulX/qXTXU2T22L0fDrSA0/OMyGA8oxzCPectEJrFL8IkP4UA= 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=iqJ2/+0v; arc=fail smtp.client-ip=40.107.249.40 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="iqJ2/+0v" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hOmHQozoOzeTdNXidSsx6xPuBIN2QPa7GzEf8ptonejiSyRlr5zD9Joqnd+oY63APCbRQWViClJu4y+k/rUrVxtNfeSRBsbwXDx02zSNSRUKLsdT1rKf+O85tejsUa7M6UgkpTBEN67KE/zcxyIuHZrNVCGcpzR59kbP8fslrWIOL6/gcKkuaMEjCmOT24Bf9wDVRlwmt/6bSs6LfyxRleq9ZCipa0JQ7rg1XWyLiWUXw7ENuqKC9mdSUgB83pS5fzA3r9FlFUodXGo1wTjdIj1xK9ku71AVH0l2BfB7kQKpKVGyRrPwNLSrNH0fUO3zqNC5gOySmScyjVW3Hyp4mw== 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=E+SZ9nm+eXTFoAfhIl95cB7FrkrtLebkNrqb5v8ua26WJjOM7Q02thshsXGYUfHP87ttktAiwoZ7lk5MWqaeiRhFUcZZTbrqFLsOZFd+aZm6sRlL5lTskf6jrmv5WR37C3NjhwCiDRfGJCNKmNMdpm3WnfzWF7cp7cL1RTxLq4nOOPb63lBukZwyILwiZVoua4RJ3M7qwEdj9j5o7Y/KVpx5+Y0Wp9FeGhRsDDPeBvndC94Hv7CF38p6+ZzLh++IS3wxq9eFsdHqcV2p2VN/oY1yET3AN9S/TA6QVXW13jItyTTowrCTufUHoqLApvCICpXEGT1Z5TCx7W2xkrZ9rg== 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=iqJ2/+0v1PvzWGAWedhfyxQy+0saq1h+luP6nueG6h6CxHaRFND2C0RT1LV0+rzkzulJL8q07yfQ6ZDE6upmVpJIvD7YbD3Yu59XqcbLbMYHZEbi9d1zvsY4ps/EXlmrOMr+EayKxkOf4hYb2BmB+uhb8DbtBLFkZLF3TudcsOk= 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 VI0PR04MB10614.eurprd04.prod.outlook.com (2603:10a6:800:260::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 12:10:24 +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.033; Mon, 8 Jul 2024 12:10:24 +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/3] mmc: sdhci-esdhc-imx: disable card detect wake for S32G based platforms Date: Mon, 8 Jul 2024 15:10:16 +0300 Message-ID: <20240708121018.246476-2-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240708121018.246476-1-ciprianmarian.costea@oss.nxp.com> References: <20240708121018.246476-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AS4P190CA0002.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::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_|VI0PR04MB10614:EE_ X-MS-Office365-Filtering-Correlation-Id: 90be1601-904a-4dd7-7df4-08dc9f46f250 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|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?pEj2WfsBkmQwMJSrfXaDFDRNPIMPh67?= =?utf-8?q?0x8x6emZEkdVGxsuY6CSVaz5Hg0hwhaUP7Vmx9KZSdERSbxgIso6mhEOsY5XoTmNy?= =?utf-8?q?xn9t2VGZTeP/R67GrzGGqBCSu7EIl5yl3iofdbHI/FCSgoXFPzozGmRRCWclf56Be?= =?utf-8?q?2X8sKKKWoaOOJuAmRiDgzv/1Wpb5d7qsxaNVevp8hZc5uVE9WX3R1qgti/NcxNj9O?= =?utf-8?q?ebaEjJ7aE93GVfZ6p6lbQeXWH010olNYNQvkBXiorDhBKd8HVg6ozLs3qwv4BI1G8?= =?utf-8?q?JHO998UmT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2a6ZNXwaEWEgXdRE4C2ci2CHDZZbqJLfPEZMvIHM2atfHcZXFbvL5S37XM7y1?= =?utf-8?q?24FoIPx+Fim9Tw9Glg++108J8OFgkzYuBTIJ5YRMJJ1BdRCYmk4cyB51N7sUu7R4C?= =?utf-8?q?mK3Fxn1Wys6X3q3qtRDyj+c2KB0iYHIV7DQ=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)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?yE1e5iO8cidb4lTSu0cBwjk3Eeyb?= =?utf-8?q?PcNp08RzH5AgGfCsBk+COIGb1pfmYx/l6SVUJNKHp3j85XNYe2jsy2Y2KEJzDRikd?= =?utf-8?q?zH+qCavm0KukKaOEnN+poXZFmFhRjXUX1QJ3OQRQwu28KMDxn2Z6d63+gWQGUCdQE?= =?utf-8?q?/TugEVq58U2Xf2Ymz0lnnWw3TyHk3YAbVFJUBshlxV8h81M9pc5j7vGMKcWLF1Ega?= =?utf-8?q?xZ/1a6PFdCirr+keNCDur5d/PkIXVhgIkUTH9Itdbo3OY6t2OKwQgMv521qdogdoz?= =?utf-8?q?TUix2/1ZQN4VlCtq3kjABQ/j5EQaR1xQo/HZSJ3L8ABdAst45mAZyn6RasOAl5P8E?= =?utf-8?q?DRnMoGPJVKenucfkRb4C/QBgkueb9UzSfR+A7N/Qj+83E0EvIGocI2mrm8r3l1fwG?= =?utf-8?q?5kyLJN2ZOrNdlP3wluC2pLD+mMOw+y9FsFS3fvBrWfk8R//ErepUabI8mPMxWmkR0?= =?utf-8?q?x4L3ZbP00voj1tmt8if6aunD7YKyYD4bV3X/D8quaZPh1DMmG4mLlW5tAFoZAaJQl?= =?utf-8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f-8?q?ReKBz9CVmfgdQsTWMlAr+3tqzrgjkIfO1slTKDAulNUUFZH4eSobijkSFAvyHVSOu?= =?utf-8?q?UPHI07qWi9pWmlw0r7QFRvNMQnPQzxHEskoZ1VlnVdKNcJC+QoIMP61eR7sLr9JAk?= =?utf-8?q?FwhwPBhUPChe2dYPFRRJo6b2oXkwWtjO+w=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90be1601-904a-4dd7-7df4-08dc9f46f250 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 12:10:24.3039 (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: cupYtf8BuAX8+jdU3iwJSmfdieTejIVBBfy9mmwsReHGIGV7Zx+Y0CvsD3RiJTe8n6G2A9jfPv5yLbO/XoT4FaSNkArsWwjFALCbJRN0tks= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10614 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 Acked-by: Adrian Hunter --- 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;