summaryrefslogtreecommitdiff
path: root/common/charge_state_v2.c
diff options
context:
space:
mode:
authorJames Chao <james_chao@asus.com>2017-04-24 12:06:23 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-04-30 22:50:54 -0700
commit92d3c8f6c8c1ad36b7ee7630f36b2a436a72a709 (patch)
tree851e16ff33547d4a0f26f578a1e6e988955a1a6d /common/charge_state_v2.c
parenta12bf17be9134dd163f891ba7d0900f02f349849 (diff)
downloadchrome-ec-92d3c8f6c8c1ad36b7ee7630f36b2a436a72a709.tar.gz
BD9995X: Enable/Disable charger depending on charging current
If charging current is set to 0mA during charging, reference of charge current feedback amp (VREF_CHG) is set to 0V. Hence the DCDC stops switching (because of the EA offset). To eliminate this issue, disable/enable charger depending on the charging current is zero or non-zero respectively. BUG=b:37413065 BRANCH=reef TEST=test 'ectool chargecontrol normal/idle/discharge' are working Change-Id: Id31876afe365a476fb906e059ab519b7a0c9a7c6 Signed-off-by: james_chao <james_chao@asus.com> Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/486101 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> (cherry picked from commit 6da9ed8786e90ee91b39934180fe84e01ac30260) Reviewed-on: https://chromium-review.googlesource.com/489812 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Diffstat (limited to 'common/charge_state_v2.c')
-rw-r--r--common/charge_state_v2.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index a7b1ddf708..5810f9c8fd 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -441,12 +441,7 @@ static int charge_request(int voltage, int current)
* Set the charge inhibit bit when possible as it appears to save
* power in some cases (e.g. Nyan with BQ24735).
*/
-#if defined(CONFIG_CHARGER_BD99955) || defined(CONFIG_CHARGER_BD99956)
- /* Charger auto exits from battery learn mode if charge inhibited */
- if (current > 0 || chg_ctl_mode == CHARGE_CONTROL_DISCHARGE)
-#else
if (voltage > 0 || current > 0)
-#endif
r3 = charger_set_mode(0);
else
r3 = charger_set_mode(CHARGE_FLAG_INHIBIT_CHARGE);