diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-11-10 09:48:37 -0800 |
---|---|---|
committer | ChromeOS bot <3su6n15k.default@developer.gserviceaccount.com> | 2015-11-13 19:07:06 +0000 |
commit | ed82a23b307795463b42af363a159261f5335769 (patch) | |
tree | 1d21366f2f879cf9ffc8c7ff3396443bbc0e6329 | |
parent | 35282dfe80953aafae90eb41e302a0f6c3ff495c (diff) | |
download | chrome-ec-ed82a23b307795463b42af363a159261f5335769.tar.gz |
ryu: disconnect usb switches until connection is debounced
Re-order logic in BC1.2 detection task so that we open the
USB switches immediately upon detecting a connection, then
debounce the connection, then reset the pericom and determine
BC1.2 charger type.
This fixes two problems:
- Problem where host would enumerate ryu, detect disconnect,
and then re-enumerate.
- Problem where sometimes ryu would detect a host workstation
as a proprietary charger because we weren't delaying long
enough after opening USB switches before triggering pericom
reset.
BUG=chrome-os-partner:47219
BRANCH=smaug
TEST=tested by connecting workstation to ryu (tested both
pluggin in A side first and C side first). Without this patch,
my workstation often see's disconnect and reconnect. With
this change we only get one connect.
Change-Id: Ib75a1905c528063316c6a4649d9cf1b71b059c6a
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311853
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/ryu/board.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/board/ryu/board.c b/board/ryu/board.c index 1e330425b4..05a0dd471a 100644 --- a/board/ryu/board.c +++ b/board/ryu/board.c @@ -155,15 +155,14 @@ static void usb_charger_bc12_detect(void) /* Debounce pin plug order if we detect a charger */ if (device_type || PI3USB9281_CHG_STATUS_ANY(charger_status)) { - msleep(USB_CHG_DEBOUNCE_DELAY_MS); - /* next operation might trigger a detach interrupt */ pi3usb9281_disable_interrupts(0); /* Ensure D+/D- are open before resetting */ pi3usb9281_set_switch_manual(0, 1); pi3usb9281_set_pins(0, 0); - /* Let D+/D- relax to their idle state */ - msleep(40); + + /* Delay to debounce pin attach order */ + msleep(USB_CHG_DEBOUNCE_DELAY_MS); /* Trigger chip reset to refresh detection registers */ pi3usb9281_reset(0); |