]> err.no Git - linux-2.6/blobdiff - drivers/acpi/hardware/hwacpi.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6] / drivers / acpi / hardware / hwacpi.c
index 5c068cc4f6748bb24c70fd3f50059615c40d5ca4..6031ca13dd2f2b9c73b66abb56aca71edd5f1d3b 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2007, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #define _COMPONENT          ACPI_HARDWARE
 ACPI_MODULE_NAME("hwacpi")
 
-/******************************************************************************
- *
- * FUNCTION:    acpi_hw_initialize
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Initialize and validate the various ACPI registers defined in
- *              the FADT.
- *
- ******************************************************************************/
-acpi_status acpi_hw_initialize(void)
-{
-       acpi_status status;
-
-       ACPI_FUNCTION_TRACE("hw_initialize");
-
-       /* We must have the ACPI tables by the time we get here */
-
-       if (!acpi_gbl_FADT) {
-               ACPI_REPORT_ERROR(("No FADT is present\n"));
-               return_ACPI_STATUS(AE_NO_ACPI_TABLES);
-       }
-
-       /* Sanity check the FADT for valid values */
-
-       status = acpi_ut_validate_fadt();
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
-       }
-
-       return_ACPI_STATUS(AE_OK);
-}
-
 /******************************************************************************
  *
  * FUNCTION:    acpi_hw_set_mode
@@ -93,21 +58,21 @@ acpi_status acpi_hw_initialize(void)
  * DESCRIPTION: Transitions the system into the requested mode.
  *
  ******************************************************************************/
-
 acpi_status acpi_hw_set_mode(u32 mode)
 {
 
        acpi_status status;
        u32 retry;
 
-       ACPI_FUNCTION_TRACE("hw_set_mode");
+       ACPI_FUNCTION_TRACE(hw_set_mode);
 
        /*
         * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
         * system does not support mode transition.
         */
-       if (!acpi_gbl_FADT->smi_cmd) {
-               ACPI_REPORT_ERROR(("No SMI_CMD in FADT, mode transition failed\n"));
+       if (!acpi_gbl_FADT.smi_command) {
+               ACPI_ERROR((AE_INFO,
+                           "No SMI_CMD in FADT, mode transition failed"));
                return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
        }
 
@@ -118,8 +83,9 @@ acpi_status acpi_hw_set_mode(u32 mode)
         * we make sure both the numbers are zero to determine these
         * transitions are not supported.
         */
-       if (!acpi_gbl_FADT->acpi_enable && !acpi_gbl_FADT->acpi_disable) {
-               ACPI_REPORT_ERROR(("No ACPI mode transition supported in this system (enable/disable both zero)\n"));
+       if (!acpi_gbl_FADT.acpi_enable && !acpi_gbl_FADT.acpi_disable) {
+               ACPI_ERROR((AE_INFO,
+                           "No ACPI mode transition supported in this system (enable/disable both zero)"));
                return_ACPI_STATUS(AE_OK);
        }
 
@@ -128,9 +94,8 @@ acpi_status acpi_hw_set_mode(u32 mode)
 
                /* BIOS should have disabled ALL fixed and GP events */
 
-               status = acpi_os_write_port(acpi_gbl_FADT->smi_cmd,
-                                           (u32) acpi_gbl_FADT->acpi_enable,
-                                           8);
+               status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
+                                           (u32) acpi_gbl_FADT.acpi_enable, 8);
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Attempting to enable ACPI mode\n"));
                break;
@@ -141,8 +106,8 @@ acpi_status acpi_hw_set_mode(u32 mode)
                 * BIOS should clear all fixed status bits and restore fixed event
                 * enable bits to default
                 */
-               status = acpi_os_write_port(acpi_gbl_FADT->smi_cmd,
-                                           (u32) acpi_gbl_FADT->acpi_disable,
+               status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
+                                           (u32) acpi_gbl_FADT.acpi_disable,
                                            8);
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Attempting to enable Legacy (non-ACPI) mode\n"));
@@ -153,8 +118,8 @@ acpi_status acpi_hw_set_mode(u32 mode)
        }
 
        if (ACPI_FAILURE(status)) {
-               ACPI_REPORT_ERROR(("Could not write mode change, %s\n",
-                                  acpi_format_exception(status)));
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Could not write ACPI mode change"));
                return_ACPI_STATUS(status);
        }
 
@@ -174,7 +139,7 @@ acpi_status acpi_hw_set_mode(u32 mode)
                retry--;
        }
 
-       ACPI_REPORT_ERROR(("Hardware never changed modes\n"));
+       ACPI_ERROR((AE_INFO, "Hardware did not change modes"));
        return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
 }
 
@@ -196,18 +161,17 @@ u32 acpi_hw_get_mode(void)
        acpi_status status;
        u32 value;
 
-       ACPI_FUNCTION_TRACE("hw_get_mode");
+       ACPI_FUNCTION_TRACE(hw_get_mode);
 
        /*
         * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
         * system does not support mode transition.
         */
-       if (!acpi_gbl_FADT->smi_cmd) {
+       if (!acpi_gbl_FADT.smi_command) {
                return_UINT32(ACPI_SYS_MODE_ACPI);
        }
 
-       status =
-           acpi_get_register(ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_LOCK);
+       status = acpi_get_register(ACPI_BITREG_SCI_ENABLE, &value);
        if (ACPI_FAILURE(status)) {
                return_UINT32(ACPI_SYS_MODE_LEGACY);
        }