diff options
author | 2017-03-13 14:44:37 +0000 | |
---|---|---|
committer | 2017-03-13 14:44:37 +0000 | |
commit | d24e5186bddbab829bcb6dbc2a9b895aa54843fa (patch) | |
tree | 63a24fd22ac60a6665a9dedc3832c253b1515296 | |
parent | flow_cmp() must compare the same flow-attributes as the kernel, (diff) | |
download | wireguard-openbsd-d24e5186bddbab829bcb6dbc2a9b895aa54843fa.tar.xz wireguard-openbsd-d24e5186bddbab829bcb6dbc2a9b895aa54843fa.zip |
Don't attach on Apple hardware, asmc(4) is already providing an
ambient light sensor.
ok jung
-rw-r--r-- | sys/dev/acpi/acpials.c | 13 |
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)); } |