summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames_chao <james_chao@asus.com>2015-01-28 14:33:47 +0800
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2015-12-29 22:35:08 +0000
commitad0ea04a5f6b373f8998207e51dd63502f3e6356 (patch)
tree04148e978658ffa30abceb7f0f4777520320f38d
parent7e0f529791dba4b36a9188265b876dffc726dc7a (diff)
downloadchrome-ec-ad0ea04a5f6b373f8998207e51dd63502f3e6356.tar.gz
charger: Implement board specific charge IC initial configure.
Some board needs to set the charge ic registers when power on, such as input current, charge options, prochot options. BUG=None TEST=make buildall -j BRANCH=firmware-strago-7287.B Change-Id: I953559e71b592ea1f7e6e1cb5498d93006101b1c Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/319334 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--common/charge_state_v2.c6
-rw-r--r--include/charger.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 642d157a18..e62d08fe4b 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -606,6 +606,12 @@ void charger_task(void)
else
prev_ac = curr.ac;
}
+ if (board_charger_post_init) {
+ rv = board_charger_post_init();
+ if (rv != EC_SUCCESS) {
+ problem(PR_POST_INIT, rv);
+ }
+ }
} else {
/* Some things are only meaningful on AC */
state_machine_force_idle = 0;
diff --git a/include/charger.h b/include/charger.h
index d29d66ed30..a0adff25f6 100644
--- a/include/charger.h
+++ b/include/charger.h
@@ -55,6 +55,9 @@ void charger_get_params(struct charger_params *chg);
/* Power state machine post init */
int charger_post_init(void);
+/* board specific charge IC init */
+int __attribute((weak)) board_charger_post_init(void);
+
/* Get charger information. */
const struct charger_info *charger_get_info(void);