|
@@ -516,6 +516,14 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
|
|
|
if (likely(i2c_dev->msg_err == I2C_ERR_NONE))
|
|
|
return 0;
|
|
|
|
|
|
+ /*
|
|
|
+ * NACK interrupt is generated before the I2C controller generates the
|
|
|
+ * STOP condition on the bus. So wait for 2 clock periods before resetting
|
|
|
+ * the controller so that STOP condition has been delivered properly.
|
|
|
+ */
|
|
|
+ if (i2c_dev->msg_err == I2C_ERR_NO_ACK)
|
|
|
+ udelay(DIV_ROUND_UP(2 * 1000000, i2c_dev->bus_clk_rate));
|
|
|
+
|
|
|
tegra_i2c_init(i2c_dev);
|
|
|
if (i2c_dev->msg_err == I2C_ERR_NO_ACK) {
|
|
|
if (msg->flags & I2C_M_IGNORE_NAK)
|