summaryrefslogtreecommitdiff
path: root/driver/tcpm/tcpci.h
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2019-06-20 22:53:18 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-16 06:32:49 +0000
commit91be7060d7694eedb53ce73b39bc7423a3814536 (patch)
tree4c236211331689195ee8c02854e6b0b6d63cbf83 /driver/tcpm/tcpci.h
parentd731e31bce43a8616bff235626bc69f71712bc7a (diff)
downloadchrome-ec-91be7060d7694eedb53ce73b39bc7423a3814536.tar.gz
usb_pd: Adding USB-C cable detection
When a discover identity command is sent with a SOP prime packet, the cable plug of an emark cable responds with the cable attribute. Added a structure pd_cable that stores the cable type and and resetting it when the cable is disconnected. Also added console command that gives the type of cable connected. Host(DFP) Cable Port-Partner(UFP) -------------------------EXPLICIT CONTRACT------------------------ Discover Identity SOP -----------------------------> request | <------------------------- Discover Identity response Discover Identity SOP' ---------> request | (If Emark Cable) <------------ Discover Identity SOP' | response Store cable type | (If Non-Emark Cable) <-------------- No response | Discover SVID SOP request ------------------------------------> (Rest of the PD flow) BUG=b:129990370 BRANCH=none TEST=Verified on dragonegg, able to get cable response Change-Id: I2536cf24d58f7ee5ff462b34fc32f69d7a200d41 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1707851 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'driver/tcpm/tcpci.h')
-rw-r--r--driver/tcpm/tcpci.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/driver/tcpm/tcpci.h b/driver/tcpm/tcpci.h
index 9bec93e325..6db71e4161 100644
--- a/driver/tcpm/tcpci.h
+++ b/driver/tcpm/tcpci.h
@@ -116,8 +116,9 @@
#define TCPC_REG_RX_DATA 0x34 /* through 0x4f */
#define TCPC_REG_TRANSMIT 0x50
-#define TCPC_REG_TRANSMIT_SET(type) \
+#define TCPC_REG_TRANSMIT_SET_WITH_RETRY(type) \
(PD_RETRY_COUNT << 4 | (type))
+#define TCPC_REG_TRANSMIT_SET_WITHOUT_RETRY(type) (type)
#define TCPC_REG_TRANSMIT_RETRY(reg) (((reg) & 0x30) >> 4)
#define TCPC_REG_TRANSMIT_TYPE(reg) ((reg) & 0x7)