All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rajeshwari Shinde <rajeshwari.s@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 7/8 V2] I2C: Add support for Multi channel
Date: Thu, 07 Jun 2012 11:39:53 +0530	[thread overview]
Message-ID: <1339049394-4816-8-git-send-email-rajeshwari.s@samsung.com> (raw)
In-Reply-To: <1339049394-4816-1-git-send-email-rajeshwari.s@samsung.com>

This adds multiple i2c channel support for I2C.

Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
---
 drivers/i2c/s3c24x0_i2c.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
index a71f147..7521cb8 100644
--- a/drivers/i2c/s3c24x0_i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -191,6 +191,33 @@ static void i2c_bus_init(struct s3c24x0_i2c *i2c, unsigned int bus)
 	i2c_ch_init(i2c, CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 }
 
+/*
+ * MULTI BUS I2C support
+ */
+
+#ifdef CONFIG_I2C_MULTI_BUS
+int i2c_set_bus_num(unsigned int bus)
+{
+	struct s3c24x0_i2c *i2c;
+
+	if ((bus < 0) || (bus >= CONFIG_MAX_I2C_NUM)) {
+		debug("Bad bus: %d\n", bus);
+		return -1;
+	}
+
+	g_current_bus = bus;
+	i2c = get_base_i2c(g_current_bus);
+	i2c_bus_init(i2c, g_current_bus);
+
+	return 0;
+}
+
+unsigned int i2c_get_bus_num(void)
+{
+	return g_current_bus;
+}
+#endif
+
 #ifdef CONFIG_EXYNOS5
 void i2c_init(int speed, int slaveadd)
 {
-- 
1.7.4.4

  parent reply	other threads:[~2012-06-07  6:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07  6:09 [U-Boot] [PATCH 0/8 V2] EXYNOS5: Enable I2C support Rajeshwari Shinde
2012-06-07  6:09 ` [U-Boot] [PATCH 1/8 V2] EXYNOS: CLK: Add i2c clock Rajeshwari Shinde
2012-06-12  5:46   ` Simon Glass
2012-06-07  6:09 ` [U-Boot] [PATCH 2/8 V2] EXYNOS: Add I2C base address Rajeshwari Shinde
2012-06-07  6:09 ` [U-Boot] [PATCH 3/8 V2] EXYNOS: PINMUX: Add pinmux support for I2C Rajeshwari Shinde
2012-06-12  5:47   ` Simon Glass
2012-06-07  6:09 ` [U-Boot] [PATCH 4/8 V2] I2C: Move struct s3c24x0_i2c to a common place Rajeshwari Shinde
2012-06-07  6:09 ` [U-Boot] [PATCH 5/8 V2] I2C: S3C24X0: Add offset to calculate next i2c channel base address Rajeshwari Shinde
2012-06-07  6:09 ` [U-Boot] [PATCH 6/8 V2] I2C: Modify the I2C driver for EXYNOS5 Rajeshwari Shinde
2012-06-12  5:52   ` Simon Glass
2012-06-15  7:10   ` Joonyoung Shim
2012-06-19  5:38     ` Rajeshwari Birje
2012-06-19  7:15       ` Joonyoung Shim
2012-06-19  7:28         ` Rajeshwari Birje
2012-06-07  6:09 ` Rajeshwari Shinde [this message]
2012-06-15  7:15   ` [U-Boot] [PATCH 7/8 V2] I2C: Add support for Multi channel Joonyoung Shim
2012-06-19  5:44     ` Rajeshwari Birje
2012-06-19  7:30       ` Joonyoung Shim
2012-06-07  6:09 ` [U-Boot] [PATCH 8/8 V2] CONFIG: SMDK5250: I2C: Enable I2C Rajeshwari Shinde

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=1339049394-4816-8-git-send-email-rajeshwari.s@samsung.com \
    --to=rajeshwari.s@samsung.com \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.