summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2018-05-31 23:13:58 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-06-04 13:31:21 -0700
commitb49d5872e9eacae9cee17c9bf011835bc5e3eb45 (patch)
treea15d2b44784056750ff204730c2c413815b0973d /driver
parentedbfb3a43b6c4e1dd28f6d00a59896cae198f68b (diff)
downloadchrome-ec-b49d5872e9eacae9cee17c9bf011835bc5e3eb45.tar.gz
bq25703: Report actual input current limit
IIN_DPM register reflects the actual input current limit programmed in the register, either from host or from ICO. After ICO, the current limit used by DPM regulation may differ from the IIN_HOST register settings. BUG=b:80279932 BRANCH=none TEST=Manually tested on BIP Used BC1.2 DCP charger 'charger' command yield 900mA while charge ramp set to 2.4A. Change-Id: I6389205bd70d7729e9dd810fef3dfbf83a7d8c65 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1080343 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/charger/bq25703.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/driver/charger/bq25703.c b/driver/charger/bq25703.c
index 0054168a59..55e90ee7e3 100644
--- a/driver/charger/bq25703.c
+++ b/driver/charger/bq25703.c
@@ -228,7 +228,13 @@ int charger_get_input_current(int *input_current)
{
int rv, reg;
- rv = raw_read8(BQ25703_REG_IIN_HOST, &reg);
+ /*
+ * IIN_DPM register reflects the actual input current limit programmed
+ * in the register, either from host or from ICO. After ICO, the
+ * current limit used by DPM regulation may differ from the IIN_HOST
+ * register settings.
+ */
+ rv = raw_read8(BQ25703_REG_IIN_DPM, &reg);
if (!rv)
*input_current = REG_TO_INPUT_CURRENT(reg);