diff options
author | Aseda Aboagye <aaboagye@google.com> | 2020-04-03 17:44:31 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-04 02:50:27 +0000 |
commit | 533c749098b53ec3e640f874dab20dda8adbd086 (patch) | |
tree | 76707aa2c971befc7d0fac458d6d088caccb5fe6 /board/waddledoo/board.c | |
parent | b11f25e61c61af66c6543c11a6bc78ff199fd92e (diff) | |
download | chrome-ec-533c749098b53ec3e640f874dab20dda8adbd086.tar.gz |
waddledoo: Enable OCPC
This commit enables OCPC for waddledoo.
BUG=b:148980016
BRANCH=None
TEST=Build and flash on waddledoo, verify that I can charge the
battery from the sub-board at desired current in G3. Additionally,
verify that adapter is nearly maxed out when system is running in S0
and battery is charging heavily.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: I5c0732b21760980cc3bb3f4c6006fd57e48cfc21
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135965
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/waddledoo/board.c')
-rw-r--r-- | board/waddledoo/board.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/board/waddledoo/board.c b/board/waddledoo/board.c index 28d54ddc6c..8c3d584807 100644 --- a/board/waddledoo/board.c +++ b/board/waddledoo/board.c @@ -349,6 +349,31 @@ int extpower_is_present(void) return pd_snk_is_vbus_provided(0) || pd_snk_is_vbus_provided(1); } +__override void ocpc_get_pid_constants(int *kp, int *kp_div, + int *ki, int *ki_div, + int *kd, int *kd_div) +{ + /* + * Early boards need different constants due to a change in charger IC + * silicon revision. + */ + if (system_get_board_version() >= 0) { + *kp = 1; + *kp_div = 128; + *ki = 1; + *ki_div = 1024; + *kd = 0; + *kd_div = 1; + } else { + *kp = 1; + *kp_div = 4; + *ki = 1; + *ki_div = 15; + *kd = 1; + *kd_div = 10; + } +} + int pd_snk_is_vbus_provided(int port) { int regval = 0; |