diff options
author | Mike Galbraith <efault@gmx.de> | 2006-12-06 23:39:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:43 -0500 |
commit | f29219f17ae46cc182123bc7d2089b69869935ae (patch) | |
tree | c51881ddd5dc3adf8f868eb46c9056b071c08881 | |
parent | aaeab80bdbc0d10a98adc6fa76c29ca2f1816553 (diff) |
[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: Mike 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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/serial/8250_pnp.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index 71d907c8288b..d3d6b82706b5 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c | |||
@@ -464,11 +464,38 @@ static void __devexit serial_pnp_remove(struct pnp_dev *dev) | |||
464 | serial8250_unregister_port(line - 1); | 464 | serial8250_unregister_port(line - 1); |
465 | } | 465 | } |
466 | 466 | ||
467 | #ifdef CONFIG_PM | ||
468 | static int serial_pnp_suspend(struct pnp_dev *dev, pm_message_t state) | ||
469 | { | ||
470 | long line = (long)pnp_get_drvdata(dev); | ||
471 | |||
472 | if (!line) | ||
473 | return -ENODEV; | ||
474 | serial8250_suspend_port(line - 1); | ||
475 | return 0; | ||
476 | } | ||
477 | |||
478 | static int serial_pnp_resume(struct pnp_dev *dev) | ||
479 | { | ||
480 | long line = (long)pnp_get_drvdata(dev); | ||
481 | |||
482 | if (!line) | ||
483 | return -ENODEV; | ||
484 | serial8250_resume_port(line - 1); | ||
485 | return 0; | ||
486 | } | ||
487 | #else | ||
488 | #define serial_pnp_suspend NULL | ||
489 | #define serial_pnp_resume NULL | ||
490 | #endif /* CONFIG_PM */ | ||
491 | |||
467 | static struct pnp_driver serial_pnp_driver = { | 492 | static struct pnp_driver serial_pnp_driver = { |
468 | .name = "serial", | 493 | .name = "serial", |
469 | .id_table = pnp_dev_table, | ||
470 | .probe = serial_pnp_probe, | 494 | .probe = serial_pnp_probe, |
471 | .remove = __devexit_p(serial_pnp_remove), | 495 | .remove = __devexit_p(serial_pnp_remove), |
496 | .suspend = serial_pnp_suspend, | ||
497 | .resume = serial_pnp_resume, | ||
498 | .id_table = pnp_dev_table, | ||
472 | }; | 499 | }; |
473 | 500 | ||
474 | static int __init serial8250_pnp_init(void) | 501 | static int __init serial8250_pnp_init(void) |