From d0fed2eb3442fb0cabf37b7b47243a9f14d0acd6 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Sat, 6 Dec 2014 11:10:57 +0000 Subject: 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@ --- sys/dev/acpi/acpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') 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 * Copyright (c) 2005 Jordan Hargrave @@ -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: -- cgit v1.2.3