summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2021-12-26 13:55:37 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2021-12-26 13:55:37 +0000
commite56aa27ecfe5f8b949623540c3b1a363b259305d (patch)
treef9d06b215c96baa02a12b201361367877039a84a /sys/dev/acpi
parentfe88819cde51dc180b6aed3bf1240375032fd8a4 (diff)
Add address locators for the ACPI "bus" and use these to fix the order of
the com(4) devices to match the traditional order one the ISA bus. ok patrick@, anton@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpivar.h6
-rw-r--r--sys/dev/acpi/com_acpi.c5
-rw-r--r--sys/dev/acpi/files.acpi4
3 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h
index ff369eeb5eb..706a2ae2147 100644
--- a/sys/dev/acpi/acpivar.h
+++ b/sys/dev/acpi/acpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivar.h,v 1.114 2021/03/15 22:44:57 patrick Exp $ */
+/* $OpenBSD: acpivar.h,v 1.115 2021/12/26 13:55:36 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -56,6 +56,10 @@ struct acpivideo_softc {
struct aml_node *sc_devnode;
};
+#define ACPIDEVCF_ADDR 0
+#define acpidevcf_addr cf_loc[ACPIDEVCF_ADDR]
+#define ACPIDEVCF_ADDR_UNK -1
+
struct acpi_attach_args {
char *aaa_name;
bus_space_tag_t aaa_iot;
diff --git a/sys/dev/acpi/com_acpi.c b/sys/dev/acpi/com_acpi.c
index 205893403cc..9643fcb9d11 100644
--- a/sys/dev/acpi/com_acpi.c
+++ b/sys/dev/acpi/com_acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_acpi.c,v 1.5 2021/12/21 06:10:29 anton Exp $ */
+/* $OpenBSD: com_acpi.c,v 1.6 2021/12/26 13:55:36 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis
*
@@ -65,6 +65,9 @@ com_acpi_match(struct device *parent, void *match, void *aux)
if (aaa->aaa_naddr < 1 || aaa->aaa_nirq < 1)
return 0;
+ if (cf->acpidevcf_addr != aaa->aaa_addr[0] &&
+ cf->acpidevcf_addr != ACPIDEVCF_ADDR_UNK)
+ return 0;
return acpi_matchhids(aaa, com_hids, cf->cf_driver->cd_name);
}
diff --git a/sys/dev/acpi/files.acpi b/sys/dev/acpi/files.acpi
index faef7f925ee..95df4ffe448 100644
--- a/sys/dev/acpi/files.acpi
+++ b/sys/dev/acpi/files.acpi
@@ -1,9 +1,9 @@
-# $OpenBSD: files.acpi,v 1.62 2020/12/06 20:39:07 kettenis Exp $
+# $OpenBSD: files.acpi,v 1.63 2021/12/26 13:55:36 kettenis Exp $
#
# Config file and device description for machine-independent ACPI code.
# Included by ports that need it.
-define acpi {}
+define acpi {[addr = -1]}
device acpi
file dev/acpi/acpi.c acpi needs-flag
file dev/acpi/acpiutil.c acpi