aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorOliver Endriss <o.endriss@gmx.de>2006-10-27 17:02:01 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-11-02 21:58:11 -0500
commit9bb6e2593ad4cb94944f547154baee64b4734598 (patch)
treea53a2c6b074c92752eef2ebab0ff3aa91e6c78c8 /drivers/media
parent588f98312c7fd1d86290583189d2eb24da70f752 (diff)
V4L/DVB (4784): [saa7146_i2c] short_delay mode fixed for fast machines
TT DVB-C 2300 runs at 137 kHz I2C speed. short_delay mode did not work reliably on fast machines with that speed. Increased max loop count from 20 to 50. Moved dummy access out of the loop. Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/saa7146_i2c.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c
index d9953f7a8b6b..5297a365c928 100644
--- a/drivers/media/common/saa7146_i2c.c
+++ b/drivers/media/common/saa7146_i2c.c
@@ -217,11 +217,9 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d
217 } 217 }
218 /* wait until we get a transfer done or error */ 218 /* wait until we get a transfer done or error */
219 timeout = jiffies + HZ/100 + 1; /* 10ms */ 219 timeout = jiffies + HZ/100 + 1; /* 10ms */
220 /* first read usually delivers bogus results... */
221 saa7146_i2c_status(dev);
220 while(1) { 222 while(1) {
221 /**
222 * first read usually delivers bogus results...
223 */
224 saa7146_i2c_status(dev);
225 status = saa7146_i2c_status(dev); 223 status = saa7146_i2c_status(dev);
226 if ((status & 0x3) != 1) 224 if ((status & 0x3) != 1)
227 break; 225 break;
@@ -232,10 +230,10 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d
232 DEB_I2C(("saa7146_i2c_writeout: timed out waiting for end of xfer\n")); 230 DEB_I2C(("saa7146_i2c_writeout: timed out waiting for end of xfer\n"));
233 return -EIO; 231 return -EIO;
234 } 232 }
235 if ((++trial < 20) && short_delay) 233 if (++trial < 50 && short_delay)
236 udelay(10); 234 udelay(10);
237 else 235 else
238 msleep(1); 236 msleep(1);
239 } 237 }
240 } 238 }
241 239