From 2d35daa430b96dc8309fdf9f1911e303246fdd10 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Wed, 17 Jun 2015 11:46:22 -0700 Subject: [PATCH] bq2589x: fix typo in voltage selection Use the right rounding function for the charging voltage selection. Signed-off-by: Vincent Palatin BRANCH=smaug BUG=chrome-os-partner:41594 TEST=On Smaug EVT2, check that the battery is charging to 100% and compare the voltage requested by the battery (using "battery" command) to the voltage set by using "charger" command. Change-Id: Ic5076f23242d1fac31ad34e0c8c9bfe0a868a91e Reviewed-on: https://chromium-review.googlesource.com/278260 Reviewed-by: Alec Berg Commit-Queue: Vincent Palatin Tested-by: Vincent Palatin --- driver/charger/bq2589x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/charger/bq2589x.c b/driver/charger/bq2589x.c index 9614d4ce26..6de1c65f33 100644 --- a/driver/charger/bq2589x.c +++ b/driver/charger/bq2589x.c @@ -200,7 +200,7 @@ int charger_set_voltage(int voltage) int rv, val; const struct charger_info * const info = charger_get_info(); - voltage = charger_closest_current(voltage); + voltage = charger_closest_voltage(voltage); rv = bq2589x_read(BQ2589X_REG_CHG_VOLT, &val); if (rv)