diff options
author | Michael Shych <michaelsh@mellanox.com> | 2018-03-27 17:01:24 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-04-30 11:39:28 +0300 |
commit | 845f2a6d00791f1f8541ae4c69a70a6be6d21fb8 (patch) | |
tree | 99d7a540d24a0b9c0e0a2faab03de57921695bc7 /drivers/i2c/busses/i2c-mlxcpld.c | |
parent | c9bfdc7c16cbc16348ede102f21d0c5c1338cee8 (diff) | |
download | linux-845f2a6d00791f1f8541ae4c69a70a6be6d21fb8.tar.xz |
i2c: mlxcpld: Fix adapter functionality support callback
It fixes report about supported functionality.
Functionality can be different up to CPLD capability.
Fixes: 6bec23bff9149 (i2c: mlxcpld: add master driver for mellanox systems)
Signed-off-by: Michael Shych <michaelsh@mellanox.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-mlxcpld.c')
-rw-r--r-- | drivers/i2c/busses/i2c-mlxcpld.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c index 4d8efe0dfe30..7341cee9cfe5 100644 --- a/drivers/i2c/busses/i2c-mlxcpld.c +++ b/drivers/i2c/busses/i2c-mlxcpld.c @@ -450,7 +450,14 @@ static int mlxcpld_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, static u32 mlxcpld_i2c_func(struct i2c_adapter *adap) { - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_SMBUS_BLOCK_DATA; + struct mlxcpld_i2c_priv *priv = i2c_get_adapdata(adap); + + if (priv->smbus_block) + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | + I2C_FUNC_SMBUS_I2C_BLOCK | I2C_FUNC_SMBUS_BLOCK_DATA; + else + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | + I2C_FUNC_SMBUS_I2C_BLOCK; } static const struct i2c_algorithm mlxcpld_i2c_algo = { |