From 5c0d4b1ea1882c52148106986a18c2761742742a Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Wed, 19 Dec 2018 14:20:46 -0800 Subject: nocturne: Discharge VBUS when stopping sourcing. When the source power path is turned off, we should discharge VBUS. BUG=none BRANCH=firmware-nocturne-10984.B TEST=Flash nocturne, PR_SWAP, verify that VBUS is discharged instead of floating during the swap. Change-Id: I30cbb85cefc70ef161853758ece57b324eab0014 Signed-off-by: Aseda Aboagye Reviewed-on: https://chromium-review.googlesource.com/1385445 Commit-Ready: ChromeOS CL Exonerator Bot Tested-by: Aseda Aboagye Reviewed-by: Aseda Aboagye --- board/nocturne/usb_pd_policy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/board/nocturne/usb_pd_policy.c b/board/nocturne/usb_pd_policy.c index 3b07ff7461..3956fc85ab 100644 --- a/board/nocturne/usb_pd_policy.c +++ b/board/nocturne/usb_pd_policy.c @@ -118,8 +118,14 @@ int pd_is_valid_input_voltage(int mv) void pd_power_supply_reset(int port) { - /* Disable VBUS. */ + /* + * Disable VBUS and discharge to vSafe0V. + * + * The PPC will automatically disable the discharge circuitry once it + * reaches vSafe0V. + */ ppc_vbus_source_enable(port, 0); + ppc_discharge_vbus(port, 1); #ifdef CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT /* Give back the current quota we are no longer using */ -- cgit v1.2.1