1 /******************************************************************************
3 * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2008, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #include <acpi/acpi.h>
45 #include <acpi/acevents.h>
46 #include <acpi/acnamesp.h>
47 #include <acpi/actables.h>
49 #define _COMPONENT ACPI_EVENTS
50 ACPI_MODULE_NAME("evxfevnt")
52 /* Local prototypes */
54 acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info
*gpe_xrupt_info
,
55 struct acpi_gpe_block_info
*gpe_block
, void *context
);
57 /*******************************************************************************
59 * FUNCTION: acpi_enable
65 * DESCRIPTION: Transfers the system into ACPI mode.
67 ******************************************************************************/
69 acpi_status
acpi_enable(void)
71 acpi_status status
= AE_OK
;
73 ACPI_FUNCTION_TRACE(acpi_enable
);
75 /* ACPI tables must be present */
77 if (!acpi_tb_tables_loaded()) {
78 return_ACPI_STATUS(AE_NO_ACPI_TABLES
);
81 /* Check current mode */
83 if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI
) {
84 ACPI_DEBUG_PRINT((ACPI_DB_INIT
,
85 "System is already in ACPI mode\n"));
87 /* Transition to ACPI mode */
89 status
= acpi_hw_set_mode(ACPI_SYS_MODE_ACPI
);
90 if (ACPI_FAILURE(status
)) {
92 "Could not transition to ACPI mode"));
93 return_ACPI_STATUS(status
);
96 ACPI_DEBUG_PRINT((ACPI_DB_INIT
,
97 "Transition to ACPI mode successful\n"));
100 return_ACPI_STATUS(status
);
103 ACPI_EXPORT_SYMBOL(acpi_enable
)
105 /*******************************************************************************
107 * FUNCTION: acpi_disable
113 * DESCRIPTION: Transfers the system into LEGACY (non-ACPI) mode.
115 ******************************************************************************/
116 acpi_status
acpi_disable(void)
118 acpi_status status
= AE_OK
;
120 ACPI_FUNCTION_TRACE(acpi_disable
);
122 if (acpi_hw_get_mode() == ACPI_SYS_MODE_LEGACY
) {
123 ACPI_DEBUG_PRINT((ACPI_DB_INIT
,
124 "System is already in legacy (non-ACPI) mode\n"));
126 /* Transition to LEGACY mode */
128 status
= acpi_hw_set_mode(ACPI_SYS_MODE_LEGACY
);
130 if (ACPI_FAILURE(status
)) {
132 "Could not exit ACPI mode to legacy mode"));
133 return_ACPI_STATUS(status
);
136 ACPI_DEBUG_PRINT((ACPI_DB_INIT
, "ACPI mode disabled\n"));
139 return_ACPI_STATUS(status
);
142 ACPI_EXPORT_SYMBOL(acpi_disable
)
144 /*******************************************************************************
146 * FUNCTION: acpi_enable_event
148 * PARAMETERS: Event - The fixed eventto be enabled
153 * DESCRIPTION: Enable an ACPI event (fixed)
155 ******************************************************************************/
156 acpi_status
acpi_enable_event(u32 event
, u32 flags
)
158 acpi_status status
= AE_OK
;
161 ACPI_FUNCTION_TRACE(acpi_enable_event
);
163 /* Decode the Fixed Event */
165 if (event
> ACPI_EVENT_MAX
) {
166 return_ACPI_STATUS(AE_BAD_PARAMETER
);
170 * Enable the requested fixed event (by writing a one to the enable
174 acpi_set_register(acpi_gbl_fixed_event_info
[event
].
175 enable_register_id
, 1);
176 if (ACPI_FAILURE(status
)) {
177 return_ACPI_STATUS(status
);
180 /* Make sure that the hardware responded */
183 acpi_get_register(acpi_gbl_fixed_event_info
[event
].
184 enable_register_id
, &value
);
185 if (ACPI_FAILURE(status
)) {
186 return_ACPI_STATUS(status
);
191 "Could not enable %s event",
192 acpi_ut_get_event_name(event
)));
193 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE
);
196 return_ACPI_STATUS(status
);
199 ACPI_EXPORT_SYMBOL(acpi_enable_event
)
201 /*******************************************************************************
203 * FUNCTION: acpi_set_gpe_type
205 * PARAMETERS: gpe_device - Parent GPE Device
206 * gpe_number - GPE level within the GPE block
207 * Type - New GPE type
211 * DESCRIPTION: Set the type of an individual GPE
213 ******************************************************************************/
214 acpi_status
acpi_set_gpe_type(acpi_handle gpe_device
, u32 gpe_number
, u8 type
)
216 acpi_status status
= AE_OK
;
217 struct acpi_gpe_event_info
*gpe_event_info
;
219 ACPI_FUNCTION_TRACE(acpi_set_gpe_type
);
221 /* Ensure that we have a valid GPE number */
223 gpe_event_info
= acpi_ev_get_gpe_event_info(gpe_device
, gpe_number
);
224 if (!gpe_event_info
) {
225 status
= AE_BAD_PARAMETER
;
226 goto unlock_and_exit
;
229 if ((gpe_event_info
->flags
& ACPI_GPE_TYPE_MASK
) == type
) {
230 return_ACPI_STATUS(AE_OK
);
233 /* Set the new type (will disable GPE if currently enabled) */
235 status
= acpi_ev_set_gpe_type(gpe_event_info
, type
);
238 return_ACPI_STATUS(status
);
241 ACPI_EXPORT_SYMBOL(acpi_set_gpe_type
)
243 /*******************************************************************************
245 * FUNCTION: acpi_enable_gpe
247 * PARAMETERS: gpe_device - Parent GPE Device
248 * gpe_number - GPE level within the GPE block
249 * Flags - Just enable, or also wake enable?
250 * Called from ISR or not
254 * DESCRIPTION: Enable an ACPI event (general purpose)
256 ******************************************************************************/
257 acpi_status
acpi_enable_gpe(acpi_handle gpe_device
, u32 gpe_number
)
259 acpi_status status
= AE_OK
;
260 acpi_cpu_flags flags
;
261 struct acpi_gpe_event_info
*gpe_event_info
;
263 ACPI_FUNCTION_TRACE(acpi_enable_gpe
);
265 flags
= acpi_os_acquire_lock(acpi_gbl_gpe_lock
);
267 /* Ensure that we have a valid GPE number */
269 gpe_event_info
= acpi_ev_get_gpe_event_info(gpe_device
, gpe_number
);
270 if (!gpe_event_info
) {
271 status
= AE_BAD_PARAMETER
;
272 goto unlock_and_exit
;
275 /* Perform the enable */
277 status
= acpi_ev_enable_gpe(gpe_event_info
, TRUE
);
280 acpi_os_release_lock(acpi_gbl_gpe_lock
, flags
);
281 return_ACPI_STATUS(status
);
284 ACPI_EXPORT_SYMBOL(acpi_enable_gpe
)
286 /*******************************************************************************
288 * FUNCTION: acpi_disable_gpe
290 * PARAMETERS: gpe_device - Parent GPE Device
291 * gpe_number - GPE level within the GPE block
292 * Flags - Just disable, or also wake disable?
293 * Called from ISR or not
297 * DESCRIPTION: Disable an ACPI event (general purpose)
299 ******************************************************************************/
300 acpi_status
acpi_disable_gpe(acpi_handle gpe_device
, u32 gpe_number
)
302 acpi_status status
= AE_OK
;
303 acpi_cpu_flags flags
;
304 struct acpi_gpe_event_info
*gpe_event_info
;
306 ACPI_FUNCTION_TRACE(acpi_disable_gpe
);
308 flags
= acpi_os_acquire_lock(acpi_gbl_gpe_lock
);
309 /* Ensure that we have a valid GPE number */
311 gpe_event_info
= acpi_ev_get_gpe_event_info(gpe_device
, gpe_number
);
312 if (!gpe_event_info
) {
313 status
= AE_BAD_PARAMETER
;
314 goto unlock_and_exit
;
317 status
= acpi_ev_disable_gpe(gpe_event_info
);
320 acpi_os_release_lock(acpi_gbl_gpe_lock
, flags
);
321 return_ACPI_STATUS(status
);
324 ACPI_EXPORT_SYMBOL(acpi_disable_gpe
)
326 /*******************************************************************************
328 * FUNCTION: acpi_disable_event
330 * PARAMETERS: Event - The fixed eventto be enabled
335 * DESCRIPTION: Disable an ACPI event (fixed)
337 ******************************************************************************/
338 acpi_status
acpi_disable_event(u32 event
, u32 flags
)
340 acpi_status status
= AE_OK
;
343 ACPI_FUNCTION_TRACE(acpi_disable_event
);
345 /* Decode the Fixed Event */
347 if (event
> ACPI_EVENT_MAX
) {
348 return_ACPI_STATUS(AE_BAD_PARAMETER
);
352 * Disable the requested fixed event (by writing a zero to the enable
356 acpi_set_register(acpi_gbl_fixed_event_info
[event
].
357 enable_register_id
, 0);
358 if (ACPI_FAILURE(status
)) {
359 return_ACPI_STATUS(status
);
363 acpi_get_register(acpi_gbl_fixed_event_info
[event
].
364 enable_register_id
, &value
);
365 if (ACPI_FAILURE(status
)) {
366 return_ACPI_STATUS(status
);
371 "Could not disable %s events",
372 acpi_ut_get_event_name(event
)));
373 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE
);
376 return_ACPI_STATUS(status
);
379 ACPI_EXPORT_SYMBOL(acpi_disable_event
)
381 /*******************************************************************************
383 * FUNCTION: acpi_clear_event
385 * PARAMETERS: Event - The fixed event to be cleared
389 * DESCRIPTION: Clear an ACPI event (fixed)
391 ******************************************************************************/
392 acpi_status
acpi_clear_event(u32 event
)
394 acpi_status status
= AE_OK
;
396 ACPI_FUNCTION_TRACE(acpi_clear_event
);
398 /* Decode the Fixed Event */
400 if (event
> ACPI_EVENT_MAX
) {
401 return_ACPI_STATUS(AE_BAD_PARAMETER
);
405 * Clear the requested fixed event (By writing a one to the status
409 acpi_set_register(acpi_gbl_fixed_event_info
[event
].
410 status_register_id
, 1);
412 return_ACPI_STATUS(status
);
415 ACPI_EXPORT_SYMBOL(acpi_clear_event
)
417 /*******************************************************************************
419 * FUNCTION: acpi_clear_gpe
421 * PARAMETERS: gpe_device - Parent GPE Device
422 * gpe_number - GPE level within the GPE block
423 * Flags - Called from an ISR or not
427 * DESCRIPTION: Clear an ACPI event (general purpose)
429 ******************************************************************************/
430 acpi_status
acpi_clear_gpe(acpi_handle gpe_device
, u32 gpe_number
, u32 flags
)
432 acpi_status status
= AE_OK
;
433 struct acpi_gpe_event_info
*gpe_event_info
;
435 ACPI_FUNCTION_TRACE(acpi_clear_gpe
);
437 /* Use semaphore lock if not executing at interrupt level */
439 if (flags
& ACPI_NOT_ISR
) {
440 status
= acpi_ut_acquire_mutex(ACPI_MTX_EVENTS
);
441 if (ACPI_FAILURE(status
)) {
442 return_ACPI_STATUS(status
);
446 /* Ensure that we have a valid GPE number */
448 gpe_event_info
= acpi_ev_get_gpe_event_info(gpe_device
, gpe_number
);
449 if (!gpe_event_info
) {
450 status
= AE_BAD_PARAMETER
;
451 goto unlock_and_exit
;
454 status
= acpi_hw_clear_gpe(gpe_event_info
);
457 if (flags
& ACPI_NOT_ISR
) {
458 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS
);
460 return_ACPI_STATUS(status
);
463 ACPI_EXPORT_SYMBOL(acpi_clear_gpe
)
464 /*******************************************************************************
466 * FUNCTION: acpi_get_event_status
468 * PARAMETERS: Event - The fixed event
469 * event_status - Where the current status of the event will
474 * DESCRIPTION: Obtains and returns the current status of the event
476 ******************************************************************************/
477 acpi_status
acpi_get_event_status(u32 event
, acpi_event_status
* event_status
)
479 acpi_status status
= AE_OK
;
482 ACPI_FUNCTION_TRACE(acpi_get_event_status
);
485 return_ACPI_STATUS(AE_BAD_PARAMETER
);
488 /* Decode the Fixed Event */
490 if (event
> ACPI_EVENT_MAX
) {
491 return_ACPI_STATUS(AE_BAD_PARAMETER
);
494 /* Get the status of the requested fixed event */
497 acpi_get_register(acpi_gbl_fixed_event_info
[event
].
498 enable_register_id
, &value
);
499 if (ACPI_FAILURE(status
))
500 return_ACPI_STATUS(status
);
502 *event_status
= value
;
505 acpi_get_register(acpi_gbl_fixed_event_info
[event
].
506 status_register_id
, &value
);
507 if (ACPI_FAILURE(status
))
508 return_ACPI_STATUS(status
);
511 *event_status
|= ACPI_EVENT_FLAG_SET
;
513 if (acpi_gbl_fixed_event_handlers
[event
].handler
)
514 *event_status
|= ACPI_EVENT_FLAG_HANDLE
;
516 return_ACPI_STATUS(status
);
519 ACPI_EXPORT_SYMBOL(acpi_get_event_status
)
521 /*******************************************************************************
523 * FUNCTION: acpi_get_gpe_status
525 * PARAMETERS: gpe_device - Parent GPE Device
526 * gpe_number - GPE level within the GPE block
527 * Flags - Called from an ISR or not
528 * event_status - Where the current status of the event will
533 * DESCRIPTION: Get status of an event (general purpose)
535 ******************************************************************************/
537 acpi_get_gpe_status(acpi_handle gpe_device
,
538 u32 gpe_number
, u32 flags
, acpi_event_status
* event_status
)
540 acpi_status status
= AE_OK
;
541 struct acpi_gpe_event_info
*gpe_event_info
;
543 ACPI_FUNCTION_TRACE(acpi_get_gpe_status
);
545 /* Use semaphore lock if not executing at interrupt level */
547 if (flags
& ACPI_NOT_ISR
) {
548 status
= acpi_ut_acquire_mutex(ACPI_MTX_EVENTS
);
549 if (ACPI_FAILURE(status
)) {
550 return_ACPI_STATUS(status
);
554 /* Ensure that we have a valid GPE number */
556 gpe_event_info
= acpi_ev_get_gpe_event_info(gpe_device
, gpe_number
);
557 if (!gpe_event_info
) {
558 status
= AE_BAD_PARAMETER
;
559 goto unlock_and_exit
;
562 /* Obtain status on the requested GPE number */
564 status
= acpi_hw_get_gpe_status(gpe_event_info
, event_status
);
566 if (gpe_event_info
->flags
& ACPI_GPE_DISPATCH_MASK
)
567 *event_status
|= ACPI_EVENT_FLAG_HANDLE
;
570 if (flags
& ACPI_NOT_ISR
) {
571 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS
);
573 return_ACPI_STATUS(status
);
576 ACPI_EXPORT_SYMBOL(acpi_get_gpe_status
)
577 /*******************************************************************************
579 * FUNCTION: acpi_install_gpe_block
581 * PARAMETERS: gpe_device - Handle to the parent GPE Block Device
582 * gpe_block_address - Address and space_iD
583 * register_count - Number of GPE register pairs in the block
584 * interrupt_number - H/W interrupt for the block
588 * DESCRIPTION: Create and Install a block of GPE registers
590 ******************************************************************************/
592 acpi_install_gpe_block(acpi_handle gpe_device
,
593 struct acpi_generic_address
*gpe_block_address
,
594 u32 register_count
, u32 interrupt_number
)
597 union acpi_operand_object
*obj_desc
;
598 struct acpi_namespace_node
*node
;
599 struct acpi_gpe_block_info
*gpe_block
;
601 ACPI_FUNCTION_TRACE(acpi_install_gpe_block
);
603 if ((!gpe_device
) || (!gpe_block_address
) || (!register_count
)) {
604 return_ACPI_STATUS(AE_BAD_PARAMETER
);
607 status
= acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE
);
608 if (ACPI_FAILURE(status
)) {
612 node
= acpi_ns_map_handle_to_node(gpe_device
);
614 status
= AE_BAD_PARAMETER
;
615 goto unlock_and_exit
;
619 * For user-installed GPE Block Devices, the gpe_block_base_number
623 acpi_ev_create_gpe_block(node
, gpe_block_address
, register_count
, 0,
624 interrupt_number
, &gpe_block
);
625 if (ACPI_FAILURE(status
)) {
626 goto unlock_and_exit
;
629 /* Run the _PRW methods and enable the GPEs */
631 status
= acpi_ev_initialize_gpe_block(node
, gpe_block
);
632 if (ACPI_FAILURE(status
)) {
633 goto unlock_and_exit
;
636 /* Get the device_object attached to the node */
638 obj_desc
= acpi_ns_get_attached_object(node
);
641 /* No object, create a new one */
643 obj_desc
= acpi_ut_create_internal_object(ACPI_TYPE_DEVICE
);
645 status
= AE_NO_MEMORY
;
646 goto unlock_and_exit
;
650 acpi_ns_attach_object(node
, obj_desc
, ACPI_TYPE_DEVICE
);
652 /* Remove local reference to the object */
654 acpi_ut_remove_reference(obj_desc
);
656 if (ACPI_FAILURE(status
)) {
657 goto unlock_and_exit
;
661 /* Install the GPE block in the device_object */
663 obj_desc
->device
.gpe_block
= gpe_block
;
666 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE
);
667 return_ACPI_STATUS(status
);
670 ACPI_EXPORT_SYMBOL(acpi_install_gpe_block
)
672 /*******************************************************************************
674 * FUNCTION: acpi_remove_gpe_block
676 * PARAMETERS: gpe_device - Handle to the parent GPE Block Device
680 * DESCRIPTION: Remove a previously installed block of GPE registers
682 ******************************************************************************/
683 acpi_status
acpi_remove_gpe_block(acpi_handle gpe_device
)
685 union acpi_operand_object
*obj_desc
;
687 struct acpi_namespace_node
*node
;
689 ACPI_FUNCTION_TRACE(acpi_remove_gpe_block
);
692 return_ACPI_STATUS(AE_BAD_PARAMETER
);
695 status
= acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE
);
696 if (ACPI_FAILURE(status
)) {
700 node
= acpi_ns_map_handle_to_node(gpe_device
);
702 status
= AE_BAD_PARAMETER
;
703 goto unlock_and_exit
;
706 /* Get the device_object attached to the node */
708 obj_desc
= acpi_ns_get_attached_object(node
);
709 if (!obj_desc
|| !obj_desc
->device
.gpe_block
) {
710 return_ACPI_STATUS(AE_NULL_OBJECT
);
713 /* Delete the GPE block (but not the device_object) */
715 status
= acpi_ev_delete_gpe_block(obj_desc
->device
.gpe_block
);
716 if (ACPI_SUCCESS(status
)) {
717 obj_desc
->device
.gpe_block
= NULL
;
721 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE
);
722 return_ACPI_STATUS(status
);
725 ACPI_EXPORT_SYMBOL(acpi_remove_gpe_block
)
727 /*******************************************************************************
729 * FUNCTION: acpi_get_gpe_device
731 * PARAMETERS: Index - System GPE index (0-current_gpe_count)
732 * gpe_device - Where the parent GPE Device is returned
736 * DESCRIPTION: Obtain the GPE device associated with the input index. A NULL
737 * gpe device indicates that the gpe number is contained in one of
738 * the FADT-defined gpe blocks. Otherwise, the GPE block device.
740 ******************************************************************************/
742 acpi_get_gpe_device(u32 index
, acpi_handle
*gpe_device
)
744 struct acpi_gpe_device_info info
;
747 ACPI_FUNCTION_TRACE(acpi_get_gpe_device
);
750 return_ACPI_STATUS(AE_BAD_PARAMETER
);
753 if (index
>= acpi_current_gpe_count
) {
754 return_ACPI_STATUS(AE_NOT_EXIST
);
757 /* Setup and walk the GPE list */
760 info
.status
= AE_NOT_EXIST
;
761 info
.gpe_device
= NULL
;
762 info
.next_block_base_index
= 0;
764 status
= acpi_ev_walk_gpe_list(acpi_ev_get_gpe_device
, &info
);
765 if (ACPI_FAILURE(status
)) {
766 return_ACPI_STATUS(status
);
769 *gpe_device
= info
.gpe_device
;
770 return_ACPI_STATUS(info
.status
);
773 ACPI_EXPORT_SYMBOL(acpi_get_gpe_device
)
775 /*******************************************************************************
777 * FUNCTION: acpi_ev_get_gpe_device
779 * PARAMETERS: GPE_WALK_CALLBACK
783 * DESCRIPTION: Matches the input GPE index (0-current_gpe_count) with a GPE
784 * block device. NULL if the GPE is one of the FADT-defined GPEs.
786 ******************************************************************************/
788 acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info
*gpe_xrupt_info
,
789 struct acpi_gpe_block_info
*gpe_block
, void *context
)
791 struct acpi_gpe_device_info
*info
= context
;
793 /* Increment Index by the number of GPEs in this block */
795 info
->next_block_base_index
+=
796 (gpe_block
->register_count
* ACPI_GPE_REGISTER_WIDTH
);
798 if (info
->index
< info
->next_block_base_index
) {
800 * The GPE index is within this block, get the node. Leave the node
801 * NULL for the FADT-defined GPEs
803 if ((gpe_block
->node
)->type
== ACPI_TYPE_DEVICE
) {
804 info
->gpe_device
= gpe_block
->node
;
807 info
->status
= AE_OK
;
808 return (AE_CTRL_END
);
814 /******************************************************************************
816 * FUNCTION: acpi_disable_all_gpes
822 * DESCRIPTION: Disable and clear all GPEs in all GPE blocks
824 ******************************************************************************/
826 acpi_status
acpi_disable_all_gpes(void)
830 ACPI_FUNCTION_TRACE(acpi_disable_all_gpes
);
832 status
= acpi_ut_acquire_mutex(ACPI_MTX_EVENTS
);
833 if (ACPI_FAILURE(status
)) {
834 return_ACPI_STATUS(status
);
837 status
= acpi_hw_disable_all_gpes();
838 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS
);
840 return_ACPI_STATUS(status
);
843 /******************************************************************************
845 * FUNCTION: acpi_enable_all_runtime_gpes
851 * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
853 ******************************************************************************/
855 acpi_status
acpi_enable_all_runtime_gpes(void)
859 ACPI_FUNCTION_TRACE(acpi_enable_all_runtime_gpes
);
861 status
= acpi_ut_acquire_mutex(ACPI_MTX_EVENTS
);
862 if (ACPI_FAILURE(status
)) {
863 return_ACPI_STATUS(status
);
866 status
= acpi_hw_enable_all_runtime_gpes();
867 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS
);
869 return_ACPI_STATUS(status
);