[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <20061103040214.PS1889240006@infradead.org>
Date: Fri, 03 Nov 2006 01:02:14 -0300
From: mchehab@...radead.org
To: linux-kernel@...r.kernel.org
Cc: linux-dvb-maintainer@...uxtv.org,
Oliver Endriss <o.endriss@....de>,
Mauro Carvalho Chehab <mchehab@...radead.org>
Subject: [PATCH 6/7] V4L/DVB (4784): [saa7146_i2c] short_delay mode fixed
for fast machines
From: Oliver Endriss <o.endriss@....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@....de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@...radead.org>
---
drivers/media/common/saa7146_i2c.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c
index d9953f7..5297a36 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 s
}
/* 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;
@@ -232,10 +230,10 @@ static int saa7146_i2c_writeout(struct s
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);
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists