lkml.org 
[lkml]   [2000]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC] [Patch] Sony APM battery status fix
The following change to the apm_get_power_status function makes my Sony
Vaio SR7K report sane battery life expectations. From surfing the web, I
believe this problem happens on other recent Sony laptops (outside of the
SR series). I'm thinking about making this fix run-time selectable via a
sysctl so that is can be pre-compiled-kernel friendly... Comments?


--- linux-old/arch/i386/kernel/apm.c Mon Sep 4 12:19:33 2000
+++ linux/arch/i386/kernel/apm.c Mon Sep 4 12:22:42 2000
@@ -673,7 +673,13 @@
return (eax >> 8) & 0xff;
*status = ebx;
*bat = ecx;
+#ifndef SONY_SR_SERIES
*life = edx;
+#else
+ *life = (edx >> 8) | 0x8000;
+ if (edx & 1)
+ *life += 0xff;
+#endif
return APM_SUCCESS;
}


davez

--
Dave Zarzycki KF6ZSS
http://thor.sbay.org/~dave/
http://www.sbay.net/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.021 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site