summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2017-03-13 14:44:38 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2017-03-13 14:44:38 +0000
commit15075e682ba5d9ec1dd4f332e0f34e3b4edc5d93 (patch)
tree03e94a695a245350c4f37dd08f1987d373431997 /sys
parentc55550f45a4e347e1b20ce842d2a982db0dde7e8 (diff)
Don't attach on Apple hardware, asmc(4) is already providing an
ambient light sensor. ok jung
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/acpials.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpials.c b/sys/dev/acpi/acpials.c
index a3b0c406ab8..6d8ddc6009d 100644
--- a/sys/dev/acpi/acpials.c
+++ b/sys/dev/acpi/acpials.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpials.c,v 1.2 2016/12/23 19:55:02 kettenis Exp $ */
+/* $OpenBSD: acpials.c,v 1.3 2017/03/13 14:44:37 jcs Exp $ */
/*
* Ambient Light Sensor device driver
* ACPI 5.0 spec section 9.2
@@ -59,7 +59,7 @@ int acpials_notify(struct aml_node *, int, void *);
void acpials_addtask(void *);
void acpials_update(void *, int);
-struct cfattach acpials_ca = {
+const struct cfattach acpials_ca = {
sizeof(struct acpials_softc),
acpials_match,
acpials_attach,
@@ -74,12 +74,21 @@ const char *acpials_hids[] = {
NULL
};
+extern char *hw_vendor;
+
int
acpials_match(struct device *parent, void *match, void *aux)
{
struct acpi_attach_args *aa = aux;
struct cfdata *cf = match;
+ /*
+ * Apple hardware will most likely have asmc(4) which also provides an
+ * illuminance sensor.
+ */
+ if (hw_vendor != NULL && strncmp(hw_vendor, "Apple", 5) == 0)
+ return 0;
+
return (acpi_matchhids(aa, acpials_hids, cf->cf_driver->cd_name));
}