Commit 02f71c66 authored by Joakim Zhang's avatar Joakim Zhang Committed by Marc Kleine-Budde

can: flexcan: disable clocks during stop mode

Disable clocks while CAN core is in stop mode.
Signed-off-by: default avatarJoakim Zhang <qiangqing.zhang@nxp.com>
Tested-by: default avatarSean Nyekjaer <sean@geanix.com>
Link: https://lore.kernel.org/r/20191210085721.9853-2-qiangqing.zhang@nxp.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 9ad02c7f
...@@ -1757,8 +1757,6 @@ static int __maybe_unused flexcan_suspend(struct device *device) ...@@ -1757,8 +1757,6 @@ static int __maybe_unused flexcan_suspend(struct device *device)
err = flexcan_chip_disable(priv); err = flexcan_chip_disable(priv);
if (err) if (err)
return err; return err;
err = pm_runtime_force_suspend(device);
} }
netif_stop_queue(dev); netif_stop_queue(dev);
netif_device_detach(dev); netif_device_detach(dev);
...@@ -1784,10 +1782,6 @@ static int __maybe_unused flexcan_resume(struct device *device) ...@@ -1784,10 +1782,6 @@ static int __maybe_unused flexcan_resume(struct device *device)
if (err) if (err)
return err; return err;
} else { } else {
err = pm_runtime_force_resume(device);
if (err)
return err;
err = flexcan_chip_enable(priv); err = flexcan_chip_enable(priv);
} }
} }
...@@ -1818,8 +1812,16 @@ static int __maybe_unused flexcan_noirq_suspend(struct device *device) ...@@ -1818,8 +1812,16 @@ static int __maybe_unused flexcan_noirq_suspend(struct device *device)
struct net_device *dev = dev_get_drvdata(device); struct net_device *dev = dev_get_drvdata(device);
struct flexcan_priv *priv = netdev_priv(dev); struct flexcan_priv *priv = netdev_priv(dev);
if (netif_running(dev) && device_may_wakeup(device)) if (netif_running(dev)) {
flexcan_enable_wakeup_irq(priv, true); int err;
if (device_may_wakeup(device))
flexcan_enable_wakeup_irq(priv, true);
err = pm_runtime_force_suspend(device);
if (err)
return err;
}
return 0; return 0;
} }
...@@ -1829,8 +1831,16 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device) ...@@ -1829,8 +1831,16 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device)
struct net_device *dev = dev_get_drvdata(device); struct net_device *dev = dev_get_drvdata(device);
struct flexcan_priv *priv = netdev_priv(dev); struct flexcan_priv *priv = netdev_priv(dev);
if (netif_running(dev) && device_may_wakeup(device)) if (netif_running(dev)) {
flexcan_enable_wakeup_irq(priv, false); int err;
err = pm_runtime_force_resume(device);
if (err)
return err;
if (device_may_wakeup(device))
flexcan_enable_wakeup_irq(priv, false);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment