summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-04-07 16:39:37 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-09 01:07:26 +0000
commit99e2e5148ec6739c1feb600cd8b41be329069fc8 (patch)
treec41ba7ca9b1db3e29a17c4529facc6d52a9865e1
parentf1d171c416ce1c1dcc009e412ff6d453813e3962 (diff)
downloadchrome-ec-99e2e5148ec6739c1feb600cd8b41be329069fc8.tar.gz
AMD FP6 Mux: Correct ready bit
Ready will actually be indicated by bit 6 in the status return. BRANCH=None BUG=b:184680878 TEST=on guybrush, confirm we see C1 mux as "ready" and try to set appropriate state Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ic522add422f06acddaf88a445398727a0e5be482 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2811940 Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
-rw-r--r--driver/usb_mux/amd_fp6.c3
-rw-r--r--driver/usb_mux/amd_fp6.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/driver/usb_mux/amd_fp6.c b/driver/usb_mux/amd_fp6.c
index a2d6311816..462d7c9297 100644
--- a/driver/usb_mux/amd_fp6.c
+++ b/driver/usb_mux/amd_fp6.c
@@ -47,7 +47,8 @@ static int amd_fp6_mux_port0_read(const struct usb_mux *me, uint8_t *val)
* payload[1]: Port 0 Control/Status
* payload[2]: Port 1 Control/Status (unused on FP6)
*/
- mux_ready = !!(payload[0] & AMD_FP6_MUX_PD_STATUS_READY);
+ mux_ready = !!((payload[0] >> AMD_FP6_MUX_PD_STATUS_OFFSET)
+ & AMD_FP6_MUX_PD_STATUS_READY);
if (!mux_ready)
return EC_ERROR_BUSY;
*val = payload[1];
diff --git a/driver/usb_mux/amd_fp6.h b/driver/usb_mux/amd_fp6.h
index b5fb661353..913903e4c4 100644
--- a/driver/usb_mux/amd_fp6.h
+++ b/driver/usb_mux/amd_fp6.h
@@ -26,5 +26,6 @@
#define AMD_FP6_MUX_PORT_CMD_TIMEOUT 0x2
#define AMD_FP6_MUX_PD_STATUS_READY BIT(5)
+#define AMD_FP6_MUX_PD_STATUS_OFFSET 1
#endif /* __CROS_EC_USB_MUX_AMD_FP6_H */