summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorChromeOS Developer <dparker@chromium.org>2014-02-21 09:28:50 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-02-24 22:03:51 +0000
commitd98bc1cf3f3c937175a630d57cdacc6aaef6f685 (patch)
tree99e148d32bf40ae69ac919cd1bc198cfa691259f /driver
parent1767e7887fa0d90b1aefc93c230c69a3cc423381 (diff)
downloadchrome-ec-d98bc1cf3f3c937175a630d57cdacc6aaef6f685.tar.gz
Enable IDPM for bq24715 charge controller
Dynamic Power Management enables proper regulation of the input adapter current set in board.h. BUG=chrome-os-partner:24933 BRANCH=ToT TEST=Power a DUT with a bench supply. Verify the input current doesn't exceed the input current limit set in board.h while the system is under load and charging the battery. Change-Id: Ida6b05f1d89b21d7cf1553f5e9936360679f8149 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/187517 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/charger/bq24715.c3
-rw-r--r--driver/charger/bq24715.h6
2 files changed, 6 insertions, 3 deletions
diff --git a/driver/charger/bq24715.c b/driver/charger/bq24715.c
index 5731057e4e..e3a9b25797 100644
--- a/driver/charger/bq24715.c
+++ b/driver/charger/bq24715.c
@@ -183,6 +183,9 @@ int charger_post_init(void)
option |= OPT_FIX_IOUT_ALWAYS;
option &= ~OPT_IOUT_MASK;
+ /* Enable dynamic power management */
+ option |= OPT_IDPM_ENABLE;
+
rv = charger_set_option(option);
if (rv)
return rv;
diff --git a/driver/charger/bq24715.h b/driver/charger/bq24715.h
index 1c3df77725..470c454f4d 100644
--- a/driver/charger/bq24715.h
+++ b/driver/charger/bq24715.h
@@ -62,9 +62,9 @@
#define OPT_LDO_MODE_MASK (1 << 2)
#define OPT_LDO_DISABLE (0 << 2)
#define OPT_LDO_ENABLE (1 << 2)
-#define OPT_ODPM_MASK (1 << 1)
-#define OPT_ODPM_DISABLE (0 << 1)
-#define OPT_ODPM_ENABLE (1 << 1)
+#define OPT_IDPM_MASK (1 << 1)
+#define OPT_IDPM_DISABLE (0 << 1)
+#define OPT_IDPM_ENABLE (1 << 1)
#define OPT_CHARGE_INHIBIT_MASK (1 << 0)
#define OPT_CHARGE_ENABLE (0 << 0)
#define OPT_CHARGE_DISABLE (1 << 0)