aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-isch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-isch.c')
-rw-r--r--drivers/i2c/busses/i2c-isch.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c
index 6561d275b8cf..f90a6057508d 100644
--- a/drivers/i2c/busses/i2c-isch.c
+++ b/drivers/i2c/busses/i2c-isch.c
@@ -47,7 +47,7 @@
47#define SMBBLKDAT (0x20 + sch_smba) 47#define SMBBLKDAT (0x20 + sch_smba)
48 48
49/* Other settings */ 49/* Other settings */
50#define MAX_TIMEOUT 500 50#define MAX_RETRIES 5000
51 51
52/* I2C constants */ 52/* I2C constants */
53#define SCH_QUICK 0x00 53#define SCH_QUICK 0x00
@@ -68,7 +68,7 @@ static int sch_transaction(void)
68{ 68{
69 int temp; 69 int temp;
70 int result = 0; 70 int result = 0;
71 int timeout = 0; 71 int retries = 0;
72 72
73 dev_dbg(&sch_adapter.dev, "Transaction (pre): CNT=%02x, CMD=%02x, " 73 dev_dbg(&sch_adapter.dev, "Transaction (pre): CNT=%02x, CMD=%02x, "
74 "ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb(SMBHSTCNT), 74 "ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb(SMBHSTCNT),
@@ -100,12 +100,12 @@ static int sch_transaction(void)
100 outb(inb(SMBHSTCNT) | 0x10, SMBHSTCNT); 100 outb(inb(SMBHSTCNT) | 0x10, SMBHSTCNT);
101 101
102 do { 102 do {
103 msleep(1); 103 usleep_range(100, 200);
104 temp = inb(SMBHSTSTS) & 0x0f; 104 temp = inb(SMBHSTSTS) & 0x0f;
105 } while ((temp & 0x08) && (timeout++ < MAX_TIMEOUT)); 105 } while ((temp & 0x08) && (retries++ < MAX_RETRIES));
106 106
107 /* If the SMBus is still busy, we give up */ 107 /* If the SMBus is still busy, we give up */
108 if (timeout > MAX_TIMEOUT) { 108 if (retries > MAX_RETRIES) {
109 dev_err(&sch_adapter.dev, "SMBus Timeout!\n"); 109 dev_err(&sch_adapter.dev, "SMBus Timeout!\n");
110 result = -ETIMEDOUT; 110 result = -ETIMEDOUT;
111 } 111 }