summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-24 02:54:39 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-28 02:52:32 +0300
commit4d183d04195318c8ee8bce048f3f9a89c0e2056d (patch)
tree2dafd73b9608fe34da773fbf77c1b0f23531bd32 /drivers/pci
parenta1a66393e39a97433bcc1737133ba7478993d247 (diff)
downloadlinux-4d183d04195318c8ee8bce048f3f9a89c0e2056d.tar.xz
ACPI / PM: Consolidate device wakeup settings code
Currently, there are two separate ways of handling device wakeup settings in the ACPI core, depending on whether this is runtime wakeup or system wakeup (from sleep states). However, after the previous commit eliminating the run_wake ACPI device wakeup flag, there is no difference between the two any more at the ACPI level, so they can be combined. For this reason, introduce acpi_pm_set_device_wakeup() to replace both acpi_pm_device_run_wake() and acpi_pm_device_sleep_wake() and make it check the ACPI device object's wakeup.valid flag to determine whether or not the device can be set up to generate wakeup signals. Also notice that zpodd_enable/disable_run_wake() only call device_set_run_wake() because acpi_pm_device_run_wake() called device_run_wake(), which is not done by acpi_pm_set_device_wakeup(), so drop the now redundant device_set_run_wake() calls from there. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci-acpi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index f084046e1feb..eb014b8ab01a 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -578,20 +578,20 @@ static bool acpi_pci_can_wakeup(struct pci_dev *dev)
static void acpi_pci_propagate_wakeup_enable(struct pci_bus *bus, bool enable)
{
while (bus->parent) {
- if (!acpi_pm_device_sleep_wake(&bus->self->dev, enable))
+ if (!acpi_pm_set_device_wakeup(&bus->self->dev, enable))
return;
bus = bus->parent;
}
/* We have reached the root bus. */
if (bus->bridge)
- acpi_pm_device_sleep_wake(bus->bridge, enable);
+ acpi_pm_set_device_wakeup(bus->bridge, enable);
}
static int acpi_pci_sleep_wake(struct pci_dev *dev, bool enable)
{
if (acpi_pci_can_wakeup(dev))
- return acpi_pm_device_sleep_wake(&dev->dev, enable);
+ return acpi_pm_set_device_wakeup(&dev->dev, enable);
acpi_pci_propagate_wakeup_enable(dev->bus, enable);
return 0;
@@ -604,14 +604,14 @@ static void acpi_pci_propagate_run_wake(struct pci_bus *bus, bool enable)
if (bridge->pme_interrupt)
return;
- if (!acpi_pm_device_run_wake(&bridge->dev, enable))
+ if (!acpi_pm_set_device_wakeup(&bridge->dev, enable))
return;
bus = bus->parent;
}
/* We have reached the root bus. */
if (bus->bridge)
- acpi_pm_device_run_wake(bus->bridge, enable);
+ acpi_pm_set_device_wakeup(bus->bridge, enable);
}
static int acpi_pci_run_wake(struct pci_dev *dev, bool enable)
@@ -625,7 +625,7 @@ static int acpi_pci_run_wake(struct pci_dev *dev, bool enable)
if (dev->pme_interrupt && !dev->runtime_d3cold)
return 0;
- if (!acpi_pm_device_run_wake(&dev->dev, enable))
+ if (!acpi_pm_set_device_wakeup(&dev->dev, enable))
return 0;
acpi_pci_propagate_run_wake(dev->bus, enable);