Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127419
b: refs/heads/master
c: 571ff75
h: refs/heads/master
i:
  127417: 5da023c
  127415: 591dbab
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Jesse Barnes committed Jan 7, 2009
1 parent 81a188f commit ab38ecd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa58d305d9925b01830e535896a7227a868a9e15
refs/heads/master: 571ff7584bb9e05fca0eb79752ae55a46faf3a98
33 changes: 29 additions & 4 deletions trunk/drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,31 @@ static int pci_legacy_resume_early(struct device *dev)
return error;
}

/* Auxiliary functions used by the new power management framework */

static bool pci_is_bridge(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}

static int pci_pm_default_resume(struct pci_dev *pci_dev)
{
if (!pci_is_bridge(pci_dev))
pci_enable_wake(pci_dev, PCI_D0, false);

return pci_default_pm_resume_late(pci_dev);
}

static void pci_pm_default_suspend(struct pci_dev *pci_dev)
{
pci_default_pm_suspend_early(pci_dev);

if (!pci_is_bridge(pci_dev))
pci_prepare_to_sleep(pci_dev);
}

/* New power management framework */

static int pci_pm_prepare(struct device *dev)
{
struct device_driver *drv = dev->driver;
Expand Down Expand Up @@ -470,7 +495,7 @@ static int pci_pm_suspend(struct device *dev)
} else if (pci_has_legacy_pm_support(pci_dev)) {
error = pci_legacy_suspend(dev, PMSG_SUSPEND);
} else {
pci_default_pm_suspend_early(pci_dev);
pci_pm_default_suspend(pci_dev);
}

pci_fixup_device(pci_fixup_suspend, pci_dev);
Expand Down Expand Up @@ -512,7 +537,7 @@ static int pci_pm_resume(struct device *dev)
} else if (pci_has_legacy_pm_support(pci_dev)) {
error = pci_legacy_resume(dev);
} else {
error = pci_default_pm_resume_late(pci_dev);
error = pci_pm_default_resume(pci_dev);
}

return error;
Expand Down Expand Up @@ -642,7 +667,7 @@ static int pci_pm_poweroff(struct device *dev)
} else if (pci_has_legacy_pm_support(pci_dev)) {
error = pci_legacy_suspend(dev, PMSG_HIBERNATE);
} else {
pci_default_pm_suspend_early(pci_dev);
pci_pm_default_suspend(pci_dev);
}

pci_fixup_device(pci_fixup_suspend, pci_dev);
Expand Down Expand Up @@ -681,7 +706,7 @@ static int pci_pm_restore(struct device *dev)
} else if (pci_has_legacy_pm_support(pci_dev)) {
error = pci_legacy_resume(dev);
} else {
error = pci_default_pm_resume_late(pci_dev);
error = pci_pm_default_resume(pci_dev);
}

return error;
Expand Down

0 comments on commit ab38ecd

Please sign in to comment.