From 5c83c9d5fce84716ff23c4db4934c7b9556b7b47 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 25 Aug 2018 09:39:20 +0000 Subject: [PATCH] Match ACPI devices based on _CID if no match for _HID is found. ok mpi@ --- sys/dev/acpi/acpi.c | 11 +++++++++-- sys/dev/acpi/acpivar.h | 3 ++- sys/dev/acpi/pluart_acpi.c | 3 +-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index ad0bab64b93..7f44f8b0778 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.357 2018/08/19 08:23:47 kettenis Exp $ */ +/* $OpenBSD: acpi.c,v 1.358 2018/08/25 09:39:20 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -541,8 +541,13 @@ acpi_matchhids(struct acpi_attach_args *aa, const char *hids[], { if (aa->aaa_dev == NULL || aa->aaa_node == NULL) return (0); + if (_acpi_matchhids(aa->aaa_dev, hids)) { dnprintf(5, "driver %s matches at least one hid\n", driver); + return (2); + } + if (aa->aaa_cdev && _acpi_matchhids(aa->aaa_cdev, hids)) { + dnprintf(5, "driver %s matches at least one cid\n", driver); return (1); } @@ -2977,8 +2982,8 @@ const char *acpi_skip_hids[] = { "PNP0200", /* PC-class DMA Controller */ "PNP0201", /* EISA DMA Controller */ "PNP0800", /* Microsoft Sound System Compatible Device */ - "PNP0A03", /* PCI Bus */ #if defined(__amd64__) || defined(__i386__) + "PNP0A03", /* PCI Bus */ "PNP0A08", /* PCI Express Bus */ #endif "PNP0C01", /* System Board */ @@ -3058,6 +3063,7 @@ acpi_foundhid(struct aml_node *node, void *arg) aaa.aaa_dmat = sc->sc_dmat; aaa.aaa_node = node->parent; aaa.aaa_dev = dev; + aaa.aaa_cdev = cdev; if (acpi_matchhids(&aaa, acpi_skip_hids, "none") || acpi_matchhids(&aaa, acpi_isa_hids, "none")) @@ -3152,6 +3158,7 @@ acpi_foundsbs(struct aml_node *node, void *arg) aaa.aaa_memt = sc->sc_memt; aaa.aaa_node = node->parent; aaa.aaa_dev = dev; + aaa.aaa_cdev = cdev; config_found(self, &aaa, acpi_print); node->parent->attached = 1; diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h index dd443491c3d..6febfeae0cd 100644 --- a/sys/dev/acpi/acpivar.h +++ b/sys/dev/acpi/acpivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivar.h,v 1.98 2018/08/19 08:23:47 kettenis Exp $ */ +/* $OpenBSD: acpivar.h,v 1.99 2018/08/25 09:39:20 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * @@ -63,6 +63,7 @@ struct acpi_attach_args { void *aaa_table; struct aml_node *aaa_node; const char *aaa_dev; + const char *aaa_cdev; }; struct acpi_mem_map { diff --git a/sys/dev/acpi/pluart_acpi.c b/sys/dev/acpi/pluart_acpi.c index 2c419562349..7b622668284 100644 --- a/sys/dev/acpi/pluart_acpi.c +++ b/sys/dev/acpi/pluart_acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pluart_acpi.c,v 1.2 2018/08/11 16:04:49 kettenis Exp $ */ +/* $OpenBSD: pluart_acpi.c,v 1.3 2018/08/25 09:39:20 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -51,7 +51,6 @@ struct cfattach pluart_acpi_ca = { }; const char *pluart_hids[] = { - "AMDI0511", "ARMH0011", NULL }; -- 2.20.1