aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2010-12-13 00:36:15 -0500
committerLen Brown <len.brown@intel.com>2011-01-12 04:24:40 -0500
commit3a37898d507794cfc68a092303e02651d3f01308 (patch)
treee3a53e7746a5a69000553814d8f07fa51b99ab45
parent3cfd53d53f700a225716294842b1a843326dea21 (diff)
ACPICA: Rename some function and variable names
Some function and variable names are renamed to be consistent with ACPICA code base. acpi_raw_enable_gpe -> acpi_ev_add_gpe_reference acpi_raw_disable_gpe -> acpi_ev_remove_gpe_reference acpi_gpe_can_wake -> acpi_setup_gpe_for_wake acpi_gpe_wakeup -> acpi_set_gpe_wake_mask acpi_update_gpes -> acpi_update_all_gpes acpi_all_gpes_initialized -> acpi_gbl_all_gpes_initialized acpi_handler_info -> acpi_gpe_handler_info ... Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/acpica/acevents.h6
-rw-r--r--drivers/acpi/acpica/acglobal.h2
-rw-r--r--drivers/acpi/acpica/aclocal.h8
-rw-r--r--drivers/acpi/acpica/evgpe.c14
-rw-r--r--drivers/acpi/acpica/evgpeblk.c4
-rw-r--r--drivers/acpi/acpica/evxface.c16
-rw-r--r--drivers/acpi/acpica/evxfgpe.c53
-rw-r--r--drivers/acpi/acpica/hwgpe.c2
-rw-r--r--drivers/acpi/acpica/utglobal.c2
-rw-r--r--drivers/acpi/dock.c2
-rw-r--r--drivers/acpi/scan.c6
-rw-r--r--drivers/acpi/wakeup.c4
-rw-r--r--include/acpi/acpixf.h6
-rw-r--r--include/acpi/actypes.h4
14 files changed, 73 insertions, 56 deletions
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index 43f15c8cd2b..ce2af07f62b 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -82,9 +82,9 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info);
82 82
83acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info); 83acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info);
84 84
85acpi_status acpi_raw_enable_gpe(struct acpi_gpe_event_info *gpe_event_info); 85acpi_status acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
86 86
87acpi_status acpi_raw_disable_gpe(struct acpi_gpe_event_info *gpe_event_info); 87acpi_status acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
88 88
89struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, 89struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
90 u32 gpe_number); 90 u32 gpe_number);
@@ -107,7 +107,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
107acpi_status 107acpi_status
108acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, 108acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
109 struct acpi_gpe_block_info *gpe_block, 109 struct acpi_gpe_block_info *gpe_block,
110 void *ignored); 110 void *context);
111 111
112acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); 112acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block);
113 113
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index ad88fcae4eb..fc694647699 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -370,7 +370,7 @@ ACPI_EXTERN struct acpi_fixed_event_handler
370ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; 370ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
371ACPI_EXTERN struct acpi_gpe_block_info 371ACPI_EXTERN struct acpi_gpe_block_info
372*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; 372*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
373ACPI_EXTERN u8 acpi_all_gpes_initialized; 373ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized;
374 374
375/***************************************************************************** 375/*****************************************************************************
376 * 376 *
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 2ceb0c05b2d..2f841d019a3 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -412,13 +412,13 @@ struct acpi_handler_info {
412 acpi_event_handler address; /* Address of handler, if any */ 412 acpi_event_handler address; /* Address of handler, if any */
413 void *context; /* Context to be passed to handler */ 413 void *context; /* Context to be passed to handler */
414 struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */ 414 struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */
415 u8 orig_flags; /* Original misc info about this GPE */ 415 u8 original_flags; /* Original (pre-handler) GPE info */
416 u8 orig_enabled; /* Set if the GPE was originally enabled */ 416 u8 originally_enabled; /* True if GPE was originally enabled */
417}; 417};
418 418
419union acpi_gpe_dispatch_info { 419union acpi_gpe_dispatch_info {
420 struct acpi_namespace_node *method_node; /* Method node for this GPE level */ 420 struct acpi_namespace_node *method_node; /* Method node for this GPE level */
421 struct acpi_handler_info *handler; 421 struct acpi_handler_info *handler; /* Installed GPE handler */
422}; 422};
423 423
424/* 424/*
@@ -458,7 +458,7 @@ struct acpi_gpe_block_info {
458 u32 register_count; /* Number of register pairs in block */ 458 u32 register_count; /* Number of register pairs in block */
459 u16 gpe_count; /* Number of individual GPEs in block */ 459 u16 gpe_count; /* Number of individual GPEs in block */
460 u8 block_base_number; /* Base GPE number for this block */ 460 u8 block_base_number; /* Base GPE number for this block */
461 u8 initialized; /* If set, the GPE block has been initialized */ 461 u8 initialized; /* TRUE if this block is initialized */
462}; 462};
463 463
464/* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ 464/* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index f226eac314d..005c170d244 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -137,7 +137,7 @@ acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
137 137
138/******************************************************************************* 138/*******************************************************************************
139 * 139 *
140 * FUNCTION: acpi_raw_enable_gpe 140 * FUNCTION: acpi_ev_add_gpe_reference
141 * 141 *
142 * PARAMETERS: gpe_event_info - GPE to enable 142 * PARAMETERS: gpe_event_info - GPE to enable
143 * 143 *
@@ -148,10 +148,12 @@ acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
148 * 148 *
149 ******************************************************************************/ 149 ******************************************************************************/
150 150
151acpi_status acpi_raw_enable_gpe(struct acpi_gpe_event_info *gpe_event_info) 151acpi_status acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)
152{ 152{
153 acpi_status status = AE_OK; 153 acpi_status status = AE_OK;
154 154
155 ACPI_FUNCTION_TRACE(ev_add_gpe_reference);
156
155 if (gpe_event_info->runtime_count == ACPI_UINT8_MAX) { 157 if (gpe_event_info->runtime_count == ACPI_UINT8_MAX) {
156 return_ACPI_STATUS(AE_LIMIT); 158 return_ACPI_STATUS(AE_LIMIT);
157 } 159 }
@@ -173,7 +175,7 @@ acpi_status acpi_raw_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
173 175
174/******************************************************************************* 176/*******************************************************************************
175 * 177 *
176 * FUNCTION: acpi_raw_disable_gpe 178 * FUNCTION: acpi_ev_remove_gpe_reference
177 * 179 *
178 * PARAMETERS: gpe_event_info - GPE to disable 180 * PARAMETERS: gpe_event_info - GPE to disable
179 * 181 *
@@ -184,10 +186,12 @@ acpi_status acpi_raw_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
184 * 186 *
185 ******************************************************************************/ 187 ******************************************************************************/
186 188
187acpi_status acpi_raw_disable_gpe(struct acpi_gpe_event_info *gpe_event_info) 189acpi_status acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)
188{ 190{
189 acpi_status status = AE_OK; 191 acpi_status status = AE_OK;
190 192
193 ACPI_FUNCTION_TRACE(ev_remove_gpe_reference);
194
191 if (!gpe_event_info->runtime_count) { 195 if (!gpe_event_info->runtime_count) {
192 return_ACPI_STATUS(AE_LIMIT); 196 return_ACPI_STATUS(AE_LIMIT);
193 } 197 }
@@ -529,7 +533,7 @@ static void acpi_ev_asynch_enable_gpe(void *context)
529 * Enable this GPE, conditionally. This means that the GPE will only be 533 * Enable this GPE, conditionally. This means that the GPE will only be
530 * physically enabled if the enable_for_run bit is set in the event_info 534 * physically enabled if the enable_for_run bit is set in the event_info
531 */ 535 */
532 (void)acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_COND_ENABLE); 536 (void)acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_CONDITIONAL_ENABLE);
533 537
534 return_VOID; 538 return_VOID;
535} 539}
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index 020add3eee1..2a445dfcfdb 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -386,7 +386,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
386 return_ACPI_STATUS(status); 386 return_ACPI_STATUS(status);
387 } 387 }
388 388
389 acpi_all_gpes_initialized = FALSE; 389 acpi_gbl_all_gpes_initialized = FALSE;
390 390
391 /* Find all GPE methods (_Lxx or_Exx) for this block */ 391 /* Find all GPE methods (_Lxx or_Exx) for this block */
392 392
@@ -479,7 +479,7 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
479 continue; 479 continue;
480 } 480 }
481 481
482 status = acpi_raw_enable_gpe(gpe_event_info); 482 status = acpi_ev_add_gpe_reference(gpe_event_info);
483 if (ACPI_FAILURE(status)) { 483 if (ACPI_FAILURE(status)) {
484 ACPI_EXCEPTION((AE_INFO, status, 484 ACPI_EXCEPTION((AE_INFO, status,
485 "Could not enable GPE 0x%02X", 485 "Could not enable GPE 0x%02X",
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 36af222cac6..042a6d69f38 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -722,7 +722,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
722 handler->address = address; 722 handler->address = address;
723 handler->context = context; 723 handler->context = context;
724 handler->method_node = gpe_event_info->dispatch.method_node; 724 handler->method_node = gpe_event_info->dispatch.method_node;
725 handler->orig_flags = gpe_event_info->flags & 725 handler->original_flags = gpe_event_info->flags &
726 (ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); 726 (ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
727 727
728 /* 728 /*
@@ -731,10 +731,10 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
731 * disabled now to avoid spurious execution of the handler. 731 * disabled now to avoid spurious execution of the handler.
732 */ 732 */
733 733
734 if ((handler->orig_flags & ACPI_GPE_DISPATCH_METHOD) 734 if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD)
735 && gpe_event_info->runtime_count) { 735 && gpe_event_info->runtime_count) {
736 handler->orig_enabled = 1; 736 handler->originally_enabled = 1;
737 (void)acpi_raw_disable_gpe(gpe_event_info); 737 (void)acpi_ev_remove_gpe_reference(gpe_event_info);
738 } 738 }
739 739
740 /* Install the handler */ 740 /* Install the handler */
@@ -835,7 +835,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
835 gpe_event_info->dispatch.method_node = handler->method_node; 835 gpe_event_info->dispatch.method_node = handler->method_node;
836 gpe_event_info->flags &= 836 gpe_event_info->flags &=
837 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); 837 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
838 gpe_event_info->flags |= handler->orig_flags; 838 gpe_event_info->flags |= handler->original_flags;
839 839
840 /* 840 /*
841 * If the GPE was previously associated with a method and it was 841 * If the GPE was previously associated with a method and it was
@@ -843,9 +843,9 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
843 * post-initialization configuration. 843 * post-initialization configuration.
844 */ 844 */
845 845
846 if ((handler->orig_flags & ACPI_GPE_DISPATCH_METHOD) 846 if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD)
847 && handler->orig_enabled) 847 && handler->originally_enabled)
848 (void)acpi_raw_enable_gpe(gpe_event_info); 848 (void)acpi_ev_add_gpe_reference(gpe_event_info);
849 849
850 /* Now we can free the handler object */ 850 /* Now we can free the handler object */
851 851
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index 8068065d90e..99f77ab2972 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -51,7 +51,7 @@ ACPI_MODULE_NAME("evxfgpe")
51 51
52/****************************************************************************** 52/******************************************************************************
53 * 53 *
54 * FUNCTION: acpi_update_gpes 54 * FUNCTION: acpi_update_all_gpes
55 * 55 *
56 * PARAMETERS: None 56 * PARAMETERS: None
57 * 57 *
@@ -65,30 +65,34 @@ ACPI_MODULE_NAME("evxfgpe")
65 * 65 *
66 ******************************************************************************/ 66 ******************************************************************************/
67 67
68acpi_status acpi_update_gpes(void) 68acpi_status acpi_update_all_gpes(void)
69{ 69{
70 acpi_status status; 70 acpi_status status;
71 71
72 ACPI_FUNCTION_TRACE(acpi_update_gpes); 72 ACPI_FUNCTION_TRACE(acpi_update_all_gpes);
73 73
74 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); 74 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
75 if (ACPI_FAILURE(status)) { 75 if (ACPI_FAILURE(status)) {
76 return_ACPI_STATUS(status); 76 return_ACPI_STATUS(status);
77 } else if (acpi_all_gpes_initialized) { 77 }
78 goto unlock; 78
79 if (acpi_gbl_all_gpes_initialized) {
80 goto unlock_and_exit;
79 } 81 }
80 82
81 status = acpi_ev_walk_gpe_list(acpi_ev_initialize_gpe_block, NULL); 83 status = acpi_ev_walk_gpe_list(acpi_ev_initialize_gpe_block, NULL);
82 if (ACPI_SUCCESS(status)) { 84 if (ACPI_SUCCESS(status)) {
83 acpi_all_gpes_initialized = TRUE; 85 acpi_gbl_all_gpes_initialized = TRUE;
84 } 86 }
85 87
86unlock: 88unlock_and_exit:
87 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 89 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
88 90
89 return_ACPI_STATUS(status); 91 return_ACPI_STATUS(status);
90} 92}
91 93
94ACPI_EXPORT_SYMBOL(acpi_update_all_gpes)
95
92/******************************************************************************* 96/*******************************************************************************
93 * 97 *
94 * FUNCTION: acpi_enable_gpe 98 * FUNCTION: acpi_enable_gpe
@@ -117,7 +121,7 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
117 121
118 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 122 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
119 if (gpe_event_info) { 123 if (gpe_event_info) {
120 status = acpi_raw_enable_gpe(gpe_event_info); 124 status = acpi_ev_add_gpe_reference(gpe_event_info);
121 } 125 }
122 126
123 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 127 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
@@ -154,7 +158,7 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number)
154 158
155 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 159 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
156 if (gpe_event_info) { 160 if (gpe_event_info) {
157 status = acpi_raw_disable_gpe(gpe_event_info) ; 161 status = acpi_ev_remove_gpe_reference(gpe_event_info) ;
158 } 162 }
159 163
160 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 164 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
@@ -164,7 +168,7 @@ ACPI_EXPORT_SYMBOL(acpi_disable_gpe)
164 168
165/******************************************************************************* 169/*******************************************************************************
166 * 170 *
167 * FUNCTION: acpi_gpe_can_wake 171 * FUNCTION: acpi_setup_gpe_for_wake
168 * 172 *
169 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 173 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
170 * gpe_number - GPE level within the GPE block 174 * gpe_number - GPE level within the GPE block
@@ -178,13 +182,13 @@ ACPI_EXPORT_SYMBOL(acpi_disable_gpe)
178 * to be initially disabled). 182 * to be initially disabled).
179 * 183 *
180 ******************************************************************************/ 184 ******************************************************************************/
181acpi_status acpi_gpe_can_wake(acpi_handle gpe_device, u32 gpe_number) 185acpi_status acpi_setup_gpe_for_wake(acpi_handle gpe_device, u32 gpe_number)
182{ 186{
183 acpi_status status = AE_OK; 187 acpi_status status = AE_OK;
184 struct acpi_gpe_event_info *gpe_event_info; 188 struct acpi_gpe_event_info *gpe_event_info;
185 acpi_cpu_flags flags; 189 acpi_cpu_flags flags;
186 190
187 ACPI_FUNCTION_TRACE(acpi_gpe_can_wake); 191 ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake);
188 192
189 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 193 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
190 194
@@ -200,11 +204,11 @@ acpi_status acpi_gpe_can_wake(acpi_handle gpe_device, u32 gpe_number)
200 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 204 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
201 return_ACPI_STATUS(status); 205 return_ACPI_STATUS(status);
202} 206}
203ACPI_EXPORT_SYMBOL(acpi_gpe_can_wake) 207ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake)
204 208
205/******************************************************************************* 209/*******************************************************************************
206 * 210 *
207 * FUNCTION: acpi_gpe_wakeup 211 * FUNCTION: acpi_set_gpe_wake_mask
208 * 212 *
209 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 213 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
210 * gpe_number - GPE level within the GPE block 214 * gpe_number - GPE level within the GPE block
@@ -216,7 +220,7 @@ ACPI_EXPORT_SYMBOL(acpi_gpe_can_wake)
216 * 220 *
217 ******************************************************************************/ 221 ******************************************************************************/
218 222
219acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action) 223acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action)
220{ 224{
221 acpi_status status = AE_OK; 225 acpi_status status = AE_OK;
222 struct acpi_gpe_event_info *gpe_event_info; 226 struct acpi_gpe_event_info *gpe_event_info;
@@ -224,18 +228,23 @@ acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action)
224 acpi_cpu_flags flags; 228 acpi_cpu_flags flags;
225 u32 register_bit; 229 u32 register_bit;
226 230
227 ACPI_FUNCTION_TRACE(acpi_gpe_wakeup); 231 ACPI_FUNCTION_TRACE(acpi_set_gpe_wake_mask);
228 232
229 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 233 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
230 234
231 /* Ensure that we have a valid GPE number */ 235 /* Ensure that we have a valid GPE number */
232 236
233 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 237 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
234 if (!gpe_event_info || !(gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) { 238 if (!gpe_event_info) {
235 status = AE_BAD_PARAMETER; 239 status = AE_BAD_PARAMETER;
236 goto unlock_and_exit; 240 goto unlock_and_exit;
237 } 241 }
238 242
243 if (!(gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) {
244 status = AE_TYPE;
245 goto unlock_and_exit;
246 }
247
239 gpe_register_info = gpe_event_info->register_info; 248 gpe_register_info = gpe_event_info->register_info;
240 if (!gpe_register_info) { 249 if (!gpe_register_info) {
241 status = AE_NOT_EXIST; 250 status = AE_NOT_EXIST;
@@ -269,7 +278,7 @@ unlock_and_exit:
269 return_ACPI_STATUS(status); 278 return_ACPI_STATUS(status);
270} 279}
271 280
272ACPI_EXPORT_SYMBOL(acpi_gpe_wakeup) 281ACPI_EXPORT_SYMBOL(acpi_set_gpe_wake_mask)
273 282
274/******************************************************************************* 283/*******************************************************************************
275 * 284 *
@@ -387,6 +396,8 @@ acpi_status acpi_disable_all_gpes(void)
387 return_ACPI_STATUS(status); 396 return_ACPI_STATUS(status);
388} 397}
389 398
399ACPI_EXPORT_SYMBOL(acpi_disable_all_gpes)
400
390/****************************************************************************** 401/******************************************************************************
391 * 402 *
392 * FUNCTION: acpi_enable_all_runtime_gpes 403 * FUNCTION: acpi_enable_all_runtime_gpes
@@ -416,6 +427,8 @@ acpi_status acpi_enable_all_runtime_gpes(void)
416 return_ACPI_STATUS(status); 427 return_ACPI_STATUS(status);
417} 428}
418 429
430ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes)
431
419/******************************************************************************* 432/*******************************************************************************
420 * 433 *
421 * FUNCTION: acpi_install_gpe_block 434 * FUNCTION: acpi_install_gpe_block
@@ -435,7 +448,7 @@ acpi_install_gpe_block(acpi_handle gpe_device,
435 struct acpi_generic_address *gpe_block_address, 448 struct acpi_generic_address *gpe_block_address,
436 u32 register_count, u32 interrupt_number) 449 u32 register_count, u32 interrupt_number)
437{ 450{
438 acpi_status status = AE_OK; 451 acpi_status status;
439 union acpi_operand_object *obj_desc; 452 union acpi_operand_object *obj_desc;
440 struct acpi_namespace_node *node; 453 struct acpi_namespace_node *node;
441 struct acpi_gpe_block_info *gpe_block; 454 struct acpi_gpe_block_info *gpe_block;
@@ -603,7 +616,7 @@ acpi_get_gpe_device(u32 index, acpi_handle *gpe_device)
603 return_ACPI_STATUS(status); 616 return_ACPI_STATUS(status);
604 } 617 }
605 618
606 *gpe_device = info.gpe_device; 619 *gpe_device = ACPI_CAST_PTR(acpi_handle, info.gpe_device);
607 return_ACPI_STATUS(info.status); 620 return_ACPI_STATUS(info.status);
608} 621}
609 622
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 14750db2a1b..7c6d4858bb4 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -118,7 +118,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action)
118 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info, 118 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
119 gpe_register_info); 119 gpe_register_info);
120 switch (action) { 120 switch (action) {
121 case ACPI_GPE_COND_ENABLE: 121 case ACPI_GPE_CONDITIONAL_ENABLE:
122 if (!(register_bit & gpe_register_info->enable_for_run)) 122 if (!(register_bit & gpe_register_info->enable_for_run))
123 return (AE_BAD_PARAMETER); 123 return (AE_BAD_PARAMETER);
124 124
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index e87bc6760be..a99c32aa48a 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -768,7 +768,7 @@ acpi_status acpi_ut_init_globals(void)
768 acpi_gbl_gpe_fadt_blocks[0] = NULL; 768 acpi_gbl_gpe_fadt_blocks[0] = NULL;
769 acpi_gbl_gpe_fadt_blocks[1] = NULL; 769 acpi_gbl_gpe_fadt_blocks[1] = NULL;
770 acpi_current_gpe_count = 0; 770 acpi_current_gpe_count = 0;
771 acpi_all_gpes_initialized = FALSE; 771 acpi_gbl_all_gpes_initialized = FALSE;
772 772
773 /* Global handlers */ 773 /* Global handlers */
774 774
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 81514a4918c..1864ad3cf89 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -725,7 +725,7 @@ static void dock_notify(acpi_handle handle, u32 event, void *data)
725 complete_dock(ds); 725 complete_dock(ds);
726 dock_event(ds, event, DOCK_EVENT); 726 dock_event(ds, event, DOCK_EVENT);
727 dock_lock(ds, 1); 727 dock_lock(ds, 1);
728 acpi_update_gpes(); 728 acpi_update_all_gpes();
729 break; 729 break;
730 } 730 }
731 if (dock_present(ds) || dock_in_progress(ds)) 731 if (dock_present(ds) || dock_in_progress(ds))
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 29ef505c487..70249b3d293 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -778,7 +778,7 @@ acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
778 wakeup->resources.handles[i] = element->reference.handle; 778 wakeup->resources.handles[i] = element->reference.handle;
779 } 779 }
780 780
781 acpi_gpe_can_wake(wakeup->gpe_device, wakeup->gpe_number); 781 acpi_setup_gpe_for_wake(wakeup->gpe_device, wakeup->gpe_number);
782 782
783 out: 783 out:
784 kfree(buffer.pointer); 784 kfree(buffer.pointer);
@@ -1467,7 +1467,7 @@ int acpi_bus_start(struct acpi_device *device)
1467 1467
1468 result = acpi_bus_scan(device->handle, &ops, NULL); 1468 result = acpi_bus_scan(device->handle, &ops, NULL);
1469 1469
1470 acpi_update_gpes(); 1470 acpi_update_all_gpes();
1471 1471
1472 return result; 1472 return result;
1473} 1473}
@@ -1584,7 +1584,7 @@ int __init acpi_scan_init(void)
1584 if (result) 1584 if (result)
1585 acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL); 1585 acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL);
1586 else 1586 else
1587 acpi_update_gpes(); 1587 acpi_update_all_gpes();
1588 1588
1589 return result; 1589 return result;
1590} 1590}
diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c
index f62a50c3ed3..c6cb68e0a80 100644
--- a/drivers/acpi/wakeup.c
+++ b/drivers/acpi/wakeup.c
@@ -45,7 +45,7 @@ void acpi_enable_wakeup_devices(u8 sleep_state)
45 acpi_enable_wakeup_device_power(dev, sleep_state); 45 acpi_enable_wakeup_device_power(dev, sleep_state);
46 46
47 /* The wake-up power should have been enabled already. */ 47 /* The wake-up power should have been enabled already. */
48 acpi_gpe_wakeup(dev->wakeup.gpe_device, dev->wakeup.gpe_number, 48 acpi_set_gpe_wake_mask(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
49 ACPI_GPE_ENABLE); 49 ACPI_GPE_ENABLE);
50 } 50 }
51} 51}
@@ -67,7 +67,7 @@ void acpi_disable_wakeup_devices(u8 sleep_state)
67 || (sleep_state > (u32) dev->wakeup.sleep_state)) 67 || (sleep_state > (u32) dev->wakeup.sleep_state))
68 continue; 68 continue;
69 69
70 acpi_gpe_wakeup(dev->wakeup.gpe_device, dev->wakeup.gpe_number, 70 acpi_set_gpe_wake_mask(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
71 ACPI_GPE_DISABLE); 71 ACPI_GPE_DISABLE);
72 72
73 if (dev->wakeup.state.enabled) 73 if (dev->wakeup.state.enabled)
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 53b7cfd924a..5f8ccf1b5ae 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -292,11 +292,11 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number);
292 292
293acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); 293acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number);
294 294
295acpi_status acpi_gpe_can_wake(acpi_handle gpe_device, u32 gpe_number); 295acpi_status acpi_setup_gpe_for_wake(acpi_handle gpe_device, u32 gpe_number);
296 296
297acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); 297acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number);
298 298
299acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action); 299acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action);
300 300
301acpi_status 301acpi_status
302acpi_get_gpe_status(acpi_handle gpe_device, 302acpi_get_gpe_status(acpi_handle gpe_device,
@@ -315,7 +315,7 @@ acpi_install_gpe_block(acpi_handle gpe_device,
315 315
316acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); 316acpi_status acpi_remove_gpe_block(acpi_handle gpe_device);
317 317
318acpi_status acpi_update_gpes(void); 318acpi_status acpi_update_all_gpes(void);
319 319
320/* 320/*
321 * Resource interfaces 321 * Resource interfaces
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 2b134b691e3..e73893994b5 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -656,11 +656,11 @@ typedef u32 acpi_event_status;
656#define ACPI_GPE_MAX 0xFF 656#define ACPI_GPE_MAX 0xFF
657#define ACPI_NUM_GPE 256 657#define ACPI_NUM_GPE 256
658 658
659/* Actions for acpi_gpe_wakeup, acpi_hw_low_set_gpe */ 659/* Actions for acpi_set_gpe_wake_mask, acpi_hw_low_set_gpe */
660 660
661#define ACPI_GPE_ENABLE 0 661#define ACPI_GPE_ENABLE 0
662#define ACPI_GPE_DISABLE 1 662#define ACPI_GPE_DISABLE 1
663#define ACPI_GPE_COND_ENABLE 2 663#define ACPI_GPE_CONDITIONAL_ENABLE 2
664 664
665/* 665/*
666 * GPE info flags - Per GPE 666 * GPE info flags - Per GPE