@@ -348,7 +348,7 @@ static struct flexcan_devtype_data fsl_imx8mp_devtype_data = {
348
348
static struct flexcan_devtype_data fsl_imx93_devtype_data = {
349
349
.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
350
350
FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_RX_MAILBOX |
351
- FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_AUTO_STOP_MODE |
351
+ FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR |
352
352
FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SUPPORT_ECC |
353
353
FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX |
354
354
FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR ,
@@ -544,11 +544,6 @@ static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
544
544
} else if (priv -> devtype_data .quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR ) {
545
545
regmap_update_bits (priv -> stm .gpr , priv -> stm .req_gpr ,
546
546
1 << priv -> stm .req_bit , 1 << priv -> stm .req_bit );
547
- } else if (priv -> devtype_data .quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE ) {
548
- /* For the auto stop mode, software do nothing, hardware will cover
549
- * all the operation automatically after system go into low power mode.
550
- */
551
- return 0 ;
552
547
}
553
548
554
549
return flexcan_low_power_enter_ack (priv );
@@ -574,12 +569,6 @@ static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
574
569
reg_mcr &= ~FLEXCAN_MCR_SLF_WAK ;
575
570
priv -> write (reg_mcr , & regs -> mcr );
576
571
577
- /* For the auto stop mode, hardware will exist stop mode
578
- * automatically after system go out of low power mode.
579
- */
580
- if (priv -> devtype_data .quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE )
581
- return 0 ;
582
-
583
572
return flexcan_low_power_exit_ack (priv );
584
573
}
585
574
@@ -1994,13 +1983,18 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
1994
1983
ret = flexcan_setup_stop_mode_scfw (pdev );
1995
1984
else if (priv -> devtype_data .quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR )
1996
1985
ret = flexcan_setup_stop_mode_gpr (pdev );
1997
- else if (priv -> devtype_data .quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE )
1998
- ret = 0 ;
1999
1986
else
2000
1987
/* return 0 directly if doesn't support stop mode feature */
2001
1988
return 0 ;
2002
1989
2003
- if (ret )
1990
+ /* If ret is -EINVAL, this means SoC claim to support stop mode, but
1991
+ * dts file lack the stop mode property definition. For this case,
1992
+ * directly return 0, this will skip the wakeup capable setting and
1993
+ * will not block the driver probe.
1994
+ */
1995
+ if (ret == - EINVAL )
1996
+ return 0 ;
1997
+ else if (ret )
2004
1998
return ret ;
2005
1999
2006
2000
device_set_wakeup_capable (& pdev -> dev , true);
@@ -2320,16 +2314,8 @@ static int __maybe_unused flexcan_noirq_suspend(struct device *device)
2320
2314
if (netif_running (dev )) {
2321
2315
int err ;
2322
2316
2323
- if (device_may_wakeup (device )) {
2317
+ if (device_may_wakeup (device ))
2324
2318
flexcan_enable_wakeup_irq (priv , true);
2325
- /* For auto stop mode, need to keep the clock on before
2326
- * system go into low power mode. After system go into
2327
- * low power mode, hardware will config the flexcan into
2328
- * stop mode, and gate off the clock automatically.
2329
- */
2330
- if (priv -> devtype_data .quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE )
2331
- return 0 ;
2332
- }
2333
2319
2334
2320
err = pm_runtime_force_suspend (device );
2335
2321
if (err )
@@ -2347,15 +2333,9 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device)
2347
2333
if (netif_running (dev )) {
2348
2334
int err ;
2349
2335
2350
- /* For the wakeup in auto stop mode, no need to gate on the
2351
- * clock here, hardware will do this automatically.
2352
- */
2353
- if (!(device_may_wakeup (device ) &&
2354
- priv -> devtype_data .quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE )) {
2355
- err = pm_runtime_force_resume (device );
2356
- if (err )
2357
- return err ;
2358
- }
2336
+ err = pm_runtime_force_resume (device );
2337
+ if (err )
2338
+ return err ;
2359
2339
2360
2340
if (device_may_wakeup (device ))
2361
2341
flexcan_enable_wakeup_irq (priv , false);
0 commit comments