mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 01:50:53 +00:00
pd: move tDRPHold to after vbus is on
Move tDRPHold timeout to after vbus is on. This makes sure we give the right amount of time for a dual-role device to recognize that it should be the UFP. BUG=none BRANCH=samus TEST=make buildall Change-Id: I8432eb172783c689d636a435073bb86828488b06 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/227720 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
493898bd6a
commit
5142cdce2d
@@ -1416,10 +1416,6 @@ void pd_task(void)
|
||||
|
||||
set_state(port, PD_STATE_SRC_STARTUP);
|
||||
caps_count = 0;
|
||||
#ifdef CONFIG_USB_PD_DUAL_ROLE
|
||||
/* Keep VBUS up for the hold period */
|
||||
next_role_swap = get_time().val + PD_T_DRP_HOLD;
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_USB_PD_DUAL_ROLE
|
||||
/* Swap roles if time expired or VBUS is present */
|
||||
@@ -1446,6 +1442,11 @@ void pd_task(void)
|
||||
PD_STATE_SRC_DISCOVERY);
|
||||
break;
|
||||
case PD_STATE_SRC_DISCOVERY:
|
||||
#ifdef CONFIG_USB_PD_DUAL_ROLE
|
||||
/* Keep VBUS up for the hold period */
|
||||
if (pd[port].last_state != pd[port].task_state)
|
||||
next_role_swap = get_time().val + PD_T_DRP_HOLD;
|
||||
#endif
|
||||
/* Send source cap some minimum number of times */
|
||||
if (caps_count < PD_CAPS_COUNT) {
|
||||
/* Query capabilites of the other side */
|
||||
@@ -1808,7 +1809,8 @@ void pd_task(void)
|
||||
if (!pd_is_connected(port) || pd_is_power_swapping(port))
|
||||
continue;
|
||||
#endif
|
||||
if (pd[port].power_role == PD_ROLE_SOURCE) {
|
||||
if (pd[port].power_role == PD_ROLE_SOURCE &&
|
||||
pd[port].task_state != PD_STATE_SRC_STARTUP) {
|
||||
/* Source: detect disconnect by monitoring CC */
|
||||
cc1_volt = pd_adc_read(port, pd[port].polarity);
|
||||
#ifdef CONFIG_USB_PD_DUAL_ROLE
|
||||
|
||||
Reference in New Issue
Block a user