bd9995x: Don't set charger current in battery profile function

In the function bd9995x_battery_charging_profile_settings, the current
values for trickle, precharge, and fastcharge were being set. Fastcharge
current level was being set via
charger_set_current(PD_MAX_CURRENT_MA). By calling this function with
a non-zero parameter, charging will always be enabled. In addition,
PD_MAX_CURRENT_MA is an input current limit and doesn't neceassrily
apply to the fastcharge current level which would be read from the
fuel gauge. The other side effect is that by enabling charging, VSYS
is being set to battery->voltage_min which reverts VSYS being set to
battery->voltage_max in the init routine.

Per Rohm, all charging profile registers should be set prior to
enabling charging. On Coral, enabling charging at this point was
leading to VSYS collapse when no battery was connected or a fully
depleted battery case. I also believe that enabling charging here
exacerbates other issues we've been running into with low battery
startup cases.

BUG=b:64388515
BRANCH=eve
TEST=On Coral tested both no battery a fully depleted battery
cases. Verified that without the call to charger_set_current() that
VSYS consistently collapses and that after removing this call, the
start up was stable and the battery begins charging.

Change-Id: Ice20ed5d8147fe9ad8faa754286a2ec8a784f8d8
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/602493
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Scott Collyer
2017-08-04 09:36:55 -07:00
committed by chrome-bot
parent 47115a93ef
commit c4e2952531

View File

@@ -741,9 +741,6 @@ static void bd9995x_battery_charging_profile_settings(void)
/* Input Current Limit Setting */
charger_set_input_current(CONFIG_CHARGER_INPUT_CURRENT);
/* Fast-charge & Pre-charge Current Setting */
charger_set_current(PD_MAX_CURRENT_MA);
/* Charge Termination Current Setting */
ch_raw_write16(BD9995X_CMD_ITERM_SET,
bd9995x_charger_info.current_min & 0x07C0,