Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

watchdog: imx7ulp_wdt: move post_rcs_wait into struct imx_wdt_hw_feature

Move post_rcs_wait into struct imx_wdt_hw_feature to simple code logic for
difference compatible string.

i.MX93 watchdog needn't wait 2.5 clocks after RCS is done. So needn't set
post_rcs_wait.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240730145610.2177627-1-Frank.Li@nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Frank Li and committed by
Wim Van Sebroeck
1f87c578 bc83b4d1

+9 -12
+9 -12
drivers/watchdog/imx7ulp_wdt.c
··· 55 55 56 56 struct imx_wdt_hw_feature { 57 57 bool prescaler_enable; 58 + bool post_rcs_wait; 58 59 u32 wdog_clock_rate; 59 60 }; 60 61 ··· 63 62 struct watchdog_device wdd; 64 63 void __iomem *base; 65 64 struct clk *clk; 66 - bool post_rcs_wait; 67 65 bool ext_reset; 68 66 const struct imx_wdt_hw_feature *hw; 69 67 }; ··· 95 95 ret = -ETIMEDOUT; 96 96 97 97 /* Wait 2.5 clocks after RCS done */ 98 - if (wdt->post_rcs_wait) 98 + if (wdt->hw->post_rcs_wait) 99 99 usleep_range(wait_min, wait_min + 2000); 100 100 101 101 return ret; ··· 334 334 /* The WDOG may need to do external reset through dedicated pin */ 335 335 imx7ulp_wdt->ext_reset = of_property_read_bool(dev->of_node, "fsl,ext-reset-output"); 336 336 337 - imx7ulp_wdt->post_rcs_wait = true; 338 - if (of_device_is_compatible(dev->of_node, 339 - "fsl,imx8ulp-wdt")) { 340 - dev_info(dev, "imx8ulp wdt probe\n"); 341 - imx7ulp_wdt->post_rcs_wait = false; 342 - } else { 343 - dev_info(dev, "imx7ulp wdt probe\n"); 344 - } 345 - 346 337 wdog = &imx7ulp_wdt->wdd; 347 338 wdog->info = &imx7ulp_wdt_info; 348 339 wdog->ops = &imx7ulp_wdt_ops; ··· 394 403 static const struct imx_wdt_hw_feature imx7ulp_wdt_hw = { 395 404 .prescaler_enable = false, 396 405 .wdog_clock_rate = 1000, 406 + .post_rcs_wait = true, 407 + }; 408 + 409 + static const struct imx_wdt_hw_feature imx8ulp_wdt_hw = { 410 + .prescaler_enable = false, 411 + .wdog_clock_rate = 1000, 397 412 }; 398 413 399 414 static const struct imx_wdt_hw_feature imx93_wdt_hw = { ··· 408 411 }; 409 412 410 413 static const struct of_device_id imx7ulp_wdt_dt_ids[] = { 411 - { .compatible = "fsl,imx8ulp-wdt", .data = &imx7ulp_wdt_hw, }, 412 414 { .compatible = "fsl,imx7ulp-wdt", .data = &imx7ulp_wdt_hw, }, 415 + { .compatible = "fsl,imx8ulp-wdt", .data = &imx8ulp_wdt_hw, }, 413 416 { .compatible = "fsl,imx93-wdt", .data = &imx93_wdt_hw, }, 414 417 { /* sentinel */ } 415 418 };