]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/events/evmisc.c
Pull trivial into release branch
[linux-2.6-omap-h63xx.git] / drivers / acpi / events / evmisc.c
index 7e57b8470f55a7aa39af4c97c7d395d411a19499..6eef4efddcf62b0f83fba9f2014b61403e4564fe 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2005, R. Byron Moore
+ * Copyright (C) 2000 - 2006, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evmisc")
 
+/* Names for Notify() values, used for debug output */
 #ifdef ACPI_DEBUG_OUTPUT
 static const char *acpi_notify_value_names[] = {
        "Bus Check",
        "Device Check",
        "Device Wake",
-       "Eject request",
+       "Eject Request",
        "Device Check Light",
        "Frequency Mismatch",
        "Bus Mode Mismatch",
@@ -124,7 +125,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
        union acpi_generic_state *notify_info;
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_NAME("ev_queue_notify_request");
+       ACPI_FUNCTION_NAME(ev_queue_notify_request);
 
        /*
         * For value 3 (Ejection Request), some device method may need to be run.
@@ -150,6 +151,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
 
        obj_desc = acpi_ns_get_attached_object(node);
        if (obj_desc) {
+
                /* We have the notify object, Get the right handler */
 
                switch (node->type) {
@@ -184,14 +186,15 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
                        return (AE_NO_MEMORY);
                }
 
-               notify_info->common.data_type = ACPI_DESC_TYPE_STATE_NOTIFY;
+               notify_info->common.descriptor_type =
+                   ACPI_DESC_TYPE_STATE_NOTIFY;
                notify_info->notify.node = node;
                notify_info->notify.value = (u16) notify_value;
                notify_info->notify.handler_obj = handler_obj;
 
-               status = acpi_os_queue_for_execution(OSD_PRIORITY_HIGH,
-                                                    acpi_ev_notify_dispatch,
-                                                    notify_info);
+               status =
+                   acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch,
+                                   notify_info);
                if (ACPI_FAILURE(status)) {
                        acpi_ut_delete_generic_state(notify_info);
                }
@@ -240,6 +243,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
         * to the device.
         */
        if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) {
+
                /* Global system notification handler */
 
                if (acpi_gbl_system_notify.handler) {
@@ -297,13 +301,15 @@ static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context)
        /* Signal threads that are waiting for the lock */
 
        if (acpi_gbl_global_lock_thread_count) {
+
                /* Send sufficient units to the semaphore */
 
                status =
                    acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore,
                                             acpi_gbl_global_lock_thread_count);
                if (ACPI_FAILURE(status)) {
-                       ACPI_REPORT_ERROR(("Could not signal Global Lock semaphore\n"));
+                       ACPI_ERROR((AE_INFO,
+                                   "Could not signal Global Lock semaphore"));
                }
        }
 }
@@ -334,17 +340,19 @@ static u32 acpi_ev_global_lock_handler(void *context)
         */
        ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired);
        if (acquired) {
+
                /* Got the lock, now wake all threads waiting for it */
 
                acpi_gbl_global_lock_acquired = TRUE;
 
                /* Run the Global Lock thread which will signal all waiting threads */
 
-               status = acpi_os_queue_for_execution(OSD_PRIORITY_HIGH,
-                                                    acpi_ev_global_lock_thread,
-                                                    context);
+               status =
+                   acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER,
+                                   acpi_ev_global_lock_thread, context);
                if (ACPI_FAILURE(status)) {
-                       ACPI_REPORT_ERROR(("Could not queue Global Lock thread, %s\n", acpi_format_exception(status)));
+                       ACPI_EXCEPTION((AE_INFO, status,
+                                       "Could not queue Global Lock thread"));
 
                        return (ACPI_INTERRUPT_NOT_HANDLED);
                }
@@ -369,7 +377,7 @@ acpi_status acpi_ev_init_global_lock_handler(void)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("ev_init_global_lock_handler");
+       ACPI_FUNCTION_TRACE(ev_init_global_lock_handler);
 
        acpi_gbl_global_lock_present = TRUE;
        status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL,
@@ -384,7 +392,8 @@ acpi_status acpi_ev_init_global_lock_handler(void)
         * with an error.
         */
        if (status == AE_NO_HARDWARE_RESPONSE) {
-               ACPI_REPORT_ERROR(("No response from Global Lock hardware, disabling lock\n"));
+               ACPI_ERROR((AE_INFO,
+                           "No response from Global Lock hardware, disabling lock"));
 
                acpi_gbl_global_lock_present = FALSE;
                status = AE_OK;
@@ -410,7 +419,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
        acpi_status status = AE_OK;
        u8 acquired = FALSE;
 
-       ACPI_FUNCTION_TRACE("ev_acquire_global_lock");
+       ACPI_FUNCTION_TRACE(ev_acquire_global_lock);
 
 #ifndef ACPI_APPLICATION
        /* Make sure that we actually have a global lock */
@@ -436,6 +445,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
 
        ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired);
        if (acquired) {
+
                /* We got the lock */
 
                ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
@@ -455,8 +465,9 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
         * Acquire the global lock semaphore first.
         * Since this wait will block, we must release the interpreter
         */
-       status = acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore,
-                                              timeout);
+       status =
+           acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore,
+                                         timeout);
        return_ACPI_STATUS(status);
 }
 
@@ -477,10 +488,11 @@ acpi_status acpi_ev_release_global_lock(void)
        u8 pending = FALSE;
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("ev_release_global_lock");
+       ACPI_FUNCTION_TRACE(ev_release_global_lock);
 
        if (!acpi_gbl_global_lock_thread_count) {
-               ACPI_REPORT_WARNING(("Cannot release HW Global Lock, it has not been acquired\n"));
+               ACPI_WARNING((AE_INFO,
+                             "Cannot release HW Global Lock, it has not been acquired"));
                return_ACPI_STATUS(AE_NOT_ACQUIRED);
        }
 
@@ -488,6 +500,7 @@ acpi_status acpi_ev_release_global_lock(void)
 
        acpi_gbl_global_lock_thread_count--;
        if (acpi_gbl_global_lock_thread_count) {
+
                /* There are still some threads holding the lock, cannot release */
 
                return_ACPI_STATUS(AE_OK);
@@ -529,7 +542,7 @@ void acpi_ev_terminate(void)
        acpi_native_uint i;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("ev_terminate");
+       ACPI_FUNCTION_TRACE(ev_terminate);
 
        if (acpi_gbl_events_initialized) {
                /*
@@ -542,9 +555,9 @@ void 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_ERROR((AE_INFO,
+                                           "Could not disable fixed event %d",
+                                           (u32) i));
                        }
                }
 
@@ -556,8 +569,7 @@ void 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_ERROR((AE_INFO, "Could not remove SCI handler"));
                }
        }
 
@@ -570,8 +582,7 @@ void acpi_ev_terminate(void)
        if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) {
                status = acpi_disable();
                if (ACPI_FAILURE(status)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                         "acpi_disable failed\n"));
+                       ACPI_WARNING((AE_INFO, "AcpiDisable failed"));
                }
        }
        return_VOID;