public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jordan Crouse" <jordan.crouse@amd.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, alan@lxorguk.ukuu.org.uk, info-linux@ldcmail.amd.com
Subject: [PATCH 3/3] APM Screen Blanking fix
Date: Thu, 15 Dec 2005 14:16:01 -0700	[thread overview]
Message-ID: <20051215211601.GG11054@cosmic.amd.com> (raw)
In-Reply-To: <20051215211423.GF11054@cosmic.amd.com>

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

A simple patch to fix APM assisted screen blanking (this at least fixes
a issue with the Geode LX BIOS).  Reposted from before with no changes.


[-- Attachment #2: apm.patch --]
[-- Type: text/plain, Size: 1534 bytes --]

APM screen blanking fix.

This patch fixes screen blanking on BIOSes that return
APM_NOT_ENGAGED when APM enabled screen blanking is not
turned on.

Signed off by: Jordan Crouse <jordan.crouse@amd.com>
---

 arch/i386/kernel/apm.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 1e60acb..03e9d84 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -1075,22 +1075,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) {

  reply	other threads:[~2005-12-15 21:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15 21:12 [PATCH 1/3] Base support for AMD Geode GX/LX processors Jordan Crouse
2005-12-15 21:14 ` [PATCH 2/3] Geode LX HW RNG Support Jordan Crouse
2005-12-15 21:16   ` Jordan Crouse [this message]
2005-12-15 21:45     ` [PATCH 3/3] APM Screen Blanking fix Andrew Morton
     [not found]     ` <LYRIS-4270-4193-2005.12.15-14.45.16--jordan.crouse#amd.com@whitestar.amd.com>
2005-12-15 21:56       ` Jordan Crouse
2005-12-15 21:39   ` [PATCH 2/3] Geode LX HW RNG Support Andrew Morton
2005-12-15 21:44     ` Jordan Crouse
2005-12-15 22:06       ` Andrew Morton
2005-12-15 22:07         ` Jeff Garzik
2005-12-15 22:47           ` Andrew Morton
2005-12-15 22:48           ` Deepak Saxena
2005-12-15 21:36 ` [PATCH 1/3] Base support for AMD Geode GX/LX processors Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051215211601.GG11054@cosmic.amd.com \
    --to=jordan.crouse@amd.com \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=info-linux@ldcmail.amd.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox