diff options
author | tony.tang <tony.tang@lcfc.corp-partner.google.com> | 2021-12-29 13:13:33 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-12-30 03:56:38 +0000 |
commit | 3c66a8ed924f30eeae2f15bcf44a89591d981155 (patch) | |
tree | 58f4c0fcddaa0dff5def277c5768e2f032a71038 | |
parent | b566adf633b2f1ec562dd94ce6e4503c531657a5 (diff) | |
download | chrome-ec-3c66a8ed924f30eeae2f15bcf44a89591d981155.tar.gz |
taniks: Set input current as 95% of adapter rating
BRANCH=brya
BUG=b:211101601, b:210073795
TEST=make buildall -j
verify pass by power team
Signed-off-by: tony.tang <tony.tang@lcfc.corp-partner.google.com>
Change-Id: I3f2348575c180ecb4a0b07d912673a027942c382
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3360319
Reviewed-by: caveh jalali <caveh@chromium.org>
-rw-r--r-- | board/taniks/board.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/board/taniks/board.c b/board/taniks/board.c index c3b496d9ce..80be70ca27 100644 --- a/board/taniks/board.c +++ b/board/taniks/board.c @@ -5,7 +5,9 @@ #include "battery.h" #include "button.h" +#include "charge_manager.h" #include "charge_ramp.h" +#include "charge_state_v2.h" #include "charger.h" #include "common.h" #include "compile_time_macros.h" @@ -109,3 +111,17 @@ enum battery_present battery_hw_present(void) /* The GPIO is low when the battery is physically present */ return gpio_get_level(GPIO_EC_BATT_PRES_ODL) ? BP_NO : BP_YES; } + +__override void board_set_charge_limit(int port, int supplier, int charge_ma, + int max_ma, int charge_mv) +{ + /* + * Follow OEM request to limit the input current to + * 95% negotiated limit. + */ + charge_ma = charge_ma * 95 / 100; + + charge_set_input_current_limit(MAX(charge_ma, + CONFIG_CHARGER_INPUT_CURRENT), + charge_mv); +}
\ No newline at end of file |