summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2021-07-29 10:27:56 +0800
committerCommit Bot <commit-bot@chromium.org>2021-07-30 09:19:41 +0000
commit8ee45dc055b809ba27c279c37a5df389f772de9b (patch)
tree6e377f1d4ecc2f8034982ba60dcc44f769afd9b4 /chip
parent77d3756d27758276c084cf20693202cfa645df3e (diff)
downloadchrome-ec-8ee45dc055b809ba27c279c37a5df389f772de9b.tar.gz
it83xx: i2c: don't check bus busy if transaction is ongoing.
This CL fixes that i2c driver will prompt "I2C chx reset cause 1" issue when one i2c transaction is separated into at least three i2c_xfer and I2C_XFER_START flag is set at least two times. eg. - i2c_xfer with I2C_XFER_START flag - i2c_xfer with I2C_XFER_START flag <= this will cause reset - xxx - i2c_xfer with I2C_XFER_STOP flag BRANCH=none BUG=none TEST=no i2c reset on Asurada, Drawcia, and ADL-RVP. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I97161db0bb0c54de3ad55d82512a6a188036270f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3058724 Tested-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'chip')
-rw-r--r--chip/it83xx/i2c.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/chip/it83xx/i2c.c b/chip/it83xx/i2c.c
index d6dc366f56..5aa8f8a460 100644
--- a/chip/it83xx/i2c.c
+++ b/chip/it83xx/i2c.c
@@ -651,10 +651,15 @@ int chip_i2c_xfer(int port, uint16_t addr_flags,
if (out_size == 0 && in_size == 0)
return EC_SUCCESS;
- if (pd->i2ccs) {
- if ((flags & I2C_XFER_SINGLE) == I2C_XFER_SINGLE)
- flags &= ~I2C_XFER_START;
- }
+ /*
+ * Make the below i2c transaction work:
+ * - i2c_xfer with I2C_XFER_START flag
+ * - i2c_xfer with I2C_XFER_START flag
+ * - xxx
+ * - i2c_xfer with I2C_XFER_STOP flag
+ */
+ if (pd->i2ccs)
+ flags &= ~I2C_XFER_START;
/* Copy data to port struct */
pd->out = out;