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

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: subversion@balloonboard.org
日付:  
To: balloon-svn
題目: [Balloon-svn] r1862 - balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4
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,
 +};
 +