1 /******************************************************************************
3 * Module Name: evxfgpe - External Interfaces for General Purpose Events (GPEs)
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2012, 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.
47 #include <contrib/dev/acpica/include/acpi.h>
48 #include <contrib/dev/acpica/include/accommon.h>
49 #include <contrib/dev/acpica/include/acevents.h>
50 #include <contrib/dev/acpica/include/acnamesp.h>
52 #define _COMPONENT ACPI_EVENTS
53 ACPI_MODULE_NAME ("evxfgpe")
56 #if (!ACPI_REDUCED_HARDWARE) /* Entire module */
57 /*******************************************************************************
59 * FUNCTION: AcpiUpdateAllGpes
65 * DESCRIPTION: Complete GPE initialization and enable all GPEs that have
66 * associated _Lxx or _Exx methods and are not pointed to by any
67 * device _PRW methods (this indicates that these GPEs are
68 * generally intended for system or device wakeup. Such GPEs
69 * have to be enabled directly when the devices whose _PRW
70 * methods point to them are set up for wakeup signaling.)
72 * NOTE: Should be called after any GPEs are added to the system. Primarily,
73 * after the system _PRW methods have been run, but also after a GPE Block
74 * Device has been added or if any new GPE methods have been added via a
77 ******************************************************************************/
86 ACPI_FUNCTION_TRACE (AcpiUpdateGpes);
89 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
90 if (ACPI_FAILURE (Status))
92 return_ACPI_STATUS (Status);
95 if (AcpiGbl_AllGpesInitialized)
100 Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock, NULL);
101 if (ACPI_SUCCESS (Status))
103 AcpiGbl_AllGpesInitialized = TRUE;
107 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
108 return_ACPI_STATUS (Status);
111 ACPI_EXPORT_SYMBOL (AcpiUpdateAllGpes)
114 /*******************************************************************************
116 * FUNCTION: AcpiEnableGpe
118 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
119 * GpeNumber - GPE level within the GPE block
123 * DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
126 ******************************************************************************/
130 ACPI_HANDLE GpeDevice,
133 ACPI_STATUS Status = AE_BAD_PARAMETER;
134 ACPI_GPE_EVENT_INFO *GpeEventInfo;
135 ACPI_CPU_FLAGS Flags;
138 ACPI_FUNCTION_TRACE (AcpiEnableGpe);
141 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
143 /* Ensure that we have a valid GPE number */
145 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
148 Status = AcpiEvAddGpeReference (GpeEventInfo);
151 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
152 return_ACPI_STATUS (Status);
155 ACPI_EXPORT_SYMBOL (AcpiEnableGpe)
158 /*******************************************************************************
160 * FUNCTION: AcpiDisableGpe
162 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
163 * GpeNumber - GPE level within the GPE block
167 * DESCRIPTION: Remove a reference to a GPE. When the last reference is
168 * removed, only then is the GPE disabled (for runtime GPEs), or
169 * the GPE mask bit disabled (for wake GPEs)
171 ******************************************************************************/
175 ACPI_HANDLE GpeDevice,
178 ACPI_STATUS Status = AE_BAD_PARAMETER;
179 ACPI_GPE_EVENT_INFO *GpeEventInfo;
180 ACPI_CPU_FLAGS Flags;
183 ACPI_FUNCTION_TRACE (AcpiDisableGpe);
186 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
188 /* Ensure that we have a valid GPE number */
190 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
193 Status = AcpiEvRemoveGpeReference (GpeEventInfo);
196 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
197 return_ACPI_STATUS (Status);
200 ACPI_EXPORT_SYMBOL (AcpiDisableGpe)
203 /*******************************************************************************
205 * FUNCTION: AcpiSetGpe
207 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
208 * GpeNumber - GPE level within the GPE block
209 * Action - ACPI_GPE_ENABLE or ACPI_GPE_DISABLE
213 * DESCRIPTION: Enable or disable an individual GPE. This function bypasses
214 * the reference count mechanism used in the AcpiEnableGpe and
215 * AcpiDisableGpe interfaces -- and should be used with care.
217 * Note: Typically used to disable a runtime GPE for short period of time,
218 * then re-enable it, without disturbing the existing reference counts. This
219 * is useful, for example, in the Embedded Controller (EC) driver.
221 ******************************************************************************/
225 ACPI_HANDLE GpeDevice,
229 ACPI_GPE_EVENT_INFO *GpeEventInfo;
231 ACPI_CPU_FLAGS Flags;
234 ACPI_FUNCTION_TRACE (AcpiSetGpe);
237 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
239 /* Ensure that we have a valid GPE number */
241 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
244 Status = AE_BAD_PARAMETER;
248 /* Perform the action */
252 case ACPI_GPE_ENABLE:
253 Status = AcpiEvEnableGpe (GpeEventInfo);
256 case ACPI_GPE_DISABLE:
257 Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
261 Status = AE_BAD_PARAMETER;
266 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
267 return_ACPI_STATUS (Status);
270 ACPI_EXPORT_SYMBOL (AcpiSetGpe)
273 /*******************************************************************************
275 * FUNCTION: AcpiSetupGpeForWake
277 * PARAMETERS: WakeDevice - Device associated with the GPE (via _PRW)
278 * GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
279 * GpeNumber - GPE level within the GPE block
283 * DESCRIPTION: Mark a GPE as having the ability to wake the system. This
284 * interface is intended to be used as the host executes the
285 * _PRW methods (Power Resources for Wake) in the system tables.
286 * Each _PRW appears under a Device Object (The WakeDevice), and
287 * contains the info for the wake GPE associated with the
290 ******************************************************************************/
293 AcpiSetupGpeForWake (
294 ACPI_HANDLE WakeDevice,
295 ACPI_HANDLE GpeDevice,
299 ACPI_GPE_EVENT_INFO *GpeEventInfo;
300 ACPI_NAMESPACE_NODE *DeviceNode;
301 ACPI_GPE_NOTIFY_INFO *Notify;
302 ACPI_CPU_FLAGS Flags;
305 ACPI_FUNCTION_TRACE (AcpiSetupGpeForWake);
308 /* Parameter Validation */
313 * By forcing WakeDevice to be valid, we automatically enable the
314 * implicit notify feature on all hosts.
316 return_ACPI_STATUS (AE_BAD_PARAMETER);
319 /* Handle root object case */
321 if (WakeDevice == ACPI_ROOT_OBJECT)
323 DeviceNode = AcpiGbl_RootNode;
327 DeviceNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, WakeDevice);
330 /* Validate WakeDevice is of type Device */
332 if (DeviceNode->Type != ACPI_TYPE_DEVICE)
334 return_ACPI_STATUS (AE_BAD_PARAMETER);
337 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
339 /* Ensure that we have a valid GPE number */
341 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
344 Status = AE_BAD_PARAMETER;
349 * If there is no method or handler for this GPE, then the
350 * WakeDevice will be notified whenever this GPE fires. This is
351 * known as an "implicit notify". Note: The GPE is assumed to be
352 * level-triggered (for windows compatibility).
354 if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
355 ACPI_GPE_DISPATCH_NONE)
358 * This is the first device for implicit notify on this GPE.
359 * Just set the flags here, and enter the NOTIFY block below.
361 GpeEventInfo->Flags =
362 (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED);
366 * If we already have an implicit notify on this GPE, add
367 * this device to the notify list.
369 if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
370 ACPI_GPE_DISPATCH_NOTIFY)
372 /* Ensure that the device is not already in the list */
374 Notify = GpeEventInfo->Dispatch.NotifyList;
377 if (Notify->DeviceNode == DeviceNode)
379 Status = AE_ALREADY_EXISTS;
382 Notify = Notify->Next;
385 /* Add this device to the notify list for this GPE */
387 Notify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO));
390 Status = AE_NO_MEMORY;
394 Notify->DeviceNode = DeviceNode;
395 Notify->Next = GpeEventInfo->Dispatch.NotifyList;
396 GpeEventInfo->Dispatch.NotifyList = Notify;
399 /* Mark the GPE as a possible wake event */
401 GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
405 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
406 return_ACPI_STATUS (Status);
409 ACPI_EXPORT_SYMBOL (AcpiSetupGpeForWake)
412 /*******************************************************************************
414 * FUNCTION: AcpiSetGpeWakeMask
416 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
417 * GpeNumber - GPE level within the GPE block
418 * Action - Enable or Disable
422 * DESCRIPTION: Set or clear the GPE's wakeup enable mask bit. The GPE must
423 * already be marked as a WAKE GPE.
425 ******************************************************************************/
429 ACPI_HANDLE GpeDevice,
433 ACPI_STATUS Status = AE_OK;
434 ACPI_GPE_EVENT_INFO *GpeEventInfo;
435 ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
436 ACPI_CPU_FLAGS Flags;
440 ACPI_FUNCTION_TRACE (AcpiSetGpeWakeMask);
443 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
446 * Ensure that we have a valid GPE number and that this GPE is in
449 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
452 Status = AE_BAD_PARAMETER;
456 if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
462 GpeRegisterInfo = GpeEventInfo->RegisterInfo;
463 if (!GpeRegisterInfo)
465 Status = AE_NOT_EXIST;
469 RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
471 /* Perform the action */
475 case ACPI_GPE_ENABLE:
476 ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
479 case ACPI_GPE_DISABLE:
480 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
484 ACPI_ERROR ((AE_INFO, "%u, Invalid action", Action));
485 Status = AE_BAD_PARAMETER;
490 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
491 return_ACPI_STATUS (Status);
494 ACPI_EXPORT_SYMBOL (AcpiSetGpeWakeMask)
497 /*******************************************************************************
499 * FUNCTION: AcpiClearGpe
501 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
502 * GpeNumber - GPE level within the GPE block
506 * DESCRIPTION: Clear an ACPI event (general purpose)
508 ******************************************************************************/
512 ACPI_HANDLE GpeDevice,
515 ACPI_STATUS Status = AE_OK;
516 ACPI_GPE_EVENT_INFO *GpeEventInfo;
517 ACPI_CPU_FLAGS Flags;
520 ACPI_FUNCTION_TRACE (AcpiClearGpe);
523 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
525 /* Ensure that we have a valid GPE number */
527 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
530 Status = AE_BAD_PARAMETER;
534 Status = AcpiHwClearGpe (GpeEventInfo);
537 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
538 return_ACPI_STATUS (Status);
541 ACPI_EXPORT_SYMBOL (AcpiClearGpe)
544 /*******************************************************************************
546 * FUNCTION: AcpiGetGpeStatus
548 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
549 * GpeNumber - GPE level within the GPE block
550 * EventStatus - Where the current status of the event
555 * DESCRIPTION: Get the current status of a GPE (signalled/not_signalled)
557 ******************************************************************************/
561 ACPI_HANDLE GpeDevice,
563 ACPI_EVENT_STATUS *EventStatus)
565 ACPI_STATUS Status = AE_OK;
566 ACPI_GPE_EVENT_INFO *GpeEventInfo;
567 ACPI_CPU_FLAGS Flags;
570 ACPI_FUNCTION_TRACE (AcpiGetGpeStatus);
573 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
575 /* Ensure that we have a valid GPE number */
577 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
580 Status = AE_BAD_PARAMETER;
584 /* Obtain status on the requested GPE number */
586 Status = AcpiHwGetGpeStatus (GpeEventInfo, EventStatus);
589 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
590 return_ACPI_STATUS (Status);
593 ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
596 /*******************************************************************************
598 * FUNCTION: AcpiFinishGpe
600 * PARAMETERS: GpeDevice - Namespace node for the GPE Block
601 * (NULL for FADT defined GPEs)
602 * GpeNumber - GPE level within the GPE block
606 * DESCRIPTION: Clear and conditionally reenable a GPE. This completes the GPE
607 * processing. Intended for use by asynchronous host-installed
608 * GPE handlers. The GPE is only reenabled if the EnableForRun bit
609 * is set in the GPE info.
611 ******************************************************************************/
615 ACPI_HANDLE GpeDevice,
618 ACPI_GPE_EVENT_INFO *GpeEventInfo;
620 ACPI_CPU_FLAGS Flags;
623 ACPI_FUNCTION_TRACE (AcpiFinishGpe);
626 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
628 /* Ensure that we have a valid GPE number */
630 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
633 Status = AE_BAD_PARAMETER;
637 Status = AcpiEvFinishGpe (GpeEventInfo);
640 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
641 return_ACPI_STATUS (Status);
644 ACPI_EXPORT_SYMBOL (AcpiFinishGpe)
647 /******************************************************************************
649 * FUNCTION: AcpiDisableAllGpes
655 * DESCRIPTION: Disable and clear all GPEs in all GPE blocks
657 ******************************************************************************/
666 ACPI_FUNCTION_TRACE (AcpiDisableAllGpes);
669 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
670 if (ACPI_FAILURE (Status))
672 return_ACPI_STATUS (Status);
675 Status = AcpiHwDisableAllGpes ();
676 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
678 return_ACPI_STATUS (Status);
681 ACPI_EXPORT_SYMBOL (AcpiDisableAllGpes)
684 /******************************************************************************
686 * FUNCTION: AcpiEnableAllRuntimeGpes
692 * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
694 ******************************************************************************/
697 AcpiEnableAllRuntimeGpes (
703 ACPI_FUNCTION_TRACE (AcpiEnableAllRuntimeGpes);
706 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
707 if (ACPI_FAILURE (Status))
709 return_ACPI_STATUS (Status);
712 Status = AcpiHwEnableAllRuntimeGpes ();
713 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
715 return_ACPI_STATUS (Status);
718 ACPI_EXPORT_SYMBOL (AcpiEnableAllRuntimeGpes)
721 /*******************************************************************************
723 * FUNCTION: AcpiInstallGpeBlock
725 * PARAMETERS: GpeDevice - Handle to the parent GPE Block Device
726 * GpeBlockAddress - Address and SpaceID
727 * RegisterCount - Number of GPE register pairs in the block
728 * InterruptNumber - H/W interrupt for the block
732 * DESCRIPTION: Create and Install a block of GPE registers. The GPEs are not
735 ******************************************************************************/
738 AcpiInstallGpeBlock (
739 ACPI_HANDLE GpeDevice,
740 ACPI_GENERIC_ADDRESS *GpeBlockAddress,
741 UINT32 RegisterCount,
742 UINT32 InterruptNumber)
745 ACPI_OPERAND_OBJECT *ObjDesc;
746 ACPI_NAMESPACE_NODE *Node;
747 ACPI_GPE_BLOCK_INFO *GpeBlock;
750 ACPI_FUNCTION_TRACE (AcpiInstallGpeBlock);
754 (!GpeBlockAddress) ||
757 return_ACPI_STATUS (AE_BAD_PARAMETER);
760 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
761 if (ACPI_FAILURE (Status))
766 Node = AcpiNsValidateHandle (GpeDevice);
769 Status = AE_BAD_PARAMETER;
774 * For user-installed GPE Block Devices, the GpeBlockBaseNumber
777 Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
778 0, InterruptNumber, &GpeBlock);
779 if (ACPI_FAILURE (Status))
784 /* Install block in the DeviceObject attached to the node */
786 ObjDesc = AcpiNsGetAttachedObject (Node);
790 * No object, create a new one (Device nodes do not always have
791 * an attached object)
793 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_DEVICE);
796 Status = AE_NO_MEMORY;
800 Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_DEVICE);
802 /* Remove local reference to the object */
804 AcpiUtRemoveReference (ObjDesc);
805 if (ACPI_FAILURE (Status))
811 /* Now install the GPE block in the DeviceObject */
813 ObjDesc->Device.GpeBlock = GpeBlock;
817 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
818 return_ACPI_STATUS (Status);
821 ACPI_EXPORT_SYMBOL (AcpiInstallGpeBlock)
824 /*******************************************************************************
826 * FUNCTION: AcpiRemoveGpeBlock
828 * PARAMETERS: GpeDevice - Handle to the parent GPE Block Device
832 * DESCRIPTION: Remove a previously installed block of GPE registers
834 ******************************************************************************/
838 ACPI_HANDLE GpeDevice)
840 ACPI_OPERAND_OBJECT *ObjDesc;
842 ACPI_NAMESPACE_NODE *Node;
845 ACPI_FUNCTION_TRACE (AcpiRemoveGpeBlock);
850 return_ACPI_STATUS (AE_BAD_PARAMETER);
853 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
854 if (ACPI_FAILURE (Status))
859 Node = AcpiNsValidateHandle (GpeDevice);
862 Status = AE_BAD_PARAMETER;
866 /* Get the DeviceObject attached to the node */
868 ObjDesc = AcpiNsGetAttachedObject (Node);
870 !ObjDesc->Device.GpeBlock)
872 return_ACPI_STATUS (AE_NULL_OBJECT);
875 /* Delete the GPE block (but not the DeviceObject) */
877 Status = AcpiEvDeleteGpeBlock (ObjDesc->Device.GpeBlock);
878 if (ACPI_SUCCESS (Status))
880 ObjDesc->Device.GpeBlock = NULL;
884 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
885 return_ACPI_STATUS (Status);
888 ACPI_EXPORT_SYMBOL (AcpiRemoveGpeBlock)
891 /*******************************************************************************
893 * FUNCTION: AcpiGetGpeDevice
895 * PARAMETERS: Index - System GPE index (0-CurrentGpeCount)
896 * GpeDevice - Where the parent GPE Device is returned
900 * DESCRIPTION: Obtain the GPE device associated with the input index. A NULL
901 * gpe device indicates that the gpe number is contained in one of
902 * the FADT-defined gpe blocks. Otherwise, the GPE block device.
904 ******************************************************************************/
909 ACPI_HANDLE *GpeDevice)
911 ACPI_GPE_DEVICE_INFO Info;
915 ACPI_FUNCTION_TRACE (AcpiGetGpeDevice);
920 return_ACPI_STATUS (AE_BAD_PARAMETER);
923 if (Index >= AcpiCurrentGpeCount)
925 return_ACPI_STATUS (AE_NOT_EXIST);
928 /* Setup and walk the GPE list */
931 Info.Status = AE_NOT_EXIST;
932 Info.GpeDevice = NULL;
933 Info.NextBlockBaseIndex = 0;
935 Status = AcpiEvWalkGpeList (AcpiEvGetGpeDevice, &Info);
936 if (ACPI_FAILURE (Status))
938 return_ACPI_STATUS (Status);
941 *GpeDevice = ACPI_CAST_PTR (ACPI_HANDLE, Info.GpeDevice);
942 return_ACPI_STATUS (Info.Status);
945 ACPI_EXPORT_SYMBOL (AcpiGetGpeDevice)
947 #endif /* !ACPI_REDUCED_HARDWARE */