From b21f335c40568060cbd0b671d138f0ff69a47a05 Mon Sep 17 00:00:00 2001 From: Wai-Hong Tam Date: Tue, 17 Apr 2018 09:57:11 -0700 Subject: [PATCH] cheza: Lower the I2C speeds on TCPC buses to 400kHz The initial I2C operating speed of the port-0 TCPC chip is 400kHz. It requires changing a register addr:0x48 to a value 0x03 to increase its speed to 1MHz. The BC1.2 chips on port-0 and port-1 also operate at 400kHz, according to the datasheet. So lower the I2C speeds on two TCPC buses to 400kHz. BRANCH=none BUG=b:78142256 TEST=Use console to enable TPCP power and check I2C communication: > gpioset EN_USB_C0_TCPC_PWR 1 > gpioset USB_C0_PD_RST_R_L 1 > i2cscan 1 Scanning 1 tcpc0...................................... 0x4a... 0x50........................ 0x80............................................................... > i2cxfer r 1 0x50 0x00 0xaa [170] Change-Id: I665136d738de50db8beeed338e3102fb5ca6fc84 Signed-off-by: Wai-Hong Tam Reviewed-on: https://chromium-review.googlesource.com/1015763 Reviewed-by: Alexandru M Stan --- board/cheza/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/cheza/board.c b/board/cheza/board.c index bbf266ca1e..0995ef0089 100644 --- a/board/cheza/board.c +++ b/board/cheza/board.c @@ -35,8 +35,8 @@ const struct adc_t adc_channels[] = {}; /* I2C port map */ const struct i2c_port_t i2c_ports[] = { {"power", I2C_PORT_POWER, 400, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, - {"tcpc0", I2C_PORT_TCPC0, 1000, GPIO_I2C1_SCL, GPIO_I2C1_SDA}, - {"tcpc1", I2C_PORT_TCPC1, 1000, GPIO_I2C2_SCL, GPIO_I2C2_SDA}, + {"tcpc0", I2C_PORT_TCPC0, 400, GPIO_I2C1_SCL, GPIO_I2C1_SDA}, + {"tcpc1", I2C_PORT_TCPC1, 400, GPIO_I2C2_SCL, GPIO_I2C2_SDA}, {"eeprom", I2C_PORT_EEPROM, 400, GPIO_I2C5_SCL, GPIO_I2C5_SDA}, {"sensor", I2C_PORT_SENSOR, 400, GPIO_I2C7_SCL, GPIO_I2C7_SDA}, };