summaryrefslogtreecommitdiff
path: root/board/poppy/board.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-01-19 16:30:06 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-02 23:53:40 -0800
commitf0532aa93af88268e512b6cb29d8bb9d01252553 (patch)
treecdae15619ee9bb085e5eca4852cc9ab1bddfc798 /board/poppy/board.c
parent4d3c8c1776f4055d999deea6593f499b588430f2 (diff)
downloadchrome-ec-f0532aa93af88268e512b6cb29d8bb9d01252553.tar.gz
charge_state_v2: Safer power transfer between lid and base
To avoid issues where adapter would drive against OTG of lid or base, and to make sure that we do not over-current the adapter, we disconnect the base/lid power transfer whenever a new adapter is connected. We reenable power transfer as needed. We also separate out base current control as a new function, that allows us to record the previous base current only when the base charge control command is successful, and ignore errors until the base is responsive for the first time. Finally, we make sure that charge_allocate_input_current_limit is only called from a single location in charger_task. BRANCH=none BUG=b:71881017 TEST=Plug/unplug base, reset lux EC, connect charger. Base is detected, power allocation works as expected. Change-Id: I8b206d5b0fbcf0fe868b56a0336745aebe2a6dc2 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/880021 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'board/poppy/board.c')
-rw-r--r--board/poppy/board.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/board/poppy/board.c b/board/poppy/board.c
index e56910833a..d5d9a6dac0 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -633,10 +633,10 @@ int board_set_active_charge_port(int charge_port)
gpio_set_level(GPIO_USB_C0_CHARGE_L, 1);
gpio_set_level(GPIO_USB_C1_CHARGE_L, 1);
} else {
- /*
- * TODO(b:67029560): Here, we should make sure that base/lid
- * power is diconnected.
- */
+#ifdef BOARD_LUX
+ /* Disable cross-power with base, charger task will reenable. */
+ board_enable_base_power(0);
+#endif
/* Make sure non-charging port is disabled */
gpio_set_level(charge_port ? GPIO_USB_C0_CHARGE_L :
GPIO_USB_C1_CHARGE_L, 1);