diff options
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r-- | drivers/acpi/button.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 2345a5ee2dbb..40ed3ec9fc94 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -235,9 +235,6 @@ static int acpi_lid_notify_state(struct acpi_device *device, int state) | |||
235 | button->last_time = ktime_get(); | 235 | button->last_time = ktime_get(); |
236 | } | 236 | } |
237 | 237 | ||
238 | if (state) | ||
239 | acpi_pm_wakeup_event(&device->dev); | ||
240 | |||
241 | ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device); | 238 | ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device); |
242 | if (ret == NOTIFY_DONE) | 239 | if (ret == NOTIFY_DONE) |
243 | ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, | 240 | ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, |
@@ -366,7 +363,8 @@ int acpi_lid_open(void) | |||
366 | } | 363 | } |
367 | EXPORT_SYMBOL(acpi_lid_open); | 364 | EXPORT_SYMBOL(acpi_lid_open); |
368 | 365 | ||
369 | static int acpi_lid_update_state(struct acpi_device *device) | 366 | static int acpi_lid_update_state(struct acpi_device *device, |
367 | bool signal_wakeup) | ||
370 | { | 368 | { |
371 | int state; | 369 | int state; |
372 | 370 | ||
@@ -374,6 +372,9 @@ static int acpi_lid_update_state(struct acpi_device *device) | |||
374 | if (state < 0) | 372 | if (state < 0) |
375 | return state; | 373 | return state; |
376 | 374 | ||
375 | if (state && signal_wakeup) | ||
376 | acpi_pm_wakeup_event(&device->dev); | ||
377 | |||
377 | return acpi_lid_notify_state(device, state); | 378 | return acpi_lid_notify_state(device, state); |
378 | } | 379 | } |
379 | 380 | ||
@@ -384,7 +385,7 @@ static void acpi_lid_initialize_state(struct acpi_device *device) | |||
384 | (void)acpi_lid_notify_state(device, 1); | 385 | (void)acpi_lid_notify_state(device, 1); |
385 | break; | 386 | break; |
386 | case ACPI_BUTTON_LID_INIT_METHOD: | 387 | case ACPI_BUTTON_LID_INIT_METHOD: |
387 | (void)acpi_lid_update_state(device); | 388 | (void)acpi_lid_update_state(device, false); |
388 | break; | 389 | break; |
389 | case ACPI_BUTTON_LID_INIT_IGNORE: | 390 | case ACPI_BUTTON_LID_INIT_IGNORE: |
390 | default: | 391 | default: |
@@ -409,7 +410,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) | |||
409 | users = button->input->users; | 410 | users = button->input->users; |
410 | mutex_unlock(&button->input->mutex); | 411 | mutex_unlock(&button->input->mutex); |
411 | if (users) | 412 | if (users) |
412 | acpi_lid_update_state(device); | 413 | acpi_lid_update_state(device, true); |
413 | } else { | 414 | } else { |
414 | int keycode; | 415 | int keycode; |
415 | 416 | ||