summaryrefslogtreecommitdiff
path: root/driver/charger/bd9995x.h
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2017-03-15 18:15:27 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-03 20:31:40 -0700
commitce65199e5ed75bf8ab4cc3a4f9abae85f63f1a02 (patch)
tree3b381dff8a99de4c7478031cb8c6c8e3009b1b7e /driver/charger/bd9995x.h
parent698cf1e2682ca8e13f1af9aeba4351add610d86f (diff)
downloadchrome-ec-ce65199e5ed75bf8ab4cc3a4f9abae85f63f1a02.tar.gz
BD9995X: Disable input current limiting for VBAT < VSYSREG_SET
The initial value for input current limit is set to CONFIG_CHARGER_INPUT_CURRENT which is typically 512 mA. In deeply discharged battery cases (Vbat < 5.8V), the 512 mA input current limit can cause VSYS to collapse which in turn causes the EC to reset. Depending on how discharged the battery is, the EC may remain off until the external charger is disconnected and reconnected again, or it may undergo a number of reset cycles, each time charging the battery just a little, until Vbat becomes > ~5.8V and the charger is able to stabilize. When the charger type is determined, either from BCD detection, or Type C/USB PD, the input current limit is set to the appropriate level. In order to avoid the issue described above, this CL sets a bit in the VIN_CTRL_SET register which will disable the input current limit in cases Where the VBAT is less than the VSYSREG_SET value. BUG=b:35648317 BRANCH=none TEST=Manually tested on Electro. a. With Zinger attached DUT boots without the battery after plugging in AC b. DUT boots from cut-off battery c. With Zinger attached DUT boots from cold-reset without the battery d. With no battery & DCP charger, anti-collapse occurs, input current is limited to 512mA & the DUT is power-up inhibited. Tested also on Eve with signal wires attached to both PPVAR_VSYS, PP3300_DSW, and Vbat. Verified that on certain boards (some board to board variation) that PPVAT_VSYS would collapse when the input current limit was set to CONFIG_CHARGER_INPUT_CURRENT. Then after adding this CL, verifed on the scope that the collapse of PPVAR_VSYS no longer occurred. Change-Id: Ief9960550f988e69ab4637db85450e91c70d3b51 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/456049 Commit-Ready: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com>
Diffstat (limited to 'driver/charger/bd9995x.h')
-rw-r--r--driver/charger/bd9995x.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/driver/charger/bd9995x.h b/driver/charger/bd9995x.h
index 2799973584..892e76cf10 100644
--- a/driver/charger/bd9995x.h
+++ b/driver/charger/bd9995x.h
@@ -94,6 +94,8 @@ enum bd9995x_charge_port {
#define BD9995X_CMD_EXT_ICC_LIM_SET 0x08
#define BD9995X_CMD_IOTG_LIM_SET 0x09
#define BD9995X_CMD_VIN_CTRL_SET 0x0A
+#define BD9995X_CMD_VIN_CTRL_SET_VSYS_PRIORITY (1 << 4)
+
#define BD9995X_CMD_VIN_CTRL_SET_PP_BOTH_THRU (1 << 11)
#define BD9995X_CMD_VIN_CTRL_SET_VBUS_PRIORITY (1 << 7)
#define BD9995X_CMD_VIN_CTRL_SET_VBUS_EN (1 << 6)