diff options
author | Lin Ming <ming.m.lin@intel.com> | 2010-12-13 00:39:37 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 04:27:00 -0500 |
commit | da50337373c90c15c6db6ed4239e87c5a3806f9a (patch) | |
tree | fb13213a1af36ece5cb760a9567dd44683f6f368 /drivers/acpi/acpica/evgpe.c | |
parent | a0fcdb237fcd4eaa7e5009b28ef5be07415f287d (diff) |
ACPICA: Misc comments to minimize code divergence
Modify/add some comments to minimize ACPICA/linux GPE code divergence.
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/evgpe.c')
-rw-r--r-- | drivers/acpi/acpica/evgpe.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c index 3bcf5ef74c62..7c339d34ab42 100644 --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c | |||
@@ -104,7 +104,7 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info) | |||
104 | * | 104 | * |
105 | * RETURN: Status | 105 | * RETURN: Status |
106 | * | 106 | * |
107 | * DESCRIPTION: Clear the given GPE from stale events and enable it. | 107 | * DESCRIPTION: Clear a GPE of stale events and enable it. |
108 | * | 108 | * |
109 | ******************************************************************************/ | 109 | ******************************************************************************/ |
110 | acpi_status | 110 | acpi_status |
@@ -142,7 +142,7 @@ acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info) | |||
142 | * | 142 | * |
143 | * FUNCTION: acpi_ev_add_gpe_reference | 143 | * FUNCTION: acpi_ev_add_gpe_reference |
144 | * | 144 | * |
145 | * PARAMETERS: gpe_event_info - GPE to enable | 145 | * PARAMETERS: gpe_event_info - Add a reference to this GPE |
146 | * | 146 | * |
147 | * RETURN: Status | 147 | * RETURN: Status |
148 | * | 148 | * |
@@ -163,6 +163,9 @@ acpi_status acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info | |||
163 | 163 | ||
164 | gpe_event_info->runtime_count++; | 164 | gpe_event_info->runtime_count++; |
165 | if (gpe_event_info->runtime_count == 1) { | 165 | if (gpe_event_info->runtime_count == 1) { |
166 | |||
167 | /* Enable on first reference */ | ||
168 | |||
166 | status = acpi_ev_update_gpe_enable_mask(gpe_event_info); | 169 | status = acpi_ev_update_gpe_enable_mask(gpe_event_info); |
167 | if (ACPI_SUCCESS(status)) { | 170 | if (ACPI_SUCCESS(status)) { |
168 | status = acpi_ev_enable_gpe(gpe_event_info); | 171 | status = acpi_ev_enable_gpe(gpe_event_info); |
@@ -180,7 +183,7 @@ acpi_status acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info | |||
180 | * | 183 | * |
181 | * FUNCTION: acpi_ev_remove_gpe_reference | 184 | * FUNCTION: acpi_ev_remove_gpe_reference |
182 | * | 185 | * |
183 | * PARAMETERS: gpe_event_info - GPE to disable | 186 | * PARAMETERS: gpe_event_info - Remove a reference to this GPE |
184 | * | 187 | * |
185 | * RETURN: Status | 188 | * RETURN: Status |
186 | * | 189 | * |
@@ -201,6 +204,9 @@ acpi_status acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_i | |||
201 | 204 | ||
202 | gpe_event_info->runtime_count--; | 205 | gpe_event_info->runtime_count--; |
203 | if (!gpe_event_info->runtime_count) { | 206 | if (!gpe_event_info->runtime_count) { |
207 | |||
208 | /* Disable on last reference */ | ||
209 | |||
204 | status = acpi_ev_update_gpe_enable_mask(gpe_event_info); | 210 | status = acpi_ev_update_gpe_enable_mask(gpe_event_info); |
205 | if (ACPI_SUCCESS(status)) { | 211 | if (ACPI_SUCCESS(status)) { |
206 | status = acpi_hw_low_set_gpe(gpe_event_info, | 212 | status = acpi_hw_low_set_gpe(gpe_event_info, |
@@ -386,7 +392,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) | |||
386 | } | 392 | } |
387 | 393 | ||
388 | ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS, | 394 | ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS, |
389 | "Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n", | 395 | "Read GPE Register at GPE%02X: Status=%02X, Enable=%02X\n", |
390 | gpe_register_info->base_gpe_number, | 396 | gpe_register_info->base_gpe_number, |
391 | status_reg, enable_reg)); | 397 | status_reg, enable_reg)); |
392 | 398 | ||
@@ -660,8 +666,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, | |||
660 | status = acpi_hw_clear_gpe(gpe_event_info); | 666 | status = acpi_hw_clear_gpe(gpe_event_info); |
661 | if (ACPI_FAILURE(status)) { | 667 | if (ACPI_FAILURE(status)) { |
662 | ACPI_EXCEPTION((AE_INFO, status, | 668 | ACPI_EXCEPTION((AE_INFO, status, |
663 | "Unable to clear GPE[0x%2X]", | 669 | "Unable to clear GPE%02X", gpe_number)); |
664 | gpe_number)); | ||
665 | return_UINT32(ACPI_INTERRUPT_NOT_HANDLED); | 670 | return_UINT32(ACPI_INTERRUPT_NOT_HANDLED); |
666 | } | 671 | } |
667 | } | 672 | } |
@@ -720,7 +725,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, | |||
720 | gpe_event_info); | 725 | gpe_event_info); |
721 | if (ACPI_FAILURE(status)) { | 726 | if (ACPI_FAILURE(status)) { |
722 | ACPI_EXCEPTION((AE_INFO, status, | 727 | ACPI_EXCEPTION((AE_INFO, status, |
723 | "Unable to queue handler for GPE[0x%2X] - event disabled", | 728 | "Unable to queue handler for GPE%2X - event disabled", |
724 | gpe_number)); | 729 | gpe_number)); |
725 | } | 730 | } |
726 | break; | 731 | break; |
@@ -733,7 +738,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, | |||
733 | * a GPE to be enabled if it has no handler or method. | 738 | * a GPE to be enabled if it has no handler or method. |
734 | */ | 739 | */ |
735 | ACPI_ERROR((AE_INFO, | 740 | ACPI_ERROR((AE_INFO, |
736 | "No handler or method for GPE[0x%2X], disabling event", | 741 | "No handler or method for GPE%02X, disabling event", |
737 | gpe_number)); | 742 | gpe_number)); |
738 | 743 | ||
739 | break; | 744 | break; |