summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMulin Chao <mlchao@nuvoton.com>2016-06-27 13:24:33 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-27 23:09:04 -0700
commit9dc2c1471c44a314dfe6dcc48e1527c4315ebf09 (patch)
tree2de9a4de59b4c8ac32c4630a06abefb700ec2392
parentdcac93af41db6a28f49a02cb168b431ee9ffa2d3 (diff)
downloadchrome-ec-9dc2c1471c44a314dfe6dcc48e1527c4315ebf09.tar.gz
npcx: i2c: Don't do i2c_unwedge / reset on repeated start requeststabilize-8516.B
Checking for bus busy (stop condition sent) should not apply if the caller is requesting a repeated start. BUG=None TEST=Manual on gru. Attach USB PD charger, verify i2c_unwedge is not called. BRANCH=None Change-Id: Idf13bdc530920c8da02c8d0d8064377513a5d144 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/356490 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--chip/npcx/i2c.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/chip/npcx/i2c.c b/chip/npcx/i2c.c
index 33f906d2e3..2f834adcfa 100644
--- a/chip/npcx/i2c.c
+++ b/chip/npcx/i2c.c
@@ -635,8 +635,11 @@ int chip_i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_size,
p_status->err_code = SMB_OK;
/* Make sure we're in a good state to start */
- if ((flags & I2C_XFER_START) && (i2c_bus_busy(ctrl)
- || (i2c_get_line_levels(port) != I2C_LINE_IDLE))) {
+ if ((flags & I2C_XFER_START) &&
+ /* Ignore busy bus for repeated start */
+ p_status->oper_state != SMB_WRITE_SUSPEND &&
+ (i2c_bus_busy(ctrl)
+ || (i2c_get_line_levels(port) != I2C_LINE_IDLE))) {
/* Attempt to unwedge the i2c port. */
i2c_unwedge(port);