diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2010-06-27 17:04:28 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2010-06-27 17:04:28 +0000 |
commit | a4acba7cb82e16ac9f796b70673af9df30cc33f6 (patch) | |
tree | 18b66b26287139717f9dab8a2d9d03ba2f7a80cb /sys | |
parent | 2994871c374e3b3803e649e06c19141b18fac980 (diff) |
Clear ACPI fixed event status on resume (power buttons/etc) so that some
machines don't immediately resume after suspending to S3.
Tested by kettenis@ and I on 5 or 6 machines, deraadt@ "yeah, looks good"
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpi/acpi.c | 6 | ||||
-rw-r--r-- | sys/dev/acpi/acpireg.h | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index f6e8a521cee..74660fb8061 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.158 2010/06/27 07:26:31 jordan Exp $ */ +/* $OpenBSD: acpi.c,v 1.159 2010/06/27 17:04:27 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2095,6 +2095,10 @@ acpi_prepare_sleep_state(struct acpi_softc *sc, int state) goto fail; } + /* Clear fixed event status */ + acpi_write_pmreg(sc, ACPIREG_PM1_STS, 1, + ACPI_PM1_ALL_STS); + /* Enable wake GPEs */ acpi_susp_resume_gpewalk(sc, state, 1); diff --git a/sys/dev/acpi/acpireg.h b/sys/dev/acpi/acpireg.h index 9550a684a41..5317ea74126 100644 --- a/sys/dev/acpi/acpireg.h +++ b/sys/dev/acpi/acpireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpireg.h,v 1.18 2009/07/23 01:38:16 cnst Exp $ */ +/* $OpenBSD: acpireg.h,v 1.19 2010/06/27 17:04:27 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> @@ -420,6 +420,11 @@ struct acpi_facs { #define ACPI_PM1_PCIEXP_WAKE_STS 0x4000 #define ACPI_PM1_WAK_STS 0x8000 +#define ACPI_PM1_ALL_STS (ACPI_PM1_TMR_STS | ACPI_PM1_BM_STS | \ + ACPI_PM1_GBL_STS | ACPI_PM1_PWRBTN_STS | \ + ACPI_PM1_SLPBTN_STS | ACPI_PM1_RTC_STS | \ + ACPI_PM1_PCIEXP_WAKE_STS | ACPI_PM1_WAK_STS ) + /* * PM1 Enable Registers */ |