diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-12-05 16:14:31 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-12-05 16:14:31 +0000 |
commit | 878a12e8dac6f402b242a4f71d7abe618cb931bc (patch) | |
tree | 311d11a0fbd85fea61e18a99aed121fb67e00fde /sys/dev/acpi | |
parent | ca0fb21a5e4f2a73f641b80b47f6fb0b0d43ce67 (diff) |
Add support for the _EVT method to the GPIO support code.
ok patrick@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/acpi.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 93d802507c3..005add9063e 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.391 2020/08/27 01:08:55 jmatthew Exp $ */ +/* $OpenBSD: acpi.c,v 1.392 2020/12/05 16:14:30 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -879,11 +879,20 @@ void acpi_gpio_event_task(void *arg0, int arg1) { struct aml_node *node = arg0; + struct aml_value evt; uint16_t pin = arg1; char name[5]; - snprintf(name, sizeof(name), "_E%.2X", pin); - aml_evalname(acpi_softc, node, name, 0, NULL, NULL); + if (pin < 256) { + snprintf(name, sizeof(name), "_E%.2X", pin); + if (aml_evalname(acpi_softc, node, name, 0, NULL, NULL) == 0) + return; + } + + memset(&evt, 0, sizeof(evt)); + evt.v_integer = pin; + evt.type = AML_OBJTYPE_INTEGER; + aml_evalname(acpi_softc, node, "_EVT", 1, &evt, NULL); } int |