GPIO OperationRegion
How ACPI models GPIO-backed platform state and why GPIO numbering, polarity, wake flags, and controller paths are common firmware bugs.
Modern platforms use GPIOs for far more than simple high/low outputs.
A single GPIO can represent:
- lid state
- tablet mode
- camera privacy switch
- touchpad interrupt
- device reset line
- power enable line
- wake source
ACPI can expose GPIOs through _CRS descriptors and through GPIO OperationRegions.
GPIO in _CRS vs GPIO OperationRegion
| Item | Value | Note |
|---|---|---|
| GpioInt in _CRS | Interrupt resource | Tells the OS driver which GPIO interrupt belongs to the device. |
| GpioIo in _CRS | GPIO I/O resource | Can describe reset or enable pins consumed by the driver. |
| GeneralPurposeIo OperationRegion | AML-accessible GPIO field | Lets AML read or write GPIO-backed state. |
| Wake flags | ExclusiveAndWake / SharedAndWake | Important for sleep and wake behavior. |
Real World Example: camera privacy switch
A camera privacy switch may be wired to a GPIO. The OS may need to know the state, while firmware may also send notifications when it changes.
OperationRegion (GPRG, GeneralPurposeIo, Zero, One)
Field (GPRG, ByteAcc, NoLock, Preserve)
{
CPSW, 1
}
Method (GCPS, 0, NotSerialized)
{
Return (CPSW)
}
If GPIO polarity is wrong, the OS reports privacy on when it is off.
Debug Diary: wake instantly after sleep
Symptom:
System enters S3
Immediately wakes again
Wake source points to GPIO controller
The issue may be:
- wrong active level
- wake GPIO not masked before sleep
- stale event status not cleared
_PRWreferences the wrong GPE_CRSmarks a GPIO as wake-capable when it should not
GPIO ACPI debug checklist
Related notes
Found this useful?
Save it or share it with someone learning firmware, BIOS/UEFI, and embedded systems.
Nội dung liên quan
Một số bài viết, ghi chú hoặc project có liên quan đến nội dung bạn vừa đọc.
_CRS Deep Dive
How ACPI _CRS reports device resources to the OS and how wrong IRQ, GPIO, I2C, SPI, or MMIO descriptors cause driver problems.
Embedded Controller OperationRegion
How AML talks to EC RAM through EmbeddedControl OperationRegion and how to debug EC timeout, SCI storm, battery, thermal, and hotkey issues.
Field in ACPI
How Field definitions map bits and bytes inside an OperationRegion to names used by AML methods.
Biến note thành bài viết hoàn chỉnh
Notes là nơi ghi nhanh khái niệm.