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 /board/pdeval-stm32f072/board.c | |
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 'board/pdeval-stm32f072/board.c')
-rw-r--r-- | board/pdeval-stm32f072/board.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/board/pdeval-stm32f072/board.c b/board/pdeval-stm32f072/board.c index 3daedb5ae1..6fd472eee5 100644 --- a/board/pdeval-stm32f072/board.c +++ b/board/pdeval-stm32f072/board.c @@ -14,6 +14,7 @@ #include "task.h" #include "usb_descriptor.h" #include "usb_pd.h" +#include "usb_pd_tcpm.h" #include "util.h" void button_event(enum gpio_signal signal); @@ -53,3 +54,10 @@ const struct i2c_port_t i2c_ports[] = { {"tcpc", I2C_PORT_TCPC, 100 /* kHz */, GPIO_I2C0_SCL, GPIO_I2C0_SDA} }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); + +const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { + {I2C_PORT_TCPC, TCPC1_I2C_ADDR}, +#if CONFIG_USB_PD_PORT_COUNT >= 2 + {I2C_PORT_TCPC, TCPC2_I2C_ADDR}, +#endif +}; |