Module Name:    src
Committed By:   jruoho
Date:           Sun Apr 25 10:05:23 UTC 2010

Modified Files:
        src/sys/dev/acpi: acpi.c

Log Message:
Evaluate _TTS on sleep state transitions. This is mainly to pro-actively
support some weird BIOS, which may require the evaluation. Ok jmcne...@.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/sys/dev/acpi/acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.188 src/sys/dev/acpi/acpi.c:1.189
--- src/sys/dev/acpi/acpi.c:1.188	Sun Apr 25 09:12:38 2010
+++ src/sys/dev/acpi/acpi.c	Sun Apr 25 10:05:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.188 2010/04/25 09:12:38 jruoho Exp $	*/
+/*	$NetBSD: acpi.c,v 1.189 2010/04/25 10:05:22 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.188 2010/04/25 09:12:38 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.189 2010/04/25 10:05:22 jruoho Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -1463,6 +1463,19 @@
 		}
 
 		/*
+		 * Evaluate the _TTS method, which should be called
+		 * before _PTS. We should also re-evaluate this once
+		 * we return to S0 (see ACPI 3.0, section 7.3.6).
+		 * In reality, _TTS is seldom seen in the field.
+		 */
+		rv = acpi_eval_set_integer(NULL, "\\_TTS", state);
+
+		if (ACPI_SUCCESS(rv))
+			aprint_debug_dev(sc->sc_dev, "evaluated _TTS\n");
+
+		rv = AE_OK;
+
+		/*
 		 * This will evaluate the  _PTS and _SST methods,
 		 * but unlike the documentation claims, not _GTS,
 		 * which is evaluated in AcpiEnterSleepState().
@@ -1504,8 +1517,11 @@
 		}
 
 		break;
+
 	case ACPI_STATE_S5:
 
+		(void)acpi_eval_set_integer(NULL, "\\_TTS", state);
+
 		rv = AcpiEnterSleepStatePrep(ACPI_STATE_S5);
 
 		if (ACPI_FAILURE(rv)) {
@@ -1522,11 +1538,14 @@
 		(void)AcpiEnterSleepState(ACPI_STATE_S5);
 
 		aprint_error_dev(sc->sc_dev, "WARNING: powerdown failed!\n");
+
 		break;
 	}
 
 	sc->sc_sleepstate = ACPI_STATE_S0;
 
+	(void)acpi_eval_set_integer(NULL, "\\_TTS", ACPI_STATE_S0);
+
 	return rv;
 }
 

Reply via email to