lkml.org 
[lkml]   [2005]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[RFC][PATCH] basic PCI<->PCI bridge PM (suspend/resume) [9/9]
From
Date
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)

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

\
 
 \ /
  Last update: 2005-07-14 11:12    [W:0.031 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site