diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-12-20 10:31:28 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:27 -0500 |
commit | 64677573a28c354828343741bc177e5543f5077e (patch) | |
tree | fe2c747a3aa840560a4e4596d173af2e4935d035 /drivers/media/video/gspca/sonixj.c | |
parent | 0a71d9cec238dd953e1e31df6ad28f69dee16fcc (diff) |
V4L/DVB (13872): gspca - sonixj: Add sensor adcm1700 and webcam 0c45:614a.
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/sonixj.c')
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 184 |
1 files changed, 146 insertions, 38 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 0bd36a00dd2a..1f21c6a7a72c 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -64,16 +64,17 @@ struct sd { | |||
64 | #define BRIDGE_SN9C110 2 | 64 | #define BRIDGE_SN9C110 2 |
65 | #define BRIDGE_SN9C120 3 | 65 | #define BRIDGE_SN9C120 3 |
66 | u8 sensor; /* Type of image sensor chip */ | 66 | u8 sensor; /* Type of image sensor chip */ |
67 | #define SENSOR_HV7131R 0 | 67 | #define SENSOR_ADCM1700 0 |
68 | #define SENSOR_MI0360 1 | 68 | #define SENSOR_HV7131R 1 |
69 | #define SENSOR_MO4000 2 | 69 | #define SENSOR_MI0360 2 |
70 | #define SENSOR_MT9V111 3 | 70 | #define SENSOR_MO4000 3 |
71 | #define SENSOR_OM6802 4 | 71 | #define SENSOR_MT9V111 4 |
72 | #define SENSOR_OV7630 5 | 72 | #define SENSOR_OM6802 5 |
73 | #define SENSOR_OV7648 6 | 73 | #define SENSOR_OV7630 6 |
74 | #define SENSOR_OV7660 7 | 74 | #define SENSOR_OV7648 7 |
75 | #define SENSOR_PO1030 8 | 75 | #define SENSOR_OV7660 8 |
76 | #define SENSOR_SP80708 9 | 76 | #define SENSOR_PO1030 9 |
77 | #define SENSOR_SP80708 10 | ||
77 | u8 i2c_addr; | 78 | u8 i2c_addr; |
78 | 79 | ||
79 | u8 *jpeg_hdr; | 80 | u8 *jpeg_hdr; |
@@ -261,28 +262,37 @@ static struct ctrl sd_ctrls[] = { | |||
261 | 262 | ||
262 | /* table of the disabled controls */ | 263 | /* table of the disabled controls */ |
263 | static __u32 ctrl_dis[] = { | 264 | static __u32 ctrl_dis[] = { |
265 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX) | | ||
266 | (1 << AUTOGAIN_IDX) | (1 << BRIGHTNESS_IDX), /* SENSOR_ADCM1700 0 */ | ||
264 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), | 267 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), |
265 | /* SENSOR_HV7131R 0 */ | 268 | /* SENSOR_HV7131R 1 */ |
266 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), | 269 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), |
267 | /* SENSOR_MI0360 1 */ | 270 | /* SENSOR_MI0360 2 */ |
268 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), | 271 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), |
269 | /* SENSOR_MO4000 2 */ | 272 | /* SENSOR_MO4000 3 */ |
270 | (1 << VFLIP_IDX) | (1 << FREQ_IDX), | 273 | (1 << VFLIP_IDX) | (1 << FREQ_IDX), |
271 | /* SENSOR_MT9V111 3 */ | 274 | /* SENSOR_MT9V111 4 */ |
272 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), | 275 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), |
273 | /* SENSOR_OM6802 4 */ | 276 | /* SENSOR_OM6802 5 */ |
274 | (1 << INFRARED_IDX), | 277 | (1 << INFRARED_IDX), |
275 | /* SENSOR_OV7630 5 */ | 278 | /* SENSOR_OV7630 6 */ |
276 | (1 << INFRARED_IDX), | 279 | (1 << INFRARED_IDX), |
277 | /* SENSOR_OV7648 6 */ | 280 | /* SENSOR_OV7648 7 */ |
278 | (1 << AUTOGAIN_IDX) | (1 << INFRARED_IDX) | (1 << VFLIP_IDX), | 281 | (1 << AUTOGAIN_IDX) | (1 << INFRARED_IDX) | (1 << VFLIP_IDX), |
279 | /* SENSOR_OV7660 7 */ | 282 | /* SENSOR_OV7660 8 */ |
280 | (1 << AUTOGAIN_IDX) | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | | 283 | (1 << AUTOGAIN_IDX) | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | |
281 | (1 << FREQ_IDX), /* SENSOR_PO1030 8 */ | 284 | (1 << FREQ_IDX), /* SENSOR_PO1030 9 */ |
282 | (1 << AUTOGAIN_IDX) | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | | 285 | (1 << AUTOGAIN_IDX) | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | |
283 | (1 << FREQ_IDX), /* SENSOR_SP80708 9 */ | 286 | (1 << FREQ_IDX), /* SENSOR_SP80708 10 */ |
284 | }; | 287 | }; |
285 | 288 | ||
289 | static const struct v4l2_pix_format cif_mode[] = { | ||
290 | {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | ||
291 | .bytesperline = 352, | ||
292 | .sizeimage = 352 * 288 * 4 / 8 + 590, | ||
293 | .colorspace = V4L2_COLORSPACE_JPEG, | ||
294 | .priv = 0}, | ||
295 | }; | ||
286 | static const struct v4l2_pix_format vga_mode[] = { | 296 | static const struct v4l2_pix_format vga_mode[] = { |
287 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 297 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, |
288 | .bytesperline = 160, | 298 | .bytesperline = 160, |
@@ -302,6 +312,17 @@ static const struct v4l2_pix_format vga_mode[] = { | |||
302 | .priv = 0}, | 312 | .priv = 0}, |
303 | }; | 313 | }; |
304 | 314 | ||
315 | static const u8 sn_adcm1700[0x1c] = { | ||
316 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */ | ||
317 | 0x00, 0x42, 0x60, 0x00, 0x1a, 0x20, 0x20, 0x20, | ||
318 | /* reg8 reg9 rega regb regc regd rege regf */ | ||
319 | 0x80, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
320 | /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */ | ||
321 | 0x03, 0x00, 0x05, 0x01, 0x05, 0x16, 0x12, 0x42, | ||
322 | /* reg18 reg19 reg1a reg1b */ | ||
323 | 0x06, 0x00, 0x00, 0x00 | ||
324 | }; | ||
325 | |||
305 | /*Data from sn9c102p+hv7131r */ | 326 | /*Data from sn9c102p+hv7131r */ |
306 | static const u8 sn_hv7131[0x1c] = { | 327 | static const u8 sn_hv7131[0x1c] = { |
307 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */ | 328 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */ |
@@ -415,6 +436,7 @@ static const u8 sn_sp80708[0x1c] = { | |||
415 | 436 | ||
416 | /* sequence specific to the sensors - !! index = SENSOR_xxx */ | 437 | /* sequence specific to the sensors - !! index = SENSOR_xxx */ |
417 | static const u8 *sn_tb[] = { | 438 | static const u8 *sn_tb[] = { |
439 | sn_adcm1700, | ||
418 | sn_hv7131, | 440 | sn_hv7131, |
419 | sn_mi0360, | 441 | sn_mi0360, |
420 | sn_mo4000, | 442 | sn_mo4000, |
@@ -432,6 +454,11 @@ static const u8 gamma_def[17] = { | |||
432 | 0x00, 0x2d, 0x46, 0x5a, 0x6c, 0x7c, 0x8b, 0x99, | 454 | 0x00, 0x2d, 0x46, 0x5a, 0x6c, 0x7c, 0x8b, 0x99, |
433 | 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff | 455 | 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff |
434 | }; | 456 | }; |
457 | /* gamma for sensor ADCM1700 */ | ||
458 | static const u8 gamma_spec_0[17] = { | ||
459 | 0x0f, 0x39, 0x5a, 0x74, 0x86, 0x95, 0xa6, 0xb4, | ||
460 | 0xbd, 0xc4, 0xcc, 0xd4, 0xd5, 0xde, 0xe4, 0xed, 0xf5 | ||
461 | }; | ||
435 | /* gamma for sensors HV7131R and MT9V111 */ | 462 | /* gamma for sensors HV7131R and MT9V111 */ |
436 | static const u8 gamma_spec_1[17] = { | 463 | static const u8 gamma_spec_1[17] = { |
437 | 0x08, 0x3a, 0x52, 0x65, 0x75, 0x83, 0x91, 0x9d, | 464 | 0x08, 0x3a, 0x52, 0x65, 0x75, 0x83, 0x91, 0x9d, |
@@ -450,6 +477,38 @@ static const u8 reg84[] = { | |||
450 | 0x3e, 0x00, 0xcd, 0x0f, 0xf7, 0x0f, /* VR VG VB */ | 477 | 0x3e, 0x00, 0xcd, 0x0f, 0xf7, 0x0f, /* VR VG VB */ |
451 | 0x00, 0x00, 0x00 /* YUV offsets */ | 478 | 0x00, 0x00, 0x00 /* YUV offsets */ |
452 | }; | 479 | }; |
480 | static const u8 adcm1700_sensor_init[][8] = { | ||
481 | {0xa0, 0x51, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
482 | {0xb0, 0x51, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10}, | ||
483 | {0xdd, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, | ||
484 | {0xb0, 0x51, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
485 | {0xdd, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, | ||
486 | {0xb0, 0x51, 0x0c, 0xe0, 0x2e, 0x00, 0x00, 0x10}, | ||
487 | {0xb0, 0x51, 0x10, 0x02, 0x02, 0x00, 0x00, 0x10}, | ||
488 | {0xb0, 0x51, 0x14, 0x0e, 0x0e, 0x00, 0x00, 0x10}, | ||
489 | {0xb0, 0x51, 0x1c, 0x00, 0x80, 0x00, 0x00, 0x10}, | ||
490 | {0xb0, 0x51, 0x20, 0x01, 0x00, 0x00, 0x00, 0x10}, | ||
491 | {0xdd, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, | ||
492 | {0xb0, 0x51, 0x04, 0x04, 0x00, 0x00, 0x00, 0x10}, | ||
493 | {0xdd, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, | ||
494 | {0xb0, 0x51, 0x04, 0x01, 0x00, 0x00, 0x00, 0x10}, | ||
495 | {0xa0, 0x51, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x10}, | ||
496 | {0xb0, 0x51, 0x14, 0x01, 0x00, 0x00, 0x00, 0x10}, | ||
497 | {0xb0, 0x51, 0x32, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
498 | {} | ||
499 | }; | ||
500 | static const u8 adcm1700_sensor_param1[][8] = { | ||
501 | {0xb0, 0x51, 0x26, 0xf9, 0x01, 0x00, 0x00, 0x10}, | ||
502 | {0xd0, 0x51, 0x1e, 0x8e, 0x8e, 0x8e, 0x8e, 0x10}, | ||
503 | |||
504 | {0xa0, 0x51, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x10}, | ||
505 | {0xb0, 0x51, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10}, | ||
506 | {0xa0, 0x51, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x10}, | ||
507 | {0xb0, 0x51, 0x32, 0x00, 0x72, 0x00, 0x00, 0x10}, | ||
508 | {0xd0, 0x51, 0x1e, 0x8e, 0x91, 0x91, 0x8e, 0x10}, | ||
509 | |||
510 | {} | ||
511 | }; | ||
453 | static const u8 hv7131r_sensor_init[][8] = { | 512 | static const u8 hv7131r_sensor_init[][8] = { |
454 | {0xc1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10}, | 513 | {0xc1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10}, |
455 | {0xb1, 0x11, 0x34, 0x17, 0x7f, 0x00, 0x00, 0x10}, | 514 | {0xb1, 0x11, 0x34, 0x17, 0x7f, 0x00, 0x00, 0x10}, |
@@ -986,17 +1045,18 @@ static const u8 sp80708_sensor_param1[][8] = { | |||
986 | {} | 1045 | {} |
987 | }; | 1046 | }; |
988 | 1047 | ||
989 | static const u8 (*sensor_init[10])[8] = { | 1048 | static const u8 (*sensor_init[11])[8] = { |
990 | hv7131r_sensor_init, /* HV7131R 0 */ | 1049 | adcm1700_sensor_init, /* ADCM1700 0 */ |
991 | mi0360_sensor_init, /* MI0360 1 */ | 1050 | hv7131r_sensor_init, /* HV7131R 1 */ |
992 | mo4000_sensor_init, /* MO4000 2 */ | 1051 | mi0360_sensor_init, /* MI0360 2 */ |
993 | mt9v111_sensor_init, /* MT9V111 3 */ | 1052 | mo4000_sensor_init, /* MO4000 3 */ |
994 | om6802_sensor_init, /* OM6802 4 */ | 1053 | mt9v111_sensor_init, /* MT9V111 4 */ |
995 | ov7630_sensor_init, /* OV7630 5 */ | 1054 | om6802_sensor_init, /* OM6802 5 */ |
996 | ov7648_sensor_init, /* OV7648 6 */ | 1055 | ov7630_sensor_init, /* OV7630 6 */ |
997 | ov7660_sensor_init, /* OV7660 7 */ | 1056 | ov7648_sensor_init, /* OV7648 7 */ |
998 | po1030_sensor_init, /* PO1030 8 */ | 1057 | ov7660_sensor_init, /* OV7660 8 */ |
999 | sp80708_sensor_init, /* SP80708 9 */ | 1058 | po1030_sensor_init, /* PO1030 9 */ |
1059 | sp80708_sensor_init, /* SP80708 10 */ | ||
1000 | }; | 1060 | }; |
1001 | 1061 | ||
1002 | /* read <len> bytes to gspca_dev->usb_buf */ | 1062 | /* read <len> bytes to gspca_dev->usb_buf */ |
@@ -1064,6 +1124,7 @@ static void i2c_w1(struct gspca_dev *gspca_dev, u8 reg, u8 val) | |||
1064 | 1124 | ||
1065 | PDEBUG(D_USBO, "i2c_w2 [%02x] = %02x", reg, val); | 1125 | PDEBUG(D_USBO, "i2c_w2 [%02x] = %02x", reg, val); |
1066 | switch (sd->sensor) { | 1126 | switch (sd->sensor) { |
1127 | case SENSOR_ADCM1700: | ||
1067 | case SENSOR_OM6802: /* i2c command = a0 (100 kHz) */ | 1128 | case SENSOR_OM6802: /* i2c command = a0 (100 kHz) */ |
1068 | gspca_dev->usb_buf[0] = 0x80 | (2 << 4); | 1129 | gspca_dev->usb_buf[0] = 0x80 | (2 << 4); |
1069 | break; | 1130 | break; |
@@ -1110,6 +1171,7 @@ static void i2c_r(struct gspca_dev *gspca_dev, u8 reg, int len) | |||
1110 | u8 mode[8]; | 1171 | u8 mode[8]; |
1111 | 1172 | ||
1112 | switch (sd->sensor) { | 1173 | switch (sd->sensor) { |
1174 | case SENSOR_ADCM1700: | ||
1113 | case SENSOR_OM6802: /* i2c command = 90 (100 kHz) */ | 1175 | case SENSOR_OM6802: /* i2c command = 90 (100 kHz) */ |
1114 | mode[0] = 0x80 | 0x10; | 1176 | mode[0] = 0x80 | 0x10; |
1115 | break; | 1177 | break; |
@@ -1284,6 +1346,12 @@ static void bridge_init(struct gspca_dev *gspca_dev, | |||
1284 | reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f); | 1346 | reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f); |
1285 | 1347 | ||
1286 | switch (sd->sensor) { | 1348 | switch (sd->sensor) { |
1349 | case SENSOR_ADCM1700: | ||
1350 | reg_w1(gspca_dev, 0x01, 0x42); | ||
1351 | reg_w1(gspca_dev, 0x17, 0x62); | ||
1352 | reg_w1(gspca_dev, 0x01, 0x42); | ||
1353 | reg_w1(gspca_dev, 0x01, 0x42); | ||
1354 | break; | ||
1287 | case SENSOR_MT9V111: | 1355 | case SENSOR_MT9V111: |
1288 | reg_w1(gspca_dev, 0x01, 0x61); | 1356 | reg_w1(gspca_dev, 0x01, 0x61); |
1289 | reg_w1(gspca_dev, 0x17, 0x61); | 1357 | reg_w1(gspca_dev, 0x17, 0x61); |
@@ -1358,8 +1426,13 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1358 | struct cam *cam; | 1426 | struct cam *cam; |
1359 | 1427 | ||
1360 | cam = &gspca_dev->cam; | 1428 | cam = &gspca_dev->cam; |
1361 | cam->cam_mode = vga_mode; | 1429 | if (sd->sensor == SENSOR_ADCM1700) { |
1362 | cam->nmodes = ARRAY_SIZE(vga_mode); | 1430 | cam->cam_mode = cif_mode; |
1431 | cam->nmodes = ARRAY_SIZE(cif_mode); | ||
1432 | } else { | ||
1433 | cam->cam_mode = vga_mode; | ||
1434 | cam->nmodes = ARRAY_SIZE(vga_mode); | ||
1435 | } | ||
1363 | cam->npkt = 24; /* 24 packets per ISOC message */ | 1436 | cam->npkt = 24; /* 24 packets per ISOC message */ |
1364 | 1437 | ||
1365 | sd->bridge = id->driver_info >> 16; | 1438 | sd->bridge = id->driver_info >> 16; |
@@ -1543,6 +1616,8 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
1543 | 1616 | ||
1544 | k2 = ((int) sd->brightness - 0x8000) >> 10; | 1617 | k2 = ((int) sd->brightness - 0x8000) >> 10; |
1545 | switch (sd->sensor) { | 1618 | switch (sd->sensor) { |
1619 | case SENSOR_ADCM1700: | ||
1620 | return; | ||
1546 | case SENSOR_HV7131R: | 1621 | case SENSOR_HV7131R: |
1547 | expo = sd->brightness << 4; | 1622 | expo = sd->brightness << 4; |
1548 | if (expo > 0x002dc6c0) | 1623 | if (expo > 0x002dc6c0) |
@@ -1625,6 +1700,9 @@ static void setgamma(struct gspca_dev *gspca_dev) | |||
1625 | }; | 1700 | }; |
1626 | 1701 | ||
1627 | switch (sd->sensor) { | 1702 | switch (sd->sensor) { |
1703 | case SENSOR_ADCM1700: | ||
1704 | gamma_base = gamma_spec_0; | ||
1705 | break; | ||
1628 | case SENSOR_HV7131R: | 1706 | case SENSOR_HV7131R: |
1629 | case SENSOR_MT9V111: | 1707 | case SENSOR_MT9V111: |
1630 | gamma_base = gamma_spec_1; | 1708 | gamma_base = gamma_spec_1; |
@@ -1804,6 +1882,8 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1804 | int mode; | 1882 | int mode; |
1805 | static const u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; | 1883 | static const u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; |
1806 | static const u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; | 1884 | static const u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; |
1885 | static const u8 CA_adcm1700[] = | ||
1886 | { 0x14, 0xec, 0x0a, 0xf6 }; | ||
1807 | static const u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd }; /* MI0360 */ | 1887 | static const u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd }; /* MI0360 */ |
1808 | static const u8 CE_ov76xx[] = | 1888 | static const u8 CE_ov76xx[] = |
1809 | { 0x32, 0xdd, 0x32, 0xdd }; | 1889 | { 0x32, 0xdd, 0x32, 0xdd }; |
@@ -1824,6 +1904,9 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1824 | i2c_w_seq(gspca_dev, sensor_init[sd->sensor]); | 1904 | i2c_w_seq(gspca_dev, sensor_init[sd->sensor]); |
1825 | 1905 | ||
1826 | switch (sd->sensor) { | 1906 | switch (sd->sensor) { |
1907 | case SENSOR_ADCM1700: | ||
1908 | reg2 = 0x60; | ||
1909 | break; | ||
1827 | case SENSOR_OM6802: | 1910 | case SENSOR_OM6802: |
1828 | reg2 = 0x71; | 1911 | reg2 = 0x71; |
1829 | break; | 1912 | break; |
@@ -1842,17 +1925,28 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1842 | reg_w1(gspca_dev, 0x12, sn9c1xx[0x12]); | 1925 | reg_w1(gspca_dev, 0x12, sn9c1xx[0x12]); |
1843 | reg_w1(gspca_dev, 0x13, sn9c1xx[0x13]); | 1926 | reg_w1(gspca_dev, 0x13, sn9c1xx[0x13]); |
1844 | reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); | 1927 | reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); |
1845 | reg_w1(gspca_dev, 0xd2, 0x6a); /* DC29 */ | 1928 | if (sd->sensor == SENSOR_ADCM1700) { |
1846 | reg_w1(gspca_dev, 0xd3, 0x50); | 1929 | reg_w1(gspca_dev, 0xd2, 0x3a); /* DC29 */ |
1930 | reg_w1(gspca_dev, 0xd3, 0x30); | ||
1931 | } else { | ||
1932 | reg_w1(gspca_dev, 0xd2, 0x6a); /* DC29 */ | ||
1933 | reg_w1(gspca_dev, 0xd3, 0x50); | ||
1934 | } | ||
1847 | reg_w1(gspca_dev, 0xc6, 0x00); | 1935 | reg_w1(gspca_dev, 0xc6, 0x00); |
1848 | reg_w1(gspca_dev, 0xc7, 0x00); | 1936 | reg_w1(gspca_dev, 0xc7, 0x00); |
1849 | reg_w1(gspca_dev, 0xc8, 0x50); | 1937 | if (sd->sensor == SENSOR_ADCM1700) { |
1850 | reg_w1(gspca_dev, 0xc9, 0x3c); | 1938 | reg_w1(gspca_dev, 0xc8, 0x2c); |
1939 | reg_w1(gspca_dev, 0xc9, 0x24); | ||
1940 | } else { | ||
1941 | reg_w1(gspca_dev, 0xc8, 0x50); | ||
1942 | reg_w1(gspca_dev, 0xc9, 0x3c); | ||
1943 | } | ||
1851 | reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); | 1944 | reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); |
1852 | switch (sd->sensor) { | 1945 | switch (sd->sensor) { |
1853 | case SENSOR_MT9V111: | 1946 | case SENSOR_MT9V111: |
1854 | reg17 = 0xe0; | 1947 | reg17 = 0xe0; |
1855 | break; | 1948 | break; |
1949 | case SENSOR_ADCM1700: | ||
1856 | case SENSOR_OV7630: | 1950 | case SENSOR_OV7630: |
1857 | reg17 = 0xe2; | 1951 | reg17 = 0xe2; |
1858 | break; | 1952 | break; |
@@ -1881,6 +1975,10 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1881 | for (i = 0; i < 8; i++) | 1975 | for (i = 0; i < 8; i++) |
1882 | reg_w(gspca_dev, 0x84, reg84, sizeof reg84); | 1976 | reg_w(gspca_dev, 0x84, reg84, sizeof reg84); |
1883 | switch (sd->sensor) { | 1977 | switch (sd->sensor) { |
1978 | case SENSOR_ADCM1700: | ||
1979 | reg_w1(gspca_dev, 0x9a, 0x05); | ||
1980 | reg_w1(gspca_dev, 0x99, 0x60); | ||
1981 | break; | ||
1884 | case SENSOR_MT9V111: | 1982 | case SENSOR_MT9V111: |
1885 | reg_w1(gspca_dev, 0x9a, 0x07); | 1983 | reg_w1(gspca_dev, 0x9a, 0x07); |
1886 | reg_w1(gspca_dev, 0x99, 0x59); | 1984 | reg_w1(gspca_dev, 0x99, 0x59); |
@@ -1917,6 +2015,11 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1917 | reg1 = 0x06; /* 640x480: clk 24Mhz, video trf enable */ | 2015 | reg1 = 0x06; /* 640x480: clk 24Mhz, video trf enable */ |
1918 | reg17 = 0x61; /* 0x:20: enable sensor clock */ | 2016 | reg17 = 0x61; /* 0x:20: enable sensor clock */ |
1919 | switch (sd->sensor) { | 2017 | switch (sd->sensor) { |
2018 | case SENSOR_ADCM1700: | ||
2019 | init = adcm1700_sensor_param1; | ||
2020 | reg1 = 0x46; | ||
2021 | reg17 = 0xe2; | ||
2022 | break; | ||
1920 | case SENSOR_MO4000: | 2023 | case SENSOR_MO4000: |
1921 | if (mode) { | 2024 | if (mode) { |
1922 | /* reg1 = 0x46; * 320 clk 48Mhz 60fp/s */ | 2025 | /* reg1 = 0x46; * 320 clk 48Mhz 60fp/s */ |
@@ -1986,8 +2089,12 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1986 | } | 2089 | } |
1987 | 2090 | ||
1988 | reg_w(gspca_dev, 0xc0, C0, 6); | 2091 | reg_w(gspca_dev, 0xc0, C0, 6); |
1989 | reg_w(gspca_dev, 0xca, CA, 4); | 2092 | if (sd->sensor == SENSOR_ADCM1700) |
2093 | reg_w(gspca_dev, 0xca, CA_adcm1700, 4); | ||
2094 | else | ||
2095 | reg_w(gspca_dev, 0xca, CA, 4); | ||
1990 | switch (sd->sensor) { | 2096 | switch (sd->sensor) { |
2097 | case SENSOR_ADCM1700: | ||
1991 | case SENSOR_OV7630: | 2098 | case SENSOR_OV7630: |
1992 | case SENSOR_OV7648: | 2099 | case SENSOR_OV7648: |
1993 | case SENSOR_OV7660: | 2100 | case SENSOR_OV7660: |
@@ -2472,6 +2579,7 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
2472 | /* {USB_DEVICE(0x0c45, 0x6142), BS(SN9C120, PO2030N)}, *sn9c120b*/ | 2579 | /* {USB_DEVICE(0x0c45, 0x6142), BS(SN9C120, PO2030N)}, *sn9c120b*/ |
2473 | {USB_DEVICE(0x0c45, 0x6143), BS(SN9C120, SP80708)}, /*sn9c120b*/ | 2580 | {USB_DEVICE(0x0c45, 0x6143), BS(SN9C120, SP80708)}, /*sn9c120b*/ |
2474 | {USB_DEVICE(0x0c45, 0x6148), BS(SN9C120, OM6802)}, /*sn9c120b*/ | 2581 | {USB_DEVICE(0x0c45, 0x6148), BS(SN9C120, OM6802)}, /*sn9c120b*/ |
2582 | {USB_DEVICE(0x0c45, 0x614a), BS(SN9C120, ADCM1700)}, /*sn9c120b*/ | ||
2475 | {} | 2583 | {} |
2476 | }; | 2584 | }; |
2477 | MODULE_DEVICE_TABLE(usb, device_table); | 2585 | MODULE_DEVICE_TABLE(usb, device_table); |