summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-01-16 21:29:32 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-22 12:01:35 +0000
commit5c95136c7fb3acdeaf182727d7417b2a02cdbdfb (patch)
tree601f860f7f8284d0b804f436061a8a2a477c5e4a /include
parentbe95f2907da12b1d7c94d4e194ac7e5bee185c40 (diff)
downloadchrome-ec-5c95136c7fb3acdeaf182727d7417b2a02cdbdfb.tar.gz
driver/tcpci: Add support for TCPCI Rev2 v1.0
The TCPCI Revision 2.0 made a couple major changes compared to the 1.0 revision. One of these changes was that the method in transmitting and receiving messages from the TCPC had changed. The receive buffer register is now comprised of three sets of registers: READABLE_BYTE_COUNT, RX_BUF_FRAME_TYPE, and RX_BUF_BYTE_x. These registers can only be accessed by reading at a common register address 30h. Similarly, the transmit buffer register holds the I2C_WRITE_BYTE_COUNT and the portion of the SOP* USB PD message payload (including the header) in TX_BUF_BYTE_x. TX_BUF_BYTE_x is "hidden" and can only be accessed by writing to register address 51h. This commit adds support for TCPCI Rev2 v1.0 by adding the new mechanisms for transmitting and receiving messages. A flag was introduced to enable the TCPCI Rev2 handling, TCPC_FLAGS_TCPCI_V2_0. A board should set this flag in their tcpc_config structs for those TCPCI-compliant TCPCs which use TCPCI Rev2. BUG=b:147716486 BRANCH=None TEST=Enable TCPCI Rev2.0 on waddledoo, verify that PD messages are able to be received and transmitted. Change-Id: Ie0117adf56c95f85f9c67ed678cf1e367f83eb7e Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2006710 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/usb_pd_tcpm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 9d6cbec160..9a4140afb4 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -355,10 +355,12 @@ struct tcpm_drv {
* Bit 0 --> Polarity for TCPC alert. Set to 1 if alert is active high.
* Bit 1 --> Set to 1 if TCPC alert line is open-drain instead of push-pull.
* Bit 2 --> Polarity for TCPC reset. Set to 1 if reset line is active high.
+ * Bit 3 --> Set to 1 if TCPC is using TCPCI Version 2.0
*/
#define TCPC_FLAGS_ALERT_ACTIVE_HIGH BIT(0)
#define TCPC_FLAGS_ALERT_OD BIT(1)
#define TCPC_FLAGS_RESET_ACTIVE_HIGH BIT(2)
+#define TCPC_FLAGS_TCPCI_V2_0 BIT(3)
struct tcpc_config_t {
enum ec_bus_type bus_type; /* enum ec_bus_type */