mlxsw: i2c: Allow flexible setting of I2C transactions size
authorVadim Pasternak <vadimp@mellanox.com>
Wed, 29 May 2019 08:47:16 +0000 (11:47 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 May 2019 19:59:46 +0000 (12:59 -0700)
commit3029a693beda5bff599feccc3beb9df1e141c786
tree505ceeb9ac97644f71f2a2f9c74c39710c551ba2
parent9bbd7efbc055b31b0e836936da94791c8890af4b
mlxsw: i2c: Allow flexible setting of I2C transactions size

Current implementation uses fixed size of I2C data transaction buffer.
Allow to set size of I2C transactions according to I2C physical adapter
capability. For that purpose adapter read and write size is obtained
from the I2C physical adapter and buffer size is set according to the
minimum of these two values. If adapter does not provide such info,
default buffer size is to be used.
It allows to improve performance of I2C access to silicon when long
size transactions are used.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/i2c.c