power: pm8921-bms: charging curve adjustments
It was observed that while charging the reported soc sometimes reaches
100% before end of charging happens. At other times it does not reach
100% at end of charge and a abrupt jump to 100% soc happens.
Fix this by linearly increasing soc based on battery charge current
after constant voltage phase is reached. Constant voltage phase is
reached when battery voltage reaches the max value.
Also once constant voltage phase is reached and the voltage or charge
current decreases keep reporting the earlier soc. This could be because
of a transient system load.
Change-Id: I14c2f42d7897041db038ce85ce1124cf1ef261af
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8960-pmic.c b/arch/arm/mach-msm/board-8960-pmic.c
index 46d317b..8d75ee9 100644
--- a/arch/arm/mach-msm/board-8960-pmic.c
+++ b/arch/arm/mach-msm/board-8960-pmic.c
@@ -394,6 +394,7 @@
};
#define MAX_VOLTAGE_MV 4200
+#define CHG_TERM_MA 100
static struct pm8921_charger_platform_data pm8921_chg_pdata __devinitdata = {
.safety_time = 180,
.update_time = 60000,
@@ -401,7 +402,7 @@
.min_voltage = 3200,
.uvd_thresh_voltage = 4050,
.resume_voltage_delta = 100,
- .term_current = 100,
+ .term_current = CHG_TERM_MA,
.cool_temp = 10,
.warm_temp = 40,
.temp_check_period = 1,
@@ -420,13 +421,14 @@
};
static struct pm8921_bms_platform_data pm8921_bms_pdata __devinitdata = {
- .battery_type = BATT_UNKNOWN,
- .r_sense = 10,
- .v_cutoff = 3400,
- .max_voltage_uv = MAX_VOLTAGE_MV * 1000,
- .rconn_mohm = 18,
- .shutdown_soc_valid_limit = 20,
- .adjust_soc_low_threshold = 25,
+ .battery_type = BATT_UNKNOWN,
+ .r_sense = 10,
+ .v_cutoff = 3400,
+ .max_voltage_uv = MAX_VOLTAGE_MV * 1000,
+ .rconn_mohm = 18,
+ .shutdown_soc_valid_limit = 20,
+ .adjust_soc_low_threshold = 25,
+ .chg_term_ua = CHG_TERM_MA * 1000,
};
#define PM8921_LC_LED_MAX_CURRENT 4 /* I = 4mA */