i2c: xiic: Add wait for FIFO empty in send_tx
authorRaviteja Narayanam <raviteja.narayanam@xilinx.com>
Thu, 2 Feb 2023 09:41:33 +0000 (15:11 +0530)
committerWolfram Sang <wsa@kernel.org>
Fri, 3 Feb 2023 16:34:08 +0000 (17:34 +0100)
commit317b56c9aa9b0b0f4fae738e27998901b7b3b51c
tree179806a9377589e4e9bc2ae3bb737340cb783d31
parent2fd5cf352efa0c62dd20d1e046bc8767395b1ec0
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: Raviteja Narayanam <raviteja.narayanam@xilinx.com>
Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-xiic.c