summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-24 14:17:41 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-25 01:33:48 +0000
commit235a735f7af1a11a12a46f816905fa268a0fd012 (patch)
treead0c376fb05186a2c12c22a0ca4f02eb3889963f
parentc8bcc57aac120ed78337e4bfa2efb9e6b4792684 (diff)
downloadchrome-ec-235a735f7af1a11a12a46f816905fa268a0fd012.tar.gz
cleanup: Add bug number to TODO comment in charger driver
And tidy the code a little. BUG=chrome-os-partner:22238 BRANCH=none TEST=compile kirby Change-Id: Ib424e66c5068297cc48ee3d3b8f900baea432bbc Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/174570 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--driver/charger/bq24192.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/driver/charger/bq24192.c b/driver/charger/bq24192.c
index 9f9bae1533..7bc191ac1b 100644
--- a/driver/charger/bq24192.c
+++ b/driver/charger/bq24192.c
@@ -214,7 +214,7 @@ int charger_post_init(void)
static void bq24192_init(void)
{
- int val, rv;
+ int val;
if (charger_device_id(&val) || val != BQ24192_DEVICE_ID) {
CPRINTF("[%T BQ24192 incorrent ID: 0x%02x]\n", val);
@@ -223,15 +223,16 @@ static void bq24192_init(void)
/*
* Disable I2C watchdog timer.
- * TODO(victoryang): Re-enable watchdog timer and kick it periodically
- * in charger task.
+ *
+ * TODO(crosbug.com/p/22238): Re-enable watchdog timer and kick it
+ * periodically in charger task.
*/
- rv = bq24192_read(BQ24192_REG_CHG_TERM_TMR, &val);
- if (rv)
+ if (bq24192_read(BQ24192_REG_CHG_TERM_TMR, &val))
return;
+
val &= ~0x30;
- rv = bq24192_write(BQ24192_REG_CHG_TERM_TMR, val);
- if (rv)
+
+ if (bq24192_write(BQ24192_REG_CHG_TERM_TMR, val))
return;
if (bq24192_set_terminate_current(128))