[Balloon-svn] r1870 - balloon/branches/menuconfig2/package/k…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: subversion@balloonboard.org
Date:  
To: balloon-svn
Subject: [Balloon-svn] r1870 - balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4
Author: nick
Date: 2012-05-04 16:41:00 +0100 (Fri, 04 May 2012)
New Revision: 1870

Modified:
balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/battery-tt.patch
Log:
ensure transit mode is turned off by default

Modified: balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/battery-tt.patch
===================================================================
--- balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/battery-tt.patch    2012-05-04 09:14:09 UTC (rev 1869)
+++ balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/battery-tt.patch    2012-05-04 15:41:00 UTC (rev 1870)
@@ -1,7 +1,7 @@
 Index: linux-2.6.39.4/drivers/power/Kconfig
 ===================================================================
---- linux-2.6.39.4.orig/drivers/power/Kconfig    2012-05-01 15:44:55.000000000 +0100
-+++ linux-2.6.39.4/drivers/power/Kconfig    2012-05-01 15:59:38.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/power/Kconfig    2011-08-03 20:43:28.000000000 +0100
++++ linux-2.6.39.4/drivers/power/Kconfig    2012-05-02 09:35:11.000000000 +0100
 @@ -219,4 +219,17 @@
        This driver can be build as a module. If so, the module will be
        called gpio-charger.
@@ -22,8 +22,8 @@
  endif # POWER_SUPPLY
 Index: linux-2.6.39.4/drivers/power/Makefile
 ===================================================================
---- linux-2.6.39.4.orig/drivers/power/Makefile    2012-05-01 15:44:55.000000000 +0100
-+++ linux-2.6.39.4/drivers/power/Makefile    2012-05-01 15:59:38.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/power/Makefile    2011-08-03 20:43:28.000000000 +0100
++++ linux-2.6.39.4/drivers/power/Makefile    2012-05-02 09:35:11.000000000 +0100
 @@ -34,3 +34,4 @@
  obj-$(CONFIG_CHARGER_ISP1704)    += isp1704_charger.o
  obj-$(CONFIG_CHARGER_TWL4030)    += twl4030_charger.o
@@ -32,8 +32,8 @@
 Index: linux-2.6.39.4/drivers/power/tt_battery.c
 ===================================================================
 --- /dev/null    1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.39.4/drivers/power/tt_battery.c    2012-05-01 17:05:53.000000000 +0100
-@@ -0,0 +1,468 @@
++++ linux-2.6.39.4/drivers/power/tt_battery.c    2012-05-04 15:14:07.000000000 +0100
+@@ -0,0 +1,476 @@
 +/*
 + * Battery and Power Management code for the Bubble TT device
 + * Copyright (c) 2011 Nick Bane
@@ -137,7 +137,7 @@
 +*/
 +
 +
-+static int transit_mode = 0;
++static int transit_mode;
 +
 +static ssize_t
 +show_transitmode(struct device *dev, struct device_attribute *attr, char *buf)
@@ -145,6 +145,10 @@
 +    return sprintf(buf, "%s\n", transit_mode ? "1":"0");
 +}
 +
++static void update_transitmode(void) {
++    samosa_write8(transit_mode ? SAMOSA_ADDR_CONTROL_REG_2_SET : SAMOSA_ADDR_CONTROL_REG_2_CLR, 1 << POWER_TRANSIT_ON_BIT);
++}
++
 +static
 +ssize_t set_transitmode(struct device *dev,
 +        struct device_attribute *attr, const char *buf, size_t count)
@@ -155,7 +159,7 @@
 +        return -EINVAL;
 +
 +    transit_mode = (int)tmp;
-+    samosa_write8(transit_mode ? SAMOSA_ADDR_CONTROL_REG_2_SET : SAMOSA_ADDR_CONTROL_REG_2_CLR, 1 << 6);
++    update_transitmode();
 +
 +    return count;
 +}
@@ -440,6 +444,10 @@
 +    if (ret)
 +        dev_err(&dev->dev, "failed to create sysfs entries\n");
 +
++    // assert transit mode off
++    transit_mode = 0;
++    update_transitmode();
++
 +    schedule_delayed_work(&bat_work, msecs_to_jiffies(250));
 +
 +    pr_info("%s: added tt-battery support\n", __func__);