diff options
author | Yilun Lin <yllin@chromium.org> | 2019-11-14 16:16:21 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-15 10:19:48 +0000 |
commit | 24eb7b805927e482d2cbdca2505734e6ae64700c (patch) | |
tree | b18bf5dfa7e2de590fb4c85d7b34c17fd4beea7a /board/jacuzzi/board.c | |
parent | fe55d00fbc8587cd349eafe0cadecc8b3c766096 (diff) | |
download | chrome-ec-24eb7b805927e482d2cbdca2505734e6ae64700c.tar.gz |
kukui,kodama,jacuzzi: fix charge/discharge control setting order
Should enable charge first then the charge port can function normally.
Besides, for device using mt6370 and in force discharge mode,
mt6370 would receive a DPDM detach event and release BC1.2
charge supply info. We should force BC1.2 detection again to
recognize BC1.2 device again.
TEST=on krane 'ectool chargecontrol discharge;
ectool chargecontrol normal' and see the charge is
charging.
BUG=b:143045248
BRANCH=kukui
Change-Id: I72481dfddf48b1e274d8d81f8d9223ccb8295c72
Signed-off-by: Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1916160
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board/jacuzzi/board.c')
-rw-r--r-- | board/jacuzzi/board.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c index f8274dd6a5..1dd26c0e4b 100644 --- a/board/jacuzzi/board.c +++ b/board/jacuzzi/board.c @@ -140,7 +140,7 @@ int board_set_active_charge_port(int charge_port) CPRINTS("New chg p%d", charge_port); /* ignore all request when discharge mode is on */ - if (force_discharge) + if (force_discharge && charge_port != CHARGE_PORT_NONE) return EC_SUCCESS; switch (charge_port) { @@ -186,12 +186,12 @@ int board_discharge_on_ac(int enable) port = charge_manager_get_active_charge_port(); } - ret = board_set_active_charge_port(port); + ret = charger_discharge_on_ac(enable); if (ret) return ret; - force_discharge = enable; - return charger_discharge_on_ac(enable); + force_discharge = enable; + return board_set_active_charge_port(port); } int pd_snk_is_vbus_provided(int port) |