From 3a668749460466ff002b5dd2cbf00529f97e5974 Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Fri, 31 May 2019 16:45:32 -0700 Subject: TCPC: Make tcpc_config handle other bus types Currently, tcpc_config assumes TCPCs are on I2C bus. ITE's EC has an embedded TCPC. This patch adds bus_type field to struct tcpc_config_t so that a TCPC location on other type of bus can be specified. Signed-off-by: Daisuke Nojiri BUG=none BRANCH=none TEST=buildall Change-Id: Ieac733011700b351e6323f46070dcf46d9e1154b Reviewed-on: https://chromium-review.googlesource.com/1640305 Commit-Ready: Daisuke Nojiri Tested-by: Daisuke Nojiri Legacy-Commit-Queue: Commit Bot Reviewed-by: Jett Rink --- board/poppy/board.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'board/poppy') diff --git a/board/poppy/board.c b/board/poppy/board.c index c65d65260c..3c27da46ba 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -210,18 +210,20 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); /* TCPC mux configuration */ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { { - .i2c_host_port = NPCX_I2C_PORT0_0, - .i2c_slave_addr = ANX74XX_I2C_ADDR1, + .bus_type = EC_BUS_TYPE_I2C, + .i2c_info = { + .port = NPCX_I2C_PORT0_0, + .addr = ANX74XX_I2C_ADDR1, + }, .drv = &anx74xx_tcpm_drv, - /* Alert is active-low, push-pull */ - .flags = 0, }, { - .i2c_host_port = NPCX_I2C_PORT0_0, - .i2c_slave_addr = PS8751_I2C_ADDR1, + .bus_type = EC_BUS_TYPE_I2C, + .i2c_info = { + .port = NPCX_I2C_PORT0_0, + .addr = PS8751_I2C_ADDR1, + }, .drv = &ps8xxx_tcpm_drv, - /* Alert is active-low, push-pull */ - .flags = 0, }, }; -- cgit v1.2.1