Merge branch 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[pandora-kernel.git] / drivers / acpi / hardware / hwgpe.c
index d84942d..117a05c 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
@@ -105,14 +105,20 @@ acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info)
 acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
 {
        acpi_status status;
+       u8 register_bit;
 
        ACPI_FUNCTION_ENTRY();
 
+       register_bit = (u8)
+           (1 <<
+            (gpe_event_info->gpe_number -
+             gpe_event_info->register_info->base_gpe_number));
+
        /*
         * Write a one to the appropriate bit in the status register to
         * clear this GPE.
         */
-       status = acpi_hw_low_level_write(8, gpe_event_info->register_bit,
+       status = acpi_hw_low_level_write(8, register_bit,
                                         &gpe_event_info->register_info->
                                         status_address);
 
@@ -155,7 +161,10 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
 
        /* Get the register bitmask for this GPE */
 
-       register_bit = gpe_event_info->register_bit;
+       register_bit = (u8)
+           (1 <<
+            (gpe_event_info->gpe_number -
+             gpe_event_info->register_info->base_gpe_number));
 
        /* GPE currently enabled? (enabled for runtime?) */
 
@@ -214,6 +223,7 @@ acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
        /* Examine each GPE Register within the block */
 
        for (i = 0; i < gpe_block->register_count; i++) {
+
                /* Disable all GPEs in this register */
 
                status = acpi_hw_low_level_write(8, 0x00,
@@ -250,6 +260,7 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
        /* Examine each GPE Register within the block */
 
        for (i = 0; i < gpe_block->register_count; i++) {
+
                /* Clear status on all GPEs in this register */
 
                status = acpi_hw_low_level_write(8, 0xFF,
@@ -368,7 +379,7 @@ acpi_status acpi_hw_disable_all_gpes(void)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("hw_disable_all_gpes");
+       ACPI_FUNCTION_TRACE(hw_disable_all_gpes);
 
        status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block);
        status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block);
@@ -391,7 +402,7 @@ acpi_status acpi_hw_enable_all_runtime_gpes(void)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("hw_enable_all_runtime_gpes");
+       ACPI_FUNCTION_TRACE(hw_enable_all_runtime_gpes);
 
        status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block);
        return_ACPI_STATUS(status);
@@ -413,7 +424,7 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("hw_enable_all_wakeup_gpes");
+       ACPI_FUNCTION_TRACE(hw_enable_all_wakeup_gpes);
 
        status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block);
        return_ACPI_STATUS(status);