All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/7] AMD Geode GX/LX support
@ 2005-10-03 17:53 Jordan Crouse
  0 siblings, 0 replies; only message in thread
From: Jordan Crouse @ 2005-10-03 17:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: info-linux

This is a simple patch that fixes console APM blanking on the GX/LX
platforms with BIOSes that still support APM.  Please apply against
linux-2.4.14-rc2-mm2.

Signed off by:  Jordan Crouse (jordan.crouse@amd.com)

Index: linux-2.6.14-rc2-mm2/arch/i386/kernel/apm.c
===================================================================
--- linux-2.6.14-rc2-mm2.orig/arch/i386/kernel/apm.c
+++ linux-2.6.14-rc2-mm2/arch/i386/kernel/apm.c
@@ -1057,22 +1057,23 @@ static int apm_engage_power_management(u
  
 static int apm_console_blank(int blank)
 {
-	int	error;
-	u_short	state;
+	int error, i;
+	u_short state;
+	u_short dev[3] = { 0x100, 0x1FF, 0x101 };
 
 	state = blank ? APM_STATE_STANDBY : APM_STATE_READY;
-	/* Blank the first display device */
-	error = set_power_state(0x100, state);
-	if ((error != APM_SUCCESS) && (error != APM_NO_ERROR)) {
-		/* try to blank them all instead */
-		error = set_power_state(0x1ff, state);
-		if ((error != APM_SUCCESS) && (error != APM_NO_ERROR))
-			/* try to blank device one instead */
-			error = set_power_state(0x101, state);
+
+	for (i = 0; i < 3; i++) {
+		error = set_power_state(dev[i], state);
+
+		if ((error == APM_SUCCESS) || (error == APM_NO_ERROR))
+			return 1;
+
+		if (error == APM_NOT_ENGAGED)
+			break;
 	}
-	if ((error == APM_SUCCESS) || (error == APM_NO_ERROR))
-		return 1;
-	if (error == APM_NOT_ENGAGED) {
+
+	if (error == APM_NOT_ENGAGED && state != APM_STATE_READY) {
 		static int tried;
 		int eng_error;
 		if (tried++ == 0) {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-10-03 17:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-03 17:53 [PATCH 3/7] AMD Geode GX/LX support Jordan Crouse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.