aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sleep/proc.c')
-rw-r--r--drivers/acpi/sleep/proc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index 4ebbba2b6b19..bf5b04de02d1 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -377,6 +377,14 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
377 return 0; 377 return 0;
378} 378}
379 379
380static void physical_device_enable_wakeup(struct acpi_device *adev)
381{
382 struct device *dev = acpi_get_physical_device(adev->handle);
383
384 if (dev && device_can_wakeup(dev))
385 device_set_wakeup_enable(dev, adev->wakeup.state.enabled);
386}
387
380static ssize_t 388static ssize_t
381acpi_system_write_wakeup_device(struct file *file, 389acpi_system_write_wakeup_device(struct file *file,
382 const char __user * buffer, 390 const char __user * buffer,
@@ -411,6 +419,7 @@ acpi_system_write_wakeup_device(struct file *file,
411 } 419 }
412 } 420 }
413 if (found_dev) { 421 if (found_dev) {
422 physical_device_enable_wakeup(found_dev);
414 list_for_each_safe(node, next, &acpi_wakeup_device_list) { 423 list_for_each_safe(node, next, &acpi_wakeup_device_list) {
415 struct acpi_device *dev = container_of(node, 424 struct acpi_device *dev = container_of(node,
416 struct 425 struct
@@ -428,6 +437,7 @@ acpi_system_write_wakeup_device(struct file *file,
428 dev->pnp.bus_id, found_dev->pnp.bus_id); 437 dev->pnp.bus_id, found_dev->pnp.bus_id);
429 dev->wakeup.state.enabled = 438 dev->wakeup.state.enabled =
430 found_dev->wakeup.state.enabled; 439 found_dev->wakeup.state.enabled;
440 physical_device_enable_wakeup(dev);
431 } 441 }
432 } 442 }
433 } 443 }