plankton: Reset USB hub when switch from DP mode to USB mode

If we are switching from DP mode to USB mode, reset the USB hub to make
sure the hub recognizes USB connection properly. Note that we only reset
the hub when making the switch by pressing the button on the board. This
is to prevent disrupting BFT test flow, during which we don't want to
reset the hub so as to maintain the USB link between the test host and
Plankton MCU.

BRANCH=None
BUG=chrome-os-partner:34296
TEST=Press the button to toggle between DP and USB mode. Measure USB hub
reset signal with a scope.

Change-Id: I69bdee292fe414abbe0a4778b8f5e8041e4534c1
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237606
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
This commit is contained in:
Vic Yang
2014-12-24 23:15:33 -08:00
committed by ChromeOS Commit Bot
parent a9099ee3fc
commit 54cbe6ec82

View File

@@ -221,6 +221,8 @@ static void button_deferred(void)
break;
case GPIO_DBG_USB_TOGGLE_L:
set_usbc_action(USBC_ACT_USBDP_TOGGLE);
if (gpio_get_level(GPIO_USBC_SS_USB_MODE))
board_maybe_reset_usb_hub();
break;
case GPIO_DBG_MUX_FLIP_L:
set_usbc_action(USBC_ACT_MUX_FLIP);