]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: microchip-corei2c: fix erroneous late ack send
authorConor Dooley <conor.dooley@microchip.com>
Fri, 5 Aug 2022 07:43:46 +0000 (08:43 +0100)
committerWolfram Sang <wsa@kernel.org>
Thu, 11 Aug 2022 12:28:56 +0000 (14:28 +0200)
commit3bc837c25f9800c8b5a3efd58a078c45ad3c3531
tree89862558ac56097f4e1d10b9cfa7651e442bea71
parent4cf7e85aaebc0c9954f545c74af1afd60b0b4350
i2c: microchip-corei2c: fix erroneous late ack send

A late ack is currently being sent at the end of a transfer due to
incorrect logic in mchp_corei2c_empty_rx(). Currently the Assert Ack
bit is being written to the controller's control reg after the last
byte has been received, causing it to sent another byte with the ack.
Instead, the AA flag should be written to the control register when
the penultimate byte is read so it is sent out for the last byte.

Reported-by: Andreas Buerkler <andreas.buerkler@enclustra.com>
Fixes: 6c1313249775 ("i2c: add support for microchip fpga i2c controllers")
Tested-by: Lewis Hanly <lewis.hanly@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
[wsa: fixed typos in commit message]
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-microchip-corei2c.c