diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-06-25 07:46:15 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-06-25 07:46:15 +0000 |
commit | bd1efbb394a6b71917f675f13958e5850f91daf5 (patch) | |
tree | c85483ca18a6bee7abc745387236ba18c69351a2 /sys/dev | |
parent | a55a8c8279f95336f6241f82aaa01c8bc2461985 (diff) |
If the Embedded Contoller device has a _STA method, evaluate it and bail out
early during attach if it signals that the device isn't present.
Reduces the noise on machines where the AML provides an (incomplete)
description of the Embedded Controller but doesn't actually have one.
ok mlarkin@, deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpi/acpiec.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpiec.c b/sys/dev/acpi/acpiec.c index d42ec184b6a..8be0cac8c99 100644 --- a/sys/dev/acpi/acpiec.c +++ b/sys/dev/acpi/acpiec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiec.c,v 1.49 2014/05/21 02:14:07 mlarkin Exp $ */ +/* $OpenBSD: acpiec.c,v 1.50 2014/06/25 07:46:14 kettenis Exp $ */ /* * Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org> * @@ -273,10 +273,18 @@ acpiec_attach(struct device *parent, struct device *self, void *aux) struct acpiec_softc *sc = (struct acpiec_softc *)self; struct acpi_attach_args *aa = aux; struct aml_value res; + int64_t st; sc->sc_acpi = (struct acpi_softc *)parent; sc->sc_devnode = aa->aaa_node; + if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "_STA", 0, NULL, &st)) + st = STA_PRESENT | STA_ENABLED | STA_DEV_OK; + if ((st & STA_PRESENT) == 0) { + printf(": not present\n"); + return; + } + if (acpiec_getcrs(sc, aa)) { printf(": Failed to read resource settings\n"); return; |