Commit d3b64c59 authored by Thomas Abraham's avatar Thomas Abraham Committed by Wolfram Sang

i2c: s3c2410: use clk_prepare_enable and clk_disable_unprepare

Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.
Signed-off-by: default avatarThomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent 3db11fef
...@@ -601,14 +601,14 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, ...@@ -601,14 +601,14 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
int ret; int ret;
pm_runtime_get_sync(&adap->dev); pm_runtime_get_sync(&adap->dev);
clk_enable(i2c->clk); clk_prepare_enable(i2c->clk);
for (retry = 0; retry < adap->retries; retry++) { for (retry = 0; retry < adap->retries; retry++) {
ret = s3c24xx_i2c_doxfer(i2c, msgs, num); ret = s3c24xx_i2c_doxfer(i2c, msgs, num);
if (ret != -EAGAIN) { if (ret != -EAGAIN) {
clk_disable(i2c->clk); clk_disable_unprepare(i2c->clk);
pm_runtime_put(&adap->dev); pm_runtime_put(&adap->dev);
return ret; return ret;
} }
...@@ -618,7 +618,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, ...@@ -618,7 +618,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
udelay(100); udelay(100);
} }
clk_disable(i2c->clk); clk_disable_unprepare(i2c->clk);
pm_runtime_put(&adap->dev); pm_runtime_put(&adap->dev);
return -EREMOTEIO; return -EREMOTEIO;
} }
...@@ -977,7 +977,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) ...@@ -977,7 +977,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk); dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
clk_enable(i2c->clk); clk_prepare_enable(i2c->clk);
/* map the registers */ /* map the registers */
...@@ -1065,7 +1065,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) ...@@ -1065,7 +1065,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
pm_runtime_enable(&i2c->adap.dev); pm_runtime_enable(&i2c->adap.dev);
dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev)); dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
clk_disable(i2c->clk); clk_disable_unprepare(i2c->clk);
return 0; return 0;
err_cpufreq: err_cpufreq:
...@@ -1082,7 +1082,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) ...@@ -1082,7 +1082,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
kfree(i2c->ioarea); kfree(i2c->ioarea);
err_clk: err_clk:
clk_disable(i2c->clk); clk_disable_unprepare(i2c->clk);
clk_put(i2c->clk); clk_put(i2c->clk);
err_noclk: err_noclk:
...@@ -1106,7 +1106,7 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) ...@@ -1106,7 +1106,7 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(&i2c->adap); i2c_del_adapter(&i2c->adap);
free_irq(i2c->irq, i2c); free_irq(i2c->irq, i2c);
clk_disable(i2c->clk); clk_disable_unprepare(i2c->clk);
clk_put(i2c->clk); clk_put(i2c->clk);
iounmap(i2c->regs); iounmap(i2c->regs);
...@@ -1135,9 +1135,9 @@ static int s3c24xx_i2c_resume(struct device *dev) ...@@ -1135,9 +1135,9 @@ static int s3c24xx_i2c_resume(struct device *dev)
struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
i2c->suspended = 0; i2c->suspended = 0;
clk_enable(i2c->clk); clk_prepare_enable(i2c->clk);
s3c24xx_i2c_init(i2c); s3c24xx_i2c_init(i2c);
clk_disable(i2c->clk); clk_disable_unprepare(i2c->clk);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment