aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/imx.c
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2018-09-05 09:24:27 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-18 16:07:24 +0200
commitfcfed1be53e014b9d707ca4520bb1591c2700f2e (patch)
treeb834b4071167d99abc1c97bdd99978267d2fff27 /drivers/tty/serial/imx.c
parenttty: serial: imx: add lock for registers save/restore (diff)
downloadlinux-dev-fcfed1be53e014b9d707ca4520bb1591c2700f2e.tar.xz
linux-dev-fcfed1be53e014b9d707ca4520bb1591c2700f2e.zip
tty: serial: imx: add pinctrl sleep/default mode switch for suspend
On some i.MX SoCs' low power mode, such as i.MX7D's LPSR(low power state retention), UART iomux settings will be lost, need to add pinctrl sleep/default mode switch during suspend/resume to make sure UART iomux settings are correct after resume. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/tty/serial/imx.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 2634272ad0fb..4341589e0aab 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -24,6 +24,7 @@
#include <linux/serial.h>
#include <linux/clk.h>
#include <linux/delay.h>
+#include <linux/pinctrl/consumer.h>
#include <linux/rational.h>
#include <linux/slab.h>
#include <linux/of.h>
@@ -2444,6 +2445,8 @@ static int imx_uart_suspend_noirq(struct device *dev)
clk_disable(sport->clk_ipg);
+ pinctrl_pm_select_sleep_state(dev);
+
return 0;
}
@@ -2452,6 +2455,8 @@ static int imx_uart_resume_noirq(struct device *dev)
struct imx_port *sport = dev_get_drvdata(dev);
int ret;
+ pinctrl_pm_select_default_state(dev);
+
ret = clk_enable(sport->clk_ipg);
if (ret)
return ret;