]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: I2C: Use clock id
authorKomal Shah <komal_shah802003@yahoo.com>
Tue, 28 Feb 2006 20:21:16 +0000 (12:21 -0800)
committerTony Lindgren <tony@atomide.com>
Tue, 28 Feb 2006 20:21:16 +0000 (12:21 -0800)
Attached patch uses clock id for I2C clocks on OMAP2. Tested with H4.

Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clock.h
drivers/i2c/busses/i2c-omap.c

index 7a7ae6bacc0e7bf85e585d9281277784a87e84a1..6c78d471fab70b8ebe50c50f49401c6fb42f5747 100644 (file)
@@ -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,
index d64d37f6086e503fd752c80d22644553e2ac7499..f416d19ac591ce82fd1ba3cd2098204c83a25483 100644 (file)
@@ -162,19 +162,17 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg)
 }
 
 #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(struct omap_i2c_dev *dev)
 }
 
 #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 *pdev)
        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);