summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/acpi.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2006-11-02 05:58:50 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2006-11-02 05:58:50 +0000
commit6749f820d65614dc38a1d441ec0586780fd4824d (patch)
tree8199f48c401fe67338acf2139c219afb695e3cfc /sys/dev/acpi/acpi.c
parent93d277c69340a15134297391cc24412cb2edf7a8 (diff)
Kill acpiec attach function and add its functionality to the generic _HID
device attach prodded and ok jordan
Diffstat (limited to 'sys/dev/acpi/acpi.c')
-rw-r--r--sys/dev/acpi/acpi.c53
1 files changed, 6 insertions, 47 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 1f8b420de5f..cabc3ec3228 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.60 2006/11/02 05:52:24 marco Exp $ */
+/* $OpenBSD: acpi.c,v 1.61 2006/11/02 05:58:49 marco Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -60,7 +60,6 @@ void acpi_unmap_pmregs(struct acpi_softc *);
void acpi_foundpss(struct aml_node *, void *);
void acpi_foundhid(struct aml_node *, void *);
-void acpi_foundec(struct aml_node *, void *);
void acpi_foundtmp(struct aml_node *, void *);
void acpi_inidev(struct aml_node *, void *);
@@ -614,51 +613,11 @@ acpi_foundhid(struct aml_node *node, void *arg)
!strcmp(dev, ACPI_DEV_PBD) ||
!strcmp(dev, ACPI_DEV_SBD))
aaa.aaa_name = "acpibtn";
-
- if (aaa.aaa_name)
- config_found(self, &aaa, acpi_print);
- aml_freevalue(&res);
-}
-
-
-void
-acpi_foundec(struct aml_node *node, void *arg)
-{
- struct acpi_softc *sc = (struct acpi_softc *)arg;
- struct device *self = (struct device *)arg;
- const char *dev;
- struct aml_value res;
- struct acpi_attach_args aaa;
-
- dnprintf(10, "found hid device: %s ", node->parent->name);
- if (aml_evalnode(sc, node, 0, NULL, &res) != 0)
- return;
-
- switch (res.type) {
- case AML_OBJTYPE_STRING:
- dev = res.v_string;
- break;
- case AML_OBJTYPE_INTEGER:
- dev = aml_eisaid(aml_val2int(&res));
- break;
- default:
- dev = "unknown";
- break;
- }
- dnprintf(10, " device: %s\n", dev);
-
- memset(&aaa, 0, sizeof(aaa));
- aaa.aaa_iot = sc->sc_iot;
- aaa.aaa_memt = sc->sc_memt;
- aaa.aaa_node = node->parent;
- aaa.aaa_dev = dev;
-
- if (!strcmp(dev, ACPI_DEV_ECD))
+ else if (!strcmp(dev, ACPI_DEV_ECD))
aaa.aaa_name = "acpiec";
if (aaa.aaa_name)
config_found(self, &aaa, acpi_print);
-
aml_freevalue(&res);
}
@@ -881,10 +840,10 @@ acpi_attach(struct device *parent, struct device *self, void *aux)
/* initialize runtime environment */
aml_find_node(aml_root.child, "_INI", acpi_inidev, sc);
- /* attach embedded controller devices */
- aml_find_node(aml_root.child, "_HID", acpi_foundec, sc);
-
- /* attach battery, power supply and button devices */
+ /*
+ * attach embedded controller, battery, power supply and button
+ * devices
+ */
aml_find_node(aml_root.child, "_HID", acpi_foundhid, sc);
/* attach cpu devices */