summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-04-30 18:47:49 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-04-30 18:47:49 +0000
commit896330ed72a6b6850a3911ff8f27c287e3eac9bd (patch)
treee7cab59d9aaa4330a2bc5d724ff41658dc910759
parentf717bc5830cf4347125d1bc697e09ef568d356f9 (diff)
Use acpi_register_gpio() to register gpio space like we do for chvgpio(4).
ok mpi@
-rw-r--r--sys/dev/acpi/bytgpio.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/sys/dev/acpi/bytgpio.c b/sys/dev/acpi/bytgpio.c
index 555db4deee4..a761afc76a2 100644
--- a/sys/dev/acpi/bytgpio.c
+++ b/sys/dev/acpi/bytgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bytgpio.c,v 1.12 2016/10/25 06:48:58 pirofti Exp $ */
+/* $OpenBSD: bytgpio.c,v 1.13 2018/04/30 18:47:48 kettenis Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -125,8 +125,6 @@ bytgpio_attach(struct device *parent, struct device *self, void *aux)
struct acpi_attach_args *aaa = aux;
struct bytgpio_softc *sc = (struct bytgpio_softc *)self;
struct aml_value res;
- struct aml_value arg[2];
- struct aml_node *node;
int64_t uid;
uint32_t reg;
int i;
@@ -219,16 +217,7 @@ bytgpio_attach(struct device *parent, struct device *self, void *aux)
printf(", %d pins\n", sc->sc_npins);
- /* Register address space. */
- memset(&arg, 0, sizeof(arg));
- arg[0].type = AML_OBJTYPE_INTEGER;
- arg[0].v_integer = ACPI_OPREG_GPIO;
- arg[1].type = AML_OBJTYPE_INTEGER;
- arg[1].v_integer = 1;
- node = aml_searchname(sc->sc_node, "_REG");
- if (node && aml_evalnode(sc->sc_acpi, node, 2, arg, NULL))
- printf("%s: _REG failed\n", sc->sc_dev.dv_xname);
-
+ acpi_register_gpio(sc->sc_acpi, sc->sc_node);
return;
unmap: