Commit 1b2ba1f5 authored by Matt Johnston's avatar Matt Johnston Committed by David S. Miller
Browse files

i2c: aspeed: Allow 255 byte block transfers



255 byte transfers have been tested on an AST2500 board

Signed-off-by: default avatarMatt Johnston <matt@codeconstruct.com.au>
Reviewed-by: default avatarBrendan Higgins <brendanhiggins@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 84a107e6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -533,7 +533,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
		msg->buf[bus->buf_index++] = recv_byte;

		if (msg->flags & I2C_M_RECV_LEN) {
			if (unlikely(recv_byte > I2C_SMBUS_BLOCK_MAX)) {
			if (unlikely(recv_byte > I2C_SMBUS_V3_BLOCK_MAX)) {
				bus->cmd_err = -EPROTO;
				aspeed_i2c_do_stop(bus);
				goto out_no_complete;
@@ -718,7 +718,8 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,

static u32 aspeed_i2c_functionality(struct i2c_adapter *adap)
{
	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_SMBUS_BLOCK_DATA;
	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
		I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_V3_BLOCK;
}

#if IS_ENABLED(CONFIG_I2C_SLAVE)