From ceb21b1f8379cd5c481ba118c68d94e61ac925cb Mon Sep 17 00:00:00 2001 From: Diana Z Date: Thu, 6 May 2021 15:15:28 -0600 Subject: 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 Change-Id: I529d33b41dc4bc55f7c647742c70832a125fd367 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2877866 Reviewed-by: Rob Barnes Commit-Queue: Rob Barnes --- driver/ppc/nx20p348x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.1