i2c: cadence: Increase timeout per message if necessary
authorLucas Tanure <tanureal@opensource.cirrus.com>
Wed, 13 Apr 2022 09:14:10 +0000 (10:14 +0100)
committerWolfram Sang <wsa@kernel.org>
Sat, 14 May 2022 13:58:56 +0000 (15:58 +0200)
commit96789dce043f5bff8b7d62aa28d52a7c59403a84
tree6976bc8715af5c8efe8f9fd12fdf09d2db2114f2
parente17daa3b58ed8ba187475b4bb12ca21193596cb3
i2c: cadence: Increase timeout per message if necessary

Timeout as 1 second sets an upper limit on the length
of the transfer executed, but there is no maximum length
of a write or read message set in i2c_adapter_quirks for
this controller.

This upper limit affects devices that require sending
large firmware blobs over I2C.

To remove that limitation, calculate the minimal time
necessary, plus some wiggle room, for every message and
use it instead of the default one second, if more than
one second.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-cadence.c