diff options
author | Keith Short <keithshort@chromium.org> | 2020-02-12 17:44:53 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-14 04:09:03 +0000 |
commit | 80f53174f404c6db2f2d275129c2a7bd852ef624 (patch) | |
tree | b21679e805515f39163dd0c0af8f55027553225a | |
parent | 4f748cf760dcc57b628f08ef705701235cb6c842 (diff) | |
download | chrome-ec-80f53174f404c6db2f2d275129c2a7bd852ef624.tar.gz |
syv682x: Don't turn off VBUS when disabling sink mode
When the last charger is removed from the system, boards call
ppc_vbus_sink_enable() to disable sink mode on all PD ports. The SYV682
doesn't support turning of VBUS and VCHG independently, so do nothing if
if the SYV682 is currently the VBUS source.
BUG=b:149428774
BRANCH=none
TEST=make buildall
TEST=On volteer, connect a charger to C0, connect a SNK device to C1.
Disconnect charger and C0 and verify VBUS stays up on C1.
Change-Id: I1747b3b19f584b0069134c520bd0ef0453a0a06a
Signed-off-by: Keith Short <keithshort@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2053036
Reviewed-by: caveh jalali <caveh@chromium.org>
-rw-r--r-- | driver/ppc/syv682x.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/driver/ppc/syv682x.c b/driver/ppc/syv682x.c index d5bee2e985..ea1617ee7b 100644 --- a/driver/ppc/syv682x.c +++ b/driver/ppc/syv682x.c @@ -98,6 +98,13 @@ static int syv682x_vbus_sink_enable(int port, int enable) int regval; int rv; + if (!enable && syv682x_is_sourcing_vbus(port)) { + /* + * We're currently a source, so nothing more to do + */ + return EC_SUCCESS; + } + /* * For sink mode need to make sure high voltage power path is connected * and sink mode is selected. @@ -115,7 +122,7 @@ static int syv682x_vbus_sink_enable(int port, int enable) } else { /* * No need to change the voltage path or channel direction. But, - * turn both paths off. + * turn both paths off because we are currently a sink. */ regval |= SYV682X_CONTROL_1_PWR_ENB; } |