diff options
-rw-r--r-- | sys/dev/acpi/acpivideo.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpivideo.c b/sys/dev/acpi/acpivideo.c index a74ee0f85ff..b101a2eb272 100644 --- a/sys/dev/acpi/acpivideo.c +++ b/sys/dev/acpi/acpivideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivideo.c,v 1.5 2009/06/04 17:16:00 pirofti Exp $ */ +/* $OpenBSD: acpivideo.c,v 1.6 2010/07/26 17:46:29 kettenis Exp $ */ /* * Copyright (c) 2008 Federico G. Schwindt <fgsch@openbsd.org> * Copyright (c) 2009 Paul Irofti <pirofti@openbsd.org> @@ -58,6 +58,8 @@ void acpivideo_get_dod(struct acpivideo_softc *); int acpi_foundvout(struct aml_node *, void *); int acpivideo_print(void *, const char *); +int acpivideo_getpcibus(struct acpivideo_softc *, struct aml_node *); + struct cfattach acpivideo_ca = { sizeof(struct acpivideo_softc), acpivideo_match, acpivideo_attach }; @@ -90,6 +92,9 @@ acpivideo_attach(struct device *parent, struct device *self, void *aux) printf(": %s\n", sc->sc_devnode->name); + if (acpivideo_getpcibus(sc, sc->sc_devnode) == -1) + return; + aml_register_notify(sc->sc_devnode, aaa->aaa_dev, acpivideo_notify, sc, ACPIDEV_NOPOLL); @@ -230,3 +235,11 @@ acpivideo_get_dod(struct acpivideo_softc * sc) aml_freevalue(&res); } + +int +acpivideo_getpcibus(struct acpivideo_softc *sc, struct aml_node *node) +{ + /* Check if parent device has PCI mapping */ + return (node->parent && node->parent->pci) ? + node->parent->pci->sub : -1; +} |