summaryrefslogtreecommitdiff
path: root/include/charge_manager.h
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2019-05-08 15:52:18 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-05-14 23:57:49 -0700
commit1598a615eb150916ea323e212b87298c3a6fcfb6 (patch)
tree073d65cfd6d64055e0ab07d042144376c61d2938 /include/charge_manager.h
parentf2dcc64ad4d7f2bca17410e8b2036f31b0499745 (diff)
downloadchrome-ec-1598a615eb150916ea323e212b87298c3a6fcfb6.tar.gz
charge_manager: Revisit charge supplier priority.stabilize-12206.B
According to USB-C spec 1.3 Table 4-17 "Precedence of power source usage", the supplier's priority should be: USB-C 3.0A/1.5A > BC1.2 > USB-C under 1.5A. This CL propose to raise the BC1.2 priority to fix that charge_manager won't choose BC1.2 when the port reports it can supply both TYPEC 500ma and BC1.2 supplier. According to the spec mentioned aboved, we should prefer BC1.2 rather than TYPEC. Besdies, charge_manager is able to pick the supplier which provides the higheste power. The CL simplifies the supplier priority a bit by taking advantage of the feature. TEST=Charge kukui with 5V/2A charger and see it can drain 1.34A (DCP current bound of mt6370 is 1.5A) rather than 0.5A. TEST=Charge kukui with Type-C 5V3A/CDP/DCP/SDP/PD charger randomly and see that the current it drains is reasonable. TEST=Charge soraka with 'A', and plug another port with 'B', and see it can transist the sinking port from A to B. Here (A, B) are: 1. (SDP 5V0.5A, Type-C 5V3A) 2. (CDP 5V1.5A, PD) 3. (SDP 5V0.5A, CDP 5V1.5A) 4. (CDP 5V1.5A, Type-C 5V3A) 5. (Type-C 5V3A, PD) BUG=b:131126720 BRANCH=None Change-Id: I46384e09d764aa926129358657d0593fca4923c2 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1581859 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/charge_manager.h')
-rw-r--r--include/charge_manager.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/charge_manager.h b/include/charge_manager.h
index 6177408acb..cb32eb623d 100644
--- a/include/charge_manager.h
+++ b/include/charge_manager.h
@@ -39,6 +39,7 @@ enum charge_supplier {
CHARGE_SUPPLIER_BC12_CDP,
CHARGE_SUPPLIER_BC12_SDP,
CHARGE_SUPPLIER_PROPRIETARY,
+ CHARGE_SUPPLIER_TYPEC_UNDER_1_5A,
CHARGE_SUPPLIER_OTHER,
CHARGE_SUPPLIER_VBUS,
#endif /* CHARGE_MANAGER_BC12 */