hwgpe.c revision 278970
167754Smsmith/******************************************************************************
267754Smsmith *
367754Smsmith * Module Name: hwgpe - Low level GPE enable/disable/clear functions
467754Smsmith *
567754Smsmith *****************************************************************************/
667754Smsmith
7217365Sjkim/*
8278970Sjkim * Copyright (C) 2000 - 2015, Intel Corp.
970243Smsmith * All rights reserved.
1067754Smsmith *
11217365Sjkim * Redistribution and use in source and binary forms, with or without
12217365Sjkim * modification, are permitted provided that the following conditions
13217365Sjkim * are met:
14217365Sjkim * 1. Redistributions of source code must retain the above copyright
15217365Sjkim *    notice, this list of conditions, and the following disclaimer,
16217365Sjkim *    without modification.
17217365Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18217365Sjkim *    substantially similar to the "NO WARRANTY" disclaimer below
19217365Sjkim *    ("Disclaimer") and any redistribution must be conditioned upon
20217365Sjkim *    including a substantially similar Disclaimer requirement for further
21217365Sjkim *    binary redistribution.
22217365Sjkim * 3. Neither the names of the above-listed copyright holders nor the names
23217365Sjkim *    of any contributors may be used to endorse or promote products derived
24217365Sjkim *    from this software without specific prior written permission.
2567754Smsmith *
26217365Sjkim * Alternatively, this software may be distributed under the terms of the
27217365Sjkim * GNU General Public License ("GPL") version 2 as published by the Free
28217365Sjkim * Software Foundation.
2967754Smsmith *
30217365Sjkim * NO WARRANTY
31217365Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32217365Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33217365Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34217365Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35217365Sjkim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36217365Sjkim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37217365Sjkim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38217365Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39217365Sjkim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40217365Sjkim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41217365Sjkim * POSSIBILITY OF SUCH DAMAGES.
42217365Sjkim */
4367754Smsmith
44193341Sjkim#include <contrib/dev/acpica/include/acpi.h>
45193341Sjkim#include <contrib/dev/acpica/include/accommon.h>
46193341Sjkim#include <contrib/dev/acpica/include/acevents.h>
4767754Smsmith
4877424Smsmith#define _COMPONENT          ACPI_HARDWARE
4991116Smsmith        ACPI_MODULE_NAME    ("hwgpe")
5067754Smsmith
51231844Sjkim#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52231844Sjkim
53151937Sjkim/* Local prototypes */
5467754Smsmith
55151937Sjkimstatic ACPI_STATUS
56151937SjkimAcpiHwEnableWakeupGpeBlock (
57151937Sjkim    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
58193267Sjkim    ACPI_GPE_BLOCK_INFO     *GpeBlock,
59193267Sjkim    void                    *Context);
60151937Sjkim
61278970Sjkimstatic ACPI_STATUS
62278970SjkimAcpiHwGpeEnableWrite (
63278970Sjkim    UINT8                   EnableMask,
64278970Sjkim    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo);
65151937Sjkim
66278970Sjkim
6767754Smsmith/******************************************************************************
6867754Smsmith *
69209746Sjkim * FUNCTION:    AcpiHwGetGpeRegisterBit
70193267Sjkim *
71209746Sjkim * PARAMETERS:  GpeEventInfo        - Info block for the GPE
72209746Sjkim *
73209746Sjkim * RETURN:      Register mask with a one in the GPE bit position
74209746Sjkim *
75209746Sjkim * DESCRIPTION: Compute the register mask for this GPE. One bit is set in the
76209746Sjkim *              correct position for the input GPE.
77209746Sjkim *
78209746Sjkim ******************************************************************************/
79209746Sjkim
80209746SjkimUINT32
81209746SjkimAcpiHwGetGpeRegisterBit (
82239340Sjkim    ACPI_GPE_EVENT_INFO     *GpeEventInfo)
83209746Sjkim{
84209746Sjkim
85209746Sjkim    return ((UINT32) 1 <<
86239340Sjkim        (GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
87209746Sjkim}
88209746Sjkim
89209746Sjkim
90209746Sjkim/******************************************************************************
91209746Sjkim *
92209746Sjkim * FUNCTION:    AcpiHwLowSetGpe
93209746Sjkim *
94193267Sjkim * PARAMETERS:  GpeEventInfo        - Info block for the GPE to be disabled
95209746Sjkim *              Action              - Enable or disable
96193267Sjkim *
97193267Sjkim * RETURN:      Status
98193267Sjkim *
99209746Sjkim * DESCRIPTION: Enable or disable a single GPE in the parent enable register.
100193267Sjkim *
101193267Sjkim ******************************************************************************/
102193267Sjkim
103193267SjkimACPI_STATUS
104209746SjkimAcpiHwLowSetGpe (
105209746Sjkim    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
106209746Sjkim    UINT32                  Action)
107193267Sjkim{
108193267Sjkim    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
109193267Sjkim    ACPI_STATUS             Status;
110193267Sjkim    UINT32                  EnableMask;
111209746Sjkim    UINT32                  RegisterBit;
112193267Sjkim
113193267Sjkim
114209746Sjkim    ACPI_FUNCTION_ENTRY ();
115209746Sjkim
116209746Sjkim
117193267Sjkim    /* Get the info block for the entire GPE register */
118193267Sjkim
119193267Sjkim    GpeRegisterInfo = GpeEventInfo->RegisterInfo;
120193267Sjkim    if (!GpeRegisterInfo)
121193267Sjkim    {
122193267Sjkim        return (AE_NOT_EXIST);
123193267Sjkim    }
124193267Sjkim
125193267Sjkim    /* Get current value of the enable register that contains this GPE */
126193267Sjkim
127197104Sjkim    Status = AcpiHwRead (&EnableMask, &GpeRegisterInfo->EnableAddress);
128193267Sjkim    if (ACPI_FAILURE (Status))
129193267Sjkim    {
130193267Sjkim        return (Status);
131193267Sjkim    }
132193267Sjkim
133209746Sjkim    /* Set or clear just the bit that corresponds to this GPE */
134193267Sjkim
135239340Sjkim    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
136278970Sjkim    switch (Action & ~ACPI_GPE_SAVE_MASK)
137209746Sjkim    {
138209746Sjkim    case ACPI_GPE_CONDITIONAL_ENABLE:
139193267Sjkim
140278970Sjkim        /* Only enable if the corresponding EnableMask bit is set */
141193267Sjkim
142278970Sjkim        if (!(RegisterBit & GpeRegisterInfo->EnableMask))
143209746Sjkim        {
144209746Sjkim            return (AE_BAD_PARAMETER);
145209746Sjkim        }
146193267Sjkim
147209746Sjkim        /*lint -fallthrough */
148193267Sjkim
149209746Sjkim    case ACPI_GPE_ENABLE:
150250838Sjkim
151209746Sjkim        ACPI_SET_BIT (EnableMask, RegisterBit);
152209746Sjkim        break;
153193267Sjkim
154209746Sjkim    case ACPI_GPE_DISABLE:
155250838Sjkim
156209746Sjkim        ACPI_CLEAR_BIT (EnableMask, RegisterBit);
157209746Sjkim        break;
15867754Smsmith
159209746Sjkim    default:
160250838Sjkim
161245582Sjkim        ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action));
162209746Sjkim        return (AE_BAD_PARAMETER);
163114237Snjl    }
16467754Smsmith
165209746Sjkim    /* Write the updated enable mask */
16684491Smsmith
167209746Sjkim    Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
168278970Sjkim    if (ACPI_SUCCESS (Status) && (Action & ACPI_GPE_SAVE_MASK))
169278970Sjkim    {
170278970Sjkim        GpeRegisterInfo->EnableMask = (UINT8) EnableMask;
171278970Sjkim    }
172129684Snjl    return (Status);
17367754Smsmith}
17467754Smsmith
17591116Smsmith
17684491Smsmith/******************************************************************************
17784491Smsmith *
17867754Smsmith * FUNCTION:    AcpiHwClearGpe
17967754Smsmith *
180128212Snjl * PARAMETERS:  GpeEventInfo        - Info block for the GPE to be cleared
18167754Smsmith *
182138287Smarks * RETURN:      Status
18367754Smsmith *
184128212Snjl * DESCRIPTION: Clear the status bit for a single GPE.
18567754Smsmith *
18667754Smsmith ******************************************************************************/
18767754Smsmith
18899679SiwasakiACPI_STATUS
18967754SmsmithAcpiHwClearGpe (
190114237Snjl    ACPI_GPE_EVENT_INFO     *GpeEventInfo)
19167754Smsmith{
192209746Sjkim    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
19399679Siwasaki    ACPI_STATUS             Status;
194209746Sjkim    UINT32                  RegisterBit;
19567754Smsmith
19680062Smsmith
19791116Smsmith    ACPI_FUNCTION_ENTRY ();
19883174Smsmith
199209746Sjkim    /* Get the info block for the entire GPE register */
20083174Smsmith
201209746Sjkim    GpeRegisterInfo = GpeEventInfo->RegisterInfo;
202209746Sjkim    if (!GpeRegisterInfo)
203209746Sjkim    {
204209746Sjkim        return (AE_NOT_EXIST);
205209746Sjkim    }
206167802Sjkim
20767754Smsmith    /*
20867754Smsmith     * Write a one to the appropriate bit in the status register to
20967754Smsmith     * clear this GPE.
21067754Smsmith     */
211239340Sjkim    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
212209746Sjkim
213197104Sjkim    Status = AcpiHwWrite (RegisterBit,
214209746Sjkim                    &GpeRegisterInfo->StatusAddress);
21599679Siwasaki
21699679Siwasaki    return (Status);
21767754Smsmith}
21867754Smsmith
21967754Smsmith
22067754Smsmith/******************************************************************************
22167754Smsmith *
22267754Smsmith * FUNCTION:    AcpiHwGetGpeStatus
22367754Smsmith *
224128212Snjl * PARAMETERS:  GpeEventInfo        - Info block for the GPE to queried
225128212Snjl *              EventStatus         - Where the GPE status is returned
22667754Smsmith *
227128212Snjl * RETURN:      Status
22867754Smsmith *
22967754Smsmith * DESCRIPTION: Return the status of a single GPE.
23067754Smsmith *
23167754Smsmith ******************************************************************************/
23267754Smsmith
23399679SiwasakiACPI_STATUS
23467754SmsmithAcpiHwGetGpeStatus (
235117521Snjl    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
23667754Smsmith    ACPI_EVENT_STATUS       *EventStatus)
23767754Smsmith{
238114237Snjl    UINT32                  InByte;
239209746Sjkim    UINT32                  RegisterBit;
24091116Smsmith    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
241209746Sjkim    ACPI_EVENT_STATUS       LocalEventStatus = 0;
24299679Siwasaki    ACPI_STATUS             Status;
24367754Smsmith
24480062Smsmith
24591116Smsmith    ACPI_FUNCTION_ENTRY ();
24683174Smsmith
24783174Smsmith
24867754Smsmith    if (!EventStatus)
24967754Smsmith    {
25099679Siwasaki        return (AE_BAD_PARAMETER);
25167754Smsmith    }
25267754Smsmith
253272444Sjkim    /* GPE currently handled? */
254272444Sjkim
255278970Sjkim    if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
256272444Sjkim            ACPI_GPE_DISPATCH_NONE)
257272444Sjkim    {
258272444Sjkim        LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
259272444Sjkim    }
260272444Sjkim
261114237Snjl    /* Get the info block for the entire GPE register */
26267754Smsmith
263114237Snjl    GpeRegisterInfo = GpeEventInfo->RegisterInfo;
26467754Smsmith
26591116Smsmith    /* Get the register bitmask for this GPE */
26691116Smsmith
267239340Sjkim    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
26891116Smsmith
269129684Snjl    /* GPE currently enabled? (enabled for runtime?) */
27091116Smsmith
271129684Snjl    if (RegisterBit & GpeRegisterInfo->EnableForRun)
27299679Siwasaki    {
273114237Snjl        LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
27467754Smsmith    }
27567754Smsmith
276129684Snjl    /* GPE enabled for wake? */
27791116Smsmith
278129684Snjl    if (RegisterBit & GpeRegisterInfo->EnableForWake)
27984491Smsmith    {
280114237Snjl        LocalEventStatus |= ACPI_EVENT_FLAG_WAKE_ENABLED;
28184491Smsmith    }
28284491Smsmith
283129684Snjl    /* GPE currently active (status bit == 1)? */
28491116Smsmith
285197104Sjkim    Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress);
28699679Siwasaki    if (ACPI_FAILURE (Status))
28799679Siwasaki    {
288202771Sjkim        return (Status);
28999679Siwasaki    }
29099679Siwasaki
291129684Snjl    if (RegisterBit & InByte)
29267754Smsmith    {
293114237Snjl        LocalEventStatus |= ACPI_EVENT_FLAG_SET;
29467754Smsmith    }
295114237Snjl
296114237Snjl    /* Set return value */
297114237Snjl
298114237Snjl    (*EventStatus) = LocalEventStatus;
299202771Sjkim    return (AE_OK);
300117521Snjl}
301117521Snjl
302117521Snjl
303117521Snjl/******************************************************************************
304117521Snjl *
305278970Sjkim * FUNCTION:    AcpiHwGpeEnableWrite
306278970Sjkim *
307278970Sjkim * PARAMETERS:  EnableMask          - Bit mask to write to the GPE register
308278970Sjkim *              GpeRegisterInfo     - Gpe Register info
309278970Sjkim *
310278970Sjkim * RETURN:      Status
311278970Sjkim *
312278970Sjkim * DESCRIPTION: Write the enable mask byte to the given GPE register.
313278970Sjkim *
314278970Sjkim ******************************************************************************/
315278970Sjkim
316278970Sjkimstatic ACPI_STATUS
317278970SjkimAcpiHwGpeEnableWrite (
318278970Sjkim    UINT8                   EnableMask,
319278970Sjkim    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo)
320278970Sjkim{
321278970Sjkim    ACPI_STATUS             Status;
322278970Sjkim
323278970Sjkim
324278970Sjkim    Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
325278970Sjkim    if (ACPI_SUCCESS (Status))
326278970Sjkim    {
327278970Sjkim        GpeRegisterInfo->EnableMask = EnableMask;
328278970Sjkim    }
329278970Sjkim
330278970Sjkim    return (Status);
331278970Sjkim}
332278970Sjkim
333278970Sjkim
334278970Sjkim/******************************************************************************
335278970Sjkim *
336117521Snjl * FUNCTION:    AcpiHwDisableGpeBlock
337117521Snjl *
338117521Snjl * PARAMETERS:  GpeXruptInfo        - GPE Interrupt info
339117521Snjl *              GpeBlock            - Gpe Block info
340117521Snjl *
341117521Snjl * RETURN:      Status
342117521Snjl *
343151937Sjkim * DESCRIPTION: Disable all GPEs within a single GPE block
344117521Snjl *
345117521Snjl ******************************************************************************/
346117521Snjl
347117521SnjlACPI_STATUS
348117521SnjlAcpiHwDisableGpeBlock (
349117521Snjl    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
350193267Sjkim    ACPI_GPE_BLOCK_INFO     *GpeBlock,
351193267Sjkim    void                    *Context)
352117521Snjl{
353117521Snjl    UINT32                  i;
354117521Snjl    ACPI_STATUS             Status;
355117521Snjl
356117521Snjl
357117521Snjl    /* Examine each GPE Register within the block */
358117521Snjl
359117521Snjl    for (i = 0; i < GpeBlock->RegisterCount; i++)
360117521Snjl    {
361126372Snjl        /* Disable all GPEs in this register */
362126372Snjl
363278970Sjkim        Status = AcpiHwGpeEnableWrite (0x00, &GpeBlock->RegisterInfo[i]);
364117521Snjl        if (ACPI_FAILURE (Status))
365117521Snjl        {
366117521Snjl            return (Status);
367117521Snjl        }
368117521Snjl    }
369117521Snjl
37099679Siwasaki    return (AE_OK);
37167754Smsmith}
37284491Smsmith
37391116Smsmith
37484491Smsmith/******************************************************************************
37584491Smsmith *
376117521Snjl * FUNCTION:    AcpiHwClearGpeBlock
377117521Snjl *
378117521Snjl * PARAMETERS:  GpeXruptInfo        - GPE Interrupt info
379117521Snjl *              GpeBlock            - Gpe Block info
380117521Snjl *
381117521Snjl * RETURN:      Status
382117521Snjl *
383151937Sjkim * DESCRIPTION: Clear status bits for all GPEs within a single GPE block
384117521Snjl *
385117521Snjl ******************************************************************************/
386117521Snjl
387117521SnjlACPI_STATUS
388117521SnjlAcpiHwClearGpeBlock (
389117521Snjl    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
390193267Sjkim    ACPI_GPE_BLOCK_INFO     *GpeBlock,
391193267Sjkim    void                    *Context)
392117521Snjl{
393117521Snjl    UINT32                  i;
394117521Snjl    ACPI_STATUS             Status;
395117521Snjl
396117521Snjl
397117521Snjl    /* Examine each GPE Register within the block */
398117521Snjl
399117521Snjl    for (i = 0; i < GpeBlock->RegisterCount; i++)
400117521Snjl    {
401128212Snjl        /* Clear status on all GPEs in this register */
402126372Snjl
403197104Sjkim        Status = AcpiHwWrite (0xFF, &GpeBlock->RegisterInfo[i].StatusAddress);
404117521Snjl        if (ACPI_FAILURE (Status))
405117521Snjl        {
406117521Snjl            return (Status);
407117521Snjl        }
408117521Snjl    }
409117521Snjl
410117521Snjl    return (AE_OK);
411117521Snjl}
412117521Snjl
413117521Snjl
414117521Snjl/******************************************************************************
415117521Snjl *
416129684Snjl * FUNCTION:    AcpiHwEnableRuntimeGpeBlock
417117521Snjl *
418117521Snjl * PARAMETERS:  GpeXruptInfo        - GPE Interrupt info
419117521Snjl *              GpeBlock            - Gpe Block info
420117521Snjl *
421117521Snjl * RETURN:      Status
422117521Snjl *
423151937Sjkim * DESCRIPTION: Enable all "runtime" GPEs within a single GPE block. Includes
424151937Sjkim *              combination wake/run GPEs.
425117521Snjl *
426117521Snjl ******************************************************************************/
427117521Snjl
428129684SnjlACPI_STATUS
429129684SnjlAcpiHwEnableRuntimeGpeBlock (
430117521Snjl    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
431193267Sjkim    ACPI_GPE_BLOCK_INFO     *GpeBlock,
432193267Sjkim    void                    *Context)
433117521Snjl{
434117521Snjl    UINT32                  i;
435117521Snjl    ACPI_STATUS             Status;
436278970Sjkim    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
437117521Snjl
438117521Snjl
439129684Snjl    /* NOTE: assumes that all GPEs are currently disabled */
440117521Snjl
441117521Snjl    /* Examine each GPE Register within the block */
442117521Snjl
443117521Snjl    for (i = 0; i < GpeBlock->RegisterCount; i++)
444117521Snjl    {
445278970Sjkim        GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
446278970Sjkim        if (!GpeRegisterInfo->EnableForRun)
447117521Snjl        {
448129684Snjl            continue;
449117521Snjl        }
450117521Snjl
451129684Snjl        /* Enable all "runtime" GPEs in this register */
452117521Snjl
453278970Sjkim        Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForRun,
454278970Sjkim                    GpeRegisterInfo);
455117521Snjl        if (ACPI_FAILURE (Status))
456117521Snjl        {
457117521Snjl            return (Status);
458117521Snjl        }
459117521Snjl    }
460117521Snjl
461117521Snjl    return (AE_OK);
462117521Snjl}
463117521Snjl
464117521Snjl
465117521Snjl/******************************************************************************
466117521Snjl *
467129684Snjl * FUNCTION:    AcpiHwEnableWakeupGpeBlock
46884491Smsmith *
469129684Snjl * PARAMETERS:  GpeXruptInfo        - GPE Interrupt info
470129684Snjl *              GpeBlock            - Gpe Block info
47184491Smsmith *
472128212Snjl * RETURN:      Status
47384491Smsmith *
474151937Sjkim * DESCRIPTION: Enable all "wake" GPEs within a single GPE block. Includes
475151937Sjkim *              combination wake/run GPEs.
47684491Smsmith *
47784491Smsmith ******************************************************************************/
47884491Smsmith
479151937Sjkimstatic ACPI_STATUS
480129684SnjlAcpiHwEnableWakeupGpeBlock (
481129684Snjl    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
482193267Sjkim    ACPI_GPE_BLOCK_INFO     *GpeBlock,
483193267Sjkim    void                    *Context)
48484491Smsmith{
485129684Snjl    UINT32                  i;
48699679Siwasaki    ACPI_STATUS             Status;
487278970Sjkim    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
48884491Smsmith
48984491Smsmith
490129684Snjl    /* Examine each GPE Register within the block */
49191116Smsmith
492129684Snjl    for (i = 0; i < GpeBlock->RegisterCount; i++)
493129684Snjl    {
494278970Sjkim        GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
49591116Smsmith
496278970Sjkim        /*
497278970Sjkim         * Enable all "wake" GPEs in this register and disable the
498278970Sjkim         * remaining ones.
499278970Sjkim         */
500278970Sjkim        Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForWake,
501278970Sjkim                    GpeRegisterInfo);
502129684Snjl        if (ACPI_FAILURE (Status))
503129684Snjl        {
504129684Snjl            return (Status);
505129684Snjl        }
506129684Snjl    }
507129684Snjl
508129684Snjl    return (AE_OK);
509117521Snjl}
51084491Smsmith
51199679Siwasaki
512117521Snjl/******************************************************************************
513117521Snjl *
514129684Snjl * FUNCTION:    AcpiHwDisableAllGpes
515117521Snjl *
516151937Sjkim * PARAMETERS:  None
517117521Snjl *
518117521Snjl * RETURN:      Status
519117521Snjl *
520151937Sjkim * DESCRIPTION: Disable and clear all GPEs in all GPE blocks
521117521Snjl *
522117521Snjl ******************************************************************************/
523114237Snjl
524129684SnjlACPI_STATUS
525129684SnjlAcpiHwDisableAllGpes (
526151937Sjkim    void)
527117521Snjl{
528117521Snjl    ACPI_STATUS             Status;
529114237Snjl
530117521Snjl
531167802Sjkim    ACPI_FUNCTION_TRACE (HwDisableAllGpes);
532117521Snjl
533117521Snjl
534193267Sjkim    Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
535193267Sjkim    Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
536129684Snjl    return_ACPI_STATUS (Status);
537129684Snjl}
538117521Snjl
539117521Snjl
540129684Snjl/******************************************************************************
541129684Snjl *
542129684Snjl * FUNCTION:    AcpiHwEnableAllRuntimeGpes
543129684Snjl *
544151937Sjkim * PARAMETERS:  None
545129684Snjl *
546129684Snjl * RETURN:      Status
547129684Snjl *
548151937Sjkim * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
549129684Snjl *
550129684Snjl ******************************************************************************/
551126372Snjl
552129684SnjlACPI_STATUS
553129684SnjlAcpiHwEnableAllRuntimeGpes (
554151937Sjkim    void)
555129684Snjl{
556129684Snjl    ACPI_STATUS             Status;
557126372Snjl
558114237Snjl
559167802Sjkim    ACPI_FUNCTION_TRACE (HwEnableAllRuntimeGpes);
560128212Snjl
561114237Snjl
562193267Sjkim    Status = AcpiEvWalkGpeList (AcpiHwEnableRuntimeGpeBlock, NULL);
563129684Snjl    return_ACPI_STATUS (Status);
56484491Smsmith}
56584491Smsmith
56691116Smsmith
56784491Smsmith/******************************************************************************
56884491Smsmith *
569129684Snjl * FUNCTION:    AcpiHwEnableAllWakeupGpes
57084491Smsmith *
571151937Sjkim * PARAMETERS:  None
57284491Smsmith *
573128212Snjl * RETURN:      Status
57484491Smsmith *
575151937Sjkim * DESCRIPTION: Enable all "wakeup" GPEs, in all GPE blocks
57684491Smsmith *
57784491Smsmith ******************************************************************************/
57884491Smsmith
57999679SiwasakiACPI_STATUS
580129684SnjlAcpiHwEnableAllWakeupGpes (
581151937Sjkim    void)
58284491Smsmith{
58399679Siwasaki    ACPI_STATUS             Status;
58484491Smsmith
58584491Smsmith
586167802Sjkim    ACPI_FUNCTION_TRACE (HwEnableAllWakeupGpes);
58791116Smsmith
58891116Smsmith
589193267Sjkim    Status = AcpiEvWalkGpeList (AcpiHwEnableWakeupGpeBlock, NULL);
590129684Snjl    return_ACPI_STATUS (Status);
59184491Smsmith}
592129684Snjl
593231844Sjkim#endif /* !ACPI_REDUCED_HARDWARE */
594