diff options
author | H.J. Liao <h.j.liao@quantatw.com> | 2015-04-23 11:05:04 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-24 01:03:12 +0000 |
commit | f7e5359e7a494bb53ce06612d02171fcad2d848d (patch) | |
tree | 48179656bae0304962f86e775acce0ad0040339a | |
parent | 9bed2b4470307cc6d6c797571a616853ec553912 (diff) | |
download | chrome-ec-f7e5359e7a494bb53ce06612d02171fcad2d848d.tar.gz |
Orco: Enable battery green book mode
The green book is a function in battery that adjust charge current based
on temperature or other condition.
BUG=chrome-os-partner:39355
BRANCH=orco
TEST=Build FW and check battery charge to full.
Change-Id: I31113cb8abff751bb18a6ebe779df9f860ad8aa4
Signed-off-by: H.J. Liao <h.j.liao@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/266863
Reviewed-by: Mohammed Habibulla <moch@google.com>
Commit-Queue: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
-rw-r--r-- | board/orco/battery.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/board/orco/battery.c b/board/orco/battery.c index b6e15992a4..e06b78ca34 100644 --- a/board/orco/battery.c +++ b/board/orco/battery.c @@ -23,6 +23,12 @@ #define SB_FETON_DATA2 0x4000 #define BATTERY_FETOFF 0x0100 +/* + * Green book support parameter + * Enable this will make battery meet JEITA standard + */ +#define GREEN_BOOK_SUPPORT (1 << 2) + static const struct battery_info info = { .voltage_max = 8600, /* mV */ .voltage_normal = 7600, @@ -44,6 +50,12 @@ const struct battery_info *battery_get_info(void) static void wakeup_deferred(void) { int d; + int mode; + + /* Add Green Book support */ + sb_read(SB_BATTERY_MODE, &mode); + mode |= GREEN_BOOK_SUPPORT; + sb_write(SB_BATTERY_MODE, mode); sb_read(SB_FET_OFF, &d); |