ARM: Tegra: TT-power: set current threshold
Hyongbin Kim [Mon, 12 Aug 2013 05:35:46 +0000 (14:35 +0900)]
Set ina230 current threshold in low SOC.
1.8A under 4% SOC and 2.5A under 8% SOC.
This change has trade off against performence drop at low SOC.

Bug 1316595
Bug 1304204

Change-Id: I6e397277729f2570e29ee3f36170e9c6dfe08467
Signed-off-by: Hyongbin Kim <hyongbink@nvidia.com>
Reviewed-on: http://git-master/r/260356
(cherry picked from commit 73fe77b1752b75f5cfdfd5d3d332856791f81ec1)
Reviewed-on: http://git-master/r/289149
Reviewed-by: Gabby Lee <galee@nvidia.com>
Tested-by: Gabby Lee <galee@nvidia.com>

arch/arm/boot/dts/tegra114-tegratab-common.dtsi
arch/arm/mach-tegra/board-tegratab-power.c
arch/arm/mach-tegra/board-tegratab-powermon.c
arch/arm/mach-tegra/board-tegratab.h

index 2f8c0db..bebcd27 100644 (file)
                                0x70 0xC0 0x51 0x40 0x43 0xE0 0x43 0xC0
                                0x29 0xC0 0x2F 0xC0 0x17 0xE0 0x12 0xE0
                                0x1C 0x20 0x13 0x80 0x0E 0x00 0x0E 0x00>;
+                       set_current_threshold = "ina230";
+                       current_normal = <4500>;        /* 4.5A */
+                       current_threshold_num = <2>;
+                       current_threshold_soc = <4 8>;
+                       current_threshold = <1800 2500>;
                };
        };
 
index 855020b..ed4d303 100644 (file)
@@ -120,6 +120,11 @@ struct max17048_battery_model tegratab_max17048_mdata = {
 
 struct max17048_platform_data tegratab_max17048_pdata = {
        .model_data = &tegratab_max17048_mdata,
+       .set_current_threshold = ina230_set_current_threshold,
+       .current_normal = TEGRATAB_BATTERY_MAX_CURRENT,
+       .current_threshold_num = 2,
+       .current_threshold_soc = {4, 8},
+       .current_threshold = {1800, 2500},
 };
 
 static struct i2c_board_info __initdata tegratab_max17048_boardinfo[] = {
index 9dcb1b5..820e494 100644 (file)
@@ -336,7 +336,7 @@ static struct ina230_platform_data power_mon_ina230_info[] = {
                /* Current threshold for detect system overcurrent.
                   Yoku(4100mA/3.7V) suggest 4.5A for max continuous
                   discharge current. It is 6.5A in datasheet. */
-               .current_threshold = 4500,
+               .current_threshold = TEGRATAB_BATTERY_MAX_CURRENT,
                .shunt_polarity_inverted = 1,
        }
 };
index 70cb2a8..eb8aacd 100644 (file)
@@ -126,4 +126,5 @@ enum tegra_bb_type {
 #define UTMI2_PORT_OWNER_XUSB  0x2
 #define HSIC1_PORT_OWNER_XUSB  0x4
 
+#define TEGRATAB_BATTERY_MAX_CURRENT   4500
 #endif