From patchwork Thu Jul 11 22:40:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13731170 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011043.outbound.protection.outlook.com [52.101.70.43]) (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 2B02F16A382 for ; Thu, 11 Jul 2024 22:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720737679; cv=fail; b=AC1ViHK/MFE7Tz40kE/WDoQP53P7ysb1kYhgt/jHpNI+lMKAv+50fXx5TRioZBP0yVvTZRyn3AFiC5Ne/y1M6ju/z6JNswModLefSPDNpFaOl2DIOamNvloCgkBc0evwFnZlHVxMmuZQrWIT8l/IOVx1VIQ2VcLMu6JW+rWFnyk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720737679; c=relaxed/simple; bh=uEiuhLf1huRMmyUKhJdKb9SI28kHXbFCt0l/dZKE7cc=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=CRujHB5taRoA5Wl8A6hER44bBroSbRWlV03RaKXbrT3yVZH+ohsudX5cbaiELyyf9fnweod6/Fk6xVz3wstDKnZWclbl1hcnvqG+QsLsCbCmnn92wKBGq7yOjneFJ9oNBNR9eMXHWjZzSXrLUOsEJ7dMpfHnYIWo6mSD6cXfKhw= 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=fTsKLlBH; arc=fail smtp.client-ip=52.101.70.43 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="fTsKLlBH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rI7zPRuU2niJvDgG/+RIMhzX7He0ZacMOQBDEXaMM9pEthOYz7II+4EH7yaJaP17SEh97NFS4BFqg3Wtjeett2tdEidj8Z1Jv6vcWUsmGxkayKSZVb5xhF0oYWu9MYVrwMHcb/fN8nPkcp7Psrkp53EgcgPk97sWyw98wz5CmunJLMbkCqHu3j6MgfqfPxcye/ftYKHsQXtLsNdt9viWiowSp63Mv44I9egUoujp7cA2UUjKy+mzep/DXL4uj4HcuYFVEr3snUOUMtit0fbrhB3wLB6FKYkbCby1lhhGCBfPwmu79YC/gYDMM6ZGmuTSr+0FDXw15dr/9oxNknysVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Ab4l3n6rAricfUg7BZy8N6NQpjP9NTqC5ViGQw4g4Xg=; b=fN4XyP5iIWqOcTx4728JFtm9LqD9Ng94nMMgpUYS0FUk0A1tg8hJrDHZq+tgr/g1xLnMAh/GbHGu3wBG6JrOYgeeGyLYY3+Gi822cK77YDVuHZLPEk1ZXQCGfvTdLZpSsiEAoJYSdZhdNBIKrbQdVLaPD2b8ht9RStFZdFA73g2b5RHvh3YmLZdgcTZUvoO72dPSJJ2qlidLECgiQAO1h3yhRPWsMeXj0BCGvrcKNXfdEgMr7mFGYqxn7J6WgEBn6DYIPs2y+UBiB+ng/9rrx71FbgQgzzV7+yNsgFY/oSDH5kUBwRuKIrso+4bftFQGUiml3M9gc8s7TP1a9KZomg== 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=Ab4l3n6rAricfUg7BZy8N6NQpjP9NTqC5ViGQw4g4Xg=; b=fTsKLlBHUMv8x/vcQLHjFXwU0q+2UwZw9IGF4lq1+nx7RfJmAy+e34aAsdfkeUwlWb15UlZ3WK9N3njk2Dl1RtPs4k+2PVeSIh8AxpJw+ybgWoSQcPnUOQ9DULizaCAbBHqn0T4kVeFxnouW8JuR1/kumM/CCSAcRkisQU5sU+E= 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 PAXPR04MB9519.eurprd04.prod.outlook.com (2603:10a6:102:22e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.22; Thu, 11 Jul 2024 22:41:14 +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.7741.033; Thu, 11 Jul 2024 22:41:14 +0000 From: Frank Li Date: Thu, 11 Jul 2024 18:40:59 -0400 Subject: [PATCH 1/2] watchdog: imx7ulp_wdt: move post_rcs_wait into struct imx_wdt_hw_feature Message-Id: <20240711-wdt-v1-1-8955a9e05ba0@nxp.com> References: <20240711-wdt-v1-0-8955a9e05ba0@nxp.com> In-Reply-To: <20240711-wdt-v1-0-8955a9e05ba0@nxp.com> To: Wim Van Sebroeck , Guenter Roeck , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-watchdog@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ye Li , Alice Guo , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1720737668; l=2641; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=uEiuhLf1huRMmyUKhJdKb9SI28kHXbFCt0l/dZKE7cc=; b=OdsQgIoFHjogQZwqSZr7Kb3UILPxxzhHcotxGri/G9JF21o8a2WRldW3M5shDp45jK/yn1tZT jwwI1YCp2LDAXH1Llh7C1f5JUJn1w13eFKQAOQI8qLkorSQUNv9W0nN X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR01CA0024.prod.exchangelabs.com (2603:10b6:a02:80::37) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB9519:EE_ X-MS-Office365-Filtering-Correlation-Id: 8fe0f9db-b606-4455-b5ed-08dca1fa9212 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?jimnQCikyenj5GL9URVK3iQt7ttRygL?= =?utf-8?q?7krviJLLIDeJSVlpnMDGj7FrAbHs+uTZO2gr/zAo/g704vKTDfpJj70eOzPER4vcB?= =?utf-8?q?BgtAB7oBXfwQ41Y5u9R97BzwCq5zpRGBMeZEwjLwf7f6MoCkLUc8O1NC3rmx2X9z2?= =?utf-8?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ESjKp9rWH5sFZsfAHZ+57lFtcsgsQLDGTowthBsA6llcxtSRB/deGGiIJF3/aDU?= =?utf-8?q?ydnBpvl+ZAofRRvbH6W3htSBfWBiZ1K8THcf91FUtSsyAEdxb5He7bO2kf5HFtsZH?= =?utf-8?q?D2RtyfZ7XCvwuVkVWr1NuwggSFfHcjQO3vSWXOvyC+vb+3xkOKHDMmHs1xUyI9Ifv?= =?utf-8?q?/uYhgN1VImIpLzMrsvqrWYjuvRGPZm1asgRx4HK0e4BDRjKK2GKIgDrC2ws8VVPin?= =?utf-8?q?iNqTS9y8putk7G/UGWrBQXN+G7dW3UGkX1ycTKt78tMfZaaFnbx3PCDDZU2t5FNqx?= =?utf-8?q?buZ2HM/HdD64Hx2HUtvClAZIF3sbVNcv8A=3D=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:(13230040)(366016)(376014)(7416014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?4qq1j46wfjYB1zReotjaxfBAD0Yg?= =?utf-8?q?7teZ626gf0wYH9wPVhf4J3V4Npke/1eBG9RUHBT5vJp39be9xLLyxc8vy8pWb5Tgp?= =?utf-8?q?j2jOVjvDAfQ8I7RaCzO2wmXOcGS7NSMSS4UAGQb81i1DjTkOIwZvUcljcqVje9v9Z?= =?utf-8?q?nF+OQWSkioi22Y4SKkf0/QaWjpq3Erg0p4ywqwzCoi/q1bxmFvhAYsTFdLtHeeOR4?= =?utf-8?q?/QQF5jgex7NDn09mhLN6/yCOhhNjgP9F1CQ0ZDQxRz/Z4irr2dAGkD4mn19jSTf6B?= =?utf-8?q?s6s3+e8T1ZoyqsCu4n5E6/TAA9HhbMol9GVyFMqh7g5iXLCRyL1ze/kY0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J9X7rJgeD8i?= =?utf-8?q?5glVuPmRllYarbIlOGLXxT0ccIjH4F+U6e7P2H9kJ38HApLKC4/cpsr+VTR/nbgP3?= =?utf-8?q?7Qz89WDJVD4IIjRgN/KbtQhF7rqFTWKvtnE0E1h51qD0+mx2A8xb0JbvxByjFjttk?= =?utf-8?q?0lTehqcirOGFzBKIvVOq45sylZvmL69pjUUY20hi7Lf7zc4hupi6yQvDVNSf5lDwy?= =?utf-8?q?ZCBd6Uyy6OUiEDXvcTZeH1fj1Rf2DGoljOMaHR9NVd5+xI6LrvVqbkmVuzjy3gK2q?= =?utf-8?q?4H+9wPFkjbZuvMrqPklwZR5A4f7hrwdabwnS92fvwnkUTWq3ClSvMh4j05oz4mLsA?= =?utf-8?q?qGV0fqGHPcKx?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8fe0f9db-b606-4455-b5ed-08dca1fa9212 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2024 22:41:14.5194 (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: Fy7OdRoY9WL2ebK7K2hYxAG8XXTOGyYn/KF+NllTwTNZcYc7w7ZYmhn2AvFa33SYR4k/VCOeUOxApR9s9QY1VA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9519 Move post_rcs_wait into struct imx_wdt_hw_feature to simple code logic for difference compatible string. No function change. Signed-off-by: Frank Li --- drivers/watchdog/imx7ulp_wdt.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c index 94914a22daff7..904b9f1873856 100644 --- a/drivers/watchdog/imx7ulp_wdt.c +++ b/drivers/watchdog/imx7ulp_wdt.c @@ -55,6 +55,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" struct imx_wdt_hw_feature { bool prescaler_enable; + bool post_rcs_wait; u32 wdog_clock_rate; }; @@ -62,7 +63,6 @@ struct imx7ulp_wdt_device { struct watchdog_device wdd; void __iomem *base; struct clk *clk; - bool post_rcs_wait; bool ext_reset; const struct imx_wdt_hw_feature *hw; }; @@ -95,7 +95,7 @@ static int imx7ulp_wdt_wait_rcs(struct imx7ulp_wdt_device *wdt) ret = -ETIMEDOUT; /* Wait 2.5 clocks after RCS done */ - if (wdt->post_rcs_wait) + if (wdt->hw->post_rcs_wait) usleep_range(wait_min, wait_min + 2000); return ret; @@ -334,15 +334,6 @@ static int imx7ulp_wdt_probe(struct platform_device *pdev) /* The WDOG may need to do external reset through dedicated pin */ imx7ulp_wdt->ext_reset = of_property_read_bool(dev->of_node, "fsl,ext-reset-output"); - imx7ulp_wdt->post_rcs_wait = true; - if (of_device_is_compatible(dev->of_node, - "fsl,imx8ulp-wdt")) { - dev_info(dev, "imx8ulp wdt probe\n"); - imx7ulp_wdt->post_rcs_wait = false; - } else { - dev_info(dev, "imx7ulp wdt probe\n"); - } - wdog = &imx7ulp_wdt->wdd; wdog->info = &imx7ulp_wdt_info; wdog->ops = &imx7ulp_wdt_ops; @@ -403,15 +394,22 @@ static const struct dev_pm_ops imx7ulp_wdt_pm_ops = { static const struct imx_wdt_hw_feature imx7ulp_wdt_hw = { .prescaler_enable = false, .wdog_clock_rate = 1000, + .post_rcs_wait = true, +}; + +static const struct imx_wdt_hw_feature imx8ulp_wdt_hw = { + .prescaler_enable = false, + .wdog_clock_rate = 1000, }; static const struct imx_wdt_hw_feature imx93_wdt_hw = { .prescaler_enable = true, .wdog_clock_rate = 125, + .post_rcs_wait = true, }; static const struct of_device_id imx7ulp_wdt_dt_ids[] = { - { .compatible = "fsl,imx8ulp-wdt", .data = &imx7ulp_wdt_hw, }, + { .compatible = "fsl,imx8ulp-wdt", .data = &imx8ulp_wdt_hw, }, { .compatible = "fsl,imx7ulp-wdt", .data = &imx7ulp_wdt_hw, }, { .compatible = "fsl,imx93-wdt", .data = &imx93_wdt_hw, }, { /* sentinel */ }