diff options
Diffstat (limited to 'board/kukui')
-rw-r--r-- | board/kukui/board.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/board/kukui/board.c b/board/kukui/board.c index f388dca751..21d77589fe 100644 --- a/board/kukui/board.c +++ b/board/kukui/board.c @@ -161,7 +161,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) { @@ -209,12 +209,15 @@ 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); + if (force_discharge && !enable) + rt946x_toggle_bc12_detection(); + + force_discharge = enable; + return board_set_active_charge_port(port); } #ifndef VARIANT_KUKUI_POGO_KEYBOARD |