summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-05-06 15:15:28 -0600
committerCommit Bot <commit-bot@chromium.org>2021-05-07 23:11:24 +0000
commitceb21b1f8379cd5c481ba118c68d94e61ac925cb (patch)
treea7500be37d3ed41dcbf4032acbff64302c304f79
parentbb90f093e020401fdb6813ca110b7dbb3ce07dda (diff)
downloadchrome-ec-ceb21b1f8379cd5c481ba118c68d94e61ac925cb.tar.gz
NX20P348x: Only check sink bit for sink_enable error
When a port is sourcing (ex. to a dongle), running sink disable on the port will currently return failure because the 5VSRC bit is set. However, sinking has been successfully disabled. Reflect this in the error return by only checking the specific sinking bit in the status register. BRANCH=None BUG=b:187220141 TEST=on guybrush, plug and unplug AC on C0 with a dongle on C1. Verify no failures to disable sinking are present. Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I529d33b41dc4bc55f7c647742c70832a125fd367 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2877866 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
-rw-r--r--driver/ppc/nx20p348x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/ppc/nx20p348x.c b/driver/ppc/nx20p348x.c
index a5ab4200c5..d8f73ddb3c 100644
--- a/driver/ppc/nx20p348x.c
+++ b/driver/ppc/nx20p348x.c
@@ -162,7 +162,7 @@ static int nx20p348x_vbus_sink_enable(int port, int enable)
if (rv)
return rv;
- return (status & NX20P348X_SWITCH_STATUS_MASK) == control ?
+ return (status & NX20P348X_SWITCH_CONTROL_HVSNK) == control ?
EC_SUCCESS : EC_ERROR_UNKNOWN;
}