summaryrefslogtreecommitdiff
path: root/common/usb_pd_protocol.c
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2017-03-14 14:51:37 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-04-07 08:54:35 -0700
commitea57c36c18d6b811a58b5055969d0017f39b5162 (patch)
tree6f078f06efc6acf448104cb5ea2a82b4c94812e6 /common/usb_pd_protocol.c
parent672bffb2b34cdeb6d259794132c34d25e8e07a79 (diff)
downloadchrome-ec-ea57c36c18d6b811a58b5055969d0017f39b5162.tar.gz
servo_v4: Added dts_mode on/off control for DUT port connection
Added a new static variable disable_dts_mode. By default, DUT port will attempt to connect as a DTS source. However, if disable_dts_mode is set via a console command, the DUT port will connect as a regular source device. Charging behavior is identical between the two modes. In DTS mode, Rp is presented on both CC lines. When it's disabled Rp is presented only on CC1. Added tables to support the appropriate VNC and RD voltage thresholds. BUG=b:36908939 BRANCH=servo TEST=Tested with new console command 'dts on|off'. If new mode equals the current mode, no action is taken. If the mode is different, then verified that DUT port connects as DTS following 'dts on' and regular SRC following 'dts off'. Verifed this when the command is issued when connected to the DUT or disconnected. Validated that the H1 console is present for DTS mode and not present when DTS mode is disabled. Change-Id: Ie649709d6b2bbe947708d05eac42fde61d2677a8 Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/468447 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r--common/usb_pd_protocol.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 2986e84843..b92641e5c8 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -3015,22 +3015,15 @@ defined(CONFIG_CASE_CLOSED_DEBUG_EXTERNAL)
if (pd[port].power_role == PD_ROLE_SOURCE) {
/* Source: detect disconnect by monitoring CC */
tcpm_get_cc(port, &cc1, &cc2);
-#ifdef CONFIG_USB_PD_DTS
- /* If accessory becomes detached */
- if (cc1 != TYPEC_CC_VOLT_RD ||
- cc2 != TYPEC_CC_VOLT_RD) {
- set_state(port, PD_STATE_SRC_DISCONNECTED);
- /* Debouncing */
- timeout = 10*MSEC;
- ccd_set_mode(CCD_MODE_DISABLED);
- }
-#endif
if (pd[port].polarity)
cc1 = cc2;
if (cc1 == TYPEC_CC_VOLT_OPEN) {
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