aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorDavid Shaohua Li <shaohua.li@intel.com>2005-03-19 00:15:48 -0500
committerLen Brown <len.brown@intel.com>2005-07-11 23:46:10 -0400
commit0f64474b8f7f1f7f3af5b24ef997baa35f923509 (patch)
tree562570b58ae67bb4d341b2c9ff864a0a64eb4c28 /drivers/pci/pci.c
parent84df749f364209c9623304b7a94ddb954dc343bb (diff)
downloadkernel_samsung_crespo-0f64474b8f7f1f7f3af5b24ef997baa35f923509.zip
kernel_samsung_crespo-0f64474b8f7f1f7f3af5b24ef997baa35f923509.tar.gz
kernel_samsung_crespo-0f64474b8f7f1f7f3af5b24ef997baa35f923509.tar.bz2
[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.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f04b9ff..5af9418 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: