summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/8250
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2012-10-15 09:25:58 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-24 18:34:51 (GMT)
commitb61c5ed57195ec97006d8d3ede1f583f6618b79e (patch)
treee532940e3c25aa6221adde0258baeb1604deb692 /drivers/tty/serial/8250
parent59c2e855e43735f4ab93b8b8db96206219f6c1d4 (diff)
downloadlinux-b61c5ed57195ec97006d8d3ede1f583f6618b79e.tar.xz
tty: serial: 8250_dw: Implement suspend/resume
Implement suspend and resume callbacks for DesignWare 8250 driver. They're simple wrappers around serial8250_{suspend,resume}_port. Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250')
-rw-r--r--drivers/tty/serial/8250/8250_dw.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index c3b2ec0..b19b8c5 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -161,6 +161,29 @@ static int __devexit dw8250_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM
+static int dw8250_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct dw8250_data *data = platform_get_drvdata(pdev);
+
+ serial8250_suspend_port(data->line);
+
+ return 0;
+}
+
+static int dw8250_resume(struct platform_device *pdev)
+{
+ struct dw8250_data *data = platform_get_drvdata(pdev);
+
+ serial8250_resume_port(data->line);
+
+ return 0;
+}
+#else
+#define dw8250_suspend NULL
+#define dw8250_resume NULL
+#endif /* CONFIG_PM */
+
static const struct of_device_id dw8250_match[] = {
{ .compatible = "snps,dw-apb-uart" },
{ /* Sentinel */ }
@@ -175,6 +198,8 @@ static struct platform_driver dw8250_platform_driver = {
},
.probe = dw8250_probe,
.remove = __devexit_p(dw8250_remove),
+ .suspend = dw8250_suspend,
+ .resume = dw8250_resume,
};
module_platform_driver(dw8250_platform_driver);