From patchwork Thu Jun 20 16:58:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13705939 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2072.outbound.protection.outlook.com [40.107.21.72]) (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 4B07B1B372F; Thu, 20 Jun 2024 16:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718902732; cv=fail; b=aHVLAQ43za8UAC7ZfrJQFzRsjJfynbtf84HhNXo0YWwp7/K6yoOyQV6jd7/qFkuZHe1s6WuFPDmwaRUrtaBhYZgwpPFgDeX1GsFX2hR6b4otMOu7Vy39mTVrhkwSyNEtleNKT458e3dPp5T2GSxIC5eBa2ujj8Q/+OxIS/ylcOA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718902732; c=relaxed/simple; bh=1ZOLTYd9nKz3dWoCJmAdaERqxG9Ou/5gY0RXA9AdHIo=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=m8DdsiHdMY+bsANKqHFn4w7cbDGvDsTNdZ9W+bUOFVUWcKdQieX6ftmmzcKCY756rLZYVNcagQmZ+AyfPaX0S6/RW3DOaJSqNspSbsk+2vU4O/Eq4w8nA4yGURxb45/VASEyTksaDcmVM3vgztBJZVBbwBiGBHsNJh00eBjl0dY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=El9noXW9; arc=fail smtp.client-ip=40.107.21.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="El9noXW9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RPZ2lZnfPN5seqtQ2ukIA51gYfGkiB4FIv58G8VKpgUfP6LqX3UlAhkBQ5aHqmAGbK0L85FfnwjiPvbsVh6uWSnpx1j0FKWqvMlFSiVYWZ7SRvfsJKRLt+izTcPfnm0rEfzsRb6EEaQ7oRIx2+snySzcvP8oOpwPKop8/0l/CdVakeEcWTVSxTcYSU7scAsTvTQbSkasXPSmrZ9gYnsXudqv/lkSJ93aibffKFT2SVvHpKY2kv/K8uwzkEqkZm2GVzWwCgdRlNCoSaSzBAwrJo3JNHYfXM4sjD71KSHv2jWsTN1JZvzJ5uXQCFVZ3BdozWxGcbBzic7S2KEorbUgJw== 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=XUAB24xN6kjPK5ovZyDhtowkdtlZKMCF4c5Y7a2oS+g=; b=AO19doavik5Oy8HzrtGKVgr9JBb2NXZJq9hA4kNwdRRg06ZadTtVT8zSRq/rpFtaBeyAHLmvrefoBWUNLfviapzroczZDqBI7tNIxR1838SmlEozO6lbNB5pHy/P6uZUwfM8ZnstlBS54O7E0/Yf47zc70Ccke2MVs7gmZjJBViXv+uGSfjB4TPL2lpSQKoqbCI85ya4wUszuHf0Cb9zQOk343XiymxYXMWDsW2+7bjmnEYH2VcU2hxvxIeLKM8yJ9Xj0LR0GNl61j40JaDdTzYFLwFPZbutk0ifR4NCxr8Q/QWHUZ3Btt8BI+6AFwaltzCN6uwJS1pMkI8qOnE3Rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XUAB24xN6kjPK5ovZyDhtowkdtlZKMCF4c5Y7a2oS+g=; b=El9noXW9I/EHGvVJnpV1meyUDlVOkivcn3XmgJjnfZUOLC4Q6YpGSqaTb1DJg/fdmenCgeuzd+mxNbkSu6ttuDpfGbvRxHjv2E6eHkrv17u/S1KnmvZYUdIQyKV+4DD/KG9qXNS/HNPW8GTcjzu5D7rllmCBgegA9pdYZZoe3Zs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PA4PR04MB7632.eurprd04.prod.outlook.com (2603:10a6:102:e8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.19; Thu, 20 Jun 2024 16:58:47 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%2]) with mapi id 15.20.7698.020; Thu, 20 Jun 2024 16:58:47 +0000 From: Frank Li Date: Thu, 20 Jun 2024 12:58:27 -0400 Subject: [PATCH v3 1/3] spi: fsl-dspi: use common proptery 'spi-cs-setup(hold)-delay-ns' Message-Id: <20240620-ls_qspi-v3-1-1a2afcf417e4@nxp.com> References: <20240620-ls_qspi-v3-0-1a2afcf417e4@nxp.com> In-Reply-To: <20240620-ls_qspi-v3-0-1a2afcf417e4@nxp.com> To: Vladimir Oltean , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1718902721; l=1322; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=1ZOLTYd9nKz3dWoCJmAdaERqxG9Ou/5gY0RXA9AdHIo=; b=2vXfgwGFREdrwbDSdVRF4yG2zVVj9U5x15ad/LT9YjmGmka/EDSXzXvb7BZHkHKHw7wHqG4te Oc8/PKEXmvuDJd962UB0nI5I5YXSPzjmwaiOsdxDyIcFQCKXCb5AFYx X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR04CA0029.namprd04.prod.outlook.com (2603:10b6:a03:217::34) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PA4PR04MB7632:EE_ X-MS-Office365-Filtering-Correlation-Id: 51137bef-79f3-4217-646e-08dc914a4047 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|7416011|366013|52116011|376011|38350700011; X-Microsoft-Antispam-Message-Info: =?utf-8?q?RXrGh98DkkmbrwYv9lVt/W9djKi3aP+?= =?utf-8?q?kCDut9p7q1R0l/IVY2eXMe9wZu/me3LJp9eQqdgczRgHcHa8HAlEb24E/+JNzL0Hb?= =?utf-8?q?Vgonvck0Si7604w5DuDPUk5cX12daxbmxJepN7B1PnMjIXJNAysuGRQYpEgNf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AsCrx1Zky6xFEaREyIrGQxdz0twSqxrficYmEPHAI2cINXeDqJSGKV?= =?utf-8?q?HE6dn7sOEnBclJa79Qy0dqEN+A1fsCPh2jNz40YBl1f9pTpIXvGdPdiVj+5xHUjxe?= =?utf-8?q?5SK+HRsjq243bobGdgNiB77n20FQ5J2jaTjGt2v98YxQvDJ0TeLt2f6gIeCx/cdIC?= =?utf-8?q?aCWj43i5eoppYYM/cLL+mGpPVfpTqwhzC1dM3Pw+kJKdl2q8Z4FPSUCMStW4fWZZT?= =?utf-8?q?cTzmJZand3Yo1wrzvIi3PXb1zWzUHoE8jn2/QQdTmK8/q8GCWmjj7BJE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(1800799021)(7416011)(366013)(52116011)(376011)(38350700011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?EAmdrop1MumQdfqvnCEryXlVJKha?= =?utf-8?q?iVpgiahwtkQqAcee/o8+u7zZI+NiBQ4+8vfF1MotHlWzZKObET11utzthaJAuLVil?= =?utf-8?q?2iDE5vtkypI8tkTz1sbHBtCc6J7LypesBgsHANIM6V6GEcBT2YReAAabdCOZfuwid?= =?utf-8?q?CtgKBb0c0OYJyZs/ZVHPJDHaLAQtp8ncc4H34dUTXMU+OWw2Zgew+Q3h0TpaO3Smr?= =?utf-8?q?2/JBOxTs4w6cbc33nJgrLErIz0nzh5ChwWwlRQ5ChncbES2magmnWXc4SDc7nbUla?= =?utf-8?q?OaBcT99tISszoxZH0MPa2JUfU3nw8OBe0bnSUNKiBhgrgrWCAwmuRQ2naDyr9FXlo?= =?utf-8?q?5r9me9H7ox/lsPReNtjCWVLeGRz/itp0e0BhUjZ+S4bb7m0asEQIGFbuJoNg0RPT9?=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Z?= =?utf-8?q?HAg19gNOHScwyTFokW3bsK4evVd8Y0agjHWZyyX5EehUXN3IDBaO6RWcuIbWA+6lB?= =?utf-8?q?8c70G4V69cTGiR2Bm2EII/IpNRhRXi3aJNhyy18XKHVtHuR5Dfrzk8pyou2D1ZafT?= =?utf-8?q?Dd8yjaCLWaYdvIPyC30WSABAty3/0G+m5tpsPdLwv1Dot/QiBZfpA95fR3UxBkqDL?= =?utf-8?q?ZYU74HfAxaj+StMf72C1yzdKVaYYANUCLDhc+QOm6jTvw1h3Z8vvItCZ3CsWpMS+g?= =?utf-8?q?dFdoBxCPsL5y?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51137bef-79f3-4217-646e-08dc914a4047 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2024 16:58:47.2607 (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: /5MJpXElOHKtfBo9Ase65r5xX4HyJWSDPioezltT9P3NsavtE5gGBPTRsw1+mXB932QwkTUZYTvnQkTYuDpEQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7632 Use SPI common DT binding properties 'spi-cs-setup-delay-ns' and 'spi-cs-hold-delay-ns'. If these properties do not exist, fall back to legacy 'fsl,spi-cs-sck-delay' and 'fsl,spi-sck-cs-delay'. Signed-off-by: Frank Li --- drivers/spi/spi-fsl-dspi.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 0a2730cd07c6a..7c1f8af9d215e 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1018,11 +1018,15 @@ static int dspi_setup(struct spi_device *spi) pdata = dev_get_platdata(&dspi->pdev->dev); if (!pdata) { - of_property_read_u32(spi->dev.of_node, "fsl,spi-cs-sck-delay", - &cs_sck_delay); - - of_property_read_u32(spi->dev.of_node, "fsl,spi-sck-cs-delay", - &sck_cs_delay); + cs_sck_delay = spi_delay_to_ns(&spi->cs_setup, NULL); + if (!cs_sck_delay) + of_property_read_u32(spi->dev.of_node, "fsl,spi-cs-sck-delay", + &cs_sck_delay); + + sck_cs_delay = spi_delay_to_ns(&spi->cs_hold, NULL); + if (!sck_cs_delay) + of_property_read_u32(spi->dev.of_node, "fsl,spi-sck-cs-delay", + &sck_cs_delay); } else { cs_sck_delay = pdata->cs_sck_delay; sck_cs_delay = pdata->sck_cs_delay;