V4L/DVB (11804): xc5000: poll at 5ms interval for register write command completion
authorDevin Heitmueller <dheitmueller@kernellabs.com>
Tue, 5 May 2009 02:29:17 +0000 (23:29 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 21:21:07 +0000 (18:21 -0300)
Instead of polling at 100ms intervals for register writes, poll at 5ms
intervals.  This is consistent with the xc5000 specification, and improves
tuning time by up to 500 ms on devices that such as the au0828 which do not
properly implement i2c clock stretching (since the five register writes that
occur for a tuning request often do not complete immediately but do complete
far before 100ms has gone by).

The net amount of time we wait before timing out is unchanged (500ms).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/xc5000.c

index cc829a0b6db77e3755491b4e99bf36894f5544c2..d006b9772d3bb8502b2b97ac826663394a4d8724 100644 (file)
@@ -262,7 +262,7 @@ static int xc5000_TunerReset(struct dvb_frontend *fe)
 static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData)
 {
        u8 buf[4];
-       int WatchDogTimer = 5;
+       int WatchDogTimer = 100;
        int result;
 
        buf[0] = (regAddr >> 8) & 0xFF;
@@ -284,7 +284,7 @@ static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData)
                                                /* busy flag cleared */
                                        break;
                                        } else {
-                                               xc_wait(100); /* wait 5 ms */
+                                               xc_wait(5); /* wait 5 ms */
                                                WatchDogTimer--;
                                        }
                                }