diff options
author | Diana Z <dzigterman@chromium.org> | 2021-04-07 16:39:37 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-09 01:07:26 +0000 |
commit | 99e2e5148ec6739c1feb600cd8b41be329069fc8 (patch) | |
tree | c41ba7ca9b1db3e29a17c4529facc6d52a9865e1 /driver | |
parent | f1d171c416ce1c1dcc009e412ff6d453813e3962 (diff) | |
download | chrome-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>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/usb_mux/amd_fp6.c | 3 | ||||
-rw-r--r-- | driver/usb_mux/amd_fp6.h | 1 |
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 */ |