summaryrefslogtreecommitdiff
path: root/include/usb_pd_tcpc.h
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-05-04 09:22:42 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-22 18:12:02 +0000
commit37a23855f7bba522f4cb300d8f4547764e5e3578 (patch)
tree5c17c6562bfb1231e164c75800e0d6ef3f3de5d0 /include/usb_pd_tcpc.h
parent608fa5efd868325ce85fca1f777a89c0909ea032 (diff)
downloadchrome-ec-37a23855f7bba522f4cb300d8f4547764e5e3578.tar.gz
pd: add first version of TCPCI I2C interface
Add first version of TCPCI (type-C port controller interface), which is an I2C protocol for interfacing with TCPCs. This is roughly tracking version 0.56 of the PD Interface spec. BUG=none BRANCH=none TEST=tested on oak. modified oak EC to be TCPM and oak PD to be TCPC and tested we can negotiate with hoho and zinger. Change-Id: I83644ca83f2d3ce69d5d8356beca20a7ab155a87 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/270172
Diffstat (limited to 'include/usb_pd_tcpc.h')
-rw-r--r--include/usb_pd_tcpc.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/usb_pd_tcpc.h b/include/usb_pd_tcpc.h
new file mode 100644
index 0000000000..b954c6f7ae
--- /dev/null
+++ b/include/usb_pd_tcpc.h
@@ -0,0 +1,26 @@
+/* Copyright 2015 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* USB Power delivery port controller */
+
+#ifndef __USB_PD_TCPC_H
+#define __USB_PD_TCPC_H
+
+#ifndef CONFIG_TCPC_I2C_BASE_ADDR
+#define CONFIG_TCPC_I2C_BASE_ADDR 0x9c
+#endif
+
+/**
+ * Process incoming TCPCI I2C command
+ *
+ * @param read This is a read request. If 0, this is a write request.
+ * @param len Length of incoming payload
+ * @param payload Pointer to incoming and outgoing data
+ * @param send_response Function to call to send response if necessary
+ */
+void tcpc_i2c_process(int read, int port, int len, uint8_t *payload,
+ void (*send_response)(int));
+
+#endif /* __USB_PD_TCPC_H */