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

From: Adam Belay
Date: Thu Jul 14 2005 - 04:09:38 EST


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@xxxxxxxxxx>

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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/