i2c: tegra: moving to clk prepare APIs
Sivaram Nair [Thu, 1 Nov 2012 15:59:47 +0000 (17:59 +0200)]
The clk_enable/clk_disable pair of APIs are replaced with
clk_prepare_enable and clk_disable_unprepare.

This is needed for the migration to common clk framework.

Bug 920915

Change-Id: I0aa15cd744729813bed3f12a0b6e516e303ecb30
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/162333
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rama Kandhala <rkandhala@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/i2c/busses/i2c-slave-tegra.c
drivers/i2c/busses/i2c-tegra.c

index 83d4b2e..82f3cfa 100644 (file)
@@ -1070,14 +1070,14 @@ static int tegra_i2c_slave_runtime_idle(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct tegra_i2c_slave_dev *i2c_dev = platform_get_drvdata(pdev);
-       clk_disable(i2c_dev->clk);
+       clk_disable_unprepare(i2c_dev->clk);
        return 0;
 }
 static int tegra_i2c_slave_runtime_resume(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct tegra_i2c_slave_dev *i2c_dev = platform_get_drvdata(pdev);
-       clk_enable(i2c_dev->clk);
+       clk_prepare_enable(i2c_dev->clk);
        return 0;
 }
 static const struct dev_pm_ops tegra_i2c_slave_dev_pm_ops = {
index d852191..7f12c96 100644 (file)
@@ -470,27 +470,27 @@ static inline int tegra_i2c_clock_enable(struct tegra_i2c_dev *i2c_dev)
 {
        int ret;
        if (i2c_dev->chipdata->has_fast_clock) {
-               ret = clk_enable(i2c_dev->fast_clk);
+               ret = clk_prepare_enable(i2c_dev->fast_clk);
                if (ret < 0) {
                        dev_err(i2c_dev->dev,
                                "Error in enabling fast clock err %d\n", ret);
                        return ret;
                }
        }
-       ret = clk_enable(i2c_dev->div_clk);
+       ret = clk_prepare_enable(i2c_dev->div_clk);
        if (ret < 0) {
                dev_err(i2c_dev->dev,
                        "Error in enabling div clock err %d\n", ret);
-               clk_disable(i2c_dev->fast_clk);
+               clk_disable_unprepare(i2c_dev->fast_clk);
        }
        return ret;
 }
 
 static inline void tegra_i2c_clock_disable(struct tegra_i2c_dev *i2c_dev)
 {
-       clk_disable(i2c_dev->div_clk);
+       clk_disable_unprepare(i2c_dev->div_clk);
        if (i2c_dev->chipdata->has_fast_clock)
-               clk_disable(i2c_dev->fast_clk);
+               clk_disable_unprepare(i2c_dev->fast_clk);
 }
 
 static void tegra_i2c_set_clk_rate(struct tegra_i2c_dev *i2c_dev)