From 46c63492e9f8de67bb6dcf27ce8798a4d18f141d Mon Sep 17 00:00:00 2001 From: Diana Z Date: Fri, 31 May 2019 15:27:51 -0600 Subject: USB PD: Disable Vconn as well as Vbus on init Currently, the pd_task will call a power supply reset during init which cuts Vbus to the port partner. However, on a sysjump we may still be sourcing Vconn to a partner which will leave it in an inconsistent state of having Vconn but no Vbus. Depending on the port partner's power topology, they may even feedback some amount of voltage on Vbus, causing them to be detected as a charger. After disabling Vbus to the port partner, disable Vconn as well. BUG=b:132110509 BRANCH=octopus TEST=unlocked EC resets and sysjumps with a display port dongle and hoho, ensuring neither was detected as a low power charger after Change-Id: Ica9b72167bc981faeaebac18bac476ca9b7bfe7f Signed-off-by: Diana Z Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1639211 Reviewed-by: Jett Rink Reviewed-by: Aseda Aboagye (cherry picked from commit 81255185ec4847ada2f09230f2c152809676a719) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1645380 --- common/usb_pd_protocol.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 8ca0bbb6fc..4bf8e600e0 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -2649,8 +2649,14 @@ void pd_task(void *u) pd_init_tasks(); #endif - /* Ensure the power supply is in the default state */ + /* + * Ensure the power supply is in the default state and ensure we are not + * sourcing Vconn + */ pd_power_supply_reset(port); +#ifdef CONFIG_USBC_VCONN + set_vconn(port, 0); +#endif /* Initialize TCPM driver and wait for TCPC to be ready */ res = reset_device_and_notify(port); -- cgit v1.2.1