summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2017-10-12 08:21:41 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-19 12:56:42 -0700
commit251212fb9dea6d95a8caa43ec9eeb210abfa2df8 (patch)
treea85685d1f78524a104ee0b5f00c97293e96d30e6
parent7c2c5a9dc3779587f78a7c602cefeb667d210d41 (diff)
downloadchrome-ec-251212fb9dea6d95a8caa43ec9eeb210abfa2df8.tar.gz
pd: Remove ACCESSORY states
According to the USB-C spec, when a debug accessory is identified, we may optionally establish USB PD communication over CC. Some DTS partners (eg. servo_v4) expect us to speak PD, so let's make it so. There is no need for special ACCESSORY states, these do not exist in the PD spec. BRANCH=servo BUG=chromium:737755,b:65837068 TEST=On scarlet, attach servo_v4 and verify scarlet charges. Also verify EC and cr50 consoles are available through servo_v4. Change-Id: I59d1ca50b4766509eccf38562cdf926578138585 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/693294 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/coral/board.h1
-rw-r--r--board/eve/board.h1
-rw-r--r--board/fizz/board.h1
-rw-r--r--board/kahlee/board.h1
-rw-r--r--board/kevin/board.h1
-rw-r--r--board/nefario/board.h1
-rw-r--r--board/poppy/board.h1
-rw-r--r--board/reef/board.h1
-rw-r--r--board/reef_it8320/board.h1
-rw-r--r--board/scarlet/board.h1
-rw-r--r--board/servo_v4/board.c7
-rw-r--r--board/servo_v4/board.h7
-rw-r--r--board/servo_v4/usb_pd_policy.c6
-rw-r--r--common/usb_pd_protocol.c123
-rw-r--r--include/case_closed_debug.h28
-rw-r--r--include/config.h5
-rw-r--r--include/usb_pd.h15
17 files changed, 56 insertions, 145 deletions
diff --git a/board/coral/board.h b/board/coral/board.h
index 53c32632c5..5472fbbb68 100644
--- a/board/coral/board.h
+++ b/board/coral/board.h
@@ -76,7 +76,6 @@
#define CONFIG_TABLET_MODE
/* USB PD config */
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_CMD_PD_CONTROL
#define CONFIG_USB_PD_ALT_MODE
#define CONFIG_USB_PD_ALT_MODE_DFP
diff --git a/board/eve/board.h b/board/eve/board.h
index 33fbc07436..6182e7c2ac 100644
--- a/board/eve/board.h
+++ b/board/eve/board.h
@@ -28,7 +28,6 @@
#define CONFIG_BOARD_VERSION
#define CONFIG_BOARD_SPECIFIC_VERSION
#define CONFIG_BUTTON_COUNT 2
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_DEVICE_EVENT
#define CONFIG_DPTF
#define CONFIG_DPTF_DEVICE_ORIENTATION
diff --git a/board/fizz/board.h b/board/fizz/board.h
index 90b68be170..a1203c140a 100644
--- a/board/fizz/board.h
+++ b/board/fizz/board.h
@@ -25,7 +25,6 @@
#define CONFIG_LED_COMMON
#define CONFIG_KEYBOARD_PROTOCOL_MKBP
#define CONFIG_MKBP_USE_HOST_EVENT
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_DPTF
#define CONFIG_FLASH_SIZE 0x80000
#define CONFIG_FPU
diff --git a/board/kahlee/board.h b/board/kahlee/board.h
index ccab23ac86..ab028983b4 100644
--- a/board/kahlee/board.h
+++ b/board/kahlee/board.h
@@ -57,7 +57,6 @@
#define GPIO_USB_CTL1 GPIO_USB_A_CHARGE_EN_L
/* USB PD config */
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_CMD_PD_CONTROL
#define CONFIG_USB_PD_ALT_MODE
#define CONFIG_USB_PD_ALT_MODE_DFP
diff --git a/board/kevin/board.h b/board/kevin/board.h
index 2f09c682ee..faa8358baf 100644
--- a/board/kevin/board.h
+++ b/board/kevin/board.h
@@ -115,7 +115,6 @@
#define CONFIG_TABLET_MODE_SWITCH
/* USB PD config */
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_CHARGE_MANAGER
#define CONFIG_CHARGE_RAMP_SW
#define CONFIG_USB_POWER_DELIVERY
diff --git a/board/nefario/board.h b/board/nefario/board.h
index bf2f6e1093..f6d24893dd 100644
--- a/board/nefario/board.h
+++ b/board/nefario/board.h
@@ -104,7 +104,6 @@
#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_ACCEL)
/* USB PD config */
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_CHARGE_MANAGER
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PD_ALT_MODE
diff --git a/board/poppy/board.h b/board/poppy/board.h
index 75188e056a..5ad8632f0b 100644
--- a/board/poppy/board.h
+++ b/board/poppy/board.h
@@ -21,7 +21,6 @@
#define CONFIG_BOARD_SPECIFIC_VERSION
#define CONFIG_BUTTON_COUNT 2
#define CONFIG_BUTTON_RECOVERY
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_DPTF
#define CONFIG_EMULATED_SYSRQ
#define CONFIG_FLASH_SIZE 0x80000
diff --git a/board/reef/board.h b/board/reef/board.h
index 3876c1ee45..2825bad90e 100644
--- a/board/reef/board.h
+++ b/board/reef/board.h
@@ -76,7 +76,6 @@
#define CONFIG_TABLET_MODE
/* USB PD config */
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_CMD_PD_CONTROL
#define CONFIG_USB_PD_ALT_MODE
#define CONFIG_USB_PD_ALT_MODE_DFP
diff --git a/board/reef_it8320/board.h b/board/reef_it8320/board.h
index 69de844874..6a5a354966 100644
--- a/board/reef_it8320/board.h
+++ b/board/reef_it8320/board.h
@@ -64,7 +64,6 @@
#define GPIO_USB_CTL1 GPIO_EN_PP5000
/* USB PD config */
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_USB_MUX_PI3USB30532
#define CONFIG_USB_MUX_PS8740
#define CONFIG_CMD_PD_CONTROL
diff --git a/board/scarlet/board.h b/board/scarlet/board.h
index adf1d74746..abd69b9acf 100644
--- a/board/scarlet/board.h
+++ b/board/scarlet/board.h
@@ -94,7 +94,6 @@
#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_BARO)
/* USB PD config */
-#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_CHARGE_MANAGER
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PD_ALT_MODE
diff --git a/board/servo_v4/board.c b/board/servo_v4/board.c
index 17a653af41..15057242b7 100644
--- a/board/servo_v4/board.c
+++ b/board/servo_v4/board.c
@@ -6,7 +6,6 @@
#include "adc.h"
#include "adc_chip.h"
-#include "case_closed_debug.h"
#include "common.h"
#include "console.h"
#include "ec_version.h"
@@ -395,9 +394,9 @@ static void check_for_disconnect(void)
ccd_keepalive_enabled = 0;
}
-void ccd_set_mode(enum ccd_mode new_mode)
+void ccd_enable(int enable)
{
- if (new_mode == CCD_MODE_ENABLED) {
+ if (enable) {
/*
* Unfortunately the polarity detect is designed for real plug
* events, and only accurately detects pre-connect idle. If
@@ -414,7 +413,7 @@ void ccd_set_mode(enum ccd_mode new_mode)
/* Allow some time following turning on of VBUS */
hook_call_deferred(&ccd_measure_sbu_data,
PD_POWER_SUPPLY_TURN_ON_DELAY);
- } else if (new_mode == CCD_MODE_DISABLED) {
+ } else {
/* We are not connected to anything */
/* Disable ccd_measure_sbu deferred call always */
diff --git a/board/servo_v4/board.h b/board/servo_v4/board.h
index a7ea1ec6e7..729051c73f 100644
--- a/board/servo_v4/board.h
+++ b/board/servo_v4/board.h
@@ -90,7 +90,6 @@
#define CONFIG_CHARGE_MANAGER
#define CONFIG_USB_POWER_DELIVERY
-#define CONFIG_USB_PD_DTS
#define CONFIG_CMD_PD
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_DYNAMIC_SRC_CAP
@@ -219,5 +218,11 @@ int pd_set_rp_rd(int port, int cc_pull, int rp_value);
*/
int board_get_version(void);
+/**
+ * Enable or disable CCD
+ *
+ * @param enable Enable CCD if true, otherwise disable
+ */
+void ccd_enable(int enable);
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c
index 2e707d85c8..0ba2777779 100644
--- a/board/servo_v4/usb_pd_policy.c
+++ b/board/servo_v4/usb_pd_policy.c
@@ -409,6 +409,10 @@ int pd_set_power_supply_ready(int port)
vbus[DUT].mv = 5000;
vbus[DUT].ma = 500;
+ /* Enable CCD, if debuggable TS attached */
+ if (pd_ts_dts_plugged(DUT))
+ ccd_enable(1);
+
return EC_SUCCESS; /* we are ready */
}
@@ -418,6 +422,8 @@ void pd_power_supply_reset(int port)
if (port == CHG)
return;
+ ccd_enable(0);
+
/* Disable VBUS */
gpio_set_level(GPIO_DUT_CHG_EN, 0);
/* Set default VBUS source to Host */
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index b5e8ed134a..40264b3342 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -5,7 +5,6 @@
#include "battery.h"
#include "board.h"
-#include "case_closed_debug.h"
#include "charge_manager.h"
#include "charge_state.h"
#include "chipset.h"
@@ -110,8 +109,6 @@ static struct pd_protocol {
uint8_t power_role;
/* current port data role (DFP or UFP) */
uint8_t data_role;
- /* port flags, see PD_FLAGS_* */
- uint16_t flags;
/* 3-bit rolling message ID counter */
uint8_t msg_id;
/* Port polarity : 0 => CC1 is CC line, 1 => CC2 is CC line */
@@ -124,6 +121,8 @@ static struct pd_protocol {
uint8_t req_suspend_state;
/* The state to go to after timeout */
enum pd_states timeout_state;
+ /* port flags, see PD_FLAGS_* */
+ uint32_t flags;
/* Timeout for the current state. Set to 0 for no timeout. */
uint64_t timeout;
/* Time for source recovery after hard reset */
@@ -170,12 +169,12 @@ static const char * const pd_state_names[] = {
"DISABLED", "SUSPENDED",
#ifdef CONFIG_USB_PD_DUAL_ROLE
"SNK_DISCONNECTED", "SNK_DISCONNECTED_DEBOUNCE",
- "SNK_ACCESSORY", "SNK_HARD_RESET_RECOVER",
+ "SNK_HARD_RESET_RECOVER",
"SNK_DISCOVERY", "SNK_REQUESTED", "SNK_TRANSITION", "SNK_READY",
"SNK_SWAP_INIT", "SNK_SWAP_SNK_DISABLE",
"SNK_SWAP_SRC_DISABLE", "SNK_SWAP_STANDBY", "SNK_SWAP_COMPLETE",
#endif /* CONFIG_USB_PD_DUAL_ROLE */
- "SRC_DISCONNECTED", "SRC_DISCONNECTED_DEBOUNCE", "SRC_ACCESSORY",
+ "SRC_DISCONNECTED", "SRC_DISCONNECTED_DEBOUNCE",
"SRC_HARD_RESET_RECOVER", "SRC_STARTUP",
"SRC_DISCOVERY", "SRC_NEGOCIATE", "SRC_ACCEPTED", "SRC_POWERED",
"SRC_TRANSITION", "SRC_READY", "SRC_GET_SNK_CAP", "DR_SWAP",
@@ -240,6 +239,15 @@ 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;
+}
+
#ifdef CONFIG_USB_PD_DUAL_ROLE
void pd_vbus_low(int port)
{
@@ -254,17 +262,6 @@ static inline int pd_is_vbus_present(int port)
return pd_snk_is_vbus_provided(port);
#endif
}
-
-static int pd_debug_acc_plugged(int port)
-{
-#ifdef CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
- return pd[port].task_state == PD_STATE_SRC_ACCESSORY ||
- pd[port].task_state == PD_STATE_SNK_ACCESSORY;
-#else
- /* Debug accessories not supported */
- return 0;
-#endif
-}
#endif
static inline void set_state(int port, enum pd_states next_state)
@@ -1381,7 +1378,7 @@ void pd_update_dual_role_config(int port)
* disconnected state).
*/
if (pd[port].power_role == PD_ROLE_SOURCE &&
- ((drp_state == PD_DRP_FORCE_SINK && !pd_debug_acc_plugged(port)) ||
+ ((drp_state == PD_DRP_FORCE_SINK && !pd_ts_dts_plugged(port)) ||
(drp_state == PD_DRP_TOGGLE_OFF
&& pd[port].task_state == PD_STATE_SRC_DISCONNECTED))) {
pd[port].power_role = PD_ROLE_SINK;
@@ -1907,13 +1904,18 @@ void pd_task(void *u)
/* Debounce complete */
/* UFP is attached */
- if (new_cc_state == PD_CC_UFP_ATTACHED) {
- pd[port].polarity = (cc2 == TYPEC_CC_VOLT_RD);
+ if (new_cc_state == PD_CC_UFP_ATTACHED ||
+ new_cc_state == PD_CC_DEBUG_ACC) {
+ pd[port].polarity = (cc1 != TYPEC_CC_VOLT_RD);
tcpm_set_polarity(port, pd[port].polarity);
/* initial data role for source is DFP */
pd_set_data_role(port, PD_ROLE_DFP);
+ if (new_cc_state == PD_CC_DEBUG_ACC)
+ pd[port].flags |=
+ PD_FLAGS_TS_DTS_PARTNER;
+
#ifndef CONFIG_USBC_BACKWARDS_COMPATIBLE_DFP
/* Enable VBUS */
if (pd_set_power_supply_ready(port)) {
@@ -1940,60 +1942,10 @@ void pd_task(void *u)
timeout = 5*MSEC;
set_state(port, PD_STATE_SRC_STARTUP);
}
- /* Accessory is attached */
- else if (new_cc_state == PD_CC_AUDIO_ACC ||
- new_cc_state == PD_CC_DEBUG_ACC) {
-#ifdef CONFIG_USBC_BACKWARDS_COMPATIBLE_DFP
- /* Remove VBUS */
- pd_power_supply_reset(port);
-#endif
- /* Set the USB muxes and the default USB role */
- pd_set_data_role(port, CONFIG_USB_PD_DEBUG_DR);
-
-#ifdef CONFIG_USB_PD_DTS
- if (new_cc_state == PD_CC_DEBUG_ACC) {
- ccd_set_mode(system_is_locked() ?
- CCD_MODE_PARTIAL :
- CCD_MODE_ENABLED);
-
- /* Enable Vbus */
- pd_set_power_supply_ready(port);
- /* Captive cable, CC1 always */
- pd[port].polarity = 0;
- tcpm_set_polarity(port, 0);
- /* Enable TCPC RX */
- if (pd_comm_is_enabled(port))
- tcpm_set_rx_enable(port, 1);
- pd[port].flags |=
- PD_FLAGS_CHECK_DR_ROLE;
- hard_reset_count = 0;
- timeout = 10*MSEC;
- set_state(port, PD_STATE_SRC_STARTUP);
- break;
- }
-#endif
- set_state(port, PD_STATE_SRC_ACCESSORY);
- }
- break;
- case PD_STATE_SRC_ACCESSORY:
- /* Combined audio / debug accessory state */
- timeout = 100*MSEC;
-
- tcpm_get_cc(port, &cc1, &cc2);
-
- /* If accessory becomes detached */
- if ((pd[port].cc_state == PD_CC_AUDIO_ACC &&
- (cc1 != TYPEC_CC_VOLT_RA ||
- cc2 != TYPEC_CC_VOLT_RA)) ||
- (pd[port].cc_state == PD_CC_DEBUG_ACC &&
- (cc1 != TYPEC_CC_VOLT_RD ||
- cc2 != TYPEC_CC_VOLT_RD))) {
- set_state(port, PD_STATE_SRC_DISCONNECTED);
-#ifdef CONFIG_USB_PD_DTS
- ccd_set_mode(CCD_MODE_DISABLED);
-#endif
- timeout = 10*MSEC;
- }
+ /*
+ * AUDIO_ACC will remain in this state indefinitely
+ * until disconnect.
+ */
break;
case PD_STATE_SRC_HARD_RESET_RECOVER:
/* Do not continue until hard reset recovery time */
@@ -2454,32 +2406,20 @@ void pd_task(void *u)
tcpm_set_rx_enable(port, 1);
/* DFP is attached */
- if (new_cc_state == PD_CC_DFP_ATTACHED) {
+ if (new_cc_state == PD_CC_DFP_ATTACHED ||
+ new_cc_state == PD_CC_DEBUG_ACC) {
pd[port].flags |= PD_FLAGS_CHECK_PR_ROLE |
PD_FLAGS_CHECK_DR_ROLE |
PD_FLAGS_CHECK_IDENTITY;
+ if (new_cc_state == PD_CC_DEBUG_ACC)
+ pd[port].flags |=
+ PD_FLAGS_TS_DTS_PARTNER;
set_state(port, PD_STATE_SNK_DISCOVERY);
timeout = 10*MSEC;
hook_call_deferred(
&pd_usb_billboard_deferred_data,
PD_T_AME);
}
-#ifdef CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
- else if (new_cc_state == PD_CC_DEBUG_ACC)
- set_state(port, PD_STATE_SNK_ACCESSORY);
- break;
- case PD_STATE_SNK_ACCESSORY:
- /* debug accessory state */
- timeout = 100*MSEC;
-
- tcpm_get_cc(port, &cc1, &cc2);
-
- /* If accessory becomes detached */
- if (!cc_is_rp(cc1) || !cc_is_rp(cc2)) {
- set_state(port, PD_STATE_SNK_DISCONNECTED);
- timeout = 10*MSEC;
- }
-#endif
break;
case PD_STATE_SNK_HARD_RESET_RECOVER:
if (pd[port].last_state != pd[port].task_state)
@@ -3025,9 +2965,6 @@ void pd_task(void *u)
set_state(port, PD_STATE_SRC_DISCONNECTED);
/* Debouncing */
timeout = 10*MSEC;
-#ifdef CONFIG_USB_PD_DTS
- ccd_set_mode(CCD_MODE_DISABLED);
-#endif
#ifdef CONFIG_USB_PD_DUAL_ROLE
/*
* If Try.SRC is configured, then ATTACHED_SRC
diff --git a/include/case_closed_debug.h b/include/case_closed_debug.h
index b41532bc5e..6a8ce14ffc 100644
--- a/include/case_closed_debug.h
+++ b/include/case_closed_debug.h
@@ -7,34 +7,6 @@
#ifndef __CROS_EC_CASE_CLOSED_DEBUG_H
#define __CROS_EC_CASE_CLOSED_DEBUG_H
-enum ccd_mode {
- /*
- * The disabled mode tri-states the DP and DN lines.
- */
- CCD_MODE_DISABLED,
-
- /*
- * The partial mode allows some CCD functionality and is to be set
- * when the device is write protected and a CCD cable is detected.
- * This mode gives access to the APs console.
- */
- CCD_MODE_PARTIAL,
-
- /*
- * The fully enabled mode is used in factory and test lab
- * configurations where it is acceptable to be able to reflash the
- * device over CCD.
- */
- CCD_MODE_ENABLED,
-
- CCD_MODE_COUNT,
-};
-
-/*
- * Set current CCD mode, this function is idempotent.
- */
-void ccd_set_mode(enum ccd_mode new_mode);
-
/**
* Return non-zero if the CCD external interface is enabled.
*/
diff --git a/include/config.h b/include/config.h
index b4de2f8589..fefeaaf81d 100644
--- a/include/config.h
+++ b/include/config.h
@@ -410,8 +410,6 @@
*/
#undef CONFIG_DEDICATED_RECOVERY_BUTTON
-/* The case close debug (CCD) feature is provided by an external chip. */
-#undef CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
/* Support V1 CCD configuration */
#undef CONFIG_CASE_CLOSED_DEBUG_V1
/* Allow unsafe debugging functionality in V1 configuration */
@@ -2509,9 +2507,6 @@
*/
#undef CONFIG_USB_PD_DISCHARGE_TCPC
-/* Define if this board is acting as a Debug Test System (DTS) */
-#undef CONFIG_USB_PD_DTS
-
/* Define if this board can act as a dual-role PD port (source and sink) */
#undef CONFIG_USB_PD_DUAL_ROLE
diff --git a/include/usb_pd.h b/include/usb_pd.h
index bcb7df3ada..c84fea56b6 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -639,7 +639,6 @@ enum pd_states {
#ifdef CONFIG_USB_PD_DUAL_ROLE
PD_STATE_SNK_DISCONNECTED,
PD_STATE_SNK_DISCONNECTED_DEBOUNCE,
- PD_STATE_SNK_ACCESSORY,
PD_STATE_SNK_HARD_RESET_RECOVER,
PD_STATE_SNK_DISCOVERY,
PD_STATE_SNK_REQUESTED,
@@ -655,7 +654,6 @@ enum pd_states {
PD_STATE_SRC_DISCONNECTED,
PD_STATE_SRC_DISCONNECTED_DEBOUNCE,
- PD_STATE_SRC_ACCESSORY,
PD_STATE_SRC_HARD_RESET_RECOVER,
PD_STATE_SRC_STARTUP,
PD_STATE_SRC_DISCOVERY,
@@ -711,6 +709,7 @@ enum pd_states {
#define PD_FLAGS_TRY_SRC (1 << 13)/* Try.SRC states are active */
#define PD_FLAGS_PARTNER_USB_COMM (1 << 14)/* port partner is USB comms */
#define PD_FLAGS_UPDATE_SRC_CAPS (1 << 15)/* send new source capabilities */
+#define PD_FLAGS_TS_DTS_PARTNER (1 << 16)/* partner has rp/rp or rd/rd */
/* Flags to clear on a disconnect */
#define PD_FLAGS_RESET_ON_DISCONNECT_MASK (PD_FLAGS_PARTNER_DR_POWER | \
PD_FLAGS_PARTNER_DR_DATA | \
@@ -725,8 +724,8 @@ enum pd_states {
PD_FLAGS_VCONN_ON | \
PD_FLAGS_TRY_SRC | \
PD_FLAGS_PARTNER_USB_COMM | \
- PD_FLAGS_UPDATE_SRC_CAPS)
-
+ PD_FLAGS_UPDATE_SRC_CAPS | \
+ PD_FLAGS_TS_DTS_PARTNER)
enum pd_cc_states {
PD_CC_NONE,
@@ -1613,6 +1612,14 @@ 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);
+
/* ----- Logging ----- */
#ifdef CONFIG_USB_PD_LOGGING
/**