Skip to content

Commit 5c01572

Browse files
Devyn LiuAndi Shyti
authored andcommitted
i2c: hisi: Optimized the value setting of maxwrite limit to fifo depth - 1
The driver finishes a write cycle by read the fifo tx full status or write limit decrease to 0. The driver starts to write data to the FIFO after the I2C FIFO almost empty interrupt is reported. The threshold for FIFO almost empty interrupt is that the amount of data in the FIFO is less than or equal to 1. Reduce write maxwrite to the fifo depth - aempty interrupt threshold. Limiting the number of data to be written at a time to remaining fifo capacity. Signed-off-by: Devyn Liu <[email protected]> Reviewed-by: Yicong Yang <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 7a7fd33 commit 5c01572

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-hisi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static int hisi_i2c_read_rx_fifo(struct hisi_i2c_controller *ctlr)
266266

267267
static void hisi_i2c_xfer_msg(struct hisi_i2c_controller *ctlr)
268268
{
269-
int max_write = HISI_I2C_TX_FIFO_DEPTH;
269+
int max_write = HISI_I2C_TX_FIFO_DEPTH - HISI_I2C_TX_F_AE_THRESH;
270270
bool need_restart = false, last_msg;
271271
struct i2c_msg *cur_msg;
272272
u32 cmd, fifo_state;

0 commit comments

Comments
 (0)