hwgpe.c revision 281075
171867Smsmith/****************************************************************************** 267754Smsmith * 367754Smsmith * Module Name: hwgpe - Low level GPE enable/disable/clear functions 467754Smsmith * 567754Smsmith *****************************************************************************/ 667754Smsmith 767754Smsmith/* 867754Smsmith * Copyright (C) 2000 - 2015, Intel Corp. 967754Smsmith * All rights reserved. 1067754Smsmith * 1167754Smsmith * Redistribution and use in source and binary forms, with or without 12193267Sjkim * modification, are permitted provided that the following conditions 1370243Smsmith * are met: 1467754Smsmith * 1. Redistributions of source code must retain the above copyright 1567754Smsmith * notice, this list of conditions, and the following disclaimer, 1667754Smsmith * without modification. 1767754Smsmith * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1867754Smsmith * substantially similar to the "NO WARRANTY" disclaimer below 1967754Smsmith * ("Disclaimer") and any redistribution must be conditioned upon 2067754Smsmith * including a substantially similar Disclaimer requirement for further 2167754Smsmith * binary redistribution. 2267754Smsmith * 3. Neither the names of the above-listed copyright holders nor the names 2367754Smsmith * of any contributors may be used to endorse or promote products derived 2467754Smsmith * from this software without specific prior written permission. 2567754Smsmith * 2667754Smsmith * Alternatively, this software may be distributed under the terms of the 2767754Smsmith * GNU General Public License ("GPL") version 2 as published by the Free 2867754Smsmith * Software Foundation. 2967754Smsmith * 3067754Smsmith * NO WARRANTY 3167754Smsmith * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 3267754Smsmith * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3367754Smsmith * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 3467754Smsmith * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3567754Smsmith * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3667754Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3767754Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3867754Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 3967754Smsmith * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 4067754Smsmith * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 4167754Smsmith * POSSIBILITY OF SUCH DAMAGES. 4267754Smsmith */ 4367754Smsmith 4467754Smsmith#include <contrib/dev/acpica/include/acpi.h> 4567754Smsmith#include <contrib/dev/acpica/include/accommon.h> 4667754Smsmith#include <contrib/dev/acpica/include/acevents.h> 4767754Smsmith 4867754Smsmith#define _COMPONENT ACPI_HARDWARE 4967754Smsmith ACPI_MODULE_NAME ("hwgpe") 5067754Smsmith 5167754Smsmith#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ 5267754Smsmith 5367754Smsmith/* Local prototypes */ 5467754Smsmith 5567754Smsmithstatic ACPI_STATUS 5667754SmsmithAcpiHwEnableWakeupGpeBlock ( 5767754Smsmith ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 5867754Smsmith ACPI_GPE_BLOCK_INFO *GpeBlock, 5967754Smsmith void *Context); 6067754Smsmith 6167754Smsmithstatic ACPI_STATUS 6267754SmsmithAcpiHwGpeEnableWrite ( 6367754Smsmith UINT8 EnableMask, 6467754Smsmith ACPI_GPE_REGISTER_INFO *GpeRegisterInfo); 6567754Smsmith 6667754Smsmith 6767754Smsmith/****************************************************************************** 6867754Smsmith * 6967754Smsmith * FUNCTION: AcpiHwGetGpeRegisterBit 7067754Smsmith * 7167754Smsmith * PARAMETERS: GpeEventInfo - Info block for the GPE 7267754Smsmith * 7367754Smsmith * RETURN: Register mask with a one in the GPE bit position 7467754Smsmith * 7567754Smsmith * DESCRIPTION: Compute the register mask for this GPE. One bit is set in the 7667754Smsmith * correct position for the input GPE. 7767754Smsmith * 7867754Smsmith ******************************************************************************/ 7967754Smsmith 8067754SmsmithUINT32 8167754SmsmithAcpiHwGetGpeRegisterBit ( 8267754Smsmith ACPI_GPE_EVENT_INFO *GpeEventInfo) 8367754Smsmith{ 8467754Smsmith 8567754Smsmith return ((UINT32) 1 << 8667754Smsmith (GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber)); 8767754Smsmith} 8867754Smsmith 8967754Smsmith 9067754Smsmith/****************************************************************************** 9167754Smsmith * 9267754Smsmith * FUNCTION: AcpiHwLowSetGpe 9367754Smsmith * 9467754Smsmith * PARAMETERS: GpeEventInfo - Info block for the GPE to be disabled 9567754Smsmith * Action - Enable or disable 9667754Smsmith * 9767754Smsmith * RETURN: Status 9867754Smsmith * 9967754Smsmith * DESCRIPTION: Enable or disable a single GPE in the parent enable register. 10067754Smsmith * 10167754Smsmith ******************************************************************************/ 10267754Smsmith 10367754SmsmithACPI_STATUS 10467754SmsmithAcpiHwLowSetGpe ( 10567754Smsmith ACPI_GPE_EVENT_INFO *GpeEventInfo, 10667754Smsmith UINT32 Action) 10767754Smsmith{ 10867754Smsmith ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; 10967754Smsmith ACPI_STATUS Status; 11067754Smsmith UINT32 EnableMask; 11167754Smsmith UINT32 RegisterBit; 11267754Smsmith 11367754Smsmith 11467754Smsmith ACPI_FUNCTION_ENTRY (); 11567754Smsmith 11667754Smsmith 117193341Sjkim /* Get the info block for the entire GPE register */ 118193341Sjkim 119193341Sjkim GpeRegisterInfo = GpeEventInfo->RegisterInfo; 12067754Smsmith if (!GpeRegisterInfo) 12177424Smsmith { 12291116Smsmith return (AE_NOT_EXIST); 12367754Smsmith } 124151937Sjkim 12567754Smsmith /* Get current value of the enable register that contains this GPE */ 126151937Sjkim 127151937Sjkim Status = AcpiHwRead (&EnableMask, &GpeRegisterInfo->EnableAddress); 128151937Sjkim if (ACPI_FAILURE (Status)) 129193267Sjkim { 130193267Sjkim return (Status); 131151937Sjkim } 132151937Sjkim 13367754Smsmith /* Set or clear just the bit that corresponds to this GPE */ 13467754Smsmith 135193267Sjkim RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); 136193267Sjkim switch (Action & ~ACPI_GPE_SAVE_MASK) 137193267Sjkim { 138193267Sjkim case ACPI_GPE_CONDITIONAL_ENABLE: 139193267Sjkim 140193267Sjkim /* Only enable if the corresponding EnableMask bit is set */ 141193267Sjkim 142193267Sjkim if (!(RegisterBit & GpeRegisterInfo->EnableMask)) 143193267Sjkim { 144193267Sjkim return (AE_BAD_PARAMETER); 145193267Sjkim } 146193267Sjkim 147193267Sjkim /*lint -fallthrough */ 148193267Sjkim 149193267Sjkim case ACPI_GPE_ENABLE: 150193267Sjkim 151193267Sjkim ACPI_SET_BIT (EnableMask, RegisterBit); 152193267Sjkim break; 153193267Sjkim 154193267Sjkim case ACPI_GPE_DISABLE: 155193267Sjkim 156193267Sjkim ACPI_CLEAR_BIT (EnableMask, RegisterBit); 157193267Sjkim break; 158193267Sjkim 159193267Sjkim default: 160193267Sjkim 161193267Sjkim ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action)); 162193267Sjkim return (AE_BAD_PARAMETER); 163193267Sjkim } 164197104Sjkim 165193267Sjkim /* Write the updated enable mask */ 166193267Sjkim 167193267Sjkim Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress); 168193267Sjkim if (ACPI_SUCCESS (Status) && (Action & ACPI_GPE_SAVE_MASK)) 169193267Sjkim { 170193267Sjkim GpeRegisterInfo->EnableMask = (UINT8) EnableMask; 171193267Sjkim } 172193267Sjkim return (Status); 173193267Sjkim} 174193267Sjkim 175193267Sjkim 176193267Sjkim/****************************************************************************** 177193267Sjkim * 178197104Sjkim * FUNCTION: AcpiHwClearGpe 179193267Sjkim * 180193267Sjkim * PARAMETERS: GpeEventInfo - Info block for the GPE to be cleared 181193267Sjkim * 182193267Sjkim * RETURN: Status 183193267Sjkim * 184193267Sjkim * DESCRIPTION: Clear the status bit for a single GPE. 185129684Snjl * 18667754Smsmith ******************************************************************************/ 187128212Snjl 18867754SmsmithACPI_STATUS 189128212SnjlAcpiHwClearGpe ( 19067754Smsmith ACPI_GPE_EVENT_INFO *GpeEventInfo) 191138287Smarks{ 192138287Smarks ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; 193129684Snjl ACPI_STATUS Status; 19467754Smsmith UINT32 RegisterBit; 19567754Smsmith 19667754Smsmith 19799679Siwasaki ACPI_FUNCTION_ENTRY (); 198129684Snjl 199114237Snjl /* Get the info block for the entire GPE register */ 20067754Smsmith 201114237Snjl GpeRegisterInfo = GpeEventInfo->RegisterInfo; 20299679Siwasaki if (!GpeRegisterInfo) 20367754Smsmith { 20483174Smsmith return (AE_NOT_EXIST); 20591116Smsmith } 20683174Smsmith 20783174Smsmith /* 208114237Snjl * Write a one to the appropriate bit in the status register to 20967754Smsmith * clear this GPE. 210114237Snjl */ 211114237Snjl RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); 212114237Snjl 213129684Snjl Status = AcpiHwWrite (RegisterBit, 214114237Snjl &GpeRegisterInfo->StatusAddress); 21567754Smsmith 216129684Snjl return (Status); 21784491Smsmith} 218197104Sjkim 219117521Snjl 22099679Siwasaki/****************************************************************************** 221129684Snjl * 22267754Smsmith * FUNCTION: AcpiHwGetGpeStatus 22367754Smsmith * 22491116Smsmith * PARAMETERS: GpeEventInfo - Info block for the GPE to queried 22584491Smsmith * EventStatus - Where the GPE status is returned 22684491Smsmith * 22767754Smsmith * RETURN: Status 22867754Smsmith * 229128212Snjl * DESCRIPTION: Return the status of a single GPE. 23067754Smsmith * 231138287Smarks ******************************************************************************/ 23267754Smsmith 233128212SnjlACPI_STATUS 23467754SmsmithAcpiHwGetGpeStatus ( 23567754Smsmith ACPI_GPE_EVENT_INFO *GpeEventInfo, 23667754Smsmith ACPI_EVENT_STATUS *EventStatus) 23799679Siwasaki{ 23867754Smsmith UINT32 InByte; 239114237Snjl UINT32 RegisterBit; 24067754Smsmith ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; 24199679Siwasaki ACPI_EVENT_STATUS LocalEventStatus = 0; 242167802Sjkim ACPI_STATUS Status; 24367754Smsmith 24480062Smsmith 24591116Smsmith ACPI_FUNCTION_ENTRY (); 24683174Smsmith 24783174Smsmith 248193267Sjkim if (!EventStatus) 249193267Sjkim { 250167802Sjkim return (AE_BAD_PARAMETER); 25167754Smsmith } 25267754Smsmith 25367754Smsmith /* GPE currently handled? */ 25467754Smsmith 255197104Sjkim if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) != 256117521Snjl ACPI_GPE_DISPATCH_NONE) 25799679Siwasaki { 25899679Siwasaki LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER; 25967754Smsmith } 26067754Smsmith 26167754Smsmith /* Get the info block for the entire GPE register */ 26267754Smsmith 26367754Smsmith GpeRegisterInfo = GpeEventInfo->RegisterInfo; 26467754Smsmith 26567754Smsmith /* Get the register bitmask for this GPE */ 266128212Snjl 267128212Snjl RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); 26867754Smsmith 269128212Snjl /* GPE currently enabled? (enabled for runtime?) */ 27067754Smsmith 27167754Smsmith if (RegisterBit & GpeRegisterInfo->EnableForRun) 27267754Smsmith { 27367754Smsmith LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED; 27467754Smsmith } 27599679Siwasaki 27667754Smsmith /* GPE enabled for wake? */ 277117521Snjl 27867754Smsmith if (RegisterBit & GpeRegisterInfo->EnableForWake) 27967754Smsmith { 280114237Snjl LocalEventStatus |= ACPI_EVENT_FLAG_WAKE_ENABLED; 281129684Snjl } 28291116Smsmith 28399679Siwasaki /* GPE currently active (status bit == 1)? */ 284114237Snjl 28567754Smsmith Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress); 28680062Smsmith if (ACPI_FAILURE (Status)) 28791116Smsmith { 28883174Smsmith return (Status); 28983174Smsmith } 29067754Smsmith 29167754Smsmith if (RegisterBit & InByte) 29299679Siwasaki { 29367754Smsmith LocalEventStatus |= ACPI_EVENT_FLAG_SET; 29467754Smsmith } 295114237Snjl 29667754Smsmith /* Set return value */ 297114237Snjl 29867754Smsmith (*EventStatus) = LocalEventStatus; 29991116Smsmith return (AE_OK); 30091116Smsmith} 301193267Sjkim 302193267Sjkim 30391116Smsmith/****************************************************************************** 304129684Snjl * 30591116Smsmith * FUNCTION: AcpiHwGpeEnableWrite 306129684Snjl * 30799679Siwasaki * PARAMETERS: EnableMask - Bit mask to write to the GPE register 308114237Snjl * GpeRegisterInfo - Gpe Register info 30967754Smsmith * 31067754Smsmith * RETURN: Status 311129684Snjl * 31291116Smsmith * DESCRIPTION: Write the enable mask byte to the given GPE register. 313129684Snjl * 31484491Smsmith ******************************************************************************/ 315114237Snjl 31684491Smsmithstatic ACPI_STATUS 31784491SmsmithAcpiHwGpeEnableWrite ( 318129684Snjl UINT8 EnableMask, 31991116Smsmith ACPI_GPE_REGISTER_INFO *GpeRegisterInfo) 320197104Sjkim{ 32199679Siwasaki ACPI_STATUS Status; 32299679Siwasaki 323117521Snjl 32499679Siwasaki Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress); 32599679Siwasaki if (ACPI_SUCCESS (Status)) 326129684Snjl { 32767754Smsmith GpeRegisterInfo->EnableMask = EnableMask; 328114237Snjl } 32967754Smsmith 330114237Snjl return (Status); 331114237Snjl} 332114237Snjl 333114237Snjl 334117521Snjl/****************************************************************************** 335117521Snjl * 336117521Snjl * FUNCTION: AcpiHwDisableGpeBlock 337117521Snjl * 338117521Snjl * PARAMETERS: GpeXruptInfo - GPE Interrupt info 339117521Snjl * GpeBlock - Gpe Block info 340117521Snjl * 341117521Snjl * RETURN: Status 342117521Snjl * 343117521Snjl * DESCRIPTION: Disable all GPEs within a single GPE block 344117521Snjl * 345117521Snjl ******************************************************************************/ 346117521Snjl 347117521SnjlACPI_STATUS 348117521SnjlAcpiHwDisableGpeBlock ( 349117521Snjl ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 350151937Sjkim ACPI_GPE_BLOCK_INFO *GpeBlock, 351117521Snjl void *Context) 352117521Snjl{ 353117521Snjl UINT32 i; 354117521Snjl ACPI_STATUS Status; 355117521Snjl 356117521Snjl 357193267Sjkim /* Examine each GPE Register within the block */ 358193267Sjkim 359117521Snjl for (i = 0; i < GpeBlock->RegisterCount; i++) 360117521Snjl { 361117521Snjl /* Disable all GPEs in this register */ 362117521Snjl 363117521Snjl Status = AcpiHwGpeEnableWrite (0x00, &GpeBlock->RegisterInfo[i]); 364117521Snjl if (ACPI_FAILURE (Status)) 365117521Snjl { 366117521Snjl return (Status); 367117521Snjl } 368126372Snjl } 369126372Snjl 370197104Sjkim return (AE_OK); 371117521Snjl} 372117521Snjl 373117521Snjl 374117521Snjl/****************************************************************************** 375117521Snjl * 376117521Snjl * FUNCTION: AcpiHwClearGpeBlock 37799679Siwasaki * 37867754Smsmith * PARAMETERS: GpeXruptInfo - GPE Interrupt info 37984491Smsmith * GpeBlock - Gpe Block info 38091116Smsmith * 38184491Smsmith * RETURN: Status 38284491Smsmith * 383117521Snjl * DESCRIPTION: Clear status bits for all GPEs within a single GPE block 384117521Snjl * 385117521Snjl ******************************************************************************/ 386117521Snjl 387117521SnjlACPI_STATUS 388117521SnjlAcpiHwClearGpeBlock ( 389117521Snjl ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 390151937Sjkim ACPI_GPE_BLOCK_INFO *GpeBlock, 391117521Snjl void *Context) 392117521Snjl{ 393117521Snjl UINT32 i; 394117521Snjl ACPI_STATUS Status; 395117521Snjl 396117521Snjl 397193267Sjkim /* Examine each GPE Register within the block */ 398193267Sjkim 399117521Snjl for (i = 0; i < GpeBlock->RegisterCount; i++) 400117521Snjl { 401117521Snjl /* Clear status on all GPEs in this register */ 402117521Snjl 403117521Snjl Status = AcpiHwWrite (0xFF, &GpeBlock->RegisterInfo[i].StatusAddress); 404117521Snjl if (ACPI_FAILURE (Status)) 405117521Snjl { 406117521Snjl return (Status); 407117521Snjl } 408128212Snjl } 409126372Snjl 410197104Sjkim return (AE_OK); 411117521Snjl} 412117521Snjl 413117521Snjl 414117521Snjl/****************************************************************************** 415117521Snjl * 416117521Snjl * FUNCTION: AcpiHwEnableRuntimeGpeBlock 417117521Snjl * 418117521Snjl * PARAMETERS: GpeXruptInfo - GPE Interrupt info 419117521Snjl * GpeBlock - Gpe Block info 420117521Snjl * 421117521Snjl * RETURN: Status 422117521Snjl * 423129684Snjl * DESCRIPTION: Enable all "runtime" GPEs within a single GPE block. Includes 424117521Snjl * combination wake/run GPEs. 425117521Snjl * 426117521Snjl ******************************************************************************/ 427117521Snjl 428117521SnjlACPI_STATUS 429117521SnjlAcpiHwEnableRuntimeGpeBlock ( 430151937Sjkim ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 431151937Sjkim ACPI_GPE_BLOCK_INFO *GpeBlock, 432117521Snjl void *Context) 433117521Snjl{ 434117521Snjl UINT32 i; 435129684Snjl ACPI_STATUS Status; 436129684Snjl ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; 437117521Snjl 438193267Sjkim 439193267Sjkim /* 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 { 445129684Snjl GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; 446117521Snjl if (!GpeRegisterInfo->EnableForRun) 447117521Snjl { 448117521Snjl continue; 449117521Snjl } 450117521Snjl 451129684Snjl /* Enable all "runtime" GPEs in this register */ 452117521Snjl 453129684Snjl Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForRun, 454117521Snjl GpeRegisterInfo); 455117521Snjl if (ACPI_FAILURE (Status)) 456129684Snjl { 457117521Snjl return (Status); 458197104Sjkim } 459129684Snjl } 460117521Snjl 461117521Snjl return (AE_OK); 462117521Snjl} 463117521Snjl 464117521Snjl 465117521Snjl/****************************************************************************** 466117521Snjl * 467117521Snjl * FUNCTION: AcpiHwEnableWakeupGpeBlock 468117521Snjl * 469117521Snjl * PARAMETERS: GpeXruptInfo - GPE Interrupt info 470117521Snjl * GpeBlock - Gpe Block info 471117521Snjl * 472129684Snjl * RETURN: Status 47384491Smsmith * 474129684Snjl * DESCRIPTION: Enable all "wake" GPEs within a single GPE block. Includes 475129684Snjl * combination wake/run GPEs. 47684491Smsmith * 477128212Snjl ******************************************************************************/ 47884491Smsmith 479151937Sjkimstatic ACPI_STATUS 480151937SjkimAcpiHwEnableWakeupGpeBlock ( 48184491Smsmith ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 48284491Smsmith ACPI_GPE_BLOCK_INFO *GpeBlock, 48384491Smsmith void *Context) 484151937Sjkim{ 485129684Snjl UINT32 i; 486129684Snjl ACPI_STATUS Status; 487193267Sjkim ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; 488193267Sjkim 48984491Smsmith 490129684Snjl /* Examine each GPE Register within the block */ 49199679Siwasaki 49284491Smsmith for (i = 0; i < GpeBlock->RegisterCount; i++) 49384491Smsmith { 494129684Snjl GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; 49591116Smsmith 496129684Snjl /* 497129684Snjl * Enable all "wake" GPEs in this register and disable the 498129684Snjl * remaining ones. 499129684Snjl */ 500129684Snjl Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForWake, 501129684Snjl GpeRegisterInfo); 50291116Smsmith if (ACPI_FAILURE (Status)) 503129684Snjl { 504129684Snjl return (Status); 505197104Sjkim } 506129684Snjl } 507129684Snjl 508129684Snjl return (AE_OK); 509129684Snjl} 510129684Snjl 511129684Snjl 512129684Snjl/****************************************************************************** 513129684Snjl * 514117521Snjl * FUNCTION: AcpiHwDisableAllGpes 51584491Smsmith * 51699679Siwasaki * PARAMETERS: None 517117521Snjl * 518117521Snjl * RETURN: Status 519129684Snjl * 520117521Snjl * DESCRIPTION: Disable and clear all GPEs in all GPE blocks 521151937Sjkim * 522117521Snjl ******************************************************************************/ 523117521Snjl 524117521SnjlACPI_STATUS 525151937SjkimAcpiHwDisableAllGpes ( 526117521Snjl void) 527117521Snjl{ 528114237Snjl ACPI_STATUS Status; 529129684Snjl 530129684Snjl 531151937Sjkim ACPI_FUNCTION_TRACE (HwDisableAllGpes); 532117521Snjl 533117521Snjl 534114237Snjl Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL); 535117521Snjl Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL); 536167802Sjkim return_ACPI_STATUS (Status); 537117521Snjl} 538117521Snjl 539193267Sjkim 540193267Sjkim/****************************************************************************** 541129684Snjl * 542129684Snjl * FUNCTION: AcpiHwEnableAllRuntimeGpes 543117521Snjl * 544117521Snjl * PARAMETERS: None 545129684Snjl * 546129684Snjl * RETURN: Status 547129684Snjl * 548129684Snjl * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks 549151937Sjkim * 550129684Snjl ******************************************************************************/ 551129684Snjl 552129684SnjlACPI_STATUS 553151937SjkimAcpiHwEnableAllRuntimeGpes ( 554129684Snjl void) 555129684Snjl{ 556126372Snjl ACPI_STATUS Status; 557129684Snjl 558129684Snjl 559151937Sjkim ACPI_FUNCTION_TRACE (HwEnableAllRuntimeGpes); 560129684Snjl 561129684Snjl 562126372Snjl Status = AcpiEvWalkGpeList (AcpiHwEnableRuntimeGpeBlock, NULL); 563114237Snjl return_ACPI_STATUS (Status); 564167802Sjkim} 565128212Snjl 566114237Snjl 567193267Sjkim/****************************************************************************** 568129684Snjl * 56984491Smsmith * FUNCTION: AcpiHwEnableAllWakeupGpes 57084491Smsmith * 57191116Smsmith * PARAMETERS: None 57284491Smsmith * 57384491Smsmith * RETURN: Status 574129684Snjl * 57584491Smsmith * DESCRIPTION: Enable all "wakeup" GPEs, in all GPE blocks 576151937Sjkim * 57784491Smsmith ******************************************************************************/ 578128212Snjl 57984491SmsmithACPI_STATUS 580151937SjkimAcpiHwEnableAllWakeupGpes ( 58184491Smsmith void) 58284491Smsmith{ 58384491Smsmith ACPI_STATUS Status; 58499679Siwasaki 585129684Snjl 586151937Sjkim ACPI_FUNCTION_TRACE (HwEnableAllWakeupGpes); 58784491Smsmith 58899679Siwasaki 58984491Smsmith Status = AcpiEvWalkGpeList (AcpiHwEnableWakeupGpeBlock, NULL); 59084491Smsmith return_ACPI_STATUS (Status); 591167802Sjkim} 59291116Smsmith 59391116Smsmith#endif /* !ACPI_REDUCED_HARDWARE */ 594193267Sjkim