]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: core: Allow 255 byte transfers for SMBus 3.x
authorMatt Johnston <matt@codeconstruct.com.au>
Mon, 15 Nov 2021 02:49:21 +0000 (10:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Nov 2021 14:11:24 +0000 (14:11 +0000)
commit6bd881c6d33aea55d7130a20a25635514ec2aa80
tree087813184352ae3f0f9788a737dfbc13c02f9b5a
parent47d95f289c07773b12e946055cac8942b31cb704
i2c: core: Allow 255 byte transfers for SMBus 3.x

SMBus 3.0 increased the maximum block transfer size from 32 bytes to
255 bytes. We increase the size of struct i2c_smbus_data's block[]
member.

i2c_smbus_xfer() and i2c_smbus_xfer_emulated() now support 255 byte
block operations, other block functions remain limited to 32 bytes for
compatibility with existing callers.

We allow adapters to indicate support for the larger size with
I2C_FUNC_SMBUS_V3_BLOCK. Most emulated drivers should be able to use 255
byte blocks by replacing I2C_SMBUS_BLOCK_MAX with I2C_SMBUS_V3_BLOCK_MAX
though some will have hardware limitations that need testing.

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/i2c/i2c-core-smbus.c
include/linux/i2c.h
include/uapi/linux/i2c.h