i2c: s3c24xx: fix transferring more than one message in polling mode
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 8 Nov 2023 16:43:53 +0000 (17:43 +0100)
committerWolfram Sang <wsa@kernel.org>
Thu, 18 Jan 2024 20:10:42 +0000 (21:10 +0100)
commit990489e1042c6c5d6bccf56deca68f8dbeed8180
tree6a7b00fa7c5c332449bc864af5ff172cef6ebdac
parent0d9cf23ed55d7ba3ab26d617a3ae507863674c8f
i2c: s3c24xx: fix transferring more than one message in polling mode

To properly handle ACK on the bus when transferring more than one
message in polling mode, move the polling handling loop from
s3c24xx_i2c_message_start() to s3c24xx_i2c_doxfer(). This way
i2c_s3c_irq_nextbyte() is always executed till the end, properly
acknowledging the IRQ bits and no recursive calls to
i2c_s3c_irq_nextbyte() are made.

While touching this, also fix finishing transfers in polling mode by
using common code path and always waiting for the bus to become idle
and disabled.

Fixes: 117053f77a5a ("i2c: s3c2410: Add polling mode support")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-s3c2410.c