diff options
| -rw-r--r-- | drivers/media/video/gspca/t613.c | 27 |
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 | ||
| 368 | static __u8 sensor_reset[] = {0x61, 0x68, 0x62, 0xff, 0x60, 0x07}; | ||
| 369 | |||
| 368 | /* read 1 byte */ | 370 | /* read 1 byte */ |
| 369 | static int reg_r(struct gspca_dev *gspca_dev, | 371 | static 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) |
