pd: Remove support for debug accessories that provide VBUS + Rd

Reworked suzy-q and suzy-qable all provide Rp, so there is no need for
special detection handling in S5. Also, CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
is no longer relevant, since we no longer take special action when VBUS
is seen without Rp.

BUG=chromium:737755
BRANCH=None
TEST=On kevin, verify reworked suzy-q and suzy-qable are detected in S5.
Also, verify zinger works in S5 on reef.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I50967bd6415d964a038b2e7d134374132eda11ec
Reviewed-on: https://chromium-review.googlesource.com/656067
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Shawn Nematbakhsh
2017-09-07 13:49:39 -07:00
committed by chrome-bot
parent 9b9189669d
commit dde1a514de
10 changed files with 3 additions and 49 deletions

View File

@@ -86,7 +86,6 @@
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_PORT_COUNT 2
#define CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
#define CONFIG_USB_PD_VBUS_DETECT_CHARGER
#define CONFIG_USB_PD_TCPC_BOARD_INIT
#define CONFIG_USB_PD_TCPC_LOW_POWER

View File

@@ -164,7 +164,6 @@
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_PORT_COUNT 2
#define CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
#define CONFIG_USB_PD_VBUS_DETECT_CHARGER
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_PD_TCPM_MUX

View File

@@ -97,7 +97,6 @@
#define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_PORT_COUNT 1
#define CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
#define CONFIG_USB_PD_VBUS_DETECT_GPIO
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_PD_TCPM_MUX

View File

@@ -60,7 +60,6 @@
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_PORT_COUNT 2
#define CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
#define CONFIG_USB_PD_TCPM_TCPCI
#define CONFIG_USB_PD_TRY_SRC
#define CONFIG_USB_PD_VBUS_DETECT_TCPC

View File

@@ -69,7 +69,6 @@
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_PORT_COUNT 2
#define CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
#undef CONFIG_USB_PD_VBUS_DETECT_CHARGER
#define ADC_VBUS -1
#define CONFIG_USB_PD_TCPC_LOW_POWER

View File

@@ -143,7 +143,6 @@
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_PORT_COUNT 2
#define CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
#define CONFIG_USB_PD_VBUS_DETECT_GPIO
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_PD_TCPM_MUX

View File

@@ -88,7 +88,6 @@
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_PORT_COUNT 2
#define CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
#define CONFIG_USB_PD_VBUS_DETECT_CHARGER
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_PD_TCPM_MUX /* for both PS8751 and ANX3429 */

View File

@@ -77,7 +77,6 @@
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_PORT_COUNT 2
#define CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
#define CONFIG_USB_PD_VBUS_DETECT_CHARGER
#define CONFIG_USB_PD_TCPM_ITE83XX
#define CONFIG_USB_PD_TRY_SRC

View File

@@ -255,36 +255,6 @@ static inline int pd_is_vbus_present(int port)
#endif
}
static int pd_snk_debug_acc_toggle(int port)
{
#if defined(CONFIG_CASE_CLOSED_DEBUG) || \
defined(CONFIG_CASE_CLOSED_DEBUG_EXTERNAL)
#ifdef CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
static int possible_debug_acc[CONFIG_USB_PD_PORT_COUNT];
int vbus = pd_is_vbus_present(port);
int result;
/* reset debouncing of Rd/Rd debug accessory presence */
if ((pd[port].last_state != PD_STATE_SNK_DISCONNECTED) || !vbus)
possible_debug_acc[port] = 0;
/* returns if it was possibly present in the previous iteration */
result = possible_debug_acc[port];
possible_debug_acc[port] = vbus;
return result;
#else /* !CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS */
/*
* when we are in SNK_DISCONNECTED and we see VBUS appearing
* (without having seen Rp before), that might be a powered debug
* accessory, let's toggle to source to try to detect it.
*/
return pd_is_vbus_present(port);
#endif /* !CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS */
#else
/* Debug accessories not supported, never toggle */
return 0;
#endif
}
static int pd_debug_acc_plugged(int port)
{
#if defined(CONFIG_CASE_CLOSED_DEBUG) || \
@@ -2404,14 +2374,9 @@ void pd_task(void *u)
break;
}
/*
* If no source detected, check for role toggle.
* If VBUS is detected, and we are in the debug
* accessory toggle state, then allow toggling.
*/
if ((drp_state == PD_DRP_TOGGLE_ON &&
get_time().val >= next_role_swap) ||
pd_snk_debug_acc_toggle(port)) {
/* If no source detected, check for role toggle. */
if (drp_state == PD_DRP_TOGGLE_ON &&
get_time().val >= next_role_swap) {
/* Swap roles to source */
pd[port].power_role = PD_ROLE_SOURCE;
set_state(port, PD_STATE_SRC_DISCONNECTED);

View File

@@ -2541,9 +2541,6 @@
/* Number of USB PD ports */
#undef CONFIG_USB_PD_PORT_COUNT
/* Workaround TCPC that takes longer time to update CC status */
#undef CONFIG_USB_PD_QUIRK_SLOW_CC_STATUS
/* Simple DFP, such as power adapter, will not send discovery VDM on connect */
#undef CONFIG_USB_PD_SIMPLE_DFP