summaryrefslogtreecommitdiff
path: root/common/charge_state_v2.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-01-09 16:31:44 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-01-10 06:02:13 -0800
commit31e68a035b83acf13b73f3b5b63fbb99540faea9 (patch)
treee9d3af5cb1d176487fd1994a70eba4f86949df50 /common/charge_state_v2.c
parent1caa2788c5198f3a89e022a559191b27b93adada (diff)
downloadchrome-ec-31e68a035b83acf13b73f3b5b63fbb99540faea9.tar.gz
driver/charger/isl923x: Make sure CONFIG_CHARGER_NARROW_VDC is set
Without this, the battery will discharge if we disallow battery charging (e.g. calling charge_request with either voltage == 0 or current == 0, either by policy, or when the battery is full). Also update config.h to set the option whenever isl923x is used. BRANCH=none BUG=b:66575472 BUG=b:35585464 TEST=make buildall -j Change-Id: Id5515d5ea82a393a3693a3da44cbdc2778296a95 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/856538 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/charge_state_v2.c')
-rw-r--r--common/charge_state_v2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 4ecc48fbcd..71d46265a5 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -546,7 +546,11 @@ static int charge_request(int voltage, int current)
if (!voltage || !current) {
#ifdef CONFIG_CHARGER_NARROW_VDC
current = 0;
- /* With NVDC charger, keep VSYS voltage higher than battery */
+ /*
+ * With NVDC charger, keep VSYS voltage higher than battery,
+ * otherwise the BGATE FET body diode would conduct and
+ * discharge the battery.
+ */
voltage = charger_closest_voltage(
curr.batt.voltage + charger_get_info()->voltage_step);
/* If the battery is full, request the max voltage. */