summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2019-02-01 16:00:13 +0100
committerPhilippe Schenker <philippe.schenker@toradex.com>2019-05-09 11:13:57 +0200
commitfe4c73c94f19ebca1233172fbadda6e0627edcf6 (patch)
treeec3e2c55ddb3da7b5938253cb875a7c580bcb619
parentaf2f191e5278bb2510e7468c4b9c16c533f02035 (diff)
net: can: flexcan: Add pinmuxing in runtime_supsend
Due to the nature of CAN Tx/Rx pins have to be high when they are idle. After boot, CAN is put into runtime_suspend state. When using xceiver-supply in DT the power to the transceiver is turned off in this state. The Tx/Rx pins are then causing backfeeding. This patch adds selection of the sleep-state pins during runtime_suspend, so someone is able to define another muxing in this sate. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
-rw-r--r--drivers/net/can/flexcan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index f971d3432f9c..35bcf97e0ce1 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1779,6 +1779,7 @@ static int __maybe_unused flexcan_runtime_suspend(struct device *device)
struct flexcan_priv *priv = netdev_priv(dev);
flexcan_clks_disable(priv);
+ pinctrl_pm_select_sleep_state(priv->dev);
return 0;
}
@@ -1788,6 +1789,7 @@ static int __maybe_unused flexcan_runtime_resume(struct device *device)
struct net_device *dev = dev_get_drvdata(device);
struct flexcan_priv *priv = netdev_priv(dev);
+ pinctrl_pm_select_default_state(priv->dev);
flexcan_clks_enable(priv);
return 0;