summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-03-22 14:45:17 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-03-22 19:54:40 -0700
commit719f5d6d01ea6a4afb239b2e58600ec854faa8ad (patch)
tree8e530fec0f4284d6c8bdacc5c7a16a2eaa0ee14d
parent6ea879339475c05475e31bc5d5263baf995e06a1 (diff)
downloadchrome-ec-719f5d6d01ea6a4afb239b2e58600ec854faa8ad.tar.gz
charger: isl9237: Report nominal current limit as ramp current
isl9237 uses HW ramping but has no way to monitor the ramp current. Zero is not a good estimate of the ramp current and scares users into thinking their device isn't charging, so use the nominal current limit instead. BUG=chrome-os-partner:51286 BRANCH=Glados TEST=Verify "ectool usbpdpower" on chell reports "14xxxmV / 2668mA" rather than "... / 0mA" with stock charger attached. Change-Id: I0a29c8092b4994fda68dc3db8e02be2e0f234fd9 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/334237 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit cef36e872f72db9e060dd0cc7e5bced3062fbfd1) Reviewed-on: https://chromium-review.googlesource.com/334395 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--driver/charger/isl9237.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/driver/charger/isl9237.c b/driver/charger/isl9237.c
index de69b4e9f7..e1ad06ad75 100644
--- a/driver/charger/isl9237.c
+++ b/driver/charger/isl9237.c
@@ -313,8 +313,15 @@ int chg_ramp_is_detected(void)
int chg_ramp_get_current_limit(void)
{
- /* ISL doesn't have a way to get this info */
- return 0;
+ /*
+ * ISL doesn't have a way to get this info, so return the nominal
+ * current limit as an estimate.
+ */
+ int input_current;
+
+ if (charger_get_input_current(&input_current) != EC_SUCCESS)
+ return 0;
+ return input_current;
}
#endif /* CONFIG_CHARGE_RAMP_HW */