|
22 | 22 | #define MLXCPLD_I2C_BUS_NUM 1
|
23 | 23 | #define MLXCPLD_I2C_DATA_REG_SZ 36
|
24 | 24 | #define MLXCPLD_I2C_DATA_SZ_BIT BIT(5)
|
| 25 | +#define MLXCPLD_I2C_DATA_EXT2_SZ_BIT BIT(6) |
25 | 26 | #define MLXCPLD_I2C_DATA_SZ_MASK GENMASK(6, 5)
|
26 | 27 | #define MLXCPLD_I2C_SMBUS_BLK_BIT BIT(7)
|
27 | 28 | #define MLXCPLD_I2C_MAX_ADDR_LEN 4
|
@@ -466,6 +467,13 @@ static const struct i2c_adapter_quirks mlxcpld_i2c_quirks_ext = {
|
466 | 467 | .max_comb_1st_msg_len = 4,
|
467 | 468 | };
|
468 | 469 |
|
| 470 | +static const struct i2c_adapter_quirks mlxcpld_i2c_quirks_ext2 = { |
| 471 | + .flags = I2C_AQ_COMB_WRITE_THEN_READ, |
| 472 | + .max_read_len = (MLXCPLD_I2C_DATA_REG_SZ - 4) * 4, |
| 473 | + .max_write_len = (MLXCPLD_I2C_DATA_REG_SZ - 4) * 4 + MLXCPLD_I2C_MAX_ADDR_LEN, |
| 474 | + .max_comb_1st_msg_len = 4, |
| 475 | +}; |
| 476 | + |
469 | 477 | static struct i2c_adapter mlxcpld_i2c_adapter = {
|
470 | 478 | .owner = THIS_MODULE,
|
471 | 479 | .name = "i2c-mlxcpld",
|
@@ -547,6 +555,8 @@ static int mlxcpld_i2c_probe(struct platform_device *pdev)
|
547 | 555 | /* Check support for extended transaction length */
|
548 | 556 | if ((val & MLXCPLD_I2C_DATA_SZ_MASK) == MLXCPLD_I2C_DATA_SZ_BIT)
|
549 | 557 | mlxcpld_i2c_adapter.quirks = &mlxcpld_i2c_quirks_ext;
|
| 558 | + else if ((val & MLXCPLD_I2C_DATA_SZ_MASK) == MLXCPLD_I2C_DATA_EXT2_SZ_BIT) |
| 559 | + mlxcpld_i2c_adapter.quirks = &mlxcpld_i2c_quirks_ext2; |
550 | 560 | /* Check support for smbus block transaction */
|
551 | 561 | if (val & MLXCPLD_I2C_SMBUS_BLK_BIT)
|
552 | 562 | priv->smbus_block = true;
|
|
0 commit comments