diff options
author | Leo Chen <leochen@broadcom.com> | 2009-07-28 18:43:33 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-02 06:21:15 -0400 |
commit | b736b89f8a001cb73f020ca90a6fac77861cddf6 (patch) | |
tree | 212a779a79d6a55f21a5c159fb3c90950bb06556 /drivers/serial/amba-pl011.c | |
parent | 8afe0b96b36bb967a00658003736ffa97967ee80 (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.c | 26 |
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 | ||
830 | static 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 | |||
840 | static 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 | |||
829 | static struct amba_id pl011_ids[] __initdata = { | 851 | static 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 | ||
852 | static int __init pl011_init(void) | 878 | static int __init pl011_init(void) |