]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
i2c: mlxcpld: Allow configurable adapter id for mlxcpld
authorMichael Shych <michaelsh@mellanox.com>
Tue, 27 Mar 2018 14:01:25 +0000 (14:01 +0000)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 30 Apr 2018 08:39:29 +0000 (10:39 +0200)
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>
drivers/i2c/busses/i2c-mlxcpld.c

index 7341cee9cfe5c69e60f59432d3777b0c3cde8616..745ed43a22d65cba3920aced8aa2f525d5e4e9a9 100644 (file)
@@ -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;