summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common/saa7146_i2c.c
diff options
context:
space:
mode:
authorOliver Endriss <o.endriss@gmx.de>2006-10-27 23:02:01 +0200
committerOliver Endriss <o.endriss@gmx.de>2006-10-27 23:02:01 +0200
commit5976d7a95cb0c575c2f7b935918851482a58cf42 (patch)
tree59ffa700f700e79e8ab7f2781f22657db747f98c /linux/drivers/media/common/saa7146_i2c.c
parent5a79261ed0e580692725278b845ba9e9c97001e7 (diff)
downloadmediapointer-dvb-s2-5976d7a95cb0c575c2f7b935918851482a58cf42.tar.gz
mediapointer-dvb-s2-5976d7a95cb0c575c2f7b935918851482a58cf42.tar.bz2
[saa7146_i2c] short_delay mode fixed for fast machines
From: Oliver Endriss <o.endriss@gmx.de> 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>
Diffstat (limited to 'linux/drivers/media/common/saa7146_i2c.c')
-rw-r--r--linux/drivers/media/common/saa7146_i2c.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c
index b87dfe8df..8cf024271 100644
--- a/linux/drivers/media/common/saa7146_i2c.c
+++ b/linux/drivers/media/common/saa7146_i2c.c
@@ -218,11 +218,9 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d
}
/* wait until we get a transfer done or error */
timeout = jiffies + HZ/100 + 1; /* 10ms */
+ /* first read usually delivers bogus results... */
+ saa7146_i2c_status(dev);
while(1) {
- /**
- * first read usually delivers bogus results...
- */
- saa7146_i2c_status(dev);
status = saa7146_i2c_status(dev);
if ((status & 0x3) != 1)
break;
@@ -233,10 +231,10 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d
DEB_I2C(("saa7146_i2c_writeout: timed out waiting for end of xfer\n"));
return -EIO;
}
- if ((++trial < 20) && short_delay)
+ if (++trial < 50 && short_delay)
udelay(10);
else
- msleep(1);
+ msleep(1);
}
}