aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/zc3xx.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-12-02 04:06:03 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:18:00 -0500
commit7bd330b44eb92b8e5ae265ab447cd317290c7aee (patch)
tree16467a4ff242b6446a48dfcbb2afcf9901ed5b8f /drivers/media/video/gspca/zc3xx.c
parent116dc5c50aff62064bfcceaa15abf44e9277578a (diff)
V4L/DVB (13563): gspca - zc3xx: Bad sensor probe of the webcam 0ac8:305b.
- probe the webcam (probe sequence from ms-win trace) - update tax5130c init sequences from ms-win newer driver - update tas5130c sequences from ms-win trace - add some comments in the probe code Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/zc3xx.c')
-rw-r--r--drivers/media/video/gspca/zc3xx.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 69e5dc4fc9de..1d525c4d63cf 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -5345,9 +5345,6 @@ static const struct usb_action tas5130cxx_InitialScale[] = { /* 320x240 */
5345 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, 5345 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5346 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, 5346 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5347 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, 5347 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5348 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5349 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5350
5351 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, 5348 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5352 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, 5349 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5353 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, 5350 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
@@ -5364,27 +5361,27 @@ static const struct usb_action tas5130cxx_InitialScale[] = { /* 320x240 */
5364 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, 5361 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5365 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, 5362 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5366 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, 5363 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5367 {0xa0, 0x95, ZC3XX_R18D_YTARGET}, 5364 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
5368 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, 5365 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
5369 {0xa0, 0x00, 0x01ad}, 5366 {0xa0, 0x00, 0x01ad},
5370 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, 5367 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5371 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, 5368 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5372 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, 5369 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5373 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, 5370 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5371 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5372 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5374 {} 5373 {}
5375}; 5374};
5376static const struct usb_action tas5130cxx_Initial[] = { /* 640x480 */ 5375static const struct usb_action tas5130cxx_Initial[] = { /* 640x480 */
5377 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, 5376 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5378 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, 5377 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
5379 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, 5378 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},
5380 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT}, 5379 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5381 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, 5380 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5382 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING}, 5381 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5383 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, 5382 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5384 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, 5383 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5385 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, 5384 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5386 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5387 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5388 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, 5385 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5389 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, 5386 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5390 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, 5387 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
@@ -5400,13 +5397,15 @@ static const struct usb_action tas5130cxx_Initial[] = { /* 640x480 */
5400 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, 5397 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5401 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, 5398 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5402 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, 5399 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5403 {0xa0, 0x95, ZC3XX_R18D_YTARGET}, 5400 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
5404 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, 5401 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
5405 {0xa0, 0x00, 0x01ad}, 5402 {0xa0, 0x00, 0x01ad},
5406 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, 5403 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5407 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, 5404 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5408 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, 5405 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5409 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, 5406 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5407 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5408 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5410 {} 5409 {}
5411}; 5410};
5412static const struct usb_action tas5130cxx_50HZ[] = { 5411static const struct usb_action tas5130cxx_50HZ[] = {
@@ -6424,11 +6423,11 @@ static int vga_2wr_probe(struct gspca_dev *gspca_dev)
6424 if (retword != 0) 6423 if (retword != 0)
6425 return 0x0e; /* PAS202BCB */ 6424 return 0x0e; /* PAS202BCB */
6426 6425
6427 start_2wr_probe(dev, 0x02); /* ?? */ 6426 start_2wr_probe(dev, 0x02); /* TAS5130C */
6428 i2c_write(gspca_dev, 0x01, 0xaa, 0x00); 6427 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6429 retword = i2c_read(gspca_dev, 0x01); 6428 retword = i2c_read(gspca_dev, 0x01);
6430 if (retword != 0) 6429 if (retword != 0)
6431 return 0x02; /* ?? */ 6430 return 0x02; /* TAS5130C */
6432ov_check: 6431ov_check:
6433 reg_r(gspca_dev, 0x0010); /* ?? */ 6432 reg_r(gspca_dev, 0x0010); /* ?? */
6434 reg_r(gspca_dev, 0x0010); 6433 reg_r(gspca_dev, 0x0010);
@@ -6505,6 +6504,8 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6505 reg_r(gspca_dev, 0x0010); 6504 reg_r(gspca_dev, 0x0010);
6506 /* value 0x4001 is meaningless */ 6505 /* value 0x4001 is meaningless */
6507 if (retword != 0x4001) { 6506 if (retword != 0x4001) {
6507 if ((retword & 0xff00) == 0x6400)
6508 return 0x02; /* TAS5130C */
6508 for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) { 6509 for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6509 if (chipset_revision_sensor[i].revision == retword) { 6510 if (chipset_revision_sensor[i].revision == retword) {
6510 sd->chip_revision = retword; 6511 sd->chip_revision = retword;
@@ -6515,7 +6516,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6515 } 6516 }
6516 } 6517 }
6517 6518
6518 reg_w(dev, 0x01, 0x0000); /* check ?? */ 6519 reg_w(dev, 0x01, 0x0000); /* check PB0330 */
6519 reg_w(dev, 0x01, 0x0001); 6520 reg_w(dev, 0x01, 0x0001);
6520 reg_w(dev, 0xdd, 0x008b); 6521 reg_w(dev, 0xdd, 0x008b);
6521 reg_w(dev, 0x0a, 0x0010); 6522 reg_w(dev, 0x0a, 0x0010);
@@ -6524,7 +6525,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6524 retword = i2c_read(gspca_dev, 0x00); 6525 retword = i2c_read(gspca_dev, 0x00);
6525 if (retword != 0) { 6526 if (retword != 0) {
6526 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?"); 6527 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6527 return 0x0a; /* ?? */ 6528 return 0x0a; /* PB0330 */
6528 } 6529 }
6529 6530
6530 reg_w(dev, 0x01, 0x0000); 6531 reg_w(dev, 0x01, 0x0000);
@@ -6673,6 +6674,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
6673 PDEBUG(D_PROBE, "Find Sensor HV7131B"); 6674 PDEBUG(D_PROBE, "Find Sensor HV7131B");
6674 sd->sensor = SENSOR_HV7131B; 6675 sd->sensor = SENSOR_HV7131B;
6675 break; 6676 break;
6677 case 0x02:
6678 PDEBUG(D_PROBE, "Sensor TAS5130C");
6679 sd->sensor = SENSOR_TAS5130CXX;
6680 break;
6676 case 0x04: 6681 case 0x04:
6677 PDEBUG(D_PROBE, "Find Sensor CS2102"); 6682 PDEBUG(D_PROBE, "Find Sensor CS2102");
6678 sd->sensor = SENSOR_CS2102; 6683 sd->sensor = SENSOR_CS2102;
@@ -6866,11 +6871,14 @@ static int sd_start(struct gspca_dev *gspca_dev)
6866 case SENSOR_GC0305: 6871 case SENSOR_GC0305:
6867 case SENSOR_OV7620: 6872 case SENSOR_OV7620:
6868 case SENSOR_PO2030: 6873 case SENSOR_PO2030:
6874 case SENSOR_TAS5130CXX:
6869 case SENSOR_TAS5130C_VF0250: 6875 case SENSOR_TAS5130C_VF0250:
6870/* msleep(100); * ?? */ 6876/* msleep(100); * ?? */
6871 reg_r(gspca_dev, 0x0002); /* --> 0x40 */ 6877 reg_r(gspca_dev, 0x0002); /* --> 0x40 */
6872 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ 6878 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */
6873 reg_w(dev, 0x15, 0x01ae); 6879 reg_w(dev, 0x15, 0x01ae);
6880 if (sd->sensor == SENSOR_TAS5130CXX)
6881 break;
6874 reg_w(dev, 0x0d, 0x003a); 6882 reg_w(dev, 0x0d, 0x003a);
6875 reg_w(dev, 0x02, 0x003b); 6883 reg_w(dev, 0x02, 0x003b);
6876 reg_w(dev, 0x00, 0x0038); 6884 reg_w(dev, 0x00, 0x0038);
@@ -6887,6 +6895,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
6887 break; 6895 break;
6888 case SENSOR_PAS202B: 6896 case SENSOR_PAS202B:
6889 case SENSOR_GC0305: 6897 case SENSOR_GC0305:
6898 case SENSOR_TAS5130CXX:
6890 reg_r(gspca_dev, 0x0008); 6899 reg_r(gspca_dev, 0x0008);
6891 /* fall thru */ 6900 /* fall thru */
6892 case SENSOR_PO2030: 6901 case SENSOR_PO2030:
@@ -6910,6 +6919,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
6910 switch (sd->sensor) { 6919 switch (sd->sensor) {
6911 case SENSOR_OV7620: 6920 case SENSOR_OV7620:
6912 case SENSOR_PAS202B: 6921 case SENSOR_PAS202B:
6922 case SENSOR_TAS5130CXX:
6913 reg_r(gspca_dev, 0x0180); /* from win */ 6923 reg_r(gspca_dev, 0x0180); /* from win */
6914 reg_w(dev, 0x00, 0x0180); 6924 reg_w(dev, 0x00, 0x0180);
6915 break; 6925 break;
@@ -6928,6 +6938,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
6928 reg_w(dev, 0x40, 0x0117); 6938 reg_w(dev, 0x40, 0x0117);
6929 break; 6939 break;
6930 case SENSOR_GC0305: 6940 case SENSOR_GC0305:
6941 case SENSOR_TAS5130CXX:
6931 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ 6942 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */
6932 reg_w(dev, 0x15, 0x01ae); 6943 reg_w(dev, 0x15, 0x01ae);
6933 /* fall thru */ 6944 /* fall thru */
@@ -7220,7 +7231,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
7220 {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106}, 7231 {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},
7221 {USB_DEVICE(0x0ac8, 0x301b)}, 7232 {USB_DEVICE(0x0ac8, 0x301b)},
7222 {USB_DEVICE(0x0ac8, 0x303b)}, 7233 {USB_DEVICE(0x0ac8, 0x303b)},
7223 {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250}, 7234 {USB_DEVICE(0x0ac8, 0x305b)},
7224 {USB_DEVICE(0x0ac8, 0x307b)}, 7235 {USB_DEVICE(0x0ac8, 0x307b)},
7225 {USB_DEVICE(0x10fd, 0x0128)}, 7236 {USB_DEVICE(0x10fd, 0x0128)},
7226 {USB_DEVICE(0x10fd, 0x804d)}, 7237 {USB_DEVICE(0x10fd, 0x804d)},