aboutsummaryrefslogtreecommitdiff
path: root/sys/modules
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2024-10-22 18:53:55 +0000
committerColin Percival <cperciva@FreeBSD.org>2024-11-03 16:15:39 +0000
commit1db6ffb2a482dee109bbb596f31e9d8d035153c4 (patch)
treea69c22ade48dd82ac171979eb9748aeb00060fd6 /sys/modules
parent4b4c7b1924004e53f501612c7ad97b860644e583 (diff)
GPIO: Add ACPI _AEI support
Changes to acpi_gpiobus.c handle discovering and parsing the _AEI objects and storing necessary data in device ivars. A new gpioaei.c file implements the device, which simply requests an interrupt when the pin is triggered and invokes the appropriate _Exx or _Lxx ACPI method. This makes the GPIO "power button" work on arm64 Graviton systems, allowing EC2 "Stop"/"Reboot" instance calls to be handled cleanly. (Prior to this change, those requests would time out after 4 minutes and the instance would be forcibly killed.) Reviewed by: imp, andrew, Ahmad Khalifa Approved by: re (kib) MFC after: 3 days Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47253 Co-authored-by: Andrew Turner <andrew@FreeBSD.org> (cherry picked from commit 9709bda03cd0f20eba0ba4276fc3c2e06354a54f) (cherry picked from commit c2cd78d9446ebe79accf6c1862230dfbe7276525)
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/gpio/Makefile2
-rw-r--r--sys/modules/gpio/gpioaei/Makefile14
2 files changed, 15 insertions, 1 deletions
diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile
index ffb3581d1f01..1d7f69f1836d 100644
--- a/sys/modules/gpio/Makefile
+++ b/sys/modules/gpio/Makefile
@@ -24,7 +24,7 @@
# SUCH DAMAGE.
#
-SUBDIR = gpiobus gpioiic gpioled gpiospi gpioths
+SUBDIR = gpioaei gpiobus gpioiic gpioled gpiospi gpioths
.if !empty(OPT_FDT)
SUBDIR += gpiokeys gpiopps
diff --git a/sys/modules/gpio/gpioaei/Makefile b/sys/modules/gpio/gpioaei/Makefile
new file mode 100644
index 000000000000..514dcd80a35e
--- /dev/null
+++ b/sys/modules/gpio/gpioaei/Makefile
@@ -0,0 +1,14 @@
+.PATH: ${SRCTOP}/sys/dev/gpio/
+
+KMOD= gpioaei
+SRCS= gpioaei.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ gpio_if.h \
+ gpiobus_if.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/
+
+.include <bsd.kmod.mk>