aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/t613.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-10-17 04:00:59 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 16:40:55 -0400
commit392ee5a59d72a3a8a72d9f33553e23848bb62e0a (patch)
treee32d60a555b498cb75efcf16cc551e48aa3ec0e0 /drivers/media/video/gspca/t613.c
parent236088d215fd0a7144376641eea97785375fd364 (diff)
V4L/DVB (9290): gspca: Adjust the sensor init sequences in t613.
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/t613.c')
-rw-r--r--drivers/media/video/gspca/t613.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c
index c0beedc6b5db..169004a95f8b 100644
--- a/drivers/media/video/gspca/t613.c
+++ b/drivers/media/video/gspca/t613.c
@@ -365,6 +365,8 @@ static const __u8 tas5130a_sensor_init[][8] = {
365 {}, 365 {},
366}; 366};
367 367
368static __u8 sensor_reset[] = {0x61, 0x68, 0x62, 0xff, 0x60, 0x07};
369
368/* read 1 byte */ 370/* read 1 byte */
369static int reg_r(struct gspca_dev *gspca_dev, 371static int reg_r(struct gspca_dev *gspca_dev,
370 __u16 index) 372 __u16 index)
@@ -437,12 +439,25 @@ static void om6802_sensor_init(struct gspca_dev *gspca_dev)
437 0x90, 0x24, 439 0x90, 0x24,
438 0x91, 0xb2, 440 0x91, 0xb2,
439 0x82, 0x32, 441 0x82, 0x32,
440 0xfd, 0x00,
441 0xfd, 0x01,
442 0xfd, 0x41, 442 0xfd, 0x41,
443 0x00 /* table end */ 443 0x00 /* table end */
444 }; 444 };
445 445
446 reg_w_buf(gspca_dev, sensor_reset, sizeof sensor_reset);
447 msleep(5);
448 i = 4;
449 while (--i < 0) {
450 byte = reg_r(gspca_dev, 0x0060);
451 if (!(byte & 0x01))
452 break;
453 msleep(100);
454 }
455 byte = reg_r(gspca_dev, 0x0063);
456 if (byte != 0x17) {
457 err("Bad sensor reset %02x", byte);
458 /* continue? */
459 }
460
446 p = sensor_init; 461 p = sensor_init;
447 while (*p != 0) { 462 while (*p != 0) {
448 val[1] = *p++; 463 val[1] = *p++;
@@ -458,7 +473,8 @@ static void om6802_sensor_init(struct gspca_dev *gspca_dev)
458 break; 473 break;
459 } 474 }
460 } 475 }
461 reg_w(gspca_dev, 0x3c80); 476 msleep(15);
477 reg_w(gspca_dev, 0x3c80);
462} 478}
463 479
464/* this function is called at probe time */ 480/* this function is called at probe time */
@@ -512,8 +528,6 @@ static int sd_init(struct gspca_dev *gspca_dev)
512 {0x08, 0x03, 0x09, 0x03, 0x12, 0x04}; 528 {0x08, 0x03, 0x09, 0x03, 0x12, 0x04};
513 static const __u8 n2[] = 529 static const __u8 n2[] =
514 {0x08, 0x00}; 530 {0x08, 0x00};
515 static const __u8 nset[] =
516 { 0x61, 0x68, 0x62, 0xff, 0x60, 0x07 };
517 static const __u8 n3[] = 531 static const __u8 n3[] =
518 {0x61, 0x68, 0x65, 0x0a, 0x60, 0x04}; 532 {0x61, 0x68, 0x65, 0x0a, 0x60, 0x04};
519 static const __u8 n4[] = 533 static const __u8 n4[] =
@@ -572,8 +586,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
572 test_byte = 0; 586 test_byte = 0;
573 i = 5; 587 i = 5;
574 while (--i >= 0) { 588 while (--i >= 0) {
575 reg_w_buf(gspca_dev, nset, sizeof nset); 589 reg_w_buf(gspca_dev, sensor_reset, sizeof sensor_reset);
576 msleep(5);
577 test_byte = reg_r(gspca_dev, 0x0063); 590 test_byte = reg_r(gspca_dev, 0x0063);
578 msleep(100); 591 msleep(100);
579 if (test_byte == 0x17) 592 if (test_byte == 0x17)