From 0e364a685be9a96ca3be033b24a07246cfa08833 Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Wed, 13 Jan 2021 18:21:16 -0800 Subject: OCPC: Init VSYS to VBAT when starting charge In order to prevent high current spikes when the OCPC PID loop runs, this commit sets the initial VSYS voltage to that of the battery. BUG=b:175334490 BRANCH=dedede TEST=Build and flash DUT. Using a Type-C breakout board and a current probe, plug in charger to sub board, verify that no initial current spike exceeds that of the contract. Signed-off-by: Aseda Aboagye Change-Id: Idb6e7d2e51acd0c5279bbb055b75774c6dab6901 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2628573 Tested-by: Aseda Aboagye Reviewed-by: Diana Z Commit-Queue: Aseda Aboagye --- include/ocpc.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/ocpc.h') diff --git a/include/ocpc.h b/include/ocpc.h index a2c4d3a644..3f7b08827f 100644 --- a/include/ocpc.h +++ b/include/ocpc.h @@ -71,6 +71,14 @@ __overridable void ocpc_get_pid_constants(int *kp, int *kp_div, */ void ocpc_init(struct ocpc_data *ocpc); +/** + * Reset the OCPC module. This also sets the initial VSYS target to the current + * battery voltage + * + * @param ocpc: Pointer to OCPC data + */ +void ocpc_reset(struct ocpc_data *ocpc); + /** * Board specific OCPC data structure initialization. This can be used to set * up and charger flags. The default implementation does nothing. -- cgit v1.2.1