@@ -158,6 +158,7 @@ static int i2c_dw_irq_handler_slave(struct dw_i2c_dev *dev)
{
u32 raw_stat, stat, enabled, tmp;
u8 val = 0, slave_activity;
+ u32 rx_valid;
regmap_read(dev->map, DW_IC_ENABLE, &enabled);
regmap_read(dev->map, DW_IC_RAW_INTR_STAT, &raw_stat);
@@ -179,11 +180,14 @@ static int i2c_dw_irq_handler_slave(struct dw_i2c_dev *dev)
&val);
}
- regmap_read(dev->map, DW_IC_DATA_CMD, &tmp);
- val = tmp;
- if (!i2c_slave_event(dev->slave, I2C_SLAVE_WRITE_RECEIVED,
- &val))
- dev_vdbg(dev->dev, "Byte %X acked!", val);
+ regmap_read(dev, DW_IC_RXFLR, &rx_valid);
+ for (; rx_valid > 0; rx_valid--) {
+ regmap_read(dev->map, DW_IC_DATA_CMD, &tmp);
+ val = tmp;
+ if (!i2c_slave_event(dev->slave, I2C_SLAVE_WRITE_RECEIVED,
+ &val))
+ dev_vdbg(dev->dev, "Byte %X acked!", val);
+ }
}
if (stat & DW_IC_INTR_RD_REQ) {