diff options
Diffstat (limited to 'drivers/acpi/events/evmisc.c')
-rw-r--r-- | drivers/acpi/events/evmisc.c | 97 |
1 files changed, 63 insertions, 34 deletions
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c index 2548efa7a45..659e9095611 100644 --- a/drivers/acpi/events/evmisc.c +++ b/drivers/acpi/events/evmisc.c @@ -50,6 +50,35 @@ ACPI_MODULE_NAME ("evmisc") +#ifdef ACPI_DEBUG_OUTPUT +static const char *acpi_notify_value_names[] = +{ + "Bus Check", + "Device Check", + "Device Wake", + "Eject request", + "Device Check Light", + "Frequency Mismatch", + "Bus Mode Mismatch", + "Power Fault" +}; +#endif + +/* Local prototypes */ + +static void ACPI_SYSTEM_XFACE +acpi_ev_notify_dispatch ( + void *context); + +static void ACPI_SYSTEM_XFACE +acpi_ev_global_lock_thread ( + void *context); + +static u32 +acpi_ev_global_lock_handler ( + void *context); + + /******************************************************************************* * * FUNCTION: acpi_ev_is_notify_object @@ -98,20 +127,6 @@ acpi_ev_is_notify_object ( * ******************************************************************************/ -#ifdef ACPI_DEBUG_OUTPUT -static const char *acpi_notify_value_names[] = -{ - "Bus Check", - "Device Check", - "Device Wake", - "Eject request", - "Device Check Light", - "Frequency Mismatch", - "Bus Mode Mismatch", - "Power Fault" -}; -#endif - acpi_status acpi_ev_queue_notify_request ( struct acpi_namespace_node *node, @@ -128,9 +143,10 @@ acpi_ev_queue_notify_request ( /* * For value 3 (Ejection Request), some device method may need to be run. - * For value 2 (Device Wake) if _PRW exists, the _PS0 method may need to be run. + * For value 2 (Device Wake) if _PRW exists, the _PS0 method may need + * to be run. * For value 0x80 (Status Change) on the power button or sleep button, - * initiate soft-off or sleep operation? + * initiate soft-off or sleep operation? */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Dispatching Notify(%X) on node %p\n", notify_value, node)); @@ -140,8 +156,9 @@ acpi_ev_queue_notify_request ( acpi_notify_value_names[notify_value])); } else { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: 0x%2.2X **Device Specific**\n", - notify_value)); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Notify value: 0x%2.2X **Device Specific**\n", + notify_value)); } /* Get the notify object attached to the NS Node */ @@ -210,7 +227,7 @@ acpi_ev_queue_notify_request ( * * FUNCTION: acpi_ev_notify_dispatch * - * PARAMETERS: Context - To be passsed to the notify handler + * PARAMETERS: Context - To be passed to the notify handler * * RETURN: None. * @@ -219,7 +236,7 @@ acpi_ev_queue_notify_request ( * ******************************************************************************/ -void ACPI_SYSTEM_XFACE +static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch ( void *context) { @@ -234,7 +251,8 @@ acpi_ev_notify_dispatch ( /* * We will invoke a global notify handler if installed. - * This is done _before_ we invoke the per-device handler attached to the device. + * This is done _before_ we invoke the per-device handler attached + * to the device. */ if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { /* Global system notification handler */ @@ -256,15 +274,17 @@ acpi_ev_notify_dispatch ( /* Invoke the system handler first, if present */ if (global_handler) { - global_handler (notify_info->notify.node, notify_info->notify.value, global_context); + global_handler (notify_info->notify.node, notify_info->notify.value, + global_context); } /* Now invoke the per-device handler, if present */ handler_obj = notify_info->notify.handler_obj; if (handler_obj) { - handler_obj->notify.handler (notify_info->notify.node, notify_info->notify.value, - handler_obj->notify.context); + handler_obj->notify.handler (notify_info->notify.node, + notify_info->notify.value, + handler_obj->notify.context); } /* All done with the info object */ @@ -370,7 +390,8 @@ acpi_ev_global_lock_handler ( ******************************************************************************/ acpi_status -acpi_ev_init_global_lock_handler (void) +acpi_ev_init_global_lock_handler ( + void) { acpi_status status; @@ -380,7 +401,7 @@ acpi_ev_init_global_lock_handler (void) acpi_gbl_global_lock_present = TRUE; status = acpi_install_fixed_event_handler (ACPI_EVENT_GLOBAL, - acpi_ev_global_lock_handler, NULL); + acpi_ev_global_lock_handler, NULL); /* * If the global lock does not exist on this platform, the attempt @@ -433,8 +454,10 @@ acpi_ev_acquire_global_lock ( acpi_gbl_global_lock_thread_count++; - /* If we (OS side vs. BIOS side) have the hardware lock already, we are done */ - + /* + * If we (OS side vs. BIOS side) have the hardware lock already, + * we are done + */ if (acpi_gbl_global_lock_acquired) { return_ACPI_STATUS (AE_OK); } @@ -480,7 +503,8 @@ acpi_ev_acquire_global_lock ( ******************************************************************************/ acpi_status -acpi_ev_release_global_lock (void) +acpi_ev_release_global_lock ( + void) { u8 pending = FALSE; acpi_status status = AE_OK; @@ -490,7 +514,8 @@ acpi_ev_release_global_lock (void) if (!acpi_gbl_global_lock_thread_count) { - ACPI_REPORT_WARNING(("Cannot release HW Global Lock, it has not been acquired\n")); + ACPI_REPORT_WARNING(( + "Cannot release HW Global Lock, it has not been acquired\n")); return_ACPI_STATUS (AE_NOT_ACQUIRED); } @@ -515,7 +540,8 @@ acpi_ev_release_global_lock (void) * register */ if (pending) { - status = acpi_set_register (ACPI_BITREG_GLOBAL_LOCK_RELEASE, 1, ACPI_MTX_LOCK); + status = acpi_set_register (ACPI_BITREG_GLOBAL_LOCK_RELEASE, + 1, ACPI_MTX_LOCK); } return_ACPI_STATUS (status); @@ -535,7 +561,8 @@ acpi_ev_release_global_lock (void) ******************************************************************************/ void -acpi_ev_terminate (void) +acpi_ev_terminate ( + void) { acpi_native_uint i; acpi_status status; @@ -555,7 +582,8 @@ acpi_ev_terminate (void) for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { status = acpi_disable_event ((u32) i, 0); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable fixed event %d\n", (u32) i)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not disable fixed event %d\n", (u32) i)); } } @@ -567,7 +595,8 @@ acpi_ev_terminate (void) status = acpi_ev_remove_sci_handler (); if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not remove SCI handler\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not remove SCI handler\n")); } } |