diff options
Diffstat (limited to 'drivers/acpi/acpica/evxfgpe.c')
-rw-r--r-- | drivers/acpi/acpica/evxfgpe.c | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c index 8068065d90eb..99f77ab29729 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 | ||
68 | acpi_status acpi_update_gpes(void) | 68 | acpi_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 | ||
86 | unlock: | 88 | unlock_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 | ||
94 | ACPI_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 | ******************************************************************************/ |
181 | acpi_status acpi_gpe_can_wake(acpi_handle gpe_device, u32 gpe_number) | 185 | acpi_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 | } |
203 | ACPI_EXPORT_SYMBOL(acpi_gpe_can_wake) | 207 | ACPI_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 | ||
219 | acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action) | 223 | acpi_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 | ||
272 | ACPI_EXPORT_SYMBOL(acpi_gpe_wakeup) | 281 | ACPI_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 | ||
399 | ACPI_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 | ||
430 | ACPI_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 | ||