diff options
Diffstat (limited to 'baseboard/honeybuns/usb_pd_policy.c')
-rw-r--r-- | baseboard/honeybuns/usb_pd_policy.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/baseboard/honeybuns/usb_pd_policy.c b/baseboard/honeybuns/usb_pd_policy.c index ef2350a03d..faaef9083f 100644 --- a/baseboard/honeybuns/usb_pd_policy.c +++ b/baseboard/honeybuns/usb_pd_policy.c @@ -369,20 +369,16 @@ static void usb_tc_connect(void) { int port = TASK_ID_TO_PD_PORT(task_get_current()); + /* Clear data role swap attempt counter at each usbc attach */ + pd_dr_swap_attempt_count[port] = 0; + /* * The EC needs to indicate to the USB hub when the host port is * attached so that the USB-EP can be properly enumerated. GPIO_BPWR_DET * is used for this purpose. */ - if (port == USB_PD_PORT_HOST) { + if (port == USB_PD_PORT_HOST) gpio_set_level(GPIO_BPWR_DET, 1); -#ifdef GPIO_UFP_PLUG_DET - gpio_set_level(GPIO_UFP_PLUG_DET, 0); -#endif - } - - /* Clear data role swap attempt counter at each usbc attach */ - pd_dr_swap_attempt_count[port] = 0; } DECLARE_HOOK(HOOK_USB_PD_CONNECT, usb_tc_connect, HOOK_PRIO_DEFAULT); @@ -391,12 +387,8 @@ static void usb_tc_disconnect(void) int port = TASK_ID_TO_PD_PORT(task_get_current()); /* Only the host port disconnect is relevant */ - if (port == USB_PD_PORT_HOST) { + if (port == USB_PD_PORT_HOST) gpio_set_level(GPIO_BPWR_DET, 0); -#ifdef GPIO_UFP_PLUG_DET - gpio_set_level(GPIO_UFP_PLUG_DET, 1); -#endif - } } DECLARE_HOOK(HOOK_USB_PD_DISCONNECT, usb_tc_disconnect, HOOK_PRIO_DEFAULT); |