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/glkrvp/chg_usb_pd.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'board/glkrvp/chg_usb_pd.c') diff --git a/board/glkrvp/chg_usb_pd.c b/board/glkrvp/chg_usb_pd.c index 020b628083..bba185202f 100644 --- a/board/glkrvp/chg_usb_pd.c +++ b/board/glkrvp/chg_usb_pd.c @@ -31,10 +31,22 @@ enum glkrvp_charge_ports { }; const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { - /* Alert is active-low, push-pull */ - {NPCX_I2C_PORT7_0, 0xA0, &tcpci_tcpm_drv, 0}, - /* Alert is active-low, push-pull */ - {NPCX_I2C_PORT7_0, 0xA4, &tcpci_tcpm_drv, 0}, + { + .bus_type = EC_BUS_TYPE_I2C, + .i2c_info = { + .port = NPCX_I2C_PORT7_0, + .addr = 0xa0, + }, + .drv = &tcpci_tcpm_drv, + }, + { + .bus_type = EC_BUS_TYPE_I2C, + .i2c_info = { + .port = NPCX_I2C_PORT7_0, + .addr = 0xa4, + }, + .drv = &tcpci_tcpm_drv, + }, }; BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_COUNT); -- cgit v1.2.1