eve: Limit data role swap to port 0

Only USB port 0 is capable of device mode, so ignore data role
swaps to other ports.

BUG=b:78308749
BRANCH=eve
TEST=manual: ensure OTG pins are not asserted with data role swap
on port 1.

Change-Id: I07a331af11c3ce599a75517a5ba0ff2716987545
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1035424
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Duncan Laurie
2018-04-30 09:37:00 -07:00
committed by chrome-bot
parent 05e33b28e7
commit 756141d6b9

View File

@@ -191,6 +191,10 @@ int pd_check_vconn_swap(int port)
void pd_execute_data_swap(int port, int data_role)
{
/* Only port 0 supports device mode. */
if (port != 0)
return;
gpio_set_level(GPIO_USB2_OTG_ID,
(data_role == PD_ROLE_UFP) ? 1 : 0);
gpio_set_level(GPIO_USB2_OTG_VBUSSENSE,