summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2015-08-21 17:53:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-10 12:35:39 -0700
commitdda0704bf96e04fbbe979ce721a14c3c12b8f45f (patch)
tree9fb7e4fc9510a838a0e3c5ea35b9d52943606153
parentaca33e4de2c07a3ab7973c2550818b214ffa6395 (diff)
downloadchrome-ec-dda0704bf96e04fbbe979ce721a14c3c12b8f45f.tar.gz
Driver: ISL9237: Enable trickle charging
Enabled the trickle charging mode by setting the MinSystemVoltage register[0x3EH] to board specific battery voltage minimum value. When the battery voltage drops below the battery voltage minimum value, trickle charging enabled. BUG=none TEST=Manually tested on Kunimitsu FAB4 prototype. Drained the battery below voltage minimum value. Using the i2cxfer command observed Trickle charging mode is active in the information register[0x3AH]. BRANCH=none Change-Id: Id6416f2b0b74fda8cf3eafb95e044586f90b8a8e Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/298143 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Rong Chang <rongchang@chromium.org>
-rw-r--r--board/kunimitsu/board.h3
-rw-r--r--driver/charger/isl9237.c8
-rw-r--r--include/config.h3
3 files changed, 14 insertions, 0 deletions
diff --git a/board/kunimitsu/board.h b/board/kunimitsu/board.h
index 3310030cd9..2a5196e5ce 100644
--- a/board/kunimitsu/board.h
+++ b/board/kunimitsu/board.h
@@ -34,6 +34,9 @@
#endif
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
+#ifndef KUNIMITSU_BOARD_V3
+#define CONFIG_TRICKLE_CHARGING
+#endif
#define CONFIG_CHIPSET_SKYLAKE
#define CONFIG_CLOCK_CRYSTAL
diff --git a/driver/charger/isl9237.c b/driver/charger/isl9237.c
index 39070bf766..4df9e53e48 100644
--- a/driver/charger/isl9237.c
+++ b/driver/charger/isl9237.c
@@ -214,6 +214,14 @@ int charger_set_voltage(int voltage)
int charger_post_init(void)
{
+#ifdef CONFIG_TRICKLE_CHARGING
+ int rv;
+ const struct battery_info *bi = battery_get_info();
+
+ rv = raw_write16(ISL9237_REG_SYS_VOLTAGE_MIN, bi->voltage_min);
+ if (rv)
+ return rv;
+#endif
return EC_SUCCESS;
}
diff --git a/include/config.h b/include/config.h
index d0fdbc03a1..2ca35f73d6 100644
--- a/include/config.h
+++ b/include/config.h
@@ -394,6 +394,9 @@
/* Charger enable GPIO is active low */
#undef CONFIG_CHARGER_EN_ACTIVE_LOW
+/* Enable trickle charging */
+#undef CONFIG_TRICKLE_CHARGING
+
/*****************************************************************************/
/* Chipset config */