From patchwork Thu Jun 13 19:00:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 804763 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2080.outbound.protection.outlook.com [40.107.21.80]) (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 284E5F9F8; Thu, 13 Jun 2024 19:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718305260; cv=fail; b=bmsMVjOlrnL0hrDFTC7JJmTt5V72z6HUxmA6ixXCTSZvioPr17xA8PYGQNHK1aKY5n5v8lmS5826hic+xOgFCq0jEmcyKdAJQq2/32LR0YZnkvcqYGFYtqAIxvoY+jsu6DARun48uWHydWMa5iV52AEF7Q+8YkQxXaLyfV8RMc0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718305260; c=relaxed/simple; bh=1ZOLTYd9nKz3dWoCJmAdaERqxG9Ou/5gY0RXA9AdHIo=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=gXPabdaO+jQ9szFCS/GYgtmpqbCWs65SMXZ8ZucjjrJE832sLmgLD+zbRI4tQSBusltL2m1zhACjE9gE7pZBcrRV/fJQE6LcxswqZH8hocvKHK+dprggg1dMjts+W85uycwqAMyjULjDAvRt+P75OZ1IwJobhaqpBqSiSgBom5s= 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=NBYcw6yG; arc=fail smtp.client-ip=40.107.21.80 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="NBYcw6yG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K445UqfDJI51X14P18VydNEYxc/ge/2ir7kLOyWLKGBPT3NH4AhW5vCaHZAAjNHCwom/Ohb/G+MrUBj000rsZtj4yZoUHnChEohwUqR0KZEgG0YW7J1rLct2zd7ewXYu61eovX4OY/8ndWtfd8Yd30XGWCR3yiNDvlm1Xvwz/geGdH6FIUFupQmX3nIgLi6vKdHBnUsGBTNfD6Gcr98tCWMR0QJixUge8bm5cHlz3GBJl8UrgsD2JxqvpABW2LkOnZD45bdASN0kKKRkMZn1QbbfuTK2R6C504v6F7RXfclzmWQAVsIeRtQg/Z8aX5mSh3Y0Bb50GUWN6gObVUTvxA== 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=H+ggjTEfdXf+5Y02s7r8s1QIXvB4ZAcIKtTLKO9UZiXBWaIpz8R/6QDf+bEZjtB3ejMKEhS0PAhan9aUF+oX1gZWQoRsljc5TfSgnutxEPsX3awrprcYr2rXAdaPVKrBMuFzLqlObWXXhkuDLJShhfD8RylSaEaeKfbm32pIfFKRdsVwh+qSNPZUdhzpD395AtmMOuZ4wK3UM3ST91ZHCVzbE0rp2agV2YRK1nIaTfly77onx10uJvJVMUehO8H9SsP+sC+qNleW5V3Bqhg1261HhsBi5UuGhxmPwL2kXaYjIXWSPfqSfg6s/y0yGjrloMS4odSRc9UiiRnwawblDA== 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=NBYcw6yGRii/aUzIwnyrI59G6PH9MqaHhp+dKoiDKhayRvSp/Rr4CTLK/2ryxJUSfDo3H3hO6yCayvXI8BAXIP7QG4EgGZgyGluf2S6eIlEGbNjLuY0srYi/amcKZW3+2jtyUWCSdrelk8YXU9JWZT+tZz3bhqdmK7nFk2l+3NM= 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 AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24; Thu, 13 Jun 2024 19:00:55 +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.7677.024; Thu, 13 Jun 2024 19:00:55 +0000 From: Frank Li Date: Thu, 13 Jun 2024 15:00:37 -0400 Subject: [PATCH v2 1/3] spi: fsl-dspi: use common proptery 'spi-cs-setup(hold)-delay-ns' Message-Id: <20240613-ls_qspi-v2-1-b288f6f5b736@nxp.com> References: <20240613-ls_qspi-v2-0-b288f6f5b736@nxp.com> In-Reply-To: <20240613-ls_qspi-v2-0-b288f6f5b736@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=1718305248; l=1322; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=1ZOLTYd9nKz3dWoCJmAdaERqxG9Ou/5gY0RXA9AdHIo=; b=AigHny9H0acvhuIMW1lTlx9mJFrEZ5WuWDM01EOzUjFXuLy+g5t8qGmSZi7sV7BNo0b/iE1gN ss40sYh5ZuuATumuD0h1Wv0m0JUCL8+4dYUZZ4eCIxtARCs0gaie0Jw X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR03CA0029.namprd03.prod.outlook.com (2603:10b6:a02:a8::42) 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_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bbb6667-33f3-4712-3bff-08dc8bdb274e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230035|52116009|376009|7416009|1800799019|366011|38350700009; X-Microsoft-Antispam-Message-Info: =?utf-8?q?hkFW0AZo6plfDr9YhsCiI9WS6Cq+Kkz?= =?utf-8?q?vQQ8zHe0OGiPdItRVRYVoFiovGKtRDkN2zN13+XQmA2xNw3uaAGO2vUbVIZ06dbNE?= =?utf-8?q?T/oC+D23niA0nZsUpZO27M7ZzNqZlFOUGj4oU0c+zzB/grvv5dEKbGxTuQs/hpD1U?= =?utf-8?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JBJNtCG7VmEq0O/oxlhrTgh0OxtYbzYMRG+zU+i+Lov6We3/kbIliiCRUVqT0pquk?= =?utf-8?q?R7mWK50FQQJHQ6/AhxNWQ7HbU6/dVkve6CqSHPUi8/Wvib3Mxl3yQXVRykNPEpjDN?= =?utf-8?q?Kwx+UA/DoFtko0UBabwwRyJ2jGRIETWfirJ42vgY7tCBNBRS6znBiXAxT5HF0yVfc?= =?utf-8?q?gSfAflPCmxx9s+T7pQCuUMAe43DPX0/Vgj4Lv6gkXXag6MppxxTNf2aQXcjBvUOjm?= =?utf-8?q?1wkbzYQ0Xj1+bBA7neoKgLntVJYCafG9iLJI/x/uFhLaRsL02+WozLZs=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:(13230035)(52116009)(376009)(7416009)(1800799019)(366011)(38350700009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?r9fBSuP6VqbacqLjjkZj2fL0ulll?= =?utf-8?q?UW4XtbOkWHMDioa8JfBoadAtuiJSZ0DjcVb97MXiqssEx2WG5t+9PbCH5Z7micGzE?= =?utf-8?q?9UL+LV7zq9ax1rfEe8Lgu4lYUs+t2voKsWrmWbcqw4CRqdxeKVOb/5nM12NXGwn7X?= =?utf-8?q?fezSnlYABIazL7HetzLOQeelcc8JmIBCbgZtMzQ8dliFo1ryoEh7+yRmbII+24x/W?= =?utf-8?q?KVSJGgT8Lg/6IjxPjB9gVgZ1w7bEE7gCy5bowHPOu2NSUqbxD3QKf8QAdixXUbQaa?= =?utf-8?q?bvDQap6XVxKoj7kEMWCGYANsvxyPTmg61iXbJxl5tNCev1x+HT4tYls7hgFldi6Kg?= =?utf-8?q?wlQBWjNt1wanMBhWwsBLzkWnWgphOzsvcqBRRlolLWq5+O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vNSwPe4Re07V?= =?utf-8?q?brYNEqxjrLgR021bvlVpOmqrCcJeZXDjkpj+396lMUd67VQMZkxcxG6Z43Rykl9AH?= =?utf-8?q?Ji9oINDhK2GgttdwT05YJdi38s3m0K1KAZkTDyac+8LDBK1aiQ7llsjLTFH8t3iNe?= =?utf-8?q?iOBxkZXrMJQo6Bpu0ry/UPpifOkBQzIFXFEy62yHxpaaI3TM9waEDd1bZMWhYbG7l?= =?utf-8?q?ZL0hmVjzIGJfnDGZX2h5gzn6Q1bvx93KJj4ItKRm87Rd2APAj6VDvccA=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2bbb6667-33f3-4712-3bff-08dc8bdb274e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 19:00:55.3959 (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: Kf1yL1RFvoB0hR/Kk4y8+pNB/fuCK3X3KeZAPq3aiRICEjoa+uquSKOvPAmNtwJsm2Zs7SdAqtXqyd/EK0HJXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 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;