From 00d071dfc7face5bb4e97fcd28c68a62ec52f183 Mon Sep 17 00:00:00 2001 From: "H.J. Liao" Date: Thu, 23 Apr 2015 11:20:53 +0800 Subject: Orco: Add charger settings Fellow Hoofer charger's setting. (Disable the LDO mode, Enable SYSOVP) BUG=chrome-os-partner:39355 BRANCH=orco TEST=Build FW and check battery charge to full. Change-Id: I21f6908b95dec085a825aff8771a02bb5a2fc690 Signed-off-by: H.J. Liao Reviewed-on: https://chromium-review.googlesource.com/266864 Reviewed-by: Sheng-liang Song Reviewed-by: Mohammed Habibulla Commit-Queue: Keith Tzeng Tested-by: Keith Tzeng --- board/orco/battery.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/board/orco/battery.c b/board/orco/battery.c index e06b78ca34..530b4d5da0 100644 --- a/board/orco/battery.c +++ b/board/orco/battery.c @@ -7,7 +7,10 @@ #include "battery.h" #include "battery_smart.h" +#include "charger.h" +#include "charge_state.h" #include "console.h" +#include "driver/charger/bq24715.h" #include "extpower.h" #include "gpio.h" #include "hooks.h" @@ -93,3 +96,24 @@ int board_cut_off_battery(void) { return cutoff(); } + +/* + * Initialize charger additional option value + */ +static void charger_init(void) +{ + if ((charge_get_state() == PWR_STATE_INIT) || + (charge_get_state() == PWR_STATE_REINIT)) { + int option; + + charger_get_option(&option); + + /* Disable LDO mode */ + option &= ~OPT_LDO_MODE_MASK; + /* Enable SYSOVP */ + option |= OPT_SYSOVP_MASK; + + charger_set_option(option); + } +} +DECLARE_HOOK(HOOK_CHARGE_STATE_CHANGE, charger_init, HOOK_PRIO_DEFAULT); -- cgit v1.2.1