diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2017-10-12 08:21:41 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-19 12:56:42 -0700 |
commit | 251212fb9dea6d95a8caa43ec9eeb210abfa2df8 (patch) | |
tree | a85685d1f78524a104ee0b5f00c97293e96d30e6 /include | |
parent | 7c2c5a9dc3779587f78a7c602cefeb667d210d41 (diff) | |
download | chrome-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>
Diffstat (limited to 'include')
-rw-r--r-- | include/case_closed_debug.h | 28 | ||||
-rw-r--r-- | include/config.h | 5 | ||||
-rw-r--r-- | include/usb_pd.h | 15 |
3 files changed, 11 insertions, 37 deletions
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 /** |