Skip to content

Commit

Permalink
i2c: designware: Add clk_{un}prepare() support
Browse files Browse the repository at this point in the history
clk_{un}prepare is mandatory for platforms using common clock framework. Since
this driver is used by SPEAr platform, which supports common clock framework,
add clk_{un}prepare() support for designware i2c.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
  • Loading branch information
Viresh Kumar authored and Wolfram Sang committed May 12, 2012
1 parent 3bf3b28 commit e1fac69
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/i2c/busses/i2c-designware-platdrv.c
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
r = -ENODEV;
goto err_free_mem;
}
clk_enable(dev->clk);
clk_prepare_enable(dev->clk);

dev->functionality =
I2C_FUNC_I2C |
@@ -156,7 +156,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
err_iounmap:
iounmap(dev->base);
err_unuse_clocks:
clk_disable(dev->clk);
clk_disable_unprepare(dev->clk);
clk_put(dev->clk);
dev->clk = NULL;
err_free_mem:
@@ -178,7 +178,7 @@ static int __devexit dw_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(&dev->adapter);
put_device(&pdev->dev);

clk_disable(dev->clk);
clk_disable_unprepare(dev->clk);
clk_put(dev->clk);
dev->clk = NULL;

@@ -205,7 +205,7 @@ static int dw_i2c_suspend(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);

clk_disable(i_dev->clk);
clk_disable_unprepare(i_dev->clk);

return 0;
}
@@ -215,7 +215,7 @@ static int dw_i2c_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);

clk_enable(i_dev->clk);
clk_prepare_enable(i_dev->clk);
i2c_dw_init(i_dev);

return 0;

0 comments on commit e1fac69

Please sign in to comment.