aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/amba-pl011.c
diff options
context:
space:
mode:
authorLeo Chen <leochen@broadcom.com>2009-07-28 18:43:33 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-09-02 06:21:15 -0400
commitb736b89f8a001cb73f020ca90a6fac77861cddf6 (patch)
tree212a779a79d6a55f21a5c159fb3c90950bb06556 /drivers/serial/amba-pl011.c
parent8afe0b96b36bb967a00658003736ffa97967ee80 (diff)
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>
Diffstat (limited to 'drivers/serial/amba-pl011.c')
-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)
826 return 0; 826 return 0;
827} 827}
828 828
829#ifdef CONFIG_PM
830static int pl011_suspend(struct amba_device *dev, pm_message_t state)
831{
832 struct uart_amba_port *uap = amba_get_drvdata(dev);
833
834 if (!uap)
835 return -EINVAL;
836
837 return uart_suspend_port(&amba_reg, &uap->port);
838}
839
840static int pl011_resume(struct amba_device *dev)
841{
842 struct uart_amba_port *uap = amba_get_drvdata(dev);
843
844 if (!uap)
845 return -EINVAL;
846
847 return uart_resume_port(&amba_reg, &uap->port);
848}
849#endif
850
829static struct amba_id pl011_ids[] __initdata = { 851static struct amba_id pl011_ids[] __initdata = {
830 { 852 {
831 .id = 0x00041011, 853 .id = 0x00041011,
@@ -847,6 +869,10 @@ static struct amba_driver pl011_driver = {
847 .id_table = pl011_ids, 869 .id_table = pl011_ids,
848 .probe = pl011_probe, 870 .probe = pl011_probe,
849 .remove = pl011_remove, 871 .remove = pl011_remove,
872#ifdef CONFIG_PM
873 .suspend = pl011_suspend,
874 .resume = pl011_resume,
875#endif
850}; 876};
851 877
852static int __init pl011_init(void) 878static int __init pl011_init(void)