1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
From 991f54c9da846ab9571c256adf42d8d80d044bdc Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Tue, 16 Feb 2010 10:04:30 -0800
Subject: [PATCH 11/37] OMAP3: trim excessively long delays in i2c driver
---
drivers/i2c/omap24xx_i2c.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 30a8b4c..ba47fc4 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -148,7 +148,7 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
if (status & I2C_STAT_XRDY) {
/* Important: have to use byte access */
writeb (regoffset, &i2c_base->data);
- udelay (20000);
+ udelay (2000);
if (readw (&i2c_base->stat) & I2C_STAT_NACK) {
i2c_error = 1;
}
@@ -160,7 +160,7 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
/* free bus, otherwise we can't use a combined transction */
writew (0, &i2c_base->con);
while (readw (&i2c_base->stat) || (readw (&i2c_base->con) & I2C_CON_MST)) {
- udelay (10000);
+ udelay (1000);
/* Have to clear pending interrupt to clear I2C_STAT */
writew (0xFFFF, &i2c_base->stat);
}
@@ -181,7 +181,7 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
#else
*value = readw (&i2c_base->data);
#endif
- udelay (20000);
+ udelay (2000);
} else {
i2c_error = 1;
}
@@ -190,7 +190,7 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
writew (I2C_CON_EN, &i2c_base->con);
while (readw (&i2c_base->stat)
|| (readw (&i2c_base->con) & I2C_CON_MST)) {
- udelay (10000);
+ udelay (1000);
writew (0xFFFF, &i2c_base->stat);
}
}
--
1.6.6.1
|