linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: michaelsh@mellanox.com
To: wsa@the-dreams.de
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Michael Shych <michaelsh@mellanox.com>
Subject: [PATCH v1 - resent 4/5] i2c: busses: Allow configurable adapter id for mlxcpld
Date: Tue, 27 Mar 2018 14:01:25 +0000	[thread overview]
Message-ID: <1522159286-41779-5-git-send-email-michaelsh@mellanox.com> (raw)
In-Reply-To: <1522159286-41779-1-git-send-email-michaelsh@mellanox.com>

From: Michael Shych <michaelsh@mellanox.com>

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>
---
 drivers/i2c/busses/i2c-mlxcpld.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c
index 7341cee9..745ed43 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;
-- 
2.1.4

  parent reply	other threads:[~2018-03-27 14:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 14:01 [PATCH v1 - resent 0/5] Add capabilities to i2c-mlxcpld michaelsh
2018-03-27 14:01 ` [PATCH v1 - resent 1/5] i2c: busses: Add support for extended transaction length for i2c-mlxcpld michaelsh
2018-03-27 14:01 ` [PATCH v1 - resent 2/5] i2c: busses: Add support for smbus block read transaction michaelsh
2018-03-27 14:01 ` [PATCH v1 - resent 3/5] i2c: busses: Fix adapter functionality support callback michaelsh
2018-03-27 14:01 ` michaelsh [this message]
2018-03-27 14:01 ` [PATCH v1 - resent 5/5] i2c: busses: Add capability register description to documentation michaelsh
2018-04-28 13:22 ` [PATCH v1 - resent 0/5] Add capabilities to i2c-mlxcpld Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522159286-41779-5-git-send-email-michaelsh@mellanox.com \
    --to=michaelsh@mellanox.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).