Skip to contentSkip to conversation

basic PCI<->PCI bridge PM (suspend/resume) [9/9]

RFC PATCH New Adam Belay 1 participant 1 message Jul 14, 2005 PCI

lore
Share & tools
lore

Adam Belay

author
#0 lore raw

RFC PATCH 1/1 basic PCI<->PCI bridge PM (suspend/resume) [9/9]

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().

drivers/pci/bus/pci-bridge.c +18 -0
@@ -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)