summaryrefslogtreecommitdiff
path: root/board/poppy
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2017-09-08 12:05:33 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-01-26 13:25:38 -0800
commite5c6f97d1a4a1fa5ad17c2bab4e316a47b8def9a (patch)
tree88986d177cc58fd4c4f039cca41bc532ccb1a418 /board/poppy
parentecfa69663813ec41aa79ed01c4af2f36723fe194 (diff)
downloadchrome-ec-e5c6f97d1a4a1fa5ad17c2bab4e316a47b8def9a.tar.gz
charge_state_v2: Basic dual-battery charging algorithm
First version of the algorithm, some TODOs are left in the code but this, generally, works reasonably well. When charging, we allocate input current in this general order: - Base system (fixed, low, number) - Lid system (based on PSYS) - Lid battery (estimating how much current the battery actually requires) - Base battery (similar estimation) - Provide everything else to lid When discharging, we generally: - First discharge the base battery - Then discharge the lid battery BRANCH=none BUG=b:71881017 TEST=Flash lux and wand, EC-EC communication works, adapter power is split in a sensible way, and discharging works fine. Change-Id: I8a4f87963962fc5466b2fedf1347eb4dadd35740 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/659460 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'board/poppy')
-rw-r--r--board/poppy/board.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/board/poppy/board.c b/board/poppy/board.c
index 8103ed5d67..9ed130fc03 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -632,6 +632,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.
+ */
/* Make sure non-charging port is disabled */
gpio_set_level(charge_port ? GPIO_USB_C0_CHARGE_L :
GPIO_USB_C1_CHARGE_L, 1);