From ffa405476096c5c1905f7f9bf9235043ad8f0257 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Tue, 27 Mar 2018 13:46:19 -0600 Subject: usbc: add default I2C addresses Add hard coded I2C addresses as defined by datasheet. BRANCH=none BUG=none TEST=none Change-Id: Ia69cc4da7474a9c1f8a994d33db88e0a405f02b7 Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/982561 Reviewed-by: Daisuke Nojiri --- board/coral/board.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'board/coral') diff --git a/board/coral/board.c b/board/coral/board.c index e54138b904..ec9d76cd62 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -191,7 +191,7 @@ struct i2c_stress_test i2c_stress_tests[] = { #ifdef CONFIG_CMD_I2C_STRESS_TEST_TCPC { .port = NPCX_I2C_PORT0_0, - .addr = 0x50, + .addr = ANX74XX_I2C_ADDR1, .i2c_test = &anx74xx_i2c_stress_test_dev, }, #endif @@ -200,7 +200,7 @@ struct i2c_stress_test i2c_stress_tests[] = { #ifdef CONFIG_CMD_I2C_STRESS_TEST_TCPC { .port = NPCX_I2C_PORT0_1, - .addr = 0x16, + .addr = PS8751_I2C_ADDR1, .i2c_test = &ps8xxx_i2c_stress_test_dev, }, #endif @@ -241,13 +241,13 @@ const int i2c_test_dev_used = ARRAY_SIZE(i2c_stress_tests); const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { [USB_PD_PORT_ANX74XX] = { .i2c_host_port = NPCX_I2C_PORT0_0, - .i2c_slave_addr = 0x50, + .i2c_slave_addr = ANX74XX_I2C_ADDR1, .drv = &anx74xx_tcpm_drv, .pol = TCPC_ALERT_ACTIVE_LOW, }, [USB_PD_PORT_PS8751] = { .i2c_host_port = NPCX_I2C_PORT0_1, - .i2c_slave_addr = 0x16, + .i2c_slave_addr = PS8751_I2C_ADDR1, .drv = &ps8xxx_tcpm_drv, .pol = TCPC_ALERT_ACTIVE_LOW, }, @@ -281,8 +281,7 @@ const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); static int ps8751_tune_mux(const struct usb_mux *mux) { /* 0x98 sets lower EQ of DP port (4.5db) */ - i2c_write8(NPCX_I2C_PORT0_1, 0x16, PS8XXX_REG_MUX_DP_EQ_CONFIGURATION, - 0x98); + tcpc_write(mux->port_addr, PS8XXX_REG_MUX_DP_EQ_CONFIGURATION, 0x98); return EC_SUCCESS; } -- cgit v1.2.1