* [RFC][PATCH] basic PCI<->PCI bridge PM (suspend/resume) [9/9]
@ 2005-07-14 8:55 Adam Belay
0 siblings, 0 replies; only message in thread
From: Adam Belay @ 2005-07-14 8:55 UTC (permalink / raw)
To: linux-kernel; +Cc: greg
This patch adds very simplistic suspend/resume support for the PCI
bridge driver. Soon this will be replaced with bridge specific code,
but for now we'll try using pci_save/restore_state().
Signed-off-by: Adam Belay <abelay@novell.com>
--- a/drivers/pci/bus/pci-bridge.c 2005-07-14 04:22:13.000000000 -0400
+++ b/drivers/pci/bus/pci-bridge.c 2005-07-14 04:26:17.257004064 -0400
@@ -159,11 +159,29 @@
pci_remove_bus(dev->subordinate);
}
+static int ppb_suspend(struct pci_dev *dev, pm_message_t state)
+{
+ pci_save_state(dev);
+ pci_set_power_state(dev, pci_choose_state(dev, state));
+
+ return 0;
+}
+
+static int ppb_resume(struct pci_dev *dev)
+{
+ pci_set_power_state(dev, PCI_D0);
+ pci_restore_state(dev);
+
+ return 0;
+}
+
static struct pci_driver ppb_driver = {
.name = "pci-bridge",
.id_table = ppb_id_tbl,
.probe = ppb_probe,
.remove = ppb_remove,
+ .suspend = ppb_suspend,
+ .resume = ppb_resume,
};
static int __init ppb_init(void)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-07-14 9:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-14 8:55 [RFC][PATCH] basic PCI<->PCI bridge PM (suspend/resume) [9/9] Adam Belay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox