summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Zhang <ryan.zhang.quanta@gmail.com>2017-01-12 17:59:16 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-13 21:48:47 -0800
commitf4c99dfd27c6d95a516f748b15318b0a95c5d543 (patch)
treef577959fa3a4f18c48488c0f4d7cc51e1d7dab2b
parent6a7e4a7b353c53d33d44662c71763490ffd1fdc4 (diff)
downloadchrome-ec-f4c99dfd27c6d95a516f748b15318b0a95c5d543.tar.gz
Electro: limit max input current for safety
+ Max = Max * 95% BUG=chrome-os-partner:61852 BRANCH=reef TEST=Run fish tank + youtube + USB 0.9A * 2 + TypeC 3A * 1 + empty battery, input current from 3.033A become 2.92A Change-Id: I34563a011915c29972835f7d878cad29045d42f0 Signed-off-by: Ryan Zhang <Ryan.Zhang@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/427485 Commit-Ready: Benson Leung <bleung@chromium.org> Tested-by: Benson Leung <bleung@chromium.org> Reviewed-by: Benson Leung <bleung@google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/reef/board.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/board/reef/board.c b/board/reef/board.c
index 8b7a9cecb2..0a91bd7069 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -608,6 +608,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
if (bd9995x_bc12_enable_charging(port, bc12_enable))
return;
+ charge_ma = (charge_ma * 95) / 100;
charge_set_input_current_limit(MAX(charge_ma,
CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
}