diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-07-26 17:46:30 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-07-26 17:46:30 +0000 |
commit | 4087d1b05a57cc379d3a244379b2e3d9e2b370a4 (patch) | |
tree | 19ca52eec394ad72a5a29c5845e79481a51df524 /sys/dev | |
parent | aa5a399b8c2ad3cd5bfa00e48573d4ed7fc2cc05 (diff) |
Some machines include VID devices for hardware that doesn't exist. Avoid
attaching those devices by checking whether the PCI bus on which they are
supposed to sit exists. Fixes issues with brightness controls on my Dell
laptop.
ok marco@, pirofti@
Diffstat (limited to 'sys/dev')
-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; +} |