From d98bc1cf3f3c937175a630d57cdacc6aaef6f685 Mon Sep 17 00:00:00 2001 From: ChromeOS Developer Date: Fri, 21 Feb 2014 09:28:50 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/187517 Reviewed-by: Bill Richardson --- driver/charger/bq24715.c | 3 +++ driver/charger/bq24715.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'driver') 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) -- cgit v1.2.1