hwgpe.c (151600) | hwgpe.c (151937) |
---|---|
1 2/****************************************************************************** 3 * 4 * Module Name: hwgpe - Low level GPE enable/disable/clear functions | 1 2/****************************************************************************** 3 * 4 * Module Name: hwgpe - Low level GPE enable/disable/clear functions |
5 * $Revision: 65 $ | 5 * $Revision: 1.71 $ |
6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * | 6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * |
13 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. | 13 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. |
14 * All rights reserved. 15 * 16 * 2. License 17 * 18 * 2.1. This is your license from Intel Corp. under its intellectual property 19 * rights. You may have additional license terms from the party that provided 20 * you this software, covering your right to use that party's intellectual 21 * property rights. --- 94 unchanged lines hidden (view full) --- 116 *****************************************************************************/ 117 118#include <contrib/dev/acpica/acpi.h> 119#include <contrib/dev/acpica/acevents.h> 120 121#define _COMPONENT ACPI_HARDWARE 122 ACPI_MODULE_NAME ("hwgpe") 123 | 14 * All rights reserved. 15 * 16 * 2. License 17 * 18 * 2.1. This is your license from Intel Corp. under its intellectual property 19 * rights. You may have additional license terms from the party that provided 20 * you this software, covering your right to use that party's intellectual 21 * property rights. --- 94 unchanged lines hidden (view full) --- 116 *****************************************************************************/ 117 118#include <contrib/dev/acpica/acpi.h> 119#include <contrib/dev/acpica/acevents.h> 120 121#define _COMPONENT ACPI_HARDWARE 122 ACPI_MODULE_NAME ("hwgpe") 123 |
124/* Local prototypes */ |
|
124 | 125 |
126static ACPI_STATUS 127AcpiHwEnableWakeupGpeBlock ( 128 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 129 ACPI_GPE_BLOCK_INFO *GpeBlock); 130 131 |
|
125/****************************************************************************** 126 * 127 * FUNCTION: AcpiHwWriteGpeEnableReg 128 * 129 * PARAMETERS: GpeEventInfo - Info block for the GPE to be enabled 130 * 131 * RETURN: Status 132 * --- 146 unchanged lines hidden (view full) --- 279 * 280 * FUNCTION: AcpiHwDisableGpeBlock 281 * 282 * PARAMETERS: GpeXruptInfo - GPE Interrupt info 283 * GpeBlock - Gpe Block info 284 * 285 * RETURN: Status 286 * | 132/****************************************************************************** 133 * 134 * FUNCTION: AcpiHwWriteGpeEnableReg 135 * 136 * PARAMETERS: GpeEventInfo - Info block for the GPE to be enabled 137 * 138 * RETURN: Status 139 * --- 146 unchanged lines hidden (view full) --- 286 * 287 * FUNCTION: AcpiHwDisableGpeBlock 288 * 289 * PARAMETERS: GpeXruptInfo - GPE Interrupt info 290 * GpeBlock - Gpe Block info 291 * 292 * RETURN: Status 293 * |
287 * DESCRIPTION: Disable all GPEs within a GPE block | 294 * DESCRIPTION: Disable all GPEs within a single GPE block |
288 * 289 ******************************************************************************/ 290 291ACPI_STATUS 292AcpiHwDisableGpeBlock ( 293 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 294 ACPI_GPE_BLOCK_INFO *GpeBlock) 295{ --- 23 unchanged lines hidden (view full) --- 319 * 320 * FUNCTION: AcpiHwClearGpeBlock 321 * 322 * PARAMETERS: GpeXruptInfo - GPE Interrupt info 323 * GpeBlock - Gpe Block info 324 * 325 * RETURN: Status 326 * | 295 * 296 ******************************************************************************/ 297 298ACPI_STATUS 299AcpiHwDisableGpeBlock ( 300 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 301 ACPI_GPE_BLOCK_INFO *GpeBlock) 302{ --- 23 unchanged lines hidden (view full) --- 326 * 327 * FUNCTION: AcpiHwClearGpeBlock 328 * 329 * PARAMETERS: GpeXruptInfo - GPE Interrupt info 330 * GpeBlock - Gpe Block info 331 * 332 * RETURN: Status 333 * |
327 * DESCRIPTION: Clear status bits for all GPEs within a GPE block | 334 * DESCRIPTION: Clear status bits for all GPEs within a single GPE block |
328 * 329 ******************************************************************************/ 330 331ACPI_STATUS 332AcpiHwClearGpeBlock ( 333 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 334 ACPI_GPE_BLOCK_INFO *GpeBlock) 335{ --- 23 unchanged lines hidden (view full) --- 359 * 360 * FUNCTION: AcpiHwEnableRuntimeGpeBlock 361 * 362 * PARAMETERS: GpeXruptInfo - GPE Interrupt info 363 * GpeBlock - Gpe Block info 364 * 365 * RETURN: Status 366 * | 335 * 336 ******************************************************************************/ 337 338ACPI_STATUS 339AcpiHwClearGpeBlock ( 340 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 341 ACPI_GPE_BLOCK_INFO *GpeBlock) 342{ --- 23 unchanged lines hidden (view full) --- 366 * 367 * FUNCTION: AcpiHwEnableRuntimeGpeBlock 368 * 369 * PARAMETERS: GpeXruptInfo - GPE Interrupt info 370 * GpeBlock - Gpe Block info 371 * 372 * RETURN: Status 373 * |
367 * DESCRIPTION: Enable all "runtime" GPEs within a GPE block. (Includes 368 * combination wake/run GPEs.) | 374 * DESCRIPTION: Enable all "runtime" GPEs within a single GPE block. Includes 375 * combination wake/run GPEs. |
369 * 370 ******************************************************************************/ 371 372ACPI_STATUS 373AcpiHwEnableRuntimeGpeBlock ( 374 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 375 ACPI_GPE_BLOCK_INFO *GpeBlock) 376{ --- 30 unchanged lines hidden (view full) --- 407 * 408 * FUNCTION: AcpiHwEnableWakeupGpeBlock 409 * 410 * PARAMETERS: GpeXruptInfo - GPE Interrupt info 411 * GpeBlock - Gpe Block info 412 * 413 * RETURN: Status 414 * | 376 * 377 ******************************************************************************/ 378 379ACPI_STATUS 380AcpiHwEnableRuntimeGpeBlock ( 381 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 382 ACPI_GPE_BLOCK_INFO *GpeBlock) 383{ --- 30 unchanged lines hidden (view full) --- 414 * 415 * FUNCTION: AcpiHwEnableWakeupGpeBlock 416 * 417 * PARAMETERS: GpeXruptInfo - GPE Interrupt info 418 * GpeBlock - Gpe Block info 419 * 420 * RETURN: Status 421 * |
415 * DESCRIPTION: Enable all "wake" GPEs within a GPE block. (Includes 416 * combination wake/run GPEs.) | 422 * DESCRIPTION: Enable all "wake" GPEs within a single GPE block. Includes 423 * combination wake/run GPEs. |
417 * 418 ******************************************************************************/ 419 | 424 * 425 ******************************************************************************/ 426 |
420ACPI_STATUS | 427static ACPI_STATUS |
421AcpiHwEnableWakeupGpeBlock ( 422 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 423 ACPI_GPE_BLOCK_INFO *GpeBlock) 424{ 425 UINT32 i; 426 ACPI_STATUS Status; 427 428 429 /* Examine each GPE Register within the block */ 430 431 for (i = 0; i < GpeBlock->RegisterCount; i++) 432 { 433 if (!GpeBlock->RegisterInfo[i].EnableForWake) 434 { 435 continue; 436 } 437 438 /* Enable all "wake" GPEs in this register */ 439 | 428AcpiHwEnableWakeupGpeBlock ( 429 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 430 ACPI_GPE_BLOCK_INFO *GpeBlock) 431{ 432 UINT32 i; 433 ACPI_STATUS Status; 434 435 436 /* Examine each GPE Register within the block */ 437 438 for (i = 0; i < GpeBlock->RegisterCount; i++) 439 { 440 if (!GpeBlock->RegisterInfo[i].EnableForWake) 441 { 442 continue; 443 } 444 445 /* Enable all "wake" GPEs in this register */ 446 |
440 Status = AcpiHwLowLevelWrite (8, GpeBlock->RegisterInfo[i].EnableForWake, | 447 Status = AcpiHwLowLevelWrite (8, 448 GpeBlock->RegisterInfo[i].EnableForWake, |
441 &GpeBlock->RegisterInfo[i].EnableAddress); 442 if (ACPI_FAILURE (Status)) 443 { 444 return (Status); 445 } 446 } 447 448 return (AE_OK); 449} 450 451 452/****************************************************************************** 453 * 454 * FUNCTION: AcpiHwDisableAllGpes 455 * | 449 &GpeBlock->RegisterInfo[i].EnableAddress); 450 if (ACPI_FAILURE (Status)) 451 { 452 return (Status); 453 } 454 } 455 456 return (AE_OK); 457} 458 459 460/****************************************************************************** 461 * 462 * FUNCTION: AcpiHwDisableAllGpes 463 * |
456 * PARAMETERS: Flags - ACPI_NOT_ISR or ACPI_ISR | 464 * PARAMETERS: None |
457 * 458 * RETURN: Status 459 * | 465 * 466 * RETURN: Status 467 * |
460 * DESCRIPTION: Disable and clear all GPEs | 468 * DESCRIPTION: Disable and clear all GPEs in all GPE blocks |
461 * 462 ******************************************************************************/ 463 464ACPI_STATUS 465AcpiHwDisableAllGpes ( | 469 * 470 ******************************************************************************/ 471 472ACPI_STATUS 473AcpiHwDisableAllGpes ( |
466 UINT32 Flags) | 474 void) |
467{ 468 ACPI_STATUS Status; 469 470 471 ACPI_FUNCTION_TRACE ("HwDisableAllGpes"); 472 473 | 475{ 476 ACPI_STATUS Status; 477 478 479 ACPI_FUNCTION_TRACE ("HwDisableAllGpes"); 480 481 |
474 Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, Flags); 475 Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, Flags); | 482 Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock); 483 Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock); |
476 return_ACPI_STATUS (Status); 477} 478 479 480/****************************************************************************** 481 * 482 * FUNCTION: AcpiHwEnableAllRuntimeGpes 483 * | 484 return_ACPI_STATUS (Status); 485} 486 487 488/****************************************************************************** 489 * 490 * FUNCTION: AcpiHwEnableAllRuntimeGpes 491 * |
484 * PARAMETERS: Flags - ACPI_NOT_ISR or ACPI_ISR | 492 * PARAMETERS: None |
485 * 486 * RETURN: Status 487 * | 493 * 494 * RETURN: Status 495 * |
488 * DESCRIPTION: Enable all GPEs of the given type | 496 * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks |
489 * 490 ******************************************************************************/ 491 492ACPI_STATUS 493AcpiHwEnableAllRuntimeGpes ( | 497 * 498 ******************************************************************************/ 499 500ACPI_STATUS 501AcpiHwEnableAllRuntimeGpes ( |
494 UINT32 Flags) | 502 void) |
495{ 496 ACPI_STATUS Status; 497 498 499 ACPI_FUNCTION_TRACE ("HwEnableAllRuntimeGpes"); 500 501 | 503{ 504 ACPI_STATUS Status; 505 506 507 ACPI_FUNCTION_TRACE ("HwEnableAllRuntimeGpes"); 508 509 |
502 Status = AcpiEvWalkGpeList (AcpiHwEnableRuntimeGpeBlock, Flags); | 510 Status = AcpiEvWalkGpeList (AcpiHwEnableRuntimeGpeBlock); |
503 return_ACPI_STATUS (Status); 504} 505 506 507/****************************************************************************** 508 * 509 * FUNCTION: AcpiHwEnableAllWakeupGpes 510 * | 511 return_ACPI_STATUS (Status); 512} 513 514 515/****************************************************************************** 516 * 517 * FUNCTION: AcpiHwEnableAllWakeupGpes 518 * |
511 * PARAMETERS: Flags - ACPI_NOT_ISR or ACPI_ISR | 519 * PARAMETERS: None |
512 * 513 * RETURN: Status 514 * | 520 * 521 * RETURN: Status 522 * |
515 * DESCRIPTION: Enable all GPEs of the given type | 523 * DESCRIPTION: Enable all "wakeup" GPEs, in all GPE blocks |
516 * 517 ******************************************************************************/ 518 519ACPI_STATUS 520AcpiHwEnableAllWakeupGpes ( | 524 * 525 ******************************************************************************/ 526 527ACPI_STATUS 528AcpiHwEnableAllWakeupGpes ( |
521 UINT32 Flags) | 529 void) |
522{ 523 ACPI_STATUS Status; 524 525 526 ACPI_FUNCTION_TRACE ("HwEnableAllWakeupGpes"); 527 528 | 530{ 531 ACPI_STATUS Status; 532 533 534 ACPI_FUNCTION_TRACE ("HwEnableAllWakeupGpes"); 535 536 |
529 Status = AcpiEvWalkGpeList (AcpiHwEnableWakeupGpeBlock, Flags); | 537 Status = AcpiEvWalkGpeList (AcpiHwEnableWakeupGpeBlock); |
530 return_ACPI_STATUS (Status); 531} 532 | 538 return_ACPI_STATUS (Status); 539} 540 |