aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/button.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r--drivers/acpi/button.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index e643a0936dc4..12c28f4adb67 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -98,6 +98,7 @@ struct acpi_button {
98 struct input_dev *input; 98 struct input_dev *input;
99 char phys[32]; /* for input device */ 99 char phys[32]; /* for input device */
100 unsigned long pushed; 100 unsigned long pushed;
101 bool wakeup_enabled;
101}; 102};
102 103
103static const struct file_operations acpi_button_info_fops = { 104static const struct file_operations acpi_button_info_fops = {
@@ -430,7 +431,10 @@ static int acpi_button_add(struct acpi_device *device)
430 /* Button's GPE is run-wake GPE */ 431 /* Button's GPE is run-wake GPE */
431 acpi_enable_gpe(device->wakeup.gpe_device, 432 acpi_enable_gpe(device->wakeup.gpe_device,
432 device->wakeup.gpe_number); 433 device->wakeup.gpe_number);
433 device_set_wakeup_enable(&device->dev, true); 434 if (!device_may_wakeup(&device->dev)) {
435 device_set_wakeup_enable(&device->dev, true);
436 button->wakeup_enabled = true;
437 }
434 } 438 }
435 439
436 printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device)); 440 printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));
@@ -452,7 +456,8 @@ static int acpi_button_remove(struct acpi_device *device, int type)
452 if (device->wakeup.flags.valid) { 456 if (device->wakeup.flags.valid) {
453 acpi_disable_gpe(device->wakeup.gpe_device, 457 acpi_disable_gpe(device->wakeup.gpe_device,
454 device->wakeup.gpe_number); 458 device->wakeup.gpe_number);
455 device_set_wakeup_enable(&device->dev, false); 459 if (button->wakeup_enabled)
460 device_set_wakeup_enable(&device->dev, false);
456 } 461 }
457 462
458 acpi_button_remove_fs(device); 463 acpi_button_remove_fs(device);