diff options
author | kspillner <kspillner@cvs.openbsd.org> | 2014-08-21 21:49:38 +0000 |
---|---|---|
committer | kspillner <kspillner@cvs.openbsd.org> | 2014-08-21 21:49:38 +0000 |
commit | 8d46ae8d15ec504456b668708ae4d0a1a1a8a730 (patch) | |
tree | d6125f84ad07951cb158610d8bbddf63011d44df /sys | |
parent | b1cbc548d045836ba0d1a0cad5dcf7b7be460bfa (diff) |
Set the sensor's status when docking and undocking, not just its value.
With this change sensorsd(8) now correctly detects state changes when
docking and undocking.
ok mlarkin@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpi/acpidock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpidock.c b/sys/dev/acpi/acpidock.c index d4dc09cdfaa..0f82f19a226 100644 --- a/sys/dev/acpi/acpidock.c +++ b/sys/dev/acpi/acpidock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidock.c,v 1.42 2010/07/27 01:21:19 jordan Exp $ */ +/* $OpenBSD: acpidock.c,v 1.43 2014/08/21 21:49:37 kspillner Exp $ */ /* * Copyright (c) 2006,2007 Michael Knudsen <mk@openbsd.org> * @@ -103,6 +103,7 @@ acpidock_attach(struct device *parent, struct device *self, void *aux) sc->sc_sens.type = SENSOR_INDICATOR; sc->sc_sens.value = sc->sc_docked == ACPIDOCK_STATUS_DOCKED; + sc->sc_sens.status = sc->sc_docked ? SENSOR_S_OK : SENSOR_S_UNKNOWN; sensor_attach(&sc->sc_sensdev, &sc->sc_sens); sensordev_install(&sc->sc_sensdev); @@ -241,6 +242,7 @@ acpidock_notify(struct aml_node *node, int notify_type, void *arg) acpidock_status(sc); sc->sc_sens.value = sc->sc_docked == ACPIDOCK_STATUS_DOCKED; + sc->sc_sens.status = sc->sc_docked ? SENSOR_S_OK : SENSOR_S_UNKNOWN; if (sc->sc_docked) strlcpy(sc->sc_sens.desc, "docked", sizeof(sc->sc_sens.desc)); |