]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/acpi/events/evmisc.c
[ACPI] ACPICA 20050729 from Bob Moore
[mv-sheeva.git] / drivers / acpi / events / evmisc.c
index 2548efa7a45f1f685244c44159583948e8f4f17d..3df3ada4b9e7a0fd0736a63ca2e7620720cc88fa 100644 (file)
         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
@@ -390,6 +411,9 @@ 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_gbl_global_lock_present = FALSE;
                status = AE_OK;
        }
@@ -433,8 +457,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 +506,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 +517,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 +543,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 +564,8 @@ acpi_ev_release_global_lock (void)
  ******************************************************************************/
 
 void
-acpi_ev_terminate (void)
+acpi_ev_terminate (
+       void)
 {
        acpi_native_uint                i;
        acpi_status                     status;
@@ -555,25 +585,27 @@ 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));
                        }
                }
 
                /* Disable all GPEs in all GPE blocks */
 
-               status = acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block, ACPI_NOT_ISR);
+               status = acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block);
 
                /* Remove SCI handler */
 
                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"));
                }
        }
 
        /* Deallocate all handler objects installed within GPE info structs */
 
-       status = acpi_ev_walk_gpe_list (acpi_ev_delete_gpe_handlers, ACPI_NOT_ISR);
+       status = acpi_ev_walk_gpe_list (acpi_ev_delete_gpe_handlers);
 
        /* Return to original mode if necessary */