Commit 317b56c9 authored by Raviteja Narayanam's avatar Raviteja Narayanam Committed by Wolfram Sang

i2c: xiic: Add wait for FIFO empty in send_tx

If the tx_half_empty interrupt comes first instead of tx_empty,
STOP bit is generated even before all the bytes are transmitted
out on the bus.
STOP bit should be sent only after all the bytes in the FIFO are
transmitted out of the FIFO. So wait until FIFO is empty before sending
the STOP bit.
Signed-off-by: default avatarRaviteja Narayanam <raviteja.narayanam@xilinx.com>
Signed-off-by: default avatarManikanta Guntupalli <manikanta.guntupalli@amd.com>
Acked-by: default avatarMichal Simek <michal.simek@amd.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 2fd5cf35
......@@ -436,6 +436,13 @@ static void xiic_fill_tx_fifo(struct xiic_i2c *i2c)
data |= XIIC_TX_DYN_STOP_MASK;
} else {
u8 cr;
int status;
/* Wait till FIFO is empty so STOP is sent last */
status = xiic_wait_tx_empty(i2c);
if (status)
return;
/* Write to CR to stop */
cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET);
xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, cr &
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment