提交 f29219f1 编写于 作者: M Mike Galbraith 提交者: Linus Torvalds

[PATCH] make 8250_pnp serial driver work after suspend to ram

Add suspend/resume methods to drivers/serial/8250_pnp.c.  Tested on a
P4/HT 16550A box, ttyS0 login survives across suspend to ram.

[akpm@osdl.org: cleanups]
Signed-off-by: NMike Galbraith <efault@gmx.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 aaeab80b
...@@ -464,11 +464,38 @@ static void __devexit serial_pnp_remove(struct pnp_dev *dev) ...@@ -464,11 +464,38 @@ static void __devexit serial_pnp_remove(struct pnp_dev *dev)
serial8250_unregister_port(line - 1); serial8250_unregister_port(line - 1);
} }
#ifdef CONFIG_PM
static int serial_pnp_suspend(struct pnp_dev *dev, pm_message_t state)
{
long line = (long)pnp_get_drvdata(dev);
if (!line)
return -ENODEV;
serial8250_suspend_port(line - 1);
return 0;
}
static int serial_pnp_resume(struct pnp_dev *dev)
{
long line = (long)pnp_get_drvdata(dev);
if (!line)
return -ENODEV;
serial8250_resume_port(line - 1);
return 0;
}
#else
#define serial_pnp_suspend NULL
#define serial_pnp_resume NULL
#endif /* CONFIG_PM */
static struct pnp_driver serial_pnp_driver = { static struct pnp_driver serial_pnp_driver = {
.name = "serial", .name = "serial",
.id_table = pnp_dev_table,
.probe = serial_pnp_probe, .probe = serial_pnp_probe,
.remove = __devexit_p(serial_pnp_remove), .remove = __devexit_p(serial_pnp_remove),
.suspend = serial_pnp_suspend,
.resume = serial_pnp_resume,
.id_table = pnp_dev_table,
}; };
static int __init serial8250_pnp_init(void) static int __init serial8250_pnp_init(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册