summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Chen <leochen@broadcom.com>2009-07-29 02:43:33 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-09-02 14:21:15 +0400
commitb736b89f8a001cb73f020ca90a6fac77861cddf6 (patch)
tree212a779a79d6a55f21a5c159fb3c90950bb06556
parent8afe0b96b36bb967a00658003736ffa97967ee80 (diff)
downloadlinux-b736b89f8a001cb73f020ca90a6fac77861cddf6.tar.xz
ARM: 5626/1: add suspend/resume functions to amba-pl011 serial driver
Add suspend/resume functions to the AMBA pl011 serial driver. Signed-off-by: Leo Chen <leochen@broadcom.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/serial/amba-pl011.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index bf82e28770a9..72ba0c6d3551 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -826,6 +826,28 @@ static int pl011_remove(struct amba_device *dev)
return 0;
}
+#ifdef CONFIG_PM
+static int pl011_suspend(struct amba_device *dev, pm_message_t state)
+{
+ struct uart_amba_port *uap = amba_get_drvdata(dev);
+
+ if (!uap)
+ return -EINVAL;
+
+ return uart_suspend_port(&amba_reg, &uap->port);
+}
+
+static int pl011_resume(struct amba_device *dev)
+{
+ struct uart_amba_port *uap = amba_get_drvdata(dev);
+
+ if (!uap)
+ return -EINVAL;
+
+ return uart_resume_port(&amba_reg, &uap->port);
+}
+#endif
+
static struct amba_id pl011_ids[] __initdata = {
{
.id = 0x00041011,
@@ -847,6 +869,10 @@ static struct amba_driver pl011_driver = {
.id_table = pl011_ids,
.probe = pl011_probe,
.remove = pl011_remove,
+#ifdef CONFIG_PM
+ .suspend = pl011_suspend,
+ .resume = pl011_resume,
+#endif
};
static int __init pl011_init(void)