aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-cadence.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-cadence.c')
-rw-r--r--drivers/i2c/busses/i2c-cadence.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index b13605718291..d917cefc5a19 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -382,8 +382,10 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
382 * Check for the message size against FIFO depth and set the 382 * Check for the message size against FIFO depth and set the
383 * 'hold bus' bit if it is greater than FIFO depth. 383 * 'hold bus' bit if it is greater than FIFO depth.
384 */ 384 */
385 if (id->recv_count > CDNS_I2C_FIFO_DEPTH) 385 if ((id->recv_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
386 ctrl_reg |= CDNS_I2C_CR_HOLD; 386 ctrl_reg |= CDNS_I2C_CR_HOLD;
387 else
388 ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
387 389
388 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET); 390 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
389 391
@@ -440,8 +442,11 @@ static void cdns_i2c_msend(struct cdns_i2c *id)
440 * Check for the message size against FIFO depth and set the 442 * Check for the message size against FIFO depth and set the
441 * 'hold bus' bit if it is greater than FIFO depth. 443 * 'hold bus' bit if it is greater than FIFO depth.
442 */ 444 */
443 if (id->send_count > CDNS_I2C_FIFO_DEPTH) 445 if ((id->send_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
444 ctrl_reg |= CDNS_I2C_CR_HOLD; 446 ctrl_reg |= CDNS_I2C_CR_HOLD;
447 else
448 ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
449
445 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET); 450 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
446 451
447 /* Clear the interrupts in interrupt status register. */ 452 /* Clear the interrupts in interrupt status register. */