diff options
| author | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-06 00:31:02 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-06 00:31:02 -0700 |
| commit | 8566cfc9fe0934f52ddedc12b083176116c13978 (patch) | |
| tree | b0f92fd0982a4dabaa2c108f4f1d130d2cff6798 /drivers/i2c/algos/i2c-algo-pca.c | |
| parent | 7bdb2b6aca356c765bb697a4e9e7599357ee1542 (diff) | |
| parent | 77ae84554cc0178e03862391599a0cedf96fa4c4 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
Diffstat (limited to 'drivers/i2c/algos/i2c-algo-pca.c')
| -rw-r--r-- | drivers/i2c/algos/i2c-algo-pca.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index cc3a952401f2..beb10edfe9c1 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c @@ -187,12 +187,14 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, int numbytes = 0; int state; int ret; + int timeout = 100; - state = pca_status(adap); - if ( state != 0xF8 ) { - dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", state ); - /* FIXME: what to do. Force stop ? */ - return -EREMOTEIO; + while ((state = pca_status(adap)) != 0xf8 && timeout--) { + msleep(10); + } + if (state != 0xf8) { + dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", state); + return -EIO; } DEB1("{{{ XFER %d messages\n", num); @@ -354,8 +356,6 @@ static int pca_init(struct i2c_algo_pca_data *adap) } static struct i2c_algorithm pca_algo = { - .name = "PCA9564 algorithm", - .id = I2C_ALGO_PCA, .master_xfer = pca_xfer, .functionality = pca_func, }; @@ -369,8 +369,6 @@ int i2c_pca_add_bus(struct i2c_adapter *adap) int rval; /* register new adapter to i2c module... */ - - adap->id |= pca_algo.id; adap->algo = &pca_algo; adap->timeout = 100; /* default values, should */ |
