Flapjack: Limit VBUS when charge current is < 1A
Flapjack: Limit VBUS when charge current is < 1A

Currently, when soc is above 85%, the input voltage is limited to 5V.

With this patch, the VBUS limitation is applied when soc > 85% and the
battery input current is below 1A. When discharging, VBUS can be kept
high.

Signed-off-by: Daisuke Nojiri <fd5f93af191bf7e8f73ea71cc3c0f66b41b1dd49@chromium.org>

BRANCH=None
BUG=b/124370341
TEST=Verify Flapjack can charge with a PD charger above 85%.
TEST=Verify VBUS is reduced to 5V when charged through USB-C.
TEST=Verify VBUS is reduced to 5V when charged through WPC.

Change-Id: Ib47d4881e04c68e5e93a2a2292b37c1471b5e79b
Reviewed-on: https://chromium-review.googlesource.com/1573208
Commit-Ready: Daisuke Nojiri <fd5f93af191bf7e8f73ea71cc3c0f66b41b1dd49@chromium.org>
Tested-by: Daisuke Nojiri <fd5f93af191bf7e8f73ea71cc3c0f66b41b1dd49@chromium.org>
Legacy-Commit-Queue: Commit Bot <5c2bf027dc5cc7ef186314391646e49f6866dc00@chromium.org>
Reviewed-by: Yilun Lin <2f2733c7206ea2b76bd2db1905cc5e8a75841c48@chromium.org>
Reviewed-by: Daisuke Nojiri <fd5f93af191bf7e8f73ea71cc3c0f66b41b1dd49@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec