Commit b10c4d40 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus/i2c/2636-rc5' of git://git.fluff.org/bjdooks/linux

* 'for-linus/i2c/2636-rc5' of git://git.fluff.org/bjdooks/linux:
  i2c-s3c2410: fix calculation of SDA line delay
  i2c-davinci: Fix race when setting up for TX
  i2c-octeon: Return -ETIMEDOUT in octeon_i2c_wait() on timeout
parents 303a4070 7031307a
...@@ -357,9 +357,6 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) ...@@ -357,9 +357,6 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)
dev->terminate = 0; dev->terminate = 0;
/* write the data into mode register */
davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);
/* /*
* First byte should be set here, not after interrupt, * First byte should be set here, not after interrupt,
* because transmit-data-ready interrupt can come before * because transmit-data-ready interrupt can come before
...@@ -371,6 +368,9 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) ...@@ -371,6 +368,9 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)
dev->buf_len--; dev->buf_len--;
} }
/* write the data into mode register; start transmitting */
davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);
r = wait_for_completion_interruptible_timeout(&dev->cmd_complete, r = wait_for_completion_interruptible_timeout(&dev->cmd_complete,
dev->adapter.timeout); dev->adapter.timeout);
if (r == 0) { if (r == 0) {
......
...@@ -218,7 +218,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c) ...@@ -218,7 +218,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c)
return result; return result;
} else if (result == 0) { } else if (result == 0) {
dev_dbg(i2c->dev, "%s: timeout\n", __func__); dev_dbg(i2c->dev, "%s: timeout\n", __func__);
result = -ETIMEDOUT; return -ETIMEDOUT;
} }
return 0; return 0;
......
...@@ -662,8 +662,8 @@ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) ...@@ -662,8 +662,8 @@ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got)
unsigned long sda_delay; unsigned long sda_delay;
if (pdata->sda_delay) { if (pdata->sda_delay) {
sda_delay = (freq / 1000) * pdata->sda_delay; sda_delay = clkin * pdata->sda_delay;
sda_delay /= 1000000; sda_delay = DIV_ROUND_UP(sda_delay, 1000000);
sda_delay = DIV_ROUND_UP(sda_delay, 5); sda_delay = DIV_ROUND_UP(sda_delay, 5);
if (sda_delay > 3) if (sda_delay > 3)
sda_delay = 3; sda_delay = 3;
......
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