diff options
author | Lan Tianyu <tianyu.lan@intel.com> | 2013-12-12 05:08:17 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-12-19 09:07:00 -0500 |
commit | 8eaa29f92a66c92ade1ad663d14d975d776ef492 (patch) | |
tree | a93ce49ff4c5300c5a73412f2490ae3f128ea037 /drivers/acpi/button.c | |
parent | 319e2e3f63c348a9b66db4667efa73178e18b17d (diff) |
ACPI / Button: Fix enabling button GPEs twice
Button GPEs have been enabled in the acpi_wake_device_init() during
boot and the button driver enables them for the second time.
Consequently, it is necessary to do
# echo disable > /sys/firmware/acpi/interrupts/gpeXXX
twice in a row to disable those GPEs via sysfs. This patch is to
remove the GPE enabling code from the button driver to avoid the
problem.
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r-- | drivers/acpi/button.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index c971929d75c2..5401e9a98b35 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -101,7 +101,6 @@ struct acpi_button { | |||
101 | struct input_dev *input; | 101 | struct input_dev *input; |
102 | char phys[32]; /* for input device */ | 102 | char phys[32]; /* for input device */ |
103 | unsigned long pushed; | 103 | unsigned long pushed; |
104 | bool wakeup_enabled; | ||
105 | }; | 104 | }; |
106 | 105 | ||
107 | static BLOCKING_NOTIFIER_HEAD(acpi_lid_notifier); | 106 | static BLOCKING_NOTIFIER_HEAD(acpi_lid_notifier); |
@@ -407,16 +406,6 @@ static int acpi_button_add(struct acpi_device *device) | |||
407 | lid_device = device; | 406 | lid_device = device; |
408 | } | 407 | } |
409 | 408 | ||
410 | if (device->wakeup.flags.valid) { | ||
411 | /* Button's GPE is run-wake GPE */ | ||
412 | acpi_enable_gpe(device->wakeup.gpe_device, | ||
413 | device->wakeup.gpe_number); | ||
414 | if (!device_may_wakeup(&device->dev)) { | ||
415 | device_set_wakeup_enable(&device->dev, true); | ||
416 | button->wakeup_enabled = true; | ||
417 | } | ||
418 | } | ||
419 | |||
420 | printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device)); | 409 | printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device)); |
421 | return 0; | 410 | return 0; |
422 | 411 | ||
@@ -433,13 +422,6 @@ static int acpi_button_remove(struct acpi_device *device) | |||
433 | { | 422 | { |
434 | struct acpi_button *button = acpi_driver_data(device); | 423 | struct acpi_button *button = acpi_driver_data(device); |
435 | 424 | ||
436 | if (device->wakeup.flags.valid) { | ||
437 | acpi_disable_gpe(device->wakeup.gpe_device, | ||
438 | device->wakeup.gpe_number); | ||
439 | if (button->wakeup_enabled) | ||
440 | device_set_wakeup_enable(&device->dev, false); | ||
441 | } | ||
442 | |||
443 | acpi_button_remove_fs(device); | 425 | acpi_button_remove_fs(device); |
444 | input_unregister_device(button->input); | 426 | input_unregister_device(button->input); |
445 | kfree(button); | 427 | kfree(button); |