summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/acpibtn.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-25 16:12:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-25 16:12:41 +0000
commit1f1204f03b29049b3702670185d2654bd7bedb55 (patch)
tree083ba4ab1c76ddd4afad57a2569a32520feef59f /sys/dev/acpi/acpibtn.c
parent14fcaff40a0935d50bcd694917237e0cea05134f (diff)
Handle the notification types for LID and Sleep button a bit more
specifically. On some thinkpads we get 0x02 for the Fn button, which means that it is going to handle the next bit for us. After that, we get an suspend key event in acpithinkpad. ok pirofti
Diffstat (limited to 'sys/dev/acpi/acpibtn.c')
-rw-r--r--sys/dev/acpi/acpibtn.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpibtn.c b/sys/dev/acpi/acpibtn.c
index 485b875500a..9eda687d0b4 100644
--- a/sys/dev/acpi/acpibtn.c
+++ b/sys/dev/acpi/acpibtn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibtn.c,v 1.22 2009/11/23 16:21:54 pirofti Exp $ */
+/* $OpenBSD: acpibtn.c,v 1.23 2009/11/25 16:12:40 deraadt Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -121,9 +121,23 @@ acpibtn_notify(struct aml_node *node, int notify_type, void *arg)
switch (sc->sc_btn_type) {
case ACPIBTN_LID:
+ /*
+ * Notification of 0x80 for lid opens or closes. We
+ * need to check using other means, and if desirable,
+ * go to sleep.
+ */
+ break;
case ACPIBTN_SLEEP:
#ifndef SMALL_KERNEL
- acpi_sleep_state(sc->sc_acpi, ACPI_STATE_S3);
+ switch (notify_type) {
+ case 0x02:
+ /* "something" has been taken care of by the system */
+ break;
+ case 0x80:
+ /* Request to go to sleep */
+ acpi_sleep_state(sc->sc_acpi, ACPI_STATE_S3);
+ break;
+ }
#endif /* SMALL_KERNEL */
break;
case ACPIBTN_POWER: