Skip to content

Commit

Permalink
ARM: 5626/1: add suspend/resume functions to amba-pl011 serial driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Leo Chen authored and Russell King committed Sep 2, 2009
1 parent 8afe0b9 commit b736b89
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions drivers/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit b736b89

Please sign in to comment.