Merge branch 'for-2637/i2c/samsung' into next-i2c
authorBen Dooks <ben-linux@fluff.org>
Thu, 28 Oct 2010 09:07:14 +0000 (10:07 +0100)
committerBen Dooks <ben-linux@fluff.org>
Thu, 28 Oct 2010 09:07:14 +0000 (10:07 +0100)
1  2 
drivers/i2c/busses/i2c-s3c2410.c

index 6a292ea5e35c3ca4dcd5f9f24c1dda4d3c3e6181,3dc1eb9f8088c3482644282ad9cfa2ad29b124af..6c00c107ebf30af4360bd3fef78fac03b62a4683
@@@ -24,6 -24,7 +24,6 @@@
  #include <linux/module.h>
  
  #include <linux/i2c.h>
 -#include <linux/i2c-id.h>
  #include <linux/init.h>
  #include <linux/time.h>
  #include <linux/interrupt.h>
@@@ -554,18 -555,23 +554,23 @@@ static int s3c24xx_i2c_xfer(struct i2c_
        int retry;
        int ret;
  
+       clk_enable(i2c->clk);
        for (retry = 0; retry < adap->retries; retry++) {
  
                ret = s3c24xx_i2c_doxfer(i2c, msgs, num);
  
-               if (ret != -EAGAIN)
+               if (ret != -EAGAIN) {
+                       clk_disable(i2c->clk);
                        return ret;
+               }
  
                dev_dbg(i2c->dev, "Retrying transmission (%d)\n", retry);
  
                udelay(100);
        }
  
+       clk_disable(i2c->clk);
        return -EREMOTEIO;
  }
  
@@@ -910,6 -916,7 +915,7 @@@ static int s3c24xx_i2c_probe(struct pla
        platform_set_drvdata(pdev, i2c);
  
        dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
+       clk_disable(i2c->clk);
        return 0;
  
   err_cpufreq:
@@@ -977,7 -984,9 +983,9 @@@ static int s3c24xx_i2c_resume(struct de
        struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
  
        i2c->suspended = 0;
+       clk_enable(i2c->clk);
        s3c24xx_i2c_init(i2c);
+       clk_disable(i2c->clk);
  
        return 0;
  }