aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-s3c2410.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-s3c2410.c')
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 6a292ea5e35c..6c00c107ebf3 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -554,18 +554,23 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
554 int retry; 554 int retry;
555 int ret; 555 int ret;
556 556
557 clk_enable(i2c->clk);
558
557 for (retry = 0; retry < adap->retries; retry++) { 559 for (retry = 0; retry < adap->retries; retry++) {
558 560
559 ret = s3c24xx_i2c_doxfer(i2c, msgs, num); 561 ret = s3c24xx_i2c_doxfer(i2c, msgs, num);
560 562
561 if (ret != -EAGAIN) 563 if (ret != -EAGAIN) {
564 clk_disable(i2c->clk);
562 return ret; 565 return ret;
566 }
563 567
564 dev_dbg(i2c->dev, "Retrying transmission (%d)\n", retry); 568 dev_dbg(i2c->dev, "Retrying transmission (%d)\n", retry);
565 569
566 udelay(100); 570 udelay(100);
567 } 571 }
568 572
573 clk_disable(i2c->clk);
569 return -EREMOTEIO; 574 return -EREMOTEIO;
570} 575}
571 576
@@ -910,6 +915,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
910 platform_set_drvdata(pdev, i2c); 915 platform_set_drvdata(pdev, i2c);
911 916
912 dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev)); 917 dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
918 clk_disable(i2c->clk);
913 return 0; 919 return 0;
914 920
915 err_cpufreq: 921 err_cpufreq:
@@ -977,7 +983,9 @@ static int s3c24xx_i2c_resume(struct device *dev)
977 struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); 983 struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
978 984
979 i2c->suspended = 0; 985 i2c->suspended = 0;
986 clk_enable(i2c->clk);
980 s3c24xx_i2c_init(i2c); 987 s3c24xx_i2c_init(i2c);
988 clk_disable(i2c->clk);
981 989
982 return 0; 990 return 0;
983} 991}