]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i2c: tegra: Add clk_prepare/clk_unprepare
authorPrashant Gaikwad <pgaikwad@nvidia.com>
Tue, 5 Jun 2012 04:29:36 +0000 (09:59 +0530)
committerStephen Warren <swarren@nvidia.com>
Mon, 11 Jun 2012 17:53:35 +0000 (11:53 -0600)
Use clk_prepare/clk_unprepare as required by the generic clk framework.

Cc: w.sang@pengutronix.de
Cc: linux-i2c@vger.kernel.org
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
drivers/i2c/busses/i2c-tegra.c

index 8b2e555a9563204476be25184d442d0422a49920..3da7ee3eb505e0816d809093958f0259816c3450 100644 (file)
@@ -341,7 +341,7 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
        u32 val;
        int err = 0;
 
-       clk_enable(i2c_dev->clk);
+       clk_prepare_enable(i2c_dev->clk);
 
        tegra_periph_reset_assert(i2c_dev->clk);
        udelay(2);
@@ -372,7 +372,7 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
        if (tegra_i2c_flush_fifos(i2c_dev))
                err = -ETIMEDOUT;
 
-       clk_disable(i2c_dev->clk);
+       clk_disable_unprepare(i2c_dev->clk);
 
        if (i2c_dev->irq_disabled) {
                i2c_dev->irq_disabled = 0;
@@ -546,14 +546,14 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
        if (i2c_dev->is_suspended)
                return -EBUSY;
 
-       clk_enable(i2c_dev->clk);
+       clk_prepare_enable(i2c_dev->clk);
        for (i = 0; i < num; i++) {
                int stop = (i == (num - 1)) ? 1  : 0;
                ret = tegra_i2c_xfer_msg(i2c_dev, &msgs[i], stop);
                if (ret)
                        break;
        }
-       clk_disable(i2c_dev->clk);
+       clk_disable_unprepare(i2c_dev->clk);
        return ret ?: i;
 }
 
@@ -666,7 +666,7 @@ static int __devinit tegra_i2c_probe(struct platform_device *pdev)
                goto err_free;
        }
 
-       clk_enable(i2c_dev->i2c_clk);
+       clk_prepare_enable(i2c_dev->i2c_clk);
 
        i2c_set_adapdata(&i2c_dev->adapter, i2c_dev);
        i2c_dev->adapter.owner = THIS_MODULE;