diff options
| -rw-r--r-- | drivers/acpi/acpica/acevents.h | 2 | ||||
| -rw-r--r-- | drivers/acpi/acpica/aclocal.h | 1 | ||||
| -rw-r--r-- | drivers/acpi/acpica/evgpe.c | 21 | ||||
| -rw-r--r-- | drivers/acpi/acpica/evgpeblk.c | 3 | ||||
| -rw-r--r-- | drivers/acpi/acpica/evgpeinit.c | 3 | ||||
| -rw-r--r-- | drivers/acpi/acpica/evxfevnt.c | 119 | ||||
| -rw-r--r-- | drivers/acpi/button.c | 6 | ||||
| -rw-r--r-- | drivers/acpi/ec.c | 6 | ||||
| -rw-r--r-- | drivers/acpi/system.c | 6 | ||||
| -rw-r--r-- | drivers/pci/pci-acpi.c | 6 | ||||
| -rw-r--r-- | include/acpi/acpixf.h | 6 | ||||
| -rw-r--r-- | include/acpi/actypes.h | 6 |
12 files changed, 50 insertions, 135 deletions
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index c3f43daa8be3..a561944fbaf9 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h | |||
| @@ -78,7 +78,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node *node, | |||
| 78 | u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list); | 78 | u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list); |
| 79 | 79 | ||
| 80 | acpi_status | 80 | acpi_status |
| 81 | acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info); | 81 | acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info); |
| 82 | 82 | ||
| 83 | struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, | 83 | struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, |
| 84 | u32 gpe_number); | 84 | u32 gpe_number); |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index eb2d420b39ec..1ee0bcf399aa 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
| @@ -429,7 +429,6 @@ struct acpi_gpe_event_info { | |||
| 429 | u8 flags; /* Misc info about this GPE */ | 429 | u8 flags; /* Misc info about this GPE */ |
| 430 | u8 gpe_number; /* This GPE */ | 430 | u8 gpe_number; /* This GPE */ |
| 431 | u8 runtime_count; /* References to a run GPE */ | 431 | u8 runtime_count; /* References to a run GPE */ |
| 432 | u8 wakeup_count; /* References to a wake GPE */ | ||
| 433 | }; | 432 | }; |
| 434 | 433 | ||
| 435 | /* Information about a GPE register pair, one per each status/enable pair in an array */ | 434 | /* Information about a GPE register pair, one per each status/enable pair in an array */ |
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c index d24d7d31f40c..9413ac61e440 100644 --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c | |||
| @@ -54,24 +54,24 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context); | |||
| 54 | 54 | ||
| 55 | /******************************************************************************* | 55 | /******************************************************************************* |
| 56 | * | 56 | * |
| 57 | * FUNCTION: acpi_ev_update_gpe_enable_masks | 57 | * FUNCTION: acpi_ev_update_gpe_enable_mask |
| 58 | * | 58 | * |
| 59 | * PARAMETERS: gpe_event_info - GPE to update | 59 | * PARAMETERS: gpe_event_info - GPE to update |
| 60 | * | 60 | * |
| 61 | * RETURN: Status | 61 | * RETURN: Status |
| 62 | * | 62 | * |
| 63 | * DESCRIPTION: Updates GPE register enable masks based upon whether there are | 63 | * DESCRIPTION: Updates GPE register enable mask based upon whether there are |
| 64 | * references (either wake or run) to this GPE | 64 | * runtime references to this GPE |
| 65 | * | 65 | * |
| 66 | ******************************************************************************/ | 66 | ******************************************************************************/ |
| 67 | 67 | ||
| 68 | acpi_status | 68 | acpi_status |
| 69 | acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info) | 69 | acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info) |
| 70 | { | 70 | { |
| 71 | struct acpi_gpe_register_info *gpe_register_info; | 71 | struct acpi_gpe_register_info *gpe_register_info; |
| 72 | u32 register_bit; | 72 | u32 register_bit; |
| 73 | 73 | ||
| 74 | ACPI_FUNCTION_TRACE(ev_update_gpe_enable_masks); | 74 | ACPI_FUNCTION_TRACE(ev_update_gpe_enable_mask); |
| 75 | 75 | ||
| 76 | gpe_register_info = gpe_event_info->register_info; | 76 | gpe_register_info = gpe_event_info->register_info; |
| 77 | if (!gpe_register_info) { | 77 | if (!gpe_register_info) { |
| @@ -81,19 +81,14 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info) | |||
| 81 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info, | 81 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info, |
| 82 | gpe_register_info); | 82 | gpe_register_info); |
| 83 | 83 | ||
| 84 | /* Clear the wake/run bits up front */ | 84 | /* Clear the run bit up front */ |
| 85 | 85 | ||
| 86 | ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake, register_bit); | ||
| 87 | ACPI_CLEAR_BIT(gpe_register_info->enable_for_run, register_bit); | 86 | ACPI_CLEAR_BIT(gpe_register_info->enable_for_run, register_bit); |
| 88 | 87 | ||
| 89 | /* Set the mask bits only if there are references to this GPE */ | 88 | /* Set the mask bit only if there are references to this GPE */ |
| 90 | 89 | ||
| 91 | if (gpe_event_info->runtime_count) { | 90 | if (gpe_event_info->runtime_count) { |
| 92 | ACPI_SET_BIT(gpe_register_info->enable_for_run, register_bit); | 91 | ACPI_SET_BIT(gpe_register_info->enable_for_run, (u8)register_bit); |
| 93 | } | ||
| 94 | |||
| 95 | if (gpe_event_info->wakeup_count) { | ||
| 96 | ACPI_SET_BIT(gpe_register_info->enable_for_wake, register_bit); | ||
| 97 | } | 92 | } |
| 98 | 93 | ||
| 99 | return_ACPI_STATUS(AE_OK); | 94 | return_ACPI_STATUS(AE_OK); |
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c index 341a38ce8aa6..77e8630043f8 100644 --- a/drivers/acpi/acpica/evgpeblk.c +++ b/drivers/acpi/acpica/evgpeblk.c | |||
| @@ -529,8 +529,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device, | |||
| 529 | 529 | ||
| 530 | /* Enable this GPE */ | 530 | /* Enable this GPE */ |
| 531 | 531 | ||
| 532 | status = acpi_enable_gpe(gpe_device, gpe_number, | 532 | status = acpi_enable_gpe(gpe_device, gpe_number); |
| 533 | ACPI_GPE_TYPE_RUNTIME); | ||
| 534 | if (ACPI_FAILURE(status)) { | 533 | if (ACPI_FAILURE(status)) { |
| 535 | ACPI_EXCEPTION((AE_INFO, status, | 534 | ACPI_EXCEPTION((AE_INFO, status, |
| 536 | "Could not enable GPE 0x%02X", | 535 | "Could not enable GPE 0x%02X", |
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c index 3f6c2d26410d..8db9e076a53b 100644 --- a/drivers/acpi/acpica/evgpeinit.c +++ b/drivers/acpi/acpica/evgpeinit.c | |||
| @@ -482,8 +482,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle, | |||
| 482 | gpe_device = NULL; | 482 | gpe_device = NULL; |
| 483 | } | 483 | } |
| 484 | 484 | ||
| 485 | status = acpi_enable_gpe(gpe_device, gpe_number, | 485 | status = acpi_enable_gpe(gpe_device, gpe_number); |
| 486 | ACPI_GPE_TYPE_RUNTIME); | ||
| 487 | if (ACPI_FAILURE(status)) { | 486 | if (ACPI_FAILURE(status)) { |
| 488 | ACPI_EXCEPTION((AE_INFO, status, | 487 | ACPI_EXCEPTION((AE_INFO, status, |
| 489 | "Could not enable GPE 0x%02X", | 488 | "Could not enable GPE 0x%02X", |
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c index d6a6d4a76592..467fde961aef 100644 --- a/drivers/acpi/acpica/evxfevnt.c +++ b/drivers/acpi/acpica/evxfevnt.c | |||
| @@ -352,12 +352,13 @@ acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action) | |||
| 352 | 352 | ||
| 353 | switch (action) { | 353 | switch (action) { |
| 354 | case ACPI_GPE_ENABLE: | 354 | case ACPI_GPE_ENABLE: |
| 355 | ACPI_SET_BIT(gpe_register_info->enable_for_wake, register_bit); | 355 | ACPI_SET_BIT(gpe_register_info->enable_for_wake, |
| 356 | (u8)register_bit); | ||
| 356 | break; | 357 | break; |
| 357 | 358 | ||
| 358 | case ACPI_GPE_DISABLE: | 359 | case ACPI_GPE_DISABLE: |
| 359 | ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake, | 360 | ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake, |
| 360 | register_bit); | 361 | (u8)register_bit); |
| 361 | break; | 362 | break; |
| 362 | 363 | ||
| 363 | default: | 364 | default: |
| @@ -379,17 +380,14 @@ ACPI_EXPORT_SYMBOL(acpi_gpe_wakeup) | |||
| 379 | * | 380 | * |
| 380 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 | 381 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 |
| 381 | * gpe_number - GPE level within the GPE block | 382 | * gpe_number - GPE level within the GPE block |
| 382 | * gpe_type - ACPI_GPE_TYPE_RUNTIME or ACPI_GPE_TYPE_WAKE | ||
| 383 | * or both | ||
| 384 | * | 383 | * |
| 385 | * RETURN: Status | 384 | * RETURN: Status |
| 386 | * | 385 | * |
| 387 | * DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is | 386 | * DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is |
| 388 | * hardware-enabled (for runtime GPEs), or the GPE register mask | 387 | * hardware-enabled. |
| 389 | * is updated (for wake GPEs). | ||
| 390 | * | 388 | * |
| 391 | ******************************************************************************/ | 389 | ******************************************************************************/ |
| 392 | acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type) | 390 | acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number) |
| 393 | { | 391 | { |
| 394 | acpi_status status = AE_OK; | 392 | acpi_status status = AE_OK; |
| 395 | struct acpi_gpe_event_info *gpe_event_info; | 393 | struct acpi_gpe_event_info *gpe_event_info; |
| @@ -397,12 +395,6 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type) | |||
| 397 | 395 | ||
| 398 | ACPI_FUNCTION_TRACE(acpi_enable_gpe); | 396 | ACPI_FUNCTION_TRACE(acpi_enable_gpe); |
| 399 | 397 | ||
| 400 | /* Parameter validation */ | ||
| 401 | |||
| 402 | if (!gpe_type || (gpe_type & ~ACPI_GPE_TYPE_WAKE_RUN)) { | ||
| 403 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
| 404 | } | ||
| 405 | |||
| 406 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | 398 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); |
| 407 | 399 | ||
| 408 | /* Ensure that we have a valid GPE number */ | 400 | /* Ensure that we have a valid GPE number */ |
| @@ -413,46 +405,19 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type) | |||
| 413 | goto unlock_and_exit; | 405 | goto unlock_and_exit; |
| 414 | } | 406 | } |
| 415 | 407 | ||
| 416 | if (gpe_type & ACPI_GPE_TYPE_RUNTIME) { | 408 | if (gpe_event_info->runtime_count == ACPI_UINT8_MAX) { |
| 417 | if (gpe_event_info->runtime_count == ACPI_UINT8_MAX) { | 409 | status = AE_LIMIT; /* Too many references */ |
| 418 | status = AE_LIMIT; /* Too many references */ | 410 | goto unlock_and_exit; |
| 419 | goto unlock_and_exit; | ||
| 420 | } | ||
| 421 | |||
| 422 | gpe_event_info->runtime_count++; | ||
| 423 | if (gpe_event_info->runtime_count == 1) { | ||
| 424 | status = acpi_ev_update_gpe_enable_masks(gpe_event_info); | ||
| 425 | if (ACPI_SUCCESS(status)) { | ||
| 426 | status = acpi_clear_and_enable_gpe(gpe_event_info); | ||
| 427 | } | ||
| 428 | |||
| 429 | if (ACPI_FAILURE(status)) { | ||
| 430 | gpe_event_info->runtime_count--; | ||
| 431 | goto unlock_and_exit; | ||
| 432 | } | ||
| 433 | } | ||
| 434 | } | 411 | } |
| 435 | 412 | ||
| 436 | if (gpe_type & ACPI_GPE_TYPE_WAKE) { | 413 | gpe_event_info->runtime_count++; |
| 437 | /* The GPE must have the ability to wake the system */ | 414 | if (gpe_event_info->runtime_count == 1) { |
| 438 | 415 | status = acpi_ev_update_gpe_enable_mask(gpe_event_info); | |
| 439 | if (!(gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) { | 416 | if (ACPI_SUCCESS(status)) { |
| 440 | status = AE_TYPE; | 417 | status = acpi_clear_and_enable_gpe(gpe_event_info); |
| 441 | goto unlock_and_exit; | ||
| 442 | } | ||
| 443 | |||
| 444 | if (gpe_event_info->wakeup_count == ACPI_UINT8_MAX) { | ||
| 445 | status = AE_LIMIT; /* Too many references */ | ||
| 446 | goto unlock_and_exit; | ||
| 447 | } | 418 | } |
| 448 | 419 | if (ACPI_FAILURE(status)) { | |
| 449 | /* | 420 | gpe_event_info->runtime_count--; |
| 450 | * Update the enable mask on the first wakeup reference. Wake GPEs | ||
| 451 | * are only hardware-enabled just before sleeping. | ||
| 452 | */ | ||
| 453 | gpe_event_info->wakeup_count++; | ||
| 454 | if (gpe_event_info->wakeup_count == 1) { | ||
| 455 | status = acpi_ev_update_gpe_enable_masks(gpe_event_info); | ||
| 456 | } | 421 | } |
| 457 | } | 422 | } |
| 458 | 423 | ||
| @@ -468,8 +433,6 @@ ACPI_EXPORT_SYMBOL(acpi_enable_gpe) | |||
| 468 | * | 433 | * |
| 469 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 | 434 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 |
| 470 | * gpe_number - GPE level within the GPE block | 435 | * gpe_number - GPE level within the GPE block |
| 471 | * gpe_type - ACPI_GPE_TYPE_RUNTIME or ACPI_GPE_TYPE_WAKE | ||
| 472 | * or both | ||
| 473 | * | 436 | * |
| 474 | * RETURN: Status | 437 | * RETURN: Status |
| 475 | * | 438 | * |
| @@ -478,7 +441,7 @@ ACPI_EXPORT_SYMBOL(acpi_enable_gpe) | |||
| 478 | * the GPE mask bit disabled (for wake GPEs) | 441 | * the GPE mask bit disabled (for wake GPEs) |
| 479 | * | 442 | * |
| 480 | ******************************************************************************/ | 443 | ******************************************************************************/ |
| 481 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type) | 444 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number) |
| 482 | { | 445 | { |
| 483 | acpi_status status = AE_OK; | 446 | acpi_status status = AE_OK; |
| 484 | struct acpi_gpe_event_info *gpe_event_info; | 447 | struct acpi_gpe_event_info *gpe_event_info; |
| @@ -486,12 +449,6 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type | |||
| 486 | 449 | ||
| 487 | ACPI_FUNCTION_TRACE(acpi_disable_gpe); | 450 | ACPI_FUNCTION_TRACE(acpi_disable_gpe); |
| 488 | 451 | ||
| 489 | /* Parameter validation */ | ||
| 490 | |||
| 491 | if (!gpe_type || (gpe_type & ~ACPI_GPE_TYPE_WAKE_RUN)) { | ||
| 492 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
| 493 | } | ||
| 494 | |||
| 495 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | 452 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); |
| 496 | 453 | ||
| 497 | /* Ensure that we have a valid GPE number */ | 454 | /* Ensure that we have a valid GPE number */ |
| @@ -504,41 +461,21 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type | |||
| 504 | 461 | ||
| 505 | /* Hardware-disable a runtime GPE on removal of the last reference */ | 462 | /* Hardware-disable a runtime GPE on removal of the last reference */ |
| 506 | 463 | ||
| 507 | if (gpe_type & ACPI_GPE_TYPE_RUNTIME) { | 464 | if (!gpe_event_info->runtime_count) { |
| 508 | if (!gpe_event_info->runtime_count) { | 465 | status = AE_LIMIT; /* There are no references to remove */ |
| 509 | status = AE_LIMIT; /* There are no references to remove */ | 466 | goto unlock_and_exit; |
| 510 | goto unlock_and_exit; | ||
| 511 | } | ||
| 512 | |||
| 513 | gpe_event_info->runtime_count--; | ||
| 514 | if (!gpe_event_info->runtime_count) { | ||
| 515 | status = acpi_ev_update_gpe_enable_masks(gpe_event_info); | ||
| 516 | if (ACPI_SUCCESS(status)) { | ||
| 517 | status = acpi_hw_low_set_gpe(gpe_event_info, | ||
| 518 | ACPI_GPE_DISABLE); | ||
| 519 | } | ||
| 520 | |||
| 521 | if (ACPI_FAILURE(status)) { | ||
| 522 | gpe_event_info->runtime_count++; | ||
| 523 | goto unlock_and_exit; | ||
| 524 | } | ||
| 525 | } | ||
| 526 | } | 467 | } |
| 527 | 468 | ||
| 528 | /* | 469 | gpe_event_info->runtime_count--; |
| 529 | * Update masks for wake GPE on removal of the last reference. | 470 | if (!gpe_event_info->runtime_count) { |
| 530 | * No need to hardware-disable wake GPEs here, they are not currently | 471 | status = acpi_ev_update_gpe_enable_mask(gpe_event_info); |
| 531 | * enabled. | 472 | if (ACPI_SUCCESS(status)) { |
| 532 | */ | 473 | status = |
| 533 | if (gpe_type & ACPI_GPE_TYPE_WAKE) { | 474 | acpi_hw_low_set_gpe(gpe_event_info, |
| 534 | if (!gpe_event_info->wakeup_count) { | 475 | ACPI_GPE_DISABLE); |
| 535 | status = AE_LIMIT; /* There are no references to remove */ | ||
| 536 | goto unlock_and_exit; | ||
| 537 | } | 476 | } |
| 538 | 477 | if (ACPI_FAILURE(status)) { | |
| 539 | gpe_event_info->wakeup_count--; | 478 | gpe_event_info->runtime_count++; |
| 540 | if (!gpe_event_info->wakeup_count) { | ||
| 541 | status = acpi_ev_update_gpe_enable_masks(gpe_event_info); | ||
| 542 | } | 479 | } |
| 543 | } | 480 | } |
| 544 | 481 | ||
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 7d857dabdde4..1575a9b51f1d 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
| @@ -424,8 +424,7 @@ static int acpi_button_add(struct acpi_device *device) | |||
| 424 | if (device->wakeup.flags.valid) { | 424 | if (device->wakeup.flags.valid) { |
| 425 | /* Button's GPE is run-wake GPE */ | 425 | /* Button's GPE is run-wake GPE */ |
| 426 | acpi_enable_gpe(device->wakeup.gpe_device, | 426 | acpi_enable_gpe(device->wakeup.gpe_device, |
| 427 | device->wakeup.gpe_number, | 427 | device->wakeup.gpe_number); |
| 428 | ACPI_GPE_TYPE_RUNTIME); | ||
| 429 | device->wakeup.run_wake_count++; | 428 | device->wakeup.run_wake_count++; |
| 430 | device->wakeup.state.enabled = 1; | 429 | device->wakeup.state.enabled = 1; |
| 431 | } | 430 | } |
| @@ -448,8 +447,7 @@ static int acpi_button_remove(struct acpi_device *device, int type) | |||
| 448 | 447 | ||
| 449 | if (device->wakeup.flags.valid) { | 448 | if (device->wakeup.flags.valid) { |
| 450 | acpi_disable_gpe(device->wakeup.gpe_device, | 449 | acpi_disable_gpe(device->wakeup.gpe_device, |
| 451 | device->wakeup.gpe_number, | 450 | device->wakeup.gpe_number); |
| 452 | ACPI_GPE_TYPE_RUNTIME); | ||
| 453 | device->wakeup.run_wake_count--; | 451 | device->wakeup.run_wake_count--; |
| 454 | device->wakeup.state.enabled = 0; | 452 | device->wakeup.state.enabled = 0; |
| 455 | } | 453 | } |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 5f2027d782e8..bf5045416575 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
| @@ -822,7 +822,7 @@ static int ec_install_handlers(struct acpi_ec *ec) | |||
| 822 | if (ACPI_FAILURE(status)) | 822 | if (ACPI_FAILURE(status)) |
| 823 | return -ENODEV; | 823 | return -ENODEV; |
| 824 | 824 | ||
| 825 | acpi_enable_gpe(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); | 825 | acpi_enable_gpe(NULL, ec->gpe); |
| 826 | status = acpi_install_address_space_handler(ec->handle, | 826 | status = acpi_install_address_space_handler(ec->handle, |
| 827 | ACPI_ADR_SPACE_EC, | 827 | ACPI_ADR_SPACE_EC, |
| 828 | &acpi_ec_space_handler, | 828 | &acpi_ec_space_handler, |
| @@ -839,7 +839,7 @@ static int ec_install_handlers(struct acpi_ec *ec) | |||
| 839 | } else { | 839 | } else { |
| 840 | acpi_remove_gpe_handler(NULL, ec->gpe, | 840 | acpi_remove_gpe_handler(NULL, ec->gpe, |
| 841 | &acpi_ec_gpe_handler); | 841 | &acpi_ec_gpe_handler); |
| 842 | acpi_disable_gpe(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); | 842 | acpi_disable_gpe(NULL, ec->gpe); |
| 843 | return -ENODEV; | 843 | return -ENODEV; |
| 844 | } | 844 | } |
| 845 | } | 845 | } |
| @@ -850,7 +850,7 @@ static int ec_install_handlers(struct acpi_ec *ec) | |||
| 850 | 850 | ||
| 851 | static void ec_remove_handlers(struct acpi_ec *ec) | 851 | static void ec_remove_handlers(struct acpi_ec *ec) |
| 852 | { | 852 | { |
| 853 | acpi_disable_gpe(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); | 853 | acpi_disable_gpe(NULL, ec->gpe); |
| 854 | if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, | 854 | if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, |
| 855 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) | 855 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) |
| 856 | pr_err(PREFIX "failed to remove space handler\n"); | 856 | pr_err(PREFIX "failed to remove space handler\n"); |
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index f8db50a0941c..5981bd07e20e 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c | |||
| @@ -388,12 +388,10 @@ static ssize_t counter_set(struct kobject *kobj, | |||
| 388 | if (index < num_gpes) { | 388 | if (index < num_gpes) { |
| 389 | if (!strcmp(buf, "disable\n") && | 389 | if (!strcmp(buf, "disable\n") && |
| 390 | (status & ACPI_EVENT_FLAG_ENABLED)) | 390 | (status & ACPI_EVENT_FLAG_ENABLED)) |
| 391 | result = acpi_disable_gpe(handle, index, | 391 | result = acpi_disable_gpe(handle, index); |
| 392 | ACPI_GPE_TYPE_RUNTIME); | ||
| 393 | else if (!strcmp(buf, "enable\n") && | 392 | else if (!strcmp(buf, "enable\n") && |
| 394 | !(status & ACPI_EVENT_FLAG_ENABLED)) | 393 | !(status & ACPI_EVENT_FLAG_ENABLED)) |
| 395 | result = acpi_enable_gpe(handle, index, | 394 | result = acpi_enable_gpe(handle, index); |
| 396 | ACPI_GPE_TYPE_RUNTIME); | ||
| 397 | else if (!strcmp(buf, "clear\n") && | 395 | else if (!strcmp(buf, "clear\n") && |
| 398 | (status & ACPI_EVENT_FLAG_SET)) | 396 | (status & ACPI_EVENT_FLAG_SET)) |
| 399 | result = acpi_clear_gpe(handle, index); | 397 | result = acpi_clear_gpe(handle, index); |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 2e7a3bf13824..5342e037e37f 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
| @@ -295,14 +295,12 @@ static int acpi_dev_run_wake(struct device *phys_dev, bool enable) | |||
| 295 | if (!dev->wakeup.run_wake_count++) { | 295 | if (!dev->wakeup.run_wake_count++) { |
| 296 | acpi_enable_wakeup_device_power(dev, ACPI_STATE_S0); | 296 | acpi_enable_wakeup_device_power(dev, ACPI_STATE_S0); |
| 297 | acpi_enable_gpe(dev->wakeup.gpe_device, | 297 | acpi_enable_gpe(dev->wakeup.gpe_device, |
| 298 | dev->wakeup.gpe_number, | 298 | dev->wakeup.gpe_number); |
| 299 | ACPI_GPE_TYPE_RUNTIME); | ||
| 300 | } | 299 | } |
| 301 | } else if (dev->wakeup.run_wake_count > 0) { | 300 | } else if (dev->wakeup.run_wake_count > 0) { |
| 302 | if (!--dev->wakeup.run_wake_count) { | 301 | if (!--dev->wakeup.run_wake_count) { |
| 303 | acpi_disable_gpe(dev->wakeup.gpe_device, | 302 | acpi_disable_gpe(dev->wakeup.gpe_device, |
| 304 | dev->wakeup.gpe_number, | 303 | dev->wakeup.gpe_number); |
| 305 | ACPI_GPE_TYPE_RUNTIME); | ||
| 306 | acpi_disable_wakeup_device_power(dev); | 304 | acpi_disable_wakeup_device_power(dev); |
| 307 | } | 305 | } |
| 308 | } else { | 306 | } else { |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 17396e83e1a4..354d785e80cb 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
| @@ -284,11 +284,9 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); | |||
| 284 | */ | 284 | */ |
| 285 | acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action); | 285 | acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action); |
| 286 | 286 | ||
| 287 | acpi_status | 287 | acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); |
| 288 | acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type); | ||
| 289 | 288 | ||
| 290 | acpi_status | 289 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); |
| 291 | acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type); | ||
| 292 | 290 | ||
| 293 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); | 291 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); |
| 294 | 292 | ||
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 6a65a94897bf..a42513ded3a4 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
| @@ -669,12 +669,6 @@ typedef u32 acpi_event_status; | |||
| 669 | #define ACPI_GPE_DISABLE 1 | 669 | #define ACPI_GPE_DISABLE 1 |
| 670 | #define ACPI_GPE_COND_ENABLE 2 | 670 | #define ACPI_GPE_COND_ENABLE 2 |
| 671 | 671 | ||
| 672 | /* gpe_types for acpi_enable_gpe and acpi_disable_gpe */ | ||
| 673 | |||
| 674 | #define ACPI_GPE_TYPE_WAKE (u8) 0x01 | ||
| 675 | #define ACPI_GPE_TYPE_RUNTIME (u8) 0x02 | ||
| 676 | #define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x03 | ||
| 677 | |||
| 678 | /* | 672 | /* |
| 679 | * GPE info flags - Per GPE | 673 | * GPE info flags - Per GPE |
| 680 | * +-------+---+-+-+ | 674 | * +-------+---+-+-+ |
