From subversion@balloonboard.org Tue May 01 17:33:18 2012
Received: from nick by stoneboat.aleph1.co.uk with local (Exim 4.72)
	(envelope-from <subversion@balloonboard.org>) id 1SPG0s-0007D3-OT
	for balloon-svn@balloonboard.org; Tue, 01 May 2012 17:33:18 +0100
Message-Id: <E1SPG0s-0007D3-OT@stoneboat.aleph1.co.uk>
Date: Tue,  1 May 2012 17:33:18 +0100
To: balloon-svn@balloonboard.org
From: subversion@balloonboard.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-SA-Exim-Connect-IP: <locally generated>
X-SA-Exim-Mail-From: subversion@balloonboard.org
X-SA-Exim-Scanned: No (on stoneboat.aleph1.co.uk);
	SAEximRunCond expanded to false
Subject: [Balloon-svn] r1862 -
	balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4
X-BeenThere: balloon-svn@balloonboard.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <balloon-svn.balloonboard.org>
List-Unsubscribe: <http://balloonboard.org/cgi-bin/mailman/options/balloon-svn>, 
	<mailto:balloon-svn-request@balloonboard.org?subject=unsubscribe>
List-Archive: <http://balloonboard.org/lurker/list/balloon-svn.html>
List-Post: <mailto:balloon-svn@balloonboard.org>
List-Help: <mailto:balloon-svn-request@balloonboard.org?subject=help>
List-Subscribe: <http://balloonboard.org/cgi-bin/mailman/listinfo/balloon-svn>, 
	<mailto:balloon-svn-request@balloonboard.org?subject=subscribe>
X-List-Received-Date: Tue, 01 May 2012 16:33:18 -0000

Author: nick
Date: 2012-05-01 17:33:18 +0100 (Tue, 01 May 2012)
New Revision: 1862

Modified:
   balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/battery-tt.patch
Log:
add transit mode sysfs entry

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-04-27 10:41:18 UTC (rev 1861)
+++ balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/battery-tt.patch	2012-05-01 16:33:18 UTC (rev 1862)
@@ -1,7 +1,7 @@
 Index: linux-2.6.39.4/drivers/power/Kconfig
 ===================================================================
---- linux-2.6.39.4.orig/drivers/power/Kconfig	2012-04-17 13:41:35.000000000 +0100
-+++ linux-2.6.39.4/drivers/power/Kconfig	2012-04-17 13:41:42.000000000 +0100
+--- 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
 @@ -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-04-17 13:41:35.000000000 +0100
-+++ linux-2.6.39.4/drivers/power/Makefile	2012-04-17 13:41:42.000000000 +0100
+--- 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
 @@ -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-04-19 13:34:03.000000000 +0100
-@@ -0,0 +1,442 @@
++++ linux-2.6.39.4/drivers/power/tt_battery.c	2012-05-01 17:05:53.000000000 +0100
+@@ -0,0 +1,468 @@
 +/*
 + * Battery and Power Management code for the Bubble TT device
 + * Copyright (c) 2011 Nick Bane
@@ -136,15 +136,41 @@
 +}
 +*/
 +
++
++static int transit_mode = 0;
++
++static ssize_t
++show_transitmode(struct device *dev, struct device_attribute *attr, char *buf)
++{
++	return sprintf(buf, "%s\n", transit_mode ? "1":"0");
++}
++
++static
++ssize_t set_transitmode(struct device *dev,
++		struct device_attribute *attr, const char *buf, size_t count)
++{
++	unsigned long tmp;
++	int ret = strict_strtoul(buf, 10, &tmp);
++	if (ret)
++		return -EINVAL;
++
++	transit_mode = (int)tmp;
++	samosa_write8(transit_mode ? SAMOSA_ADDR_CONTROL_REG_2_SET : SAMOSA_ADDR_CONTROL_REG_2_CLR, 1 << 6);
++
++	return count;
++}
++
 +static DEVICE_ATTR(vbus, S_IRUGO, show_vbus, NULL);
 +static DEVICE_ATTR(adc, S_IRUGO, show_adc, NULL);
 +//static DEVICE_ATTR(fastcharge, S_IRUGO | S_IWUSR, show_fastcharge, set_fastcharge);
 +static DEVICE_ATTR(fastcharge, S_IRUGO | S_IWUSR, show_fastcharge, NULL);
++static DEVICE_ATTR(transitmode, S_IRUGO | S_IWUSR, show_transitmode, set_transitmode);
 +
 +static struct attribute *tt_bat_sysfs_entries[] = {
 +	&dev_attr_vbus.attr,
 +	&dev_attr_adc.attr,
 +	&dev_attr_fastcharge.attr,
++	&dev_attr_transitmode.attr,
 +	NULL,
 +};
 +


