diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-28 17:04:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-28 17:04:53 -0400 |
commit | 07d43ba98621f08e252a48c96b258b4d572b0257 (patch) | |
tree | c5dd8be6b2032b02fb2a27a91b02a55d54ed702d /drivers/i2c/busses/i2c-davinci.c | |
parent | 0fe41b8982001cd14ee2c77cd776735a5024e98b (diff) | |
parent | 09b8ce0a691d8e76f14a16ac6cbfde899f6c68e3 (diff) |
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
i2c-core: Some style cleanups
i2c-piix4: Add support for the Broadcom HT1100 chipset
i2c-piix4: Add support to SB800 SMBus changes
i2c-pca-platform: Use defaults if no platform_data given
i2c-algo-pca: Use timeout for checking the state machine
i2c-algo-pca: Rework waiting for a free bus
i2c-algo-pca: Add PCA9665 support
i2c: Adapt debug macros for KERN_* constants
i2c-davinci: Fix timeout handling
i2c: Adapter timeout is in jiffies
i2c: Set a default timeout value for all adapters
i2c: Add missing KERN_* constants to printks
i2c-algo-pcf: Handle timeout correctly
i2c-algo-pcf: Style cleanups
eeprom/at24: Remove EXPERIMENTAL
i2c-nforce2: Add support for MCP67, MCP73, MCP78S and MCP79
i2c: Clarify which clients are auto-removed
i2c: Let checkpatch shout on users of the legacy model
i2c: Document the different ways to instantiate i2c devices
Diffstat (limited to 'drivers/i2c/busses/i2c-davinci.c')
-rw-r--r-- | drivers/i2c/busses/i2c-davinci.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 5d7789834b95..3fae3a91ce5b 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c | |||
@@ -216,7 +216,7 @@ static int i2c_davinci_wait_bus_not_busy(struct davinci_i2c_dev *dev, | |||
216 | { | 216 | { |
217 | unsigned long timeout; | 217 | unsigned long timeout; |
218 | 218 | ||
219 | timeout = jiffies + DAVINCI_I2C_TIMEOUT; | 219 | timeout = jiffies + dev->adapter.timeout; |
220 | while (davinci_i2c_read_reg(dev, DAVINCI_I2C_STR_REG) | 220 | while (davinci_i2c_read_reg(dev, DAVINCI_I2C_STR_REG) |
221 | & DAVINCI_I2C_STR_BB) { | 221 | & DAVINCI_I2C_STR_BB) { |
222 | if (time_after(jiffies, timeout)) { | 222 | if (time_after(jiffies, timeout)) { |
@@ -289,7 +289,7 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) | |||
289 | davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); | 289 | davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); |
290 | 290 | ||
291 | r = wait_for_completion_interruptible_timeout(&dev->cmd_complete, | 291 | r = wait_for_completion_interruptible_timeout(&dev->cmd_complete, |
292 | DAVINCI_I2C_TIMEOUT); | 292 | dev->adapter.timeout); |
293 | if (r == 0) { | 293 | if (r == 0) { |
294 | dev_err(dev->dev, "controller timed out\n"); | 294 | dev_err(dev->dev, "controller timed out\n"); |
295 | i2c_davinci_init(dev); | 295 | i2c_davinci_init(dev); |
@@ -546,9 +546,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) | |||
546 | strlcpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name)); | 546 | strlcpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name)); |
547 | adap->algo = &i2c_davinci_algo; | 547 | adap->algo = &i2c_davinci_algo; |
548 | adap->dev.parent = &pdev->dev; | 548 | adap->dev.parent = &pdev->dev; |
549 | 549 | adap->timeout = DAVINCI_I2C_TIMEOUT; | |
550 | /* FIXME */ | ||
551 | adap->timeout = 1; | ||
552 | 550 | ||
553 | adap->nr = pdev->id; | 551 | adap->nr = pdev->id; |
554 | r = i2c_add_numbered_adapter(adap); | 552 | r = i2c_add_numbered_adapter(adap); |