summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Liao <h.j.liao@quantatw.com>2015-04-23 11:20:53 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-24 23:23:24 +0000
commit00d071dfc7face5bb4e97fcd28c68a62ec52f183 (patch)
tree420a2abff8609451fd446035f6a7a9f9e624ba8c
parentf7e5359e7a494bb53ce06612d02171fcad2d848d (diff)
downloadchrome-ec-00d071dfc7face5bb4e97fcd28c68a62ec52f183.tar.gz
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 <h.j.liao@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/266864 Reviewed-by: Sheng-liang Song <ssl@chromium.org> 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.c24
1 files changed, 24 insertions, 0 deletions
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);