diff options
author | Scott Chao <scott_chao@wistron.corp-partner.google.com> | 2021-08-24 17:00:11 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-07 18:26:02 +0000 |
commit | ec03c15fd7f73fa7ce3c0308ad847d17e0edc386 (patch) | |
tree | 3ece2e8cf5199d63ecb0386efe41ae94b8598791 /board | |
parent | 3adc4af3ce621a80b32ee7ec3df1adee69ec36dd (diff) | |
download | chrome-ec-ec03c15fd7f73fa7ce3c0308ad847d17e0edc386.tar.gz |
primus: set input current
BUG=b:198682648
BRANCH=none
TEST=make -j BOARD=primus
TEST=verify by power team.
Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com>
Change-Id: Id273828019c08d1c8bb6fe4ea6524250553d6f9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115871
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Commit-Queue: Boris Mittelberg <bmbm@google.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/primus/board.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/board/primus/board.c b/board/primus/board.c index cc8087a6df..0881ab1c86 100644 --- a/board/primus/board.c +++ b/board/primus/board.c @@ -8,6 +8,7 @@ #include "charge_ramp.h" #include "charger.h" #include "common.h" +#include "charge_state_v2.h" #include "compile_time_macros.h" #include "console.h" #include "fw_config.h" @@ -23,6 +24,7 @@ #include "switch.h" #include "throttle_ap.h" #include "usbc_config.h" +#include "util.h" #include "gpio_list.h" /* Must come after other header files. */ @@ -116,3 +118,17 @@ static void keyboard_init(void) set_scancode_set2(0, 11, get_scancode_set2(3, 9)); } DECLARE_HOOK(HOOK_INIT, keyboard_init, HOOK_PRIO_DEFAULT); + +__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 + * 97% negotiated limit. + */ + charge_ma = charge_ma * 97 / 100; + + charge_set_input_current_limit(MAX(charge_ma, + CONFIG_CHARGER_INPUT_CURRENT), + charge_mv); +} |