diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-09-18 04:36:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:40:24 -0500 |
commit | 1d76331ddbb43c04d4d62bf5b9cc93efc05149c7 (patch) | |
tree | d63899dfb80cf8c2a5232aeb9ee1226b954d6f12 /drivers/media/video/gspca/zc3xx.c | |
parent | c0faeee5a3b70c894a27fa81a0d98a3ab223aff0 (diff) |
V4L/DVB (13114): gspca - zc3xx.c: Bad init sequences of sensor cs2102.
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.c | 399 |
1 files changed, 112 insertions, 287 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index cdf3357b4c9..e544630757c 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -420,9 +420,7 @@ static const struct usb_action adcm2700_NoFliker[] = { | |||
420 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | 420 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ |
421 | {} | 421 | {} |
422 | }; | 422 | }; |
423 | static const struct usb_action cs2102_Initial[] = { | 423 | static const struct usb_action cs2102_Initial[] = { /* 320x240 */ |
424 | {0xa1, 0x01, 0x0008}, | ||
425 | {0xa1, 0x01, 0x0008}, | ||
426 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, | 424 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, |
427 | {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, | 425 | {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, |
428 | {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT}, | 426 | {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT}, |
@@ -471,88 +469,10 @@ static const struct usb_action cs2102_Initial[] = { | |||
471 | {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, | 469 | {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, |
472 | {0xa0, 0x68, ZC3XX_R18D_YTARGET}, | 470 | {0xa0, 0x68, ZC3XX_R18D_YTARGET}, |
473 | {0xa0, 0x00, 0x01ad}, | 471 | {0xa0, 0x00, 0x01ad}, |
474 | {0xa1, 0x01, 0x0002}, | ||
475 | {0xa1, 0x01, 0x0008}, | ||
476 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */ | ||
477 | {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ | ||
478 | {0xa1, 0x01, 0x01c8}, | ||
479 | {0xa1, 0x01, 0x01c9}, | ||
480 | {0xa1, 0x01, 0x01ca}, | ||
481 | {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ | ||
482 | {0xa0, 0x24, ZC3XX_R120_GAMMA00}, /* gamma 5 */ | ||
483 | {0xa0, 0x44, ZC3XX_R121_GAMMA01}, | ||
484 | {0xa0, 0x64, ZC3XX_R122_GAMMA02}, | ||
485 | {0xa0, 0x84, ZC3XX_R123_GAMMA03}, | ||
486 | {0xa0, 0x9d, ZC3XX_R124_GAMMA04}, | ||
487 | {0xa0, 0xb2, ZC3XX_R125_GAMMA05}, | ||
488 | {0xa0, 0xc4, ZC3XX_R126_GAMMA06}, | ||
489 | {0xa0, 0xd3, ZC3XX_R127_GAMMA07}, | ||
490 | {0xa0, 0xe0, ZC3XX_R128_GAMMA08}, | ||
491 | {0xa0, 0xeb, ZC3XX_R129_GAMMA09}, | ||
492 | {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A}, | ||
493 | {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B}, | ||
494 | {0xa0, 0xff, ZC3XX_R12C_GAMMA0C}, | ||
495 | {0xa0, 0xff, ZC3XX_R12D_GAMMA0D}, | ||
496 | {0xa0, 0xff, ZC3XX_R12E_GAMMA0E}, | ||
497 | {0xa0, 0xff, ZC3XX_R12F_GAMMA0F}, | ||
498 | {0xa0, 0x18, ZC3XX_R130_GAMMA10}, | ||
499 | {0xa0, 0x20, ZC3XX_R131_GAMMA11}, | ||
500 | {0xa0, 0x20, ZC3XX_R132_GAMMA12}, | ||
501 | {0xa0, 0x1c, ZC3XX_R133_GAMMA13}, | ||
502 | {0xa0, 0x16, ZC3XX_R134_GAMMA14}, | ||
503 | {0xa0, 0x13, ZC3XX_R135_GAMMA15}, | ||
504 | {0xa0, 0x10, ZC3XX_R136_GAMMA16}, | ||
505 | {0xa0, 0x0e, ZC3XX_R137_GAMMA17}, | ||
506 | {0xa0, 0x0b, ZC3XX_R138_GAMMA18}, | ||
507 | {0xa0, 0x09, ZC3XX_R139_GAMMA19}, | ||
508 | {0xa0, 0x07, ZC3XX_R13A_GAMMA1A}, | ||
509 | {0xa0, 0x06, ZC3XX_R13B_GAMMA1B}, | ||
510 | {0xa0, 0x00, ZC3XX_R13C_GAMMA1C}, | ||
511 | {0xa0, 0x00, ZC3XX_R13D_GAMMA1D}, | ||
512 | {0xa0, 0x00, ZC3XX_R13E_GAMMA1E}, | ||
513 | {0xa0, 0x01, ZC3XX_R13F_GAMMA1F}, | ||
514 | {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */ | ||
515 | {0xa0, 0xf4, ZC3XX_R10B_RGB01}, | ||
516 | {0xa0, 0xf4, ZC3XX_R10C_RGB02}, | ||
517 | {0xa0, 0xf4, ZC3XX_R10D_RGB10}, | ||
518 | {0xa0, 0x58, ZC3XX_R10E_RGB11}, | ||
519 | {0xa0, 0xf4, ZC3XX_R10F_RGB12}, | ||
520 | {0xa0, 0xf4, ZC3XX_R110_RGB20}, | ||
521 | {0xa0, 0xf4, ZC3XX_R111_RGB21}, | ||
522 | {0xa0, 0x58, ZC3XX_R112_RGB22}, | ||
523 | {0xa1, 0x01, 0x0180}, | ||
524 | {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, | ||
525 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, | ||
526 | {0xaa, 0x23, 0x0001}, | ||
527 | {0xaa, 0x24, 0x0055}, | ||
528 | {0xaa, 0x25, 0x00cc}, | ||
529 | {0xaa, 0x21, 0x003f}, | ||
530 | {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH}, | ||
531 | {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID}, | ||
532 | {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW}, | ||
533 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, | ||
534 | {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID}, | ||
535 | {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW}, | ||
536 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, | ||
537 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, | ||
538 | {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, | ||
539 | {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, | ||
540 | {0xa0, 0x39, ZC3XX_R01D_HSYNC_0}, | ||
541 | {0xa0, 0x70, ZC3XX_R01E_HSYNC_1}, | ||
542 | {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2}, | ||
543 | {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, | ||
544 | {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE}, | ||
545 | {0xa1, 0x01, 0x0180}, | ||
546 | {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, | ||
547 | {0xa0, 0x40, ZC3XX_R116_RGAIN}, | ||
548 | {0xa0, 0x40, ZC3XX_R117_GGAIN}, | ||
549 | {0xa0, 0x40, ZC3XX_R118_BGAIN}, | ||
550 | {} | 472 | {} |
551 | }; | 473 | }; |
552 | 474 | ||
553 | static const struct usb_action cs2102_InitialScale[] = { | 475 | static const struct usb_action cs2102_InitialScale[] = { /* 640x480 */ |
554 | {0xa1, 0x01, 0x0008}, | ||
555 | {0xa1, 0x01, 0x0008}, | ||
556 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, | 476 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, |
557 | {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, | 477 | {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, |
558 | {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT}, | 478 | {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT}, |
@@ -601,57 +521,75 @@ static const struct usb_action cs2102_InitialScale[] = { | |||
601 | {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, | 521 | {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, |
602 | {0xa0, 0x68, ZC3XX_R18D_YTARGET}, | 522 | {0xa0, 0x68, ZC3XX_R18D_YTARGET}, |
603 | {0xa0, 0x00, 0x01ad}, | 523 | {0xa0, 0x00, 0x01ad}, |
604 | {0xa1, 0x01, 0x0002}, | 524 | {} |
605 | {0xa1, 0x01, 0x0008}, | 525 | }; |
606 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */ | 526 | static const struct usb_action cs2102_50HZ[] = { |
607 | {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ | 527 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, |
608 | {0xa1, 0x01, 0x01c8}, | 528 | {0xaa, 0x23, 0x0001}, |
609 | {0xa1, 0x01, 0x01c9}, | 529 | {0xaa, 0x24, 0x005f}, |
610 | {0xa1, 0x01, 0x01ca}, | 530 | {0xaa, 0x25, 0x0090}, |
611 | {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ | 531 | {0xaa, 0x21, 0x00dd}, |
612 | {0xa0, 0x24, ZC3XX_R120_GAMMA00}, /* gamma 5 */ | 532 | {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH}, |
613 | {0xa0, 0x44, ZC3XX_R121_GAMMA01}, | 533 | {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID}, |
614 | {0xa0, 0x64, ZC3XX_R122_GAMMA02}, | 534 | {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, |
615 | {0xa0, 0x84, ZC3XX_R123_GAMMA03}, | 535 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, |
616 | {0xa0, 0x9d, ZC3XX_R124_GAMMA04}, | 536 | {0xa0, 0x3a, ZC3XX_R196_ANTIFLICKERMID}, |
617 | {0xa0, 0xb2, ZC3XX_R125_GAMMA05}, | 537 | {0xa0, 0x98, ZC3XX_R197_ANTIFLICKERLOW}, |
618 | {0xa0, 0xc4, ZC3XX_R126_GAMMA06}, | 538 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, |
619 | {0xa0, 0xd3, ZC3XX_R127_GAMMA07}, | 539 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, |
620 | {0xa0, 0xe0, ZC3XX_R128_GAMMA08}, | 540 | {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, |
621 | {0xa0, 0xeb, ZC3XX_R129_GAMMA09}, | 541 | {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, |
622 | {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A}, | 542 | {0xa0, 0xdd, ZC3XX_R01D_HSYNC_0}, |
623 | {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B}, | 543 | {0xa0, 0xe4, ZC3XX_R01E_HSYNC_1}, |
624 | {0xa0, 0xff, ZC3XX_R12C_GAMMA0C}, | 544 | {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2}, |
625 | {0xa0, 0xff, ZC3XX_R12D_GAMMA0D}, | 545 | {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, |
626 | {0xa0, 0xff, ZC3XX_R12E_GAMMA0E}, | 546 | {} |
627 | {0xa0, 0xff, ZC3XX_R12F_GAMMA0F}, | 547 | }; |
628 | {0xa0, 0x18, ZC3XX_R130_GAMMA10}, | 548 | static const struct usb_action cs2102_50HZScale[] = { |
629 | {0xa0, 0x20, ZC3XX_R131_GAMMA11}, | 549 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, |
630 | {0xa0, 0x20, ZC3XX_R132_GAMMA12}, | 550 | {0xaa, 0x23, 0x0000}, |
631 | {0xa0, 0x1c, ZC3XX_R133_GAMMA13}, | 551 | {0xaa, 0x24, 0x00af}, |
632 | {0xa0, 0x16, ZC3XX_R134_GAMMA14}, | 552 | {0xaa, 0x25, 0x00c8}, |
633 | {0xa0, 0x13, ZC3XX_R135_GAMMA15}, | 553 | {0xaa, 0x21, 0x0068}, |
634 | {0xa0, 0x10, ZC3XX_R136_GAMMA16}, | 554 | {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH}, |
635 | {0xa0, 0x0e, ZC3XX_R137_GAMMA17}, | 555 | {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID}, |
636 | {0xa0, 0x0b, ZC3XX_R138_GAMMA18}, | 556 | {0xa0, 0x90, ZC3XX_R192_EXPOSURELIMITLOW}, |
637 | {0xa0, 0x09, ZC3XX_R139_GAMMA19}, | 557 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, |
638 | {0xa0, 0x07, ZC3XX_R13A_GAMMA1A}, | 558 | {0xa0, 0x1d, ZC3XX_R196_ANTIFLICKERMID}, |
639 | {0xa0, 0x06, ZC3XX_R13B_GAMMA1B}, | 559 | {0xa0, 0x4c, ZC3XX_R197_ANTIFLICKERLOW}, |
640 | {0xa0, 0x00, ZC3XX_R13C_GAMMA1C}, | 560 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, |
641 | {0xa0, 0x00, ZC3XX_R13D_GAMMA1D}, | 561 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, |
642 | {0xa0, 0x00, ZC3XX_R13E_GAMMA1E}, | 562 | {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, |
643 | {0xa0, 0x01, ZC3XX_R13F_GAMMA1F}, | 563 | {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, |
644 | {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */ | 564 | {0xa0, 0x68, ZC3XX_R01D_HSYNC_0}, |
645 | {0xa0, 0xf4, ZC3XX_R10B_RGB01}, | 565 | {0xa0, 0xe3, ZC3XX_R01E_HSYNC_1}, |
646 | {0xa0, 0xf4, ZC3XX_R10C_RGB02}, | 566 | {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2}, |
647 | {0xa0, 0xf4, ZC3XX_R10D_RGB10}, | 567 | {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, |
648 | {0xa0, 0x58, ZC3XX_R10E_RGB11}, | 568 | {} |
649 | {0xa0, 0xf4, ZC3XX_R10F_RGB12}, | 569 | }; |
650 | {0xa0, 0xf4, ZC3XX_R110_RGB20}, | 570 | static const struct usb_action cs2102_60HZ[] = { |
651 | {0xa0, 0xf4, ZC3XX_R111_RGB21}, | 571 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, |
652 | {0xa0, 0x58, ZC3XX_R112_RGB22}, | 572 | {0xaa, 0x23, 0x0001}, |
653 | {0xa1, 0x01, 0x0180}, | 573 | {0xaa, 0x24, 0x0055}, |
654 | {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, | 574 | {0xaa, 0x25, 0x00cc}, |
575 | {0xaa, 0x21, 0x003f}, | ||
576 | {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH}, | ||
577 | {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID}, | ||
578 | {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW}, | ||
579 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, | ||
580 | {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID}, | ||
581 | {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW}, | ||
582 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, | ||
583 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, | ||
584 | {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, | ||
585 | {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, | ||
586 | {0xa0, 0x39, ZC3XX_R01D_HSYNC_0}, | ||
587 | {0xa0, 0x70, ZC3XX_R01E_HSYNC_1}, | ||
588 | {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2}, | ||
589 | {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, | ||
590 | {} | ||
591 | }; | ||
592 | static const struct usb_action cs2102_60HZScale[] = { | ||
655 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, | 593 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, |
656 | {0xaa, 0x23, 0x0000}, | 594 | {0xaa, 0x23, 0x0000}, |
657 | {0xaa, 0x24, 0x00aa}, | 595 | {0xaa, 0x24, 0x00aa}, |
@@ -671,162 +609,50 @@ static const struct usb_action cs2102_InitialScale[] = { | |||
671 | {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1}, | 609 | {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1}, |
672 | {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2}, | 610 | {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2}, |
673 | {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, | 611 | {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, |
674 | {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE}, | ||
675 | {0xa1, 0x01, 0x0180}, | ||
676 | {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, | ||
677 | {0xa0, 0x40, ZC3XX_R116_RGAIN}, | ||
678 | {0xa0, 0x40, ZC3XX_R117_GGAIN}, | ||
679 | {0xa0, 0x40, ZC3XX_R118_BGAIN}, | ||
680 | {} | ||
681 | }; | ||
682 | static const struct usb_action cs2102_50HZ[] = { | ||
683 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | ||
684 | {0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */ | ||
685 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | ||
686 | {0xaa, 0x04, 0x00ac}, /* 00,04,ac,aa */ | ||
687 | {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */ | ||
688 | {0xaa, 0x11, 0x00ac}, /* 00,11,ac,aa */ | ||
689 | {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */ | ||
690 | {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */ | ||
691 | {0xaa, 0x1d, 0x00ac}, /* 00,1d,ac,aa */ | ||
692 | {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ | ||
693 | {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */ | ||
694 | {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */ | ||
695 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */ | ||
696 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */ | ||
697 | {0xa0, 0x42, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,42,cc */ | ||
698 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */ | ||
699 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */ | ||
700 | {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */ | ||
701 | {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */ | ||
702 | {0xa0, 0x8c, ZC3XX_R01D_HSYNC_0}, /* 00,1d,8c,cc */ | ||
703 | {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */ | ||
704 | {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */ | ||
705 | {} | ||
706 | }; | ||
707 | static const struct usb_action cs2102_50HZScale[] = { | ||
708 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | ||
709 | {0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */ | ||
710 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | ||
711 | {0xaa, 0x04, 0x00a1}, /* 00,04,a1,aa */ | ||
712 | {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */ | ||
713 | {0xaa, 0x11, 0x00a1}, /* 00,11,a1,aa */ | ||
714 | {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */ | ||
715 | {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */ | ||
716 | {0xaa, 0x1d, 0x00a1}, /* 00,1d,a1,aa */ | ||
717 | {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ | ||
718 | {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */ | ||
719 | {0xa0, 0xf7, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f7,cc */ | ||
720 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */ | ||
721 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */ | ||
722 | {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */ | ||
723 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */ | ||
724 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */ | ||
725 | {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */ | ||
726 | {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */ | ||
727 | {0xa0, 0x93, ZC3XX_R01D_HSYNC_0}, /* 00,1d,93,cc */ | ||
728 | {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */ | ||
729 | {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */ | ||
730 | {} | ||
731 | }; | ||
732 | static const struct usb_action cs2102_60HZ[] = { | ||
733 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | ||
734 | {0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */ | ||
735 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | ||
736 | {0xaa, 0x04, 0x00aa}, /* 00,04,aa,aa */ | ||
737 | {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */ | ||
738 | {0xaa, 0x11, 0x00aa}, /* 00,11,aa,aa */ | ||
739 | {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */ | ||
740 | {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */ | ||
741 | {0xaa, 0x1d, 0x00aa}, /* 00,1d,aa,aa */ | ||
742 | {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ | ||
743 | {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */ | ||
744 | {0xa0, 0xe4, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e4,cc */ | ||
745 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */ | ||
746 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */ | ||
747 | {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3a,cc */ | ||
748 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */ | ||
749 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */ | ||
750 | {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */ | ||
751 | {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */ | ||
752 | {0xa0, 0x5d, ZC3XX_R01D_HSYNC_0}, /* 00,1d,5d,cc */ | ||
753 | {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */ | ||
754 | {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */ | ||
755 | {} | ||
756 | }; | ||
757 | static const struct usb_action cs2102_60HZScale[] = { | ||
758 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | ||
759 | {0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */ | ||
760 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | ||
761 | {0xaa, 0x04, 0x00be}, /* 00,04,be,aa */ | ||
762 | {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */ | ||
763 | {0xaa, 0x11, 0x00be}, /* 00,11,be,aa */ | ||
764 | {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */ | ||
765 | {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */ | ||
766 | {0xaa, 0x1d, 0x00be}, /* 00,1d,be,aa */ | ||
767 | {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ | ||
768 | {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */ | ||
769 | {0xa0, 0xfc, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,fc,cc */ | ||
770 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */ | ||
771 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */ | ||
772 | {0xa0, 0x69, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,69,cc */ | ||
773 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */ | ||
774 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */ | ||
775 | {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */ | ||
776 | {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */ | ||
777 | {0xa0, 0xb7, ZC3XX_R01D_HSYNC_0}, /* 00,1d,b7,cc */ | ||
778 | {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */ | ||
779 | {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */ | ||
780 | {} | 612 | {} |
781 | }; | 613 | }; |
782 | static const struct usb_action cs2102_NoFliker[] = { | 614 | static const struct usb_action cs2102_NoFliker[] = { |
783 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | 615 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, |
784 | {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */ | 616 | {0xaa, 0x23, 0x0001}, |
785 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | 617 | {0xaa, 0x24, 0x005f}, |
786 | {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */ | 618 | {0xaa, 0x25, 0x0000}, |
787 | {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */ | 619 | {0xaa, 0x21, 0x0001}, |
788 | {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */ | 620 | {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH}, |
789 | {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */ | 621 | {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID}, |
790 | {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */ | 622 | {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, |
791 | {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */ | 623 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, |
792 | {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ | 624 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, |
793 | {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */ | 625 | {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW}, |
794 | {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */ | 626 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, |
795 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */ | 627 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, |
796 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */ | 628 | {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, |
797 | {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */ | 629 | {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, |
798 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */ | 630 | {0xa0, 0x01, ZC3XX_R01D_HSYNC_0}, |
799 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */ | 631 | {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, |
800 | {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */ | 632 | {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2}, |
801 | {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */ | 633 | {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, |
802 | {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */ | ||
803 | {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */ | ||
804 | {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */ | ||
805 | {} | 634 | {} |
806 | }; | 635 | }; |
807 | static const struct usb_action cs2102_NoFlikerScale[] = { | 636 | static const struct usb_action cs2102_NoFlikerScale[] = { |
808 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | 637 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, |
809 | {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */ | 638 | {0xaa, 0x23, 0x0000}, |
810 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | 639 | {0xaa, 0x24, 0x00af}, |
811 | {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */ | 640 | {0xaa, 0x25, 0x0080}, |
812 | {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */ | 641 | {0xaa, 0x21, 0x0001}, |
813 | {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */ | 642 | {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH}, |
814 | {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */ | 643 | {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID}, |
815 | {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */ | 644 | {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, |
816 | {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */ | 645 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, |
817 | {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ | 646 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, |
818 | {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */ | 647 | {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW}, |
819 | {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */ | 648 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, |
820 | {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */ | 649 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, |
821 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */ | 650 | {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, |
822 | {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */ | 651 | {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, |
823 | {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */ | 652 | {0xa0, 0x01, ZC3XX_R01D_HSYNC_0}, |
824 | {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */ | 653 | {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, |
825 | {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */ | 654 | {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2}, |
826 | {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */ | 655 | {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, |
827 | {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */ | ||
828 | {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */ | ||
829 | {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */ | ||
830 | {} | 656 | {} |
831 | }; | 657 | }; |
832 | 658 | ||
@@ -6384,7 +6210,7 @@ static void setmatrix(struct gspca_dev *gspca_dev) | |||
6384 | {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b}; | 6210 | {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b}; |
6385 | static const __u8 *matrix_tb[SENSOR_MAX] = { | 6211 | static const __u8 *matrix_tb[SENSOR_MAX] = { |
6386 | adcm2700_matrix, /* SENSOR_ADCM2700 0 */ | 6212 | adcm2700_matrix, /* SENSOR_ADCM2700 0 */ |
6387 | NULL, /* SENSOR_CS2102 1 */ | 6213 | ov7620_matrix, /* SENSOR_CS2102 1 */ |
6388 | NULL, /* SENSOR_CS2102K 2 */ | 6214 | NULL, /* SENSOR_CS2102K 2 */ |
6389 | gc0305_matrix, /* SENSOR_GC0305 3 */ | 6215 | gc0305_matrix, /* SENSOR_GC0305 3 */ |
6390 | NULL, /* SENSOR_HDCS2020b 4 */ | 6216 | NULL, /* SENSOR_HDCS2020b 4 */ |
@@ -7025,7 +6851,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
7025 | int vga = 1; /* 1: vga, 0: sif */ | 6851 | int vga = 1; /* 1: vga, 0: sif */ |
7026 | static const __u8 gamma[SENSOR_MAX] = { | 6852 | static const __u8 gamma[SENSOR_MAX] = { |
7027 | 4, /* SENSOR_ADCM2700 0 */ | 6853 | 4, /* SENSOR_ADCM2700 0 */ |
7028 | 5, /* SENSOR_CS2102 1 */ | 6854 | 4, /* SENSOR_CS2102 1 */ |
7029 | 5, /* SENSOR_CS2102K 2 */ | 6855 | 5, /* SENSOR_CS2102K 2 */ |
7030 | 4, /* SENSOR_GC0305 3 */ | 6856 | 4, /* SENSOR_GC0305 3 */ |
7031 | 4, /* SENSOR_HDCS2020b 4 */ | 6857 | 4, /* SENSOR_HDCS2020b 4 */ |
@@ -7310,8 +7136,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7310 | 7136 | ||
7311 | /* set the gamma tables when not set */ | 7137 | /* set the gamma tables when not set */ |
7312 | switch (sd->sensor) { | 7138 | switch (sd->sensor) { |
7313 | case SENSOR_CS2102: /* gamma set in xxx_Initial */ | 7139 | case SENSOR_CS2102K: /* gamma set in xxx_Initial */ |
7314 | case SENSOR_CS2102K: | ||
7315 | case SENSOR_HDCS2020b: | 7140 | case SENSOR_HDCS2020b: |
7316 | case SENSOR_PB0330: /* pb with chip_revision - see above */ | 7141 | case SENSOR_PB0330: /* pb with chip_revision - see above */ |
7317 | case SENSOR_OV7630C: | 7142 | case SENSOR_OV7630C: |