diff options
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, | |||
187 | int numbytes = 0; | 187 | int numbytes = 0; |
188 | int state; | 188 | int state; |
189 | int ret; | 189 | int ret; |
190 | int timeout = 100; | ||
190 | 191 | ||
191 | state = pca_status(adap); | 192 | while ((state = pca_status(adap)) != 0xf8 && timeout--) { |
192 | if ( state != 0xF8 ) { | 193 | msleep(10); |
193 | dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", state ); | 194 | } |
194 | /* FIXME: what to do. Force stop ? */ | 195 | if (state != 0xf8) { |
195 | return -EREMOTEIO; | 196 | dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", state); |
197 | return -EIO; | ||
196 | } | 198 | } |
197 | 199 | ||
198 | DEB1("{{{ XFER %d messages\n", num); | 200 | DEB1("{{{ XFER %d messages\n", num); |
@@ -354,8 +356,6 @@ static int pca_init(struct i2c_algo_pca_data *adap) | |||
354 | } | 356 | } |
355 | 357 | ||
356 | static struct i2c_algorithm pca_algo = { | 358 | static struct i2c_algorithm pca_algo = { |
357 | .name = "PCA9564 algorithm", | ||
358 | .id = I2C_ALGO_PCA, | ||
359 | .master_xfer = pca_xfer, | 359 | .master_xfer = pca_xfer, |
360 | .functionality = pca_func, | 360 | .functionality = pca_func, |
361 | }; | 361 | }; |
@@ -369,8 +369,6 @@ int i2c_pca_add_bus(struct i2c_adapter *adap) | |||
369 | int rval; | 369 | int rval; |
370 | 370 | ||
371 | /* register new adapter to i2c module... */ | 371 | /* register new adapter to i2c module... */ |
372 | |||
373 | adap->id |= pca_algo.id; | ||
374 | adap->algo = &pca_algo; | 372 | adap->algo = &pca_algo; |
375 | 373 | ||
376 | adap->timeout = 100; /* default values, should */ | 374 | adap->timeout = 100; /* default values, should */ |