usbc: Remove pd_ts_dts_plugged() check from PD_DRP_FORCE_SINK
PD_DRP_FORCE_SINK had an exception (since crrev.com/c/277275), allowing role to remain source on S5 entry if DTS (debug accessory) is connected. Remove this exception. rddkeepalive on cr50 (set when servod starts) ensures CCD mode stays enabled across power and role changes. BUG=b:173457150 BRANCH=none TEST=servo_v4_role:snk, AP S0/S5/G3, EC reboot/hibernate -> CCD keeps working Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Iccdfb504c6269ee2ba072e9818920e3e10a56739 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2542578 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
This commit is contained in:
parent
87d6897906
commit
46826ee4fc
|
@ -392,15 +392,6 @@ int pd_is_connected(int port)
|
|||
pd[port].task_state != PD_STATE_SRC_DISCONNECTED_DEBOUNCE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true if partner port is a DTS or TS capable of entering debug
|
||||
* mode (eg. is presenting Rp/Rp or Rd/Rd).
|
||||
*/
|
||||
int pd_ts_dts_plugged(int port)
|
||||
{
|
||||
return pd[port].flags & PD_FLAGS_TS_DTS_PARTNER;
|
||||
}
|
||||
|
||||
/* Return true if partner port is known to be PD capable. */
|
||||
bool pd_capable(int port)
|
||||
{
|
||||
|
@ -2529,12 +2520,11 @@ static void pd_update_dual_role_config(int port)
|
|||
{
|
||||
/*
|
||||
* Change to sink if port is currently a source AND (new DRP
|
||||
* state is force sink OR new DRP state is either toggle off
|
||||
* or debug accessory toggle only and we are in the source
|
||||
* disconnected state).
|
||||
* state is force sink OR new DRP state is toggle off and we are in the
|
||||
* source disconnected state).
|
||||
*/
|
||||
if (pd[port].power_role == PD_ROLE_SOURCE &&
|
||||
((drp_state[port] == PD_DRP_FORCE_SINK && !pd_ts_dts_plugged(port))
|
||||
(drp_state[port] == PD_DRP_FORCE_SINK
|
||||
|| (drp_state[port] == PD_DRP_TOGGLE_OFF
|
||||
&& pd[port].task_state == PD_STATE_SRC_DISCONNECTED))) {
|
||||
pd_set_power_role(port, PD_ROLE_SINK);
|
||||
|
|
|
@ -711,15 +711,6 @@ void pd_request_data_swap(int port)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true if partner port is a DTS or TS capable of entering debug
|
||||
* mode (eg. is presenting Rp/Rp or Rd/Rd).
|
||||
*/
|
||||
int pd_ts_dts_plugged(int port)
|
||||
{
|
||||
return TC_CHK_FLAG(port, TC_FLAGS_TS_DTS_PARTNER);
|
||||
}
|
||||
|
||||
/* Return true if partner port is known to be PD capable. */
|
||||
bool pd_capable(int port)
|
||||
{
|
||||
|
@ -1690,15 +1681,13 @@ static void set_vconn(int port, int enable)
|
|||
static void pd_update_dual_role_config(int port)
|
||||
{
|
||||
if (tc[port].power_role == PD_ROLE_SOURCE &&
|
||||
((drp_state[port] == PD_DRP_FORCE_SINK &&
|
||||
!pd_ts_dts_plugged(port)) ||
|
||||
(drp_state[port] == PD_DRP_FORCE_SINK ||
|
||||
(drp_state[port] == PD_DRP_TOGGLE_OFF &&
|
||||
get_state_tc(port) == TC_UNATTACHED_SRC))) {
|
||||
/*
|
||||
* Change to sink if port is currently a source AND (new DRP
|
||||
* state is force sink OR new DRP state is either toggle off
|
||||
* or debug accessory toggle only and we are in the source
|
||||
* disconnected state).
|
||||
* state is force sink OR new DRP state is toggle off and we are
|
||||
* in the source disconnected state).
|
||||
*/
|
||||
set_state_tc(port, TC_UNATTACHED_SNK);
|
||||
} else if (tc[port].power_role == PD_ROLE_SINK &&
|
||||
|
|
|
@ -2725,14 +2725,6 @@ void pd_prepare_reset(void);
|
|||
*/
|
||||
void pd_set_new_power_request(int port);
|
||||
|
||||
/**
|
||||
* Return true if partner port is a DTS or TS capable of entering debug
|
||||
* mode (eg. is presenting Rp/Rp or Rd/Rd).
|
||||
*
|
||||
* @param port USB-C port number
|
||||
*/
|
||||
int pd_ts_dts_plugged(int port);
|
||||
|
||||
/**
|
||||
* Return true if partner port is known to be PD capable.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue