summaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-23 19:54:39 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-27 19:52:32 -0400
commit4d183d04195318c8ee8bce048f3f9a89c0e2056d (patch)
tree2dafd73b9608fe34da773fbf77c1b0f23531bd32 /drivers/pnp
parenta1a66393e39a97433bcc1737133ba7478993d247 (diff)
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/pnp')
-rw-r--r--drivers/pnp/pnpacpi/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 9113876487ed..3a4c1aa0201e 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -149,8 +149,8 @@ static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state)
149 } 149 }
150 150
151 if (device_can_wakeup(&dev->dev)) { 151 if (device_can_wakeup(&dev->dev)) {
152 error = acpi_pm_device_sleep_wake(&dev->dev, 152 error = acpi_pm_set_device_wakeup(&dev->dev,
153 device_may_wakeup(&dev->dev)); 153 device_may_wakeup(&dev->dev));
154 if (error) 154 if (error)
155 return error; 155 return error;
156 } 156 }
@@ -185,7 +185,7 @@ static int pnpacpi_resume(struct pnp_dev *dev)
185 } 185 }
186 186
187 if (device_may_wakeup(&dev->dev)) 187 if (device_may_wakeup(&dev->dev))
188 acpi_pm_device_sleep_wake(&dev->dev, false); 188 acpi_pm_set_device_wakeup(&dev->dev, false);
189 189
190 if (acpi_device_power_manageable(acpi_dev)) 190 if (acpi_device_power_manageable(acpi_dev))
191 error = acpi_device_set_power(acpi_dev, ACPI_STATE_D0); 191 error = acpi_device_set_power(acpi_dev, ACPI_STATE_D0);