summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-05-21 07:32:59 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-05 04:22:56 +0000
commit31369a69dbf34cff8d9135f5d503efa717e3da35 (patch)
treea77f2778fb71da215b5d8748a551d49e21e51e89 /include
parent565f1cb5ae1ebd287e1bf00ab8245274a5ecbaa6 (diff)
downloadchrome-ec-31369a69dbf34cff8d9135f5d503efa717e3da35.tar.gz
samus: Add EC <-> PD i2c interface using host commands
Initial support for EC to PD communication using host command interface over i2c. BUG=chrome-os-partner:28351, chrome-os-partner:28352 BRANCH=none TEST=on EC console send hello host command: > pdcmd 0x01 0 0xa0 0xb0 0xc0 0xd0 Host command 0x01, returned 4 a4 b3 c2 d1 Change-Id: I0969808f455574ee456d6db8a60ce9b1204a0739 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/200786 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h6
-rw-r--r--include/host_command.h14
2 files changed, 20 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index 4700e00dbb..86b43d2509 100644
--- a/include/config.h
+++ b/include/config.h
@@ -496,6 +496,9 @@
/*****************************************************************************/
+/* Support EC acting as host master for other MCUs. */
+#undef CONFIG_HOST_CMD_MASTER
+
/*
* Support the host asking the EC about the status of the most recent host
* command.
@@ -860,6 +863,9 @@
/* USB PD transmit uses SPI master */
#undef CONFIG_USB_PD_TX_USES_SPI_MASTER
+/* USB PD MCU slave address for host commands */
+#define CONFIG_USB_PD_I2C_SLAVE_ADDR 0x3c
+
/* Support simple control of power to the device's USB ports */
#undef CONFIG_USB_PORT_POWER_DUMB
diff --git a/include/host_command.h b/include/host_command.h
index 158367a80b..1fbf0b6554 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -207,4 +207,18 @@ void host_packet_receive(struct host_packet *pkt);
*/
void host_throttle_cpu(int throttle);
+/**
+ * Send host command to PD MCU.
+ *
+ * @param command Host command number
+ * @param version Version of host command
+ * @param outdata Pointer to buffer of out data
+ * @param outsize Size of buffer to out data
+ * @param indata Pointer to buffer to store response
+ * @param insize Size of buffer to store response
+ */
+int pd_host_command(int command, int version,
+ const void *outdata, int outsize,
+ void *indata, int insize);
+
#endif /* __CROS_EC_HOST_COMMAND_H */