diff options
author | David Shaohua Li <shaohua.li@intel.com> | 2005-03-19 00:15:48 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-07-11 23:46:10 -0400 |
commit | 0f64474b8f7f1f7f3af5b24ef997baa35f923509 (patch) | |
tree | 562570b58ae67bb4d341b2c9ff864a0a64eb4c28 /drivers/pci/pci.c | |
parent | 84df749f364209c9623304b7a94ddb954dc343bb (diff) |
[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 <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 11 |
1 files changed, 10 insertions, 1 deletions
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) | |||
304 | return 0; | 304 | return 0; |
305 | } | 305 | } |
306 | 306 | ||
307 | int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state) = NULL; | ||
308 | |||
307 | /** | 309 | /** |
308 | * pci_choose_state - Choose the power state of a PCI device | 310 | * pci_choose_state - Choose the power state of a PCI device |
309 | * @dev: PCI device to be suspended | 311 | * @dev: PCI device to be suspended |
@@ -316,10 +318,17 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
316 | 318 | ||
317 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) | 319 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) |
318 | { | 320 | { |
321 | int ret; | ||
322 | |||
319 | if (!pci_find_capability(dev, PCI_CAP_ID_PM)) | 323 | if (!pci_find_capability(dev, PCI_CAP_ID_PM)) |
320 | return PCI_D0; | 324 | return PCI_D0; |
321 | 325 | ||
322 | switch (state) { | 326 | if (platform_pci_choose_state) { |
327 | ret = platform_pci_choose_state(dev, state); | ||
328 | if (ret >= 0) | ||
329 | state = ret; | ||
330 | } | ||
331 | switch (state) { | ||
323 | case 0: return PCI_D0; | 332 | case 0: return PCI_D0; |
324 | case 3: return PCI_D3hot; | 333 | case 3: return PCI_D3hot; |
325 | default: | 334 | default: |