From 0612630250610d4969a5116970126febad9bfd43 Mon Sep 17 00:00:00 2001 From: Philippe Schenker Date: Fri, 1 Feb 2019 16:00:13 +0100 Subject: 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 --- drivers/net/can/flexcan.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net') diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 3c8cf01838d4..550ae1f8b318 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -1987,6 +1987,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; } @@ -1996,6 +1997,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; -- cgit v1.2.3