Skip to contentSkip to conversation

power_supply: bump EC version check that we refuse to run with in olpc_battery

PATCH Applied Andres Salomon 2 participants 3 messages Apr 30, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 power_supply: bump EC version check that we refuse to run with in olpc_battery

Refuse to run with an EC < 0x44. We're playing it safe, and this is a pretty old EC version.

Also, add a comment about why we're checking the EC version.

---
 drivers/power/olpc_battery.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/power/olpc_battery.c +6 -1
index cb45a67..086b146 100644
@@ -398,7 +398,12 @@ static int __init olpc_bat_init(void)
 
 	if (!olpc_platform_info.ecver)
 		return -ENXIO;
-	if (olpc_platform_info.ecver < 0x43) {
+
+	/*
+	 * We've seen a number of EC protocol changes; this driver requires
+	 * the latest EC protocol, supported by 0x44 and above.
+	 */
+	if (olpc_platform_info.ecver < 0x44) {
 		printk(KERN_NOTICE "OLPC EC version 0x%02x too old for battery driver.\n", olpc_platform_info.ecver);
 		return -ENXIO;
 	}
Signature · 1 line
1.5.5
#1 lore raw
Quoted 5 lines · On Wed, 30 Apr 2008 16:30:30 -0400 Andres Salomon <[email protected]> wrote:

Refuse to run with an EC < 0x44. We're playing it safe, and this is a pretty old EC version.

Also, add a comment about why we're checking the EC version.

Sigh. Presantly, the entirety of olpc_battery.c looks very nice in an 80-column display.

Quoted 8 lines
drivers/power/olpc_battery.c +0 -0
index cb45a67..086b146 100644
@@ -398,7 +398,12 @@ static int __init olpc_bat_init(void)
 
 	if (!olpc_platform_info.ecver)

drivers/power/olpc_battery.c static int __init olpc_bat_init(void) · line 408

Quoted 10 lines
drivers/power/olpc_battery.c +6 -1
 		return -ENXIO;
-	if (olpc_platform_info.ecver < 0x43) {
+
+	/*
+	 * We've seen a number of EC protocol changes; this driver requires
+	 * the latest EC protocol, supported by 0x44 and above.
+	 */
+	if (olpc_platform_info.ecver < 0x44) {
 		printk(KERN_NOTICE "OLPC EC version 0x%02x too old for battery driver.\n", olpc_platform_info.ecver);
 		return -ENXIO;

Now it needs 0x80 :(

#2 lore raw
Quoted 19 lines · On Wed, 30 Apr 2008 14:55:15 -0700 Andrew Morton <[email protected]>…
Quoted 5 lines · On Wed, 30 Apr 2008 16:30:30 -0400 Andres Salomon <[email protected]> wrote:

Refuse to run with an EC < 0x44. We're playing it safe, and this is a pretty old EC version.

Also, add a comment about why we're checking the EC version.

Sigh. Presantly, the entirety of olpc_battery.c looks very nice in an 80-column display.

Quoted 7 lines
drivers/power/olpc_battery.c +0 -0
index cb45a67..086b146 100644
@@ -398,7 +398,12 @@ static int __init olpc_bat_init(void)
 
Quoted 13 lines

drivers/power/olpc_battery.c static int __init olpc_bat_init(void) · line 408

Quoted 11 lines
drivers/power/olpc_battery.c +6 -1
 	if (!olpc_platform_info.ecver)
 		return -ENXIO;
-	if (olpc_platform_info.ecver < 0x43) {
+
+	/*
+	 * We've seen a number of EC protocol changes; this driver requires
+	 * the latest EC protocol, supported by 0x44 and above.
+	 */
+	if (olpc_platform_info.ecver < 0x44) {
 		printk(KERN_NOTICE "OLPC EC version 0x%02x too old for battery driver.\n", olpc_platform_info.ecver);
 		return -ENXIO;

Now it needs 0x80 :(

You can fight dwmw2 on that one, I'm keeping out of such battles. :)