From 5fef5654ceb57364872ab5352eaff6a7f5cae91e Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Wed, 20 Jan 2021 17:32:46 +0000 Subject: servo_v4p1: clean-up and USB-C timings Small clean-ups inherited from Nathan, the sooner they are pushed the better. - Fix typos/terminology. - Use symbolic port names. - update timings from power supplies to be more tolerant when using an upstream host charger. - disable the discharge on the power path at startup as a safety measure. Signed-off-by: Vincent Palatin BUG=none BRANCH=servo TEST=none Change-Id: If3ca4498b23763ce43371ce9cfe80391b0c1a4b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2640656 Commit-Queue: Vincent Palatin Tested-by: Vincent Palatin Reviewed-by: Aseda Aboagye --- board/servo_v4p1/chg_control.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'board/servo_v4p1/chg_control.c') diff --git a/board/servo_v4p1/chg_control.c b/board/servo_v4p1/chg_control.c index cddd8efc69..19be03a755 100644 --- a/board/servo_v4p1/chg_control.c +++ b/board/servo_v4p1/chg_control.c @@ -8,6 +8,7 @@ #include "ioexpanders.h" #include "registers.h" #include "timer.h" +#include "usb_pd.h" #define CHG_P5V_POWER 0 #define CHG_VBUS_POWER 1 @@ -20,7 +21,8 @@ void chg_reset(void) /* Disconnect CHG CC1(Rd) and CC2(Rd) */ chg_attach_cc_rds(0); - msleep(100); + /* Give time for CHG to detach, use tErrorRecovery. */ + msleep(PD_T_ERROR_RECOVERY); /* Connect CHG CC1(Rd) and CC2(Rd) to detect charger */ chg_attach_cc_rds(1); -- cgit v1.2.1