summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/msm_serial.c
diff options
context:
space:
mode:
authorPascal Huerst <pascal.huerst@gmail.com>2018-04-11 14:50:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-22 18:32:43 +0300
commit7a91e382974c2d75c8a49022c361113c7d8f4935 (patch)
tree7389e9d1c13098a9ba2a6d7baea5d971616c7565 /drivers/tty/serial/msm_serial.c
parenta406c4b8097473a1294ab056e65df801382b8f28 (diff)
downloadlinux-7a91e382974c2d75c8a49022c361113c7d8f4935.tar.xz
tty: serial: msm_serial: Add support for suspend/resume
Without this, tx stops working after resume. By adding these calls, everything seems to work fine. Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/msm_serial.c')
-rw-r--r--drivers/tty/serial/msm_serial.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index ee96cf0d0057..33cd6e59ea69 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -1812,11 +1812,36 @@ static const struct of_device_id msm_match_table[] = {
};
MODULE_DEVICE_TABLE(of, msm_match_table);
+#ifdef CONFIG_PM_SLEEP
+static int msm_serial_suspend(struct device *dev)
+{
+ struct msm_port *port = dev_get_drvdata(dev);
+
+ uart_suspend_port(&msm_uart_driver, &port->uart);
+
+ return 0;
+}
+
+static int msm_serial_resume(struct device *dev)
+{
+ struct msm_port *port = dev_get_drvdata(dev);
+
+ uart_resume_port(&msm_uart_driver, &port->uart);
+
+ return 0;
+}
+#endif /* CONFIG_PM_SLEEP */
+
+static const struct dev_pm_ops msm_serial_dev_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(msm_serial_suspend, msm_serial_resume)
+};
+
static struct platform_driver msm_platform_driver = {
.remove = msm_serial_remove,
.probe = msm_serial_probe,
.driver = {
.name = "msm_serial",
+ .pm = &msm_serial_dev_pm_ops,
.of_match_table = msm_match_table,
},
};