diff options
author | Ting Shen <phoenixshen@google.com> | 2019-06-04 17:36:18 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-19 13:26:37 +0000 |
commit | de2a794a228ea8aa86f4d4c5c21c99150f4688f6 (patch) | |
tree | 65e1ee78b839ad7b6981006784e4f50e5b9f34ae | |
parent | 5cffaa236f7e0ef1658a009fc32bf19d22cac700 (diff) | |
download | chrome-ec-de2a794a228ea8aa86f4d4c5c21c99150f4688f6.tar.gz |
krane: limit input power to 5V/2A in S0
This is a short term fix to prevent charger overheat.
BUG=b:134227872
TEST=manually, boot with the new fw and measure the power.
BRANCH=master
Change-Id: I88c3444f0a0c0c9a755579fcb1f9c52fc032a179
Signed-off-by: Ting Shen <phoenixshen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1642478
Tested-by: Tony Lin <tonycwlin@google.com>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Yilun Lin <yllin@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
-rw-r--r-- | board/kukui/battery.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/board/kukui/battery.c b/board/kukui/battery.c index 6a01322b89..8cf9299f41 100644 --- a/board/kukui/battery.c +++ b/board/kukui/battery.c @@ -15,6 +15,7 @@ #include "extpower.h" #include "gpio.h" #include "hooks.h" +#include "power.h" #include "usb_pd.h" #include "util.h" @@ -211,10 +212,20 @@ int charger_profile_override(struct charge_state_data *curr) /* Limit input (=VBUS) to 5V when soc > 85% and charge current < 1A. */ if (!(curr->batt.flags & BATT_FLAG_BAD_CURRENT) && charge_get_percent() > BAT_LEVEL_PD_LIMIT && - curr->batt.current < 1000) + curr->batt.current < 1000) { chg_limit_mv = 5500; - else + } else if (IS_ENABLED(BOARD_KRANE) && + board_get_version() == 3 && + power_get_state() == POWER_S0) { + /* + * TODO(b:134227872): limit power to 5V/2A in S0 to prevent + * overheat + */ + chg_limit_mv = 5500; + curr->requested_current = 2000; + } else { chg_limit_mv = PD_MAX_VOLTAGE_MV; + } if (chg_limit_mv != previous_chg_limit_mv) CPRINTS("VBUS limited to %dmV", chg_limit_mv); |