summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-19 22:46:17 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-19 22:46:17 +0000
commite66266d1cc0420068c475934c6c5918a5622d7f4 (patch)
treee0d304a04741c822a5a9a3f188ff030f308893cc
parent451a55192d88795cbc3f7da40baa4c5ee75f29bd (diff)
acpi sub-drivers may not use sensordev_install(); all acpi/acpiec/dsdt
operations must currently operate under the acpi thread. So use aml_register_notify with ACPI_POLL for now -- it is a horrific hack of an interface, but now that all drivers are unified to use it, we can consider improving it. tested by jasper and claudio
-rw-r--r--sys/dev/acpi/atk0110.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sys/dev/acpi/atk0110.c b/sys/dev/acpi/atk0110.c
index 8b371d0a9bc..734535ba905 100644
--- a/sys/dev/acpi/atk0110.c
+++ b/sys/dev/acpi/atk0110.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atk0110.c,v 1.4 2010/05/17 21:59:45 nicm Exp $ */
+/* $OpenBSD: atk0110.c,v 1.5 2010/09/19 22:46:16 deraadt Exp $ */
/*
* Copyright (c) 2009 Constantine A. Murenin <cnst+openbsd@bugmail.mojo.ru>
@@ -66,6 +66,7 @@ struct aibs_softc {
int aibs_match(struct device *, void *, void *);
void aibs_attach(struct device *, struct device *, void *);
+int aibs_notify(struct aml_node *, int, void *);
void aibs_refresh(void *);
void aibs_attach_sif(struct aibs_softc *, enum sensor_type);
@@ -117,12 +118,10 @@ aibs_attach(struct device *parent, struct device *self, void *aux)
return;
}
- if (sensor_task_register(sc, aibs_refresh, 5) == NULL) {
- printf("%s: unable to register update task\n", DEVNAME(sc));
- return;
- }
-
sensordev_install(&sc->sc_sensordev);
+
+ aml_register_notify(sc->sc_devnode, aa->aaa_dev,
+ aibs_notify, sc, ACPIDEV_POLL);
}
void
@@ -377,3 +376,15 @@ aibs_refresh_r(struct aibs_softc *sc, enum sensor_type st)
return;
}
+
+int
+aibs_notify(struct aml_node *node, int notify_type, void *arg)
+{
+ struct aibs_softc *sc = arg;
+
+ if (notify_type == 0x00) {
+ /* Poll sensors */
+ aibs_refresh(sc);
+ }
+ return (0);
+}