summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-12-06 11:10:57 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-12-06 11:10:57 +0000
commitd0fed2eb3442fb0cabf37b7b47243a9f14d0acd6 (patch)
treecac278e5d96707ad1bfccd8e48bcd39f5d6bdefc /sys
parentdce472d7b4b44212b838ec2855b154537f83a9f2 (diff)
If "machdep.lidsuspend" is not set, do not go back to sleep if the lid
is still closed when resuming. This allows docked laptop to be resumed without opening them. ok mlarkin@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/acpi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 67659c875cf..00817d59118 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.275 2014/11/23 20:33:47 mlarkin Exp $ */
+/* $OpenBSD: acpi.c,v 1.276 2014/12/06 11:10:56 mpi Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -2111,6 +2111,7 @@ int
acpi_sleep_state(struct acpi_softc *sc, int state)
{
extern int perflevel;
+ extern int lid_suspend;
int error = ENXIO;
int s;
@@ -2252,7 +2253,7 @@ fail_alloc:
acpi_indicator(sc, ACPI_SST_WORKING);
/* If we woke up but all the lids are closed, go back to sleep */
- if (acpibtn_numopenlids() == 0)
+ if (acpibtn_numopenlids() == 0 && lid_suspend != 0)
acpi_addtask(sc, acpi_sleep_task, sc, state);
fail_tts: