Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294809
b: refs/heads/master
c: c62c3ca
h: refs/heads/master
i:
  294807: 5cc2cc7
v: v3
  • Loading branch information
Mark Brown authored and Wolfram Sang committed Mar 7, 2012
1 parent c46aeb8 commit 0a622c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ea1557ff7862f63511420395d16647b74ba6f5c
refs/heads/master: c62c3ca55e0db52b311b1258ed08bc6c7525195e
10 changes: 10 additions & 0 deletions trunk/drivers/i2c/busses/i2c-s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/clk.h>
#include <linux/cpufreq.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -564,6 +565,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
int retry;
int ret;

pm_runtime_get_sync(&adap->dev);
clk_enable(i2c->clk);

for (retry = 0; retry < adap->retries; retry++) {
Expand All @@ -572,6 +574,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,

if (ret != -EAGAIN) {
clk_disable(i2c->clk);
pm_runtime_put_sync(&adap->dev);
return ret;
}

Expand All @@ -581,6 +584,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
}

clk_disable(i2c->clk);
pm_runtime_put_sync(&adap->dev);
return -EREMOTEIO;
}

Expand Down Expand Up @@ -1013,6 +1017,9 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
of_i2c_register_devices(&i2c->adap);
platform_set_drvdata(pdev, i2c);

pm_runtime_enable(&pdev->dev);
pm_runtime_enable(&i2c->adap.dev);

dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
clk_disable(i2c->clk);
return 0;
Expand Down Expand Up @@ -1047,6 +1054,9 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
{
struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);

pm_runtime_disable(&i2c->adap.dev);
pm_runtime_disable(&pdev->dev);

s3c24xx_i2c_deregister_cpufreq(i2c);

i2c_del_adapter(&i2c->adap);
Expand Down

0 comments on commit 0a622c4

Please sign in to comment.