Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 241675
b: refs/heads/master
c: c19f9a8
h: refs/heads/master
i:
  241673: 0918a7c
  241671: 143899c
v: v3
  • Loading branch information
Rafael J. Wysocki committed Feb 24, 2011
1 parent 771544f commit a84342f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: 5190726765b40774c069e187a958e10ccd970e65
refs/heads/master: c19f9a84ec807da57fd75bbd9a3f2b8269611f79
9 changes: 7 additions & 2 deletions trunk/drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ struct acpi_button {
struct input_dev *input;
char phys[32]; /* for input device */
unsigned long pushed;
bool wakeup_enabled;
};

static const struct file_operations acpi_button_info_fops = {
Expand Down Expand Up @@ -430,7 +431,10 @@ static int acpi_button_add(struct acpi_device *device)
/* Button's GPE is run-wake GPE */
acpi_enable_gpe(device->wakeup.gpe_device,
device->wakeup.gpe_number);
device_set_wakeup_enable(&device->dev, true);
if (!device_may_wakeup(&device->dev)) {
device_set_wakeup_enable(&device->dev, true);
button->wakeup_enabled = true;
}
}

printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));
Expand All @@ -452,7 +456,8 @@ static int acpi_button_remove(struct acpi_device *device, int type)
if (device->wakeup.flags.valid) {
acpi_disable_gpe(device->wakeup.gpe_device,
device->wakeup.gpe_number);
device_set_wakeup_enable(&device->dev, false);
if (button->wakeup_enabled)
device_set_wakeup_enable(&device->dev, false);
}

acpi_button_remove_fs(device);
Expand Down

0 comments on commit a84342f

Please sign in to comment.