From bd1efbb394a6b71917f675f13958e5850f91daf5 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 25 Jun 2014 07:46:15 +0000 Subject: 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@ --- sys/dev/acpi/acpiec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/dev') 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 * @@ -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; -- cgit v1.2.3