nautilus: Enable usb device mode
BRANCH=poppy
TEST=Verified following:
1. ectool usbpd 0 dr_swap
2. ectool usbpd 0
> Role: SNK UFP
Commit-Ready: Furquan Shaikh
Tested-by: Furquan Shaikh
@@ -189,7 +189,14 @@ int pd_check_vconn_swap(int port)
void pd_execute_data_swap(int port, int data_role)
{
- /* Do nothing */
+ /* 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,
+ (data_role == PD_ROLE_UFP) ? 1 : 0);
}
void pd_check_pr_role(int port, int pr_role, int flags)
