From 0f64474b8f7f1f7f3af5b24ef997baa35f923509 Mon Sep 17 00:00:00 2001 From: David Shaohua Li Date: Sat, 19 Mar 2005 00:15:48 -0500 Subject: [ACPI] PCI can now get suspend state from firmware pci_choose_state() can now call platform_pci_choose_state() and ACPI can answer http://bugzilla.kernel.org/show_bug.cgi?id=4277 Signed-off-by: David Shaohua Li Signed-off-by: Len Brown --- drivers/pci/pci.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'drivers/pci/pci.c') diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f04b9ffe4153..5af941807785 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -304,6 +304,8 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) return 0; } +int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state) = NULL; + /** * pci_choose_state - Choose the power state of a PCI device * @dev: PCI device to be suspended @@ -316,10 +318,17 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { + int ret; + if (!pci_find_capability(dev, PCI_CAP_ID_PM)) return PCI_D0; - switch (state) { + if (platform_pci_choose_state) { + ret = platform_pci_choose_state(dev, state); + if (ret >= 0) + state = ret; + } + switch (state) { case 0: return PCI_D0; case 3: return PCI_D3hot; default: -- cgit v1.2.1