]> Pileus Git - ~andy/linux/commitdiff
V4L/DVB (11449): gspca - zc3xx: Bad probe of many webcams since adcm2700 addition.
authorJean-Francois Moine <moinejf@free.fr>
Sun, 5 Apr 2009 07:01:13 +0000 (04:01 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 21:20:23 +0000 (18:20 -0300)
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/zc3xx.c

index 4fe01d8b6c87e542d6e4655d55c4ab4567fc369f..c4684b9a412c151eaa57e4b0794403bd3004bfb0 100644 (file)
@@ -6868,7 +6868,6 @@ static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
        {0x8001, 0x13},
        {0x8000, 0x14},         /* CS2102K */
        {0x8400, 0x15},         /* TAS5130K */
-       {0x4001, 0x16},         /* ADCM2700 */
 };
 
 static int vga_3wr_probe(struct gspca_dev *gspca_dev)
@@ -6904,12 +6903,15 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
        retword |= reg_r(gspca_dev, 0x000a);
        PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword);
        reg_r(gspca_dev, 0x0010);
-       /* this is tested only once anyway */
-       for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
-               if (chipset_revision_sensor[i].revision == retword) {
-                       sd->chip_revision = retword;
-                       send_unknown(dev, SENSOR_PB0330);
-                       return chipset_revision_sensor[i].internal_sensor_id;
+       /* value 0x4001 is meaningless */
+       if (retword != 0x4001) {
+               for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
+                       if (chipset_revision_sensor[i].revision == retword) {
+                               sd->chip_revision = retword;
+                               send_unknown(dev, SENSOR_PB0330);
+                               return chipset_revision_sensor[i]
+                                                       .internal_sensor_id;
+                       }
                }
        }
 
@@ -6980,12 +6982,12 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
        reg_w(dev, 0x01, 0x0001);
        reg_w(dev, 0x03, 0x0012);
        reg_w(dev, 0x01, 0x0012);
-       reg_w(dev, 0x05, 0x0001);
+       reg_w(dev, 0x05, 0x0012);
        reg_w(dev, 0xd3, 0x008b);
        retword = i2c_read(gspca_dev, 0x01);
        if (retword != 0) {
                PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword);
-               return retword;
+               return 0x16;                    /* adcm2700 (6100/6200) */
        }
        return -1;
 }