[media] gspca - ov519: Fix sensor detection problems
authorJean-François Moine <moinejf@free.fr>
Sun, 3 Jul 2011 08:17:27 +0000 (05:17 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:53:38 +0000 (17:53 -0300)
The sensor of some webcams could not be detected due to timing problems
in sensor register reading. This patch adds bridge register readings
before sensor register reading.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/ov519.c

index cb42a5182d1741798825c34382fdc9bfd4662bf0..b17c6604eb4156cd111a8ca855a1012a0ac86aef 100644 (file)
@@ -2432,9 +2432,12 @@ static int ov518_i2c_r(struct sd *sd, u8 reg)
 
        /* Initiate 2-byte write cycle */
        reg_w(sd, R518_I2C_CTL, 0x03);
+       reg_r8(sd, R518_I2C_CTL);
 
        /* Initiate 2-byte read cycle */
        reg_w(sd, R518_I2C_CTL, 0x05);
+       reg_r8(sd, R518_I2C_CTL);
+
        value = reg_r(sd, R51x_I2C_DATA);
        PDEBUG(D_USBI, "ov518_i2c_r %02x %02x", reg, value);
        return value;