summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2015-08-21 17:53:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-10 12:35:39 -0700
commitdda0704bf96e04fbbe979ce721a14c3c12b8f45f (patch)
tree9fb7e4fc9510a838a0e3c5ea35b9d52943606153 /driver
parentaca33e4de2c07a3ab7973c2550818b214ffa6395 (diff)
downloadchrome-ec-dda0704bf96e04fbbe979ce721a14c3c12b8f45f.tar.gz
Driver: ISL9237: Enable trickle charging
Enabled the trickle charging mode by setting the MinSystemVoltage register[0x3EH] to board specific battery voltage minimum value. When the battery voltage drops below the battery voltage minimum value, trickle charging enabled. BUG=none TEST=Manually tested on Kunimitsu FAB4 prototype. Drained the battery below voltage minimum value. Using the i2cxfer command observed Trickle charging mode is active in the information register[0x3AH]. BRANCH=none Change-Id: Id6416f2b0b74fda8cf3eafb95e044586f90b8a8e Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/298143 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Rong Chang <rongchang@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/charger/isl9237.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/driver/charger/isl9237.c b/driver/charger/isl9237.c
index 39070bf766..4df9e53e48 100644
--- a/driver/charger/isl9237.c
+++ b/driver/charger/isl9237.c
@@ -214,6 +214,14 @@ int charger_set_voltage(int voltage)
int charger_post_init(void)
{
+#ifdef CONFIG_TRICKLE_CHARGING
+ int rv;
+ const struct battery_info *bi = battery_get_info();
+
+ rv = raw_write16(ISL9237_REG_SYS_VOLTAGE_MIN, bi->voltage_min);
+ if (rv)
+ return rv;
+#endif
return EC_SUCCESS;
}