aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-mlxcpld.c
diff options
context:
space:
mode:
authorMichael Shych <michaelsh@mellanox.com>2018-03-27 14:01:25 +0000
committerWolfram Sang <wsa@the-dreams.de>2018-04-30 10:39:29 +0200
commitae4aa68dd3e4bf16bff6078c1851b832b0b3db1a (patch)
treedf4faad7e5edae6002cdbe2cbe6ce71bf1d5e9c5 /drivers/i2c/busses/i2c-mlxcpld.c
parent845f2a6d00791f1f8541ae4c69a70a6be6d21fb8 (diff)
i2c: mlxcpld: Allow configurable adapter id for mlxcpld
It allows mlxcpld driver to be connected to pre-defined adapter number equal or greater than one, in order to avoid current limitation, assuming usage of id number one only. 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c
index 7341cee9cfe5..745ed43a22d6 100644
--- a/drivers/i2c/busses/i2c-mlxcpld.c
+++ b/drivers/i2c/busses/i2c-mlxcpld.c
@@ -514,6 +514,8 @@ static int mlxcpld_i2c_probe(struct platform_device *pdev)
/* Check support for smbus block transaction */
if (val & MLXCPLD_I2C_SMBUS_BLK_BIT)
priv->smbus_block = true;
+ if (pdev->id >= -1)
+ mlxcpld_i2c_adapter.nr = pdev->id;
priv->adap = mlxcpld_i2c_adapter;
priv->adap.dev.parent = &pdev->dev;
priv->base_addr = MLXPLAT_CPLD_LPC_I2C_BASE_ADDR;