From e294f8086692cf86785ecb5aede4bedff86600a9 Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Mon, 26 Aug 2013 16:13:40 +0800 Subject: [PATCH] pit: i2c: dump after ADDR bit is cleared instead of before Dumping before the ADDR bit is cleared also has the effect of clearing the ADDR bit. BUG=chrome-os-partner:22235 TEST=Manual test on peach pit. Keep executing the "battery" command on the EC console while busy running flashrom on the host to read back the EC. See that there's no error produced. BRANCH=pit Signed-off-by: Hung-ying Tyan Change-Id: I10e88a8512f4e9eb90267ef1aca1df5dd214318d Reviewed-on: https://chromium-review.googlesource.com/66930 Reviewed-by: Douglas Anderson Commit-Queue: Hung-ying Tyan Tested-by: Hung-ying Tyan Reviewed-by: Randall Spangler --- chip/stm32/i2c-stm32l.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chip/stm32/i2c-stm32l.c b/chip/stm32/i2c-stm32l.c index 0892dc28e7..6f09cc340b 100644 --- a/chip/stm32/i2c-stm32l.c +++ b/chip/stm32/i2c-stm32l.c @@ -108,7 +108,6 @@ static int send_start(int port, int slave_addr) /* Write slave address */ STM32_I2C_DR(port) = slave_addr & 0xff; - dump_i2c_reg(port, "wrote addr"); rv = wait_sr1(port, STM32_I2C_SR1_ADDR); if (rv) return rv; @@ -116,6 +115,8 @@ static int send_start(int port, int slave_addr) /* Read SR2 to clear ADDR bit */ rv = STM32_I2C_SR2(port); + dump_i2c_reg(port, "wrote addr"); + return EC_SUCCESS; }