diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-11-04 12:43:07 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-08 17:31:12 -0800 |
commit | 92a65427d3881f3d2ec64b1ab540fb5a4aa0ce93 (patch) | |
tree | 6f99c785998cc784755ed1317724a236ffd656ab /include | |
parent | 6f4595ff7ac0821c9e4a4097444e6838e33b52c1 (diff) | |
download | chrome-ec-92a65427d3881f3d2ec64b1ab540fb5a4aa0ce93.tar.gz |
tcpm: Add configuration struct for tcpc i2c params
Add a new configuration struct tcpc_config_t that initially defines the
i2c host port and i2c slave address of all TCPCs present on the board.
This will allow us to create boards with multiple TCPCs on different i2c
ports, with arbitrary i2c slave addresses.
BUG=chromium:551078
TEST=Manual on glados. Verify PD communication / charging is still
functional on both PD ports.
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I9b2bde85d7f1642e8727c052e064371be7967619
Reviewed-on: https://chromium-review.googlesource.com/311000
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 2 | ||||
-rw-r--r-- | include/usb_pd_tcpc.h | 4 | ||||
-rw-r--r-- | include/usb_pd_tcpm.h | 9 |
3 files changed, 10 insertions, 5 deletions
diff --git a/include/config.h b/include/config.h index a1e1d8e78c..1e8618ca7d 100644 --- a/include/config.h +++ b/include/config.h @@ -1783,7 +1783,7 @@ #undef CONFIG_USB_PD_TCPM_VBUS /* Define the type-c port controller I2C base address. */ -#undef CONFIG_TCPC_I2C_BASE_ADDR +#define CONFIG_TCPC_I2C_BASE_ADDR 0x9c /* Use this option to enable Try.SRC mode for Dual Role devices */ #undef CONFIG_USB_PD_TRY_SRC diff --git a/include/usb_pd_tcpc.h b/include/usb_pd_tcpc.h index a640714c4f..371e6666a4 100644 --- a/include/usb_pd_tcpc.h +++ b/include/usb_pd_tcpc.h @@ -8,10 +8,6 @@ #ifndef __CROS_EC_USB_PD_TCPC_H #define __CROS_EC_USB_PD_TCPC_H -#ifndef CONFIG_TCPC_I2C_BASE_ADDR -#define CONFIG_TCPC_I2C_BASE_ADDR 0x9c -#endif - /* If we are a TCPC but do not a TCPM, then we implement the slave TCPCI */ #if defined(CONFIG_USB_PD_TCPC) && !defined(CONFIG_USB_PD_TCPM_STUB) #define TCPCI_I2C_SLAVE diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index 8d446bcae8..6b1180cafd 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -47,6 +47,15 @@ enum tcpc_transmit_complete { TCPC_TX_COMPLETE_FAILED = 2, }; +struct tcpc_config_t { + int i2c_host_port; + int i2c_slave_addr; + /* + * TODO: Consider adding driver struct / function pointers to support + * different TCPM drivers on the same board. + */ +}; + /** * Initialize TCPM driver and wait for TCPC readiness. * |