Skip to content

Commit 1166779

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
i2c-bcm2708: Increase timeouts to allow larger transfers
Use the timeout value provided by the I2C_TIMEOUT ioctl when waiting for completion. The default timeout is 1 second. See: #260
1 parent d645d31 commit 1166779

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/i2c/busses/i2c-bcm2708.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@
6767
#define BSC_S_DONE 0x00000002
6868
#define BSC_S_TA 0x00000001
6969

70-
#define I2C_TIMEOUT_MS 150
71-
#define I2C_WAIT_LOOP_COUNT 40
70+
#define I2C_WAIT_LOOP_COUNT 200
7271

73-
#define DRV_NAME "bcm2708_i2c"
72+
#define DRV_NAME "bcm2708_i2c"
7473

7574
static unsigned int baudrate = CONFIG_I2C_BCM2708_BAUDRATE;
7675
module_param(baudrate, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
@@ -305,7 +304,7 @@ static int bcm2708_i2c_master_xfer(struct i2c_adapter *adap,
305304
goto error_timeout;
306305
}
307306

308-
ret = wait_for_completion_timeout(&bi->done, msecs_to_jiffies(I2C_TIMEOUT_MS));
307+
ret = wait_for_completion_timeout(&bi->done, adap->timeout);
309308
if (ret == 0) {
310309
dev_err(&adap->dev, "transfer timed out\n");
311310
goto error_timeout;

0 commit comments

Comments
 (0)