public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Komal Shah <komal_shah802003@yahoo.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH] OMAP2: I2C: Use clock id
Date: Mon, 27 Feb 2006 06:43:42 -0800 (PST)	[thread overview]
Message-ID: <20060227144342.94854.qmail@web32901.mail.mud.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

Tony,

Attached patch uses clock id for I2C clocks on OMAP2. Tested with H4.

Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[-- Attachment #2: 1237781688-i2c-clkid.patch --]
[-- Type: application/octet-stream, Size: 2651 bytes --]

diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 7a7ae6b..6c78d47 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -1698,7 +1698,8 @@ static struct clk hdq_fck = {
 };
 
 static struct clk i2c2_ick = {
-	.name		= "i2c2_ick",
+	.name		= "i2c_ick",
+	.id		= 2,
 	.parent		= &l4_ck,
 	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
 	.enable_reg	= (void __iomem *)&CM_ICLKEN1_CORE,
@@ -1707,7 +1708,8 @@ static struct clk i2c2_ick = {
 };
 
 static struct clk i2c2_fck = {
-	.name		= "i2c2_fck",
+	.name		= "i2c_fck",
+	.id		= 2,
 	.parent		= &func_12m_ck,
 	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
 	.enable_reg	= (void __iomem *)&CM_FCLKEN1_CORE,
@@ -1725,7 +1727,8 @@ static struct clk i2chs2_fck = {
 };
 
 static struct clk i2c1_ick = {
-	.name		= "i2c1_ick",
+	.name		= "i2c_ick",
+	.id		= 1,
 	.parent		= &l4_ck,
 	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
 	.enable_reg	= (void __iomem *)&CM_ICLKEN1_CORE,
@@ -1734,7 +1737,8 @@ static struct clk i2c1_ick = {
 };
 
 static struct clk i2c1_fck = {
-	.name		= "i2c1_fck",
+	.name		= "i2c_fck",
+	.id		= 1,
 	.parent		= &func_12m_ck,
 	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
 	.enable_reg	= (void __iomem *)&CM_FCLKEN1_CORE,
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index d64d37f..f416d19 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -162,19 +162,17 @@ static inline u16 omap_i2c_read_reg(stru
 }
 
 #ifdef CONFIG_ARCH_OMAP24XX
-static int omap_i2c_get_clocks(struct omap_i2c_dev *dev, int bus)
+static int omap_i2c_get_clocks(struct omap_i2c_dev *dev)
 {
 	if (!cpu_is_omap24xx())
 		return 0;
 
-	dev->iclk = clk_get(NULL,
-		bus == 1 ? "i2c1_ick" : "i2c2_ick");
+	dev->iclk = clk_get(dev->dev, "i2c_ick");
 	if (IS_ERR(dev->iclk)) {
 		return -ENODEV;
 	}
 
-	dev->fclk = clk_get(NULL,
-		bus == 1 ? "i2c1_fck" : "i2c2_fck");
+	dev->fclk = clk_get(dev->dev, "i2c_fck");
 	if (IS_ERR(dev->fclk)) {
 		clk_put(dev->fclk);
 		return -ENODEV;
@@ -202,7 +200,7 @@ static void omap_i2c_disable_clocks(stru
 }
 
 #else
-#define omap_i2c_get_clocks(x, y)		0
+#define omap_i2c_get_clocks(x)		0
 #define omap_i2c_enable_clocks(x)	do {} while (0)
 #define omap_i2c_disable_clocks(x)	do {} while (0)
 #define omap_i2c_put_clocks(x)		do {} while (0)
@@ -619,7 +617,7 @@ omap_i2c_probe(struct platform_device *p
 	dev->base = (void __iomem *) IO_ADDRESS(mem->start);
 	platform_set_drvdata(pdev, dev);
 
-	if ((r = omap_i2c_get_clocks(dev, pdev->id)) != 0)
+	if ((r = omap_i2c_get_clocks(dev)) != 0)
 		goto do_free_mem;
 
 	omap_i2c_enable_clocks(dev);

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2006-02-27 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-27 14:43 Komal Shah [this message]
2006-02-28 20:21 ` [PATCH] OMAP2: I2C: Use clock id Tony Lindgren

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=20060227144342.94854.qmail@web32901.mail.mud.yahoo.com \
    --to=komal_shah802003@yahoo.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /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