22 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24 #define MODULE_NAME "sonixj"
26 #include <linux/input.h>
30 MODULE_AUTHOR(
"Jean-François Moine <http://moinejf.free.fr>");
71 #define QUALITY_MIN 25
72 #define QUALITY_MAX 90
73 #define QUALITY_DEF 70
81 #define AG_CNT_START 13
84 #define BRIDGE_SN9C102P 0
85 #define BRIDGE_SN9C105 1
86 #define BRIDGE_SN9C110 2
87 #define BRIDGE_SN9C120 3
114 #define F_PDN_INV 0x01
119 #define S_PWR_DN 0x01
120 #define S_PDN_INV 0x02
123 #define SCL_SEL_OD 0x20
124 #define SYS_SEL_48M 0x40
126 #define MCK_SIZE_MASK 0x1f
127 #define SEN_CLK_EN 0x20
149 .name =
"Brightness",
153 .default_value = 0x80,
155 .set_control = setbrightness
163 #define CONTRAST_MAX 127
168 .set_control = setcontrast
174 .name =
"Saturation",
178 #define COLORS_DEF 25
181 .set_control = setcolors
187 .name =
"Blue Balance",
193 .set_control = setredblue
199 .name =
"Red Balance",
205 .set_control = setredblue
218 .set_control = setgamma
228 .default_value = 1024
230 .set_control = setexposure
242 .set = sd_setautogain,
254 .set_control = setgain
266 .set_control = sethvflip
278 .set_control = sethvflip
290 .set_control = setsharpness
296 .name =
"Illuminator / infrared",
302 .set_control = setillum
309 .name =
"Light frequency filter",
315 .set_control = setfreq
320 static const __u32 ctrl_dis[] = {
410 .sizeimage = 352 * 288 * 4 / 8 + 590,
417 .sizeimage = 160 * 120 * 4 / 8 + 590,
422 .sizeimage = 320 * 240 * 3 / 8 + 590,
428 .sizeimage = 640 * 480 * 3 / 4 + 590,
433 static const u8 sn_adcm1700[0x1c] = {
435 0x00, 0x43, 0x60, 0x00, 0x1a, 0x00, 0x00, 0x00,
437 0x80, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
439 0x03, 0x00, 0x05, 0x01, 0x05, 0x16, 0x12, 0x42,
441 0x06, 0x00, 0x00, 0x00
444 static const u8 sn_gc0307[0x1c] = {
446 0x00, 0x61, 0x62, 0x00, 0x1a, 0x00, 0x00, 0x00,
448 0x80, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
450 0x03, 0x00, 0x03, 0x01, 0x08, 0x28, 0x1e, 0x02,
452 0x06, 0x00, 0x00, 0x00
455 static const u8 sn_hv7131[0x1c] = {
457 0x00, 0x03, 0x60, 0x00, 0x1a, 0x20, 0x20, 0x20,
459 0x81, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
461 0x03, 0x00, 0x00, 0x01, 0x03, 0x28, 0x1e, 0x41,
463 0x0a, 0x00, 0x00, 0x00
466 static const u8 sn_mi0360[0x1c] = {
468 0x00, 0x63, 0x40, 0x00, 0x1a, 0x20, 0x20, 0x20,
470 0x81, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
472 0x03, 0x00, 0x00, 0x02, 0x0a, 0x28, 0x1e, 0x61,
474 0x06, 0x00, 0x00, 0x00
477 static const u8 sn_mi0360b[0x1c] = {
479 0x00, 0x61, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
481 0x81, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
483 0x03, 0x00, 0x00, 0x02, 0x0a, 0x28, 0x1e, 0x40,
485 0x06, 0x00, 0x00, 0x00
488 static const u8 sn_mo4000[0x1c] = {
490 0x00, 0x23, 0x60, 0x00, 0x1a, 0x00, 0x20, 0x18,
492 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
494 0x03, 0x00, 0x0b, 0x0f, 0x14, 0x28, 0x1e, 0x40,
496 0x08, 0x00, 0x00, 0x00
499 static const u8 sn_mt9v111[0x1c] = {
501 0x00, 0x61, 0x40, 0x00, 0x1a, 0x20, 0x20, 0x20,
503 0x81, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
505 0x03, 0x00, 0x00, 0x02, 0x1c, 0x28, 0x1e, 0x40,
507 0x06, 0x00, 0x00, 0x00
510 static const u8 sn_om6802[0x1c] = {
512 0x00, 0x23, 0x72, 0x00, 0x1a, 0x20, 0x20, 0x19,
514 0x80, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
516 0x03, 0x00, 0x51, 0x01, 0x00, 0x28, 0x1e, 0x40,
518 0x05, 0x00, 0x00, 0x00
521 static const u8 sn_ov7630[0x1c] = {
523 0x00, 0x21, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
525 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
527 0x03, 0x00, 0x04, 0x01, 0x0a, 0x28, 0x1e, 0xc2,
529 0x0b, 0x00, 0x00, 0x00
532 static const u8 sn_ov7648[0x1c] = {
534 0x00, 0x63, 0x40, 0x00, 0x1a, 0x20, 0x20, 0x20,
536 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
538 0x03, 0x00, 0x00, 0x01, 0x00, 0x28, 0x1e, 0x00,
540 0x0b, 0x00, 0x00, 0x00
543 static const u8 sn_ov7660[0x1c] = {
545 0x00, 0x61, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
547 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
549 0x03, 0x00, 0x01, 0x01, 0x08, 0x28, 0x1e, 0x20,
551 0x07, 0x00, 0x00, 0x00
554 static const u8 sn_po1030[0x1c] = {
556 0x00, 0x21, 0x62, 0x00, 0x1a, 0x20, 0x20, 0x20,
558 0x81, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
560 0x03, 0x00, 0x00, 0x06, 0x06, 0x28, 0x1e, 0x00,
562 0x07, 0x00, 0x00, 0x00
565 static const u8 sn_po2030n[0x1c] = {
567 0x00, 0x63, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
569 0x81, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
571 0x03, 0x00, 0x00, 0x01, 0x14, 0x28, 0x1e, 0x00,
573 0x07, 0x00, 0x00, 0x00
576 static const u8 sn_soi768[0x1c] = {
578 0x00, 0x21, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
580 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
582 0x03, 0x00, 0x00, 0x01, 0x08, 0x28, 0x1e, 0x00,
584 0x07, 0x00, 0x00, 0x00
587 static const u8 sn_sp80708[0x1c] = {
589 0x00, 0x63, 0x60, 0x00, 0x1a, 0x20, 0x20, 0x20,
591 0x81, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
593 0x03, 0x00, 0x00, 0x03, 0x04, 0x28, 0x1e, 0x00,
595 0x07, 0x00, 0x00, 0x00
599 static const u8 *sn_tb[] = {
618 static const u8 gamma_def[17] = {
619 0x00, 0x2d, 0x46, 0x5a, 0x6c, 0x7c, 0x8b, 0x99,
620 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff
623 static const u8 gamma_spec_0[17] = {
624 0x0f, 0x39, 0x5a, 0x74, 0x86, 0x95, 0xa6, 0xb4,
625 0xbd, 0xc4, 0xcc, 0xd4, 0xd5, 0xde, 0xe4, 0xed, 0xf5
628 static const u8 gamma_spec_1[17] = {
629 0x08, 0x3a, 0x52, 0x65, 0x75, 0x83, 0x91, 0x9d,
630 0xa9, 0xb4, 0xbe, 0xc8, 0xd2, 0xdb, 0xe4, 0xed, 0xf5
633 static const u8 gamma_spec_2[17] = {
634 0x14, 0x37, 0x50, 0x6a, 0x7c, 0x8d, 0x9d, 0xab,
635 0xb5, 0xbf, 0xc2, 0xcb, 0xd1, 0xd6, 0xdb, 0xe1, 0xeb
638 static const u8 gamma_spec_3[17] = {
639 0x0a, 0x2d, 0x4e, 0x68, 0x7d, 0x8f, 0x9f, 0xab,
640 0xb7, 0xc2, 0xcc, 0xd3, 0xd8, 0xde, 0xe2, 0xe5, 0xe6
644 static const u8 reg84[] = {
645 0x14, 0x00, 0x27, 0x00, 0x07, 0x00,
646 0xe8, 0x0f, 0xda, 0x0f, 0x40, 0x00,
647 0x3e, 0x00, 0xcd, 0x0f, 0xf7, 0x0f,
653 static const u8 adcm1700_sensor_init[][8] = {
654 {0xa0, 0x51, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x10},
655 {0xb0, 0x51, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10},
656 {
DELAY, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
657 {0xb0, 0x51, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10},
658 {
DELAY, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
659 {0xb0, 0x51, 0x0c, 0xe0, 0x2e, 0x00, 0x00, 0x10},
660 {0xb0, 0x51, 0x10, 0x02, 0x02, 0x00, 0x00, 0x10},
661 {0xb0, 0x51, 0x14, 0x0e, 0x0e, 0x00, 0x00, 0x10},
662 {0xb0, 0x51, 0x1c, 0x00, 0x80, 0x00, 0x00, 0x10},
663 {0xb0, 0x51, 0x20, 0x01, 0x00, 0x00, 0x00, 0x10},
664 {
DELAY, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
665 {0xb0, 0x51, 0x04, 0x04, 0x00, 0x00, 0x00, 0x10},
666 {
DELAY, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
667 {0xb0, 0x51, 0x04, 0x01, 0x00, 0x00, 0x00, 0x10},
668 {0xa0, 0x51, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x10},
669 {0xb0, 0x51, 0x14, 0x01, 0x00, 0x00, 0x00, 0x10},
670 {0xb0, 0x51, 0x32, 0x00, 0x00, 0x00, 0x00, 0x10},
673 static const u8 adcm1700_sensor_param1[][8] = {
674 {0xb0, 0x51, 0x26, 0xf9, 0x01, 0x00, 0x00, 0x10},
675 {0xd0, 0x51, 0x1e, 0x8e, 0x8e, 0x8e, 0x8e, 0x10},
677 {0xa0, 0x51, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x10},
678 {0xb0, 0x51, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10},
679 {0xa0, 0x51, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x10},
680 {0xb0, 0x51, 0x32, 0x00, 0x72, 0x00, 0x00, 0x10},
681 {0xd0, 0x51, 0x1e, 0xbe, 0xd7, 0xe8, 0xbe, 0x10},
683 {0xa0, 0x51, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x10},
684 {0xb0, 0x51, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10},
685 {0xa0, 0x51, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x10},
686 {0xb0, 0x51, 0x32, 0x00, 0xa2, 0x00, 0x00, 0x10},
689 static const u8 gc0307_sensor_init[][8] = {
690 {0xa0, 0x21, 0x43, 0x00, 0x00, 0x00, 0x00, 0x10},
691 {0xa0, 0x21, 0x44, 0xa2, 0x00, 0x00, 0x00, 0x10},
692 {0xa0, 0x21, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x10},
693 {0xa0, 0x21, 0x02, 0x70, 0x00, 0x00, 0x00, 0x10},
694 {0xa0, 0x21, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
695 {0xa0, 0x21, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x10},
696 {0xa0, 0x21, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x10},
697 {0xa0, 0x21, 0x11, 0x05, 0x00, 0x00, 0x00, 0x10},
698 {0xa0, 0x21, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10},
699 {0xa0, 0x21, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10},
700 {0xa0, 0x21, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10},
701 {0xa0, 0x21, 0x08, 0x02, 0x00, 0x00, 0x00, 0x10},
702 {0xa0, 0x21, 0x09, 0x01, 0x00, 0x00, 0x00, 0x10},
703 {0xa0, 0x21, 0x0a, 0xe8, 0x00, 0x00, 0x00, 0x10},
704 {0xa0, 0x21, 0x0b, 0x02, 0x00, 0x00, 0x00, 0x10},
705 {0xa0, 0x21, 0x0c, 0x80, 0x00, 0x00, 0x00, 0x10},
706 {0xa0, 0x21, 0x0d, 0x22, 0x00, 0x00, 0x00, 0x10},
707 {0xa0, 0x21, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x10},
708 {0xa0, 0x21, 0x0f, 0xb2, 0x00, 0x00, 0x00, 0x10},
709 {0xa0, 0x21, 0x12, 0x70, 0x00, 0x00, 0x00, 0x10},
710 {
DELAY, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
711 {0xa0, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00, 0x10},
712 {0xa0, 0x21, 0x15, 0xb8, 0x00, 0x00, 0x00, 0x10},
713 {0xa0, 0x21, 0x16, 0x13, 0x00, 0x00, 0x00, 0x10},
714 {0xa0, 0x21, 0x17, 0x52, 0x00, 0x00, 0x00, 0x10},
715 {0xa0, 0x21, 0x18, 0x50, 0x00, 0x00, 0x00, 0x10},
716 {0xa0, 0x21, 0x1e, 0x0d, 0x00, 0x00, 0x00, 0x10},
717 {0xa0, 0x21, 0x1f, 0x32, 0x00, 0x00, 0x00, 0x10},
718 {0xa0, 0x21, 0x61, 0x90, 0x00, 0x00, 0x00, 0x10},
719 {0xa0, 0x21, 0x63, 0x70, 0x00, 0x00, 0x00, 0x10},
720 {0xa0, 0x21, 0x65, 0x98, 0x00, 0x00, 0x00, 0x10},
721 {0xa0, 0x21, 0x67, 0x90, 0x00, 0x00, 0x00, 0x10},
722 {0xa0, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10},
723 {0xa0, 0x21, 0x04, 0x96, 0x00, 0x00, 0x00, 0x10},
724 {0xa0, 0x21, 0x45, 0x27, 0x00, 0x00, 0x00, 0x10},
725 {0xa0, 0x21, 0x47, 0x2c, 0x00, 0x00, 0x00, 0x10},
726 {0xa0, 0x21, 0x43, 0x47, 0x00, 0x00, 0x00, 0x10},
727 {0xa0, 0x21, 0x44, 0xd8, 0x00, 0x00, 0x00, 0x10},
730 static const u8 gc0307_sensor_param1[][8] = {
731 {0xa0, 0x21, 0x68, 0x13, 0x00, 0x00, 0x00, 0x10},
732 {0xd0, 0x21, 0x61, 0x80, 0x00, 0x80, 0x00, 0x10},
733 {0xc0, 0x21, 0x65, 0x80, 0x00, 0x80, 0x00, 0x10},
734 {0xc0, 0x21, 0x63, 0xa0, 0x00, 0xa6, 0x00, 0x10},
736 {0xa0, 0x21, 0x01, 0x6e, 0x00, 0x00, 0x00, 0x10},
737 {0xa0, 0x21, 0x02, 0x88, 0x00, 0x00, 0x00, 0x10},
741 static const u8 hv7131r_sensor_init[][8] = {
742 {0xc1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10},
743 {0xb1, 0x11, 0x34, 0x17, 0x7f, 0x00, 0x00, 0x10},
744 {0xd1, 0x11, 0x40, 0xff, 0x7f, 0x7f, 0x7f, 0x10},
746 {0xd1, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
747 {0xd1, 0x11, 0x14, 0x01, 0xe2, 0x02, 0x82, 0x10},
750 {0xa1, 0x11, 0x01, 0x08, 0x00, 0x00, 0x00, 0x10},
751 {0xa1, 0x11, 0x01, 0x08, 0x00, 0x00, 0x00, 0x10},
752 {0xc1, 0x11, 0x25, 0x00, 0x61, 0xa8, 0x00, 0x10},
753 {0xa1, 0x11, 0x30, 0x22, 0x00, 0x00, 0x00, 0x10},
754 {0xc1, 0x11, 0x31, 0x20, 0x2e, 0x20, 0x00, 0x10},
755 {0xc1, 0x11, 0x25, 0x00, 0xc3, 0x50, 0x00, 0x10},
756 {0xa1, 0x11, 0x30, 0x07, 0x00, 0x00, 0x00, 0x10},
757 {0xc1, 0x11, 0x31, 0x10, 0x10, 0x10, 0x00, 0x10},
759 {0xa1, 0x11, 0x01, 0x08, 0x00, 0x00, 0x00, 0x10},
760 {0xa1, 0x11, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
761 {0xa1, 0x11, 0x21, 0xd0, 0x00, 0x00, 0x00, 0x10},
762 {0xa1, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
763 {0xa1, 0x11, 0x23, 0x09, 0x00, 0x00, 0x00, 0x10},
765 {0xa1, 0x11, 0x01, 0x08, 0x00, 0x00, 0x00, 0x10},
766 {0xa1, 0x11, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
767 {0xa1, 0x11, 0x21, 0xd0, 0x00, 0x00, 0x00, 0x10},
768 {0xa1, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
769 {0xa1, 0x11, 0x23, 0x10, 0x00, 0x00, 0x00, 0x10},
770 {0xa1, 0x11, 0x01, 0x18, 0x00, 0x00, 0x00, 0x10},
774 static const u8 mi0360_sensor_init[][8] = {
775 {0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10},
776 {0xb1, 0x5d, 0x0d, 0x00, 0x01, 0x00, 0x00, 0x10},
777 {0xb1, 0x5d, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x10},
778 {0xd1, 0x5d, 0x01, 0x00, 0x08, 0x00, 0x16, 0x10},
779 {0xd1, 0x5d, 0x03, 0x01, 0xe2, 0x02, 0x82, 0x10},
780 {0xd1, 0x5d, 0x05, 0x00, 0x09, 0x00, 0x53, 0x10},
781 {0xb1, 0x5d, 0x0d, 0x00, 0x02, 0x00, 0x00, 0x10},
782 {0xd1, 0x5d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10},
783 {0xd1, 0x5d, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x10},
784 {0xd1, 0x5d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x10},
785 {0xd1, 0x5d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
786 {0xd1, 0x5d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
787 {0xd1, 0x5d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x10},
788 {0xd1, 0x5d, 0x16, 0x00, 0x00, 0x00, 0x00, 0x10},
789 {0xd1, 0x5d, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10},
790 {0xd1, 0x5d, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x10},
791 {0xd1, 0x5d, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x10},
792 {0xb1, 0x5d, 0x32, 0x00, 0x00, 0x00, 0x00, 0x10},
793 {0xd1, 0x5d, 0x20, 0x91, 0x01, 0x00, 0x00, 0x10},
794 {0xd1, 0x5d, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
795 {0xd1, 0x5d, 0x24, 0x00, 0x00, 0x00, 0x00, 0x10},
796 {0xd1, 0x5d, 0x26, 0x00, 0x00, 0x00, 0x24, 0x10},
797 {0xd1, 0x5d, 0x2f, 0xf7, 0xb0, 0x00, 0x04, 0x10},
798 {0xd1, 0x5d, 0x31, 0x00, 0x00, 0x00, 0x00, 0x10},
799 {0xd1, 0x5d, 0x33, 0x00, 0x00, 0x01, 0x00, 0x10},
800 {0xb1, 0x5d, 0x3d, 0x06, 0x8f, 0x00, 0x00, 0x10},
801 {0xd1, 0x5d, 0x40, 0x01, 0xe0, 0x00, 0xd1, 0x10},
802 {0xb1, 0x5d, 0x44, 0x00, 0x82, 0x00, 0x00, 0x10},
803 {0xd1, 0x5d, 0x58, 0x00, 0x78, 0x00, 0x43, 0x10},
804 {0xd1, 0x5d, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x10},
805 {0xd1, 0x5d, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x10},
806 {0xd1, 0x5d, 0x5e, 0x00, 0x00, 0xa3, 0x1d, 0x10},
807 {0xb1, 0x5d, 0x62, 0x04, 0x11, 0x00, 0x00, 0x10},
809 {0xb1, 0x5d, 0x20, 0x91, 0x01, 0x00, 0x00, 0x10},
810 {0xb1, 0x5d, 0x20, 0x11, 0x01, 0x00, 0x00, 0x10},
811 {0xb1, 0x5d, 0x09, 0x00, 0x64, 0x00, 0x00, 0x10},
812 {0xd1, 0x5d, 0x2b, 0x00, 0xa0, 0x00, 0xb0, 0x10},
813 {0xd1, 0x5d, 0x2d, 0x00, 0xa0, 0x00, 0xa0, 0x10},
815 {0xb1, 0x5d, 0x0a, 0x00, 0x02, 0x00, 0x00, 0x10},
816 {0xb1, 0x5d, 0x06, 0x00, 0x30, 0x00, 0x00, 0x10},
817 {0xb1, 0x5d, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x10},
818 {0xb1, 0x5d, 0x09, 0x02, 0x35, 0x00, 0x00, 0x10},
820 {0xd1, 0x5d, 0x2b, 0x00, 0xb9, 0x00, 0xe3, 0x10},
821 {0xd1, 0x5d, 0x2d, 0x00, 0x5f, 0x00, 0xb9, 0x10},
824 {0xb1, 0x5d, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10},
825 {0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10},
828 static const u8 mi0360b_sensor_init[][8] = {
829 {0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10},
830 {0xb1, 0x5d, 0x0d, 0x00, 0x01, 0x00, 0x00, 0x10},
831 {
DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
832 {0xb1, 0x5d, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x10},
833 {
DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
834 {0xd1, 0x5d, 0x01, 0x00, 0x08, 0x00, 0x16, 0x10},
835 {0xd1, 0x5d, 0x03, 0x01, 0xe2, 0x02, 0x82, 0x10},
836 {0xd1, 0x5d, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10},
837 {0xb1, 0x5d, 0x0d, 0x00, 0x02, 0x00, 0x00, 0x10},
838 {0xd1, 0x5d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10},
839 {0xd1, 0x5d, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x10},
840 {0xd1, 0x5d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x10},
841 {0xd1, 0x5d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
842 {0xd1, 0x5d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
843 {0xd1, 0x5d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x10},
844 {0xd1, 0x5d, 0x16, 0x00, 0x00, 0x00, 0x00, 0x10},
845 {0xd1, 0x5d, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10},
846 {0xd1, 0x5d, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x10},
847 {0xd1, 0x5d, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x10},
848 {0xb1, 0x5d, 0x32, 0x00, 0x00, 0x00, 0x00, 0x10},
849 {0xd1, 0x5d, 0x20, 0x11, 0x01, 0x00, 0x00, 0x10},
850 {0xd1, 0x5d, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
851 {0xd1, 0x5d, 0x24, 0x00, 0x00, 0x00, 0x00, 0x10},
852 {0xd1, 0x5d, 0x26, 0x00, 0x00, 0x00, 0x24, 0x10},
853 {0xd1, 0x5d, 0x2f, 0xf7, 0xb0, 0x00, 0x04, 0x10},
854 {0xd1, 0x5d, 0x31, 0x00, 0x00, 0x00, 0x00, 0x10},
855 {0xd1, 0x5d, 0x33, 0x00, 0x00, 0x01, 0x00, 0x10},
856 {0xb1, 0x5d, 0x3d, 0x06, 0x8f, 0x00, 0x00, 0x10},
857 {0xd1, 0x5d, 0x40, 0x01, 0xe0, 0x00, 0xd1, 0x10},
858 {0xb1, 0x5d, 0x44, 0x00, 0x82, 0x00, 0x00, 0x10},
859 {0xd1, 0x5d, 0x58, 0x00, 0x78, 0x00, 0x43, 0x10},
860 {0xd1, 0x5d, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x10},
861 {0xd1, 0x5d, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x10},
862 {0xd1, 0x5d, 0x5e, 0x00, 0x00, 0xa3, 0x1d, 0x10},
863 {0xb1, 0x5d, 0x62, 0x04, 0x11, 0x00, 0x00, 0x10},
865 {0xb1, 0x5d, 0x20, 0x11, 0x01, 0x00, 0x00, 0x10},
866 {0xb1, 0x5d, 0x20, 0x11, 0x01, 0x00, 0x00, 0x10},
867 {0xb1, 0x5d, 0x09, 0x00, 0x64, 0x00, 0x00, 0x10},
868 {0xd1, 0x5d, 0x2b, 0x00, 0x33, 0x00, 0xa0, 0x10},
869 {0xd1, 0x5d, 0x2d, 0x00, 0xa0, 0x00, 0x33, 0x10},
872 static const u8 mi0360b_sensor_param1[][8] = {
873 {0xb1, 0x5d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10},
874 {0xb1, 0x5d, 0x06, 0x00, 0x53, 0x00, 0x00, 0x10},
875 {0xb1, 0x5d, 0x05, 0x00, 0x09, 0x00, 0x00, 0x10},
876 {0xb1, 0x5d, 0x09, 0x02, 0x35, 0x00, 0x00, 0x10},
878 {0xd1, 0x5d, 0x2b, 0x00, 0xd1, 0x01, 0xc9, 0x10},
879 {0xd1, 0x5d, 0x2d, 0x00, 0xed, 0x00, 0xd1, 0x10},
880 {0xb1, 0x5d, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10},
881 {0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10},
884 static const u8 mo4000_sensor_init[][8] = {
885 {0xa1, 0x21, 0x01, 0x02, 0x00, 0x00, 0x00, 0x10},
886 {0xa1, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10},
887 {0xa1, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10},
888 {0xa1, 0x21, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10},
889 {0xa1, 0x21, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10},
890 {0xa1, 0x21, 0x05, 0x04, 0x00, 0x00, 0x00, 0x10},
891 {0xa1, 0x21, 0x06, 0x80, 0x00, 0x00, 0x00, 0x10},
892 {0xa1, 0x21, 0x06, 0x81, 0x00, 0x00, 0x00, 0x10},
893 {0xa1, 0x21, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x10},
894 {0xa1, 0x21, 0x11, 0x00, 0x00, 0x00, 0x00, 0x10},
895 {0xa1, 0x21, 0x11, 0x20, 0x00, 0x00, 0x00, 0x10},
896 {0xa1, 0x21, 0x11, 0x30, 0x00, 0x00, 0x00, 0x10},
897 {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10},
898 {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10},
899 {0xa1, 0x21, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
900 {0xa1, 0x21, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
901 {0xa1, 0x21, 0x0f, 0x20, 0x00, 0x00, 0x00, 0x10},
902 {0xa1, 0x21, 0x10, 0x20, 0x00, 0x00, 0x00, 0x10},
903 {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
904 {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10},
907 static const u8 mt9v111_sensor_init[][8] = {
908 {0xb1, 0x5c, 0x0d, 0x00, 0x01, 0x00, 0x00, 0x10},
909 {
DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
910 {0xb1, 0x5c, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x10},
911 {0xb1, 0x5c, 0x01, 0x00, 0x01, 0x00, 0x00, 0x10},
912 {0xb1, 0x5c, 0x08, 0x04, 0x80, 0x00, 0x00, 0x10},
913 {0xb1, 0x5c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10},
914 {0xb1, 0x5c, 0x01, 0x00, 0x04, 0x00, 0x00, 0x10},
915 {0xb1, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x00, 0x10},
916 {0xb1, 0x5c, 0x02, 0x00, 0x16, 0x00, 0x00, 0x10},
917 {0xb1, 0x5c, 0x03, 0x01, 0xe7, 0x00, 0x00, 0x10},
918 {0xb1, 0x5c, 0x04, 0x02, 0x87, 0x00, 0x00, 0x10},
919 {0xb1, 0x5c, 0x07, 0x30, 0x02, 0x00, 0x00, 0x10},
920 {0xb1, 0x5c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x10},
921 {0xb1, 0x5c, 0x12, 0x00, 0xb0, 0x00, 0x00, 0x10},
922 {0xb1, 0x5c, 0x13, 0x00, 0x7c, 0x00, 0x00, 0x10},
923 {0xb1, 0x5c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x10},
924 {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
925 {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
928 static const u8 mt9v111_sensor_param1[][8] = {
929 {0xd1, 0x5c, 0x2b, 0x00, 0x33, 0x00, 0xad, 0x10},
930 {0xd1, 0x5c, 0x2d, 0x00, 0xad, 0x00, 0x33, 0x10},
931 {0xb1, 0x5c, 0x06, 0x00, 0x40, 0x00, 0x00, 0x10},
932 {0xb1, 0x5c, 0x05, 0x00, 0x09, 0x00, 0x00, 0x10},
933 {0xb1, 0x5c, 0x35, 0x01, 0xc0, 0x00, 0x00, 0x10},
936 static const u8 om6802_init0[2][8] = {
938 {0xa0, 0x34, 0x29, 0x0e, 0x00, 0x00, 0x00, 0x10},
939 {0xa0, 0x34, 0x23, 0xb0, 0x00, 0x00, 0x00, 0x10},
941 static const u8 om6802_sensor_init[][8] = {
942 {0xa0, 0x34, 0xdf, 0x6d, 0x00, 0x00, 0x00, 0x10},
944 {0xa0, 0x34, 0xdd, 0x18, 0x00, 0x00, 0x00, 0x10},
946 {0xa0, 0x34, 0x5a, 0xc0, 0x00, 0x00, 0x00, 0x10},
948 {0xa0, 0x34, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x10},
962 {0xa0, 0x34, 0xe9, 0x0f, 0x00, 0x00, 0x00, 0x10},
964 {0xa0, 0x34, 0xe4, 0xff, 0x00, 0x00, 0x00, 0x10},
969 {0xa0, 0x34, 0x5d, 0x80, 0x00, 0x00, 0x00, 0x10},
972 static const u8 om6802_sensor_param1[][8] = {
973 {0xa0, 0x34, 0x71, 0x84, 0x00, 0x00, 0x00, 0x10},
974 {0xa0, 0x34, 0x72, 0x05, 0x00, 0x00, 0x00, 0x10},
975 {0xa0, 0x34, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10},
976 {0xa0, 0x34, 0x69, 0x01, 0x00, 0x00, 0x00, 0x10},
979 static const u8 ov7630_sensor_init[][8] = {
980 {0xa1, 0x21, 0x76, 0x01, 0x00, 0x00, 0x00, 0x10},
981 {0xa1, 0x21, 0x12, 0xc8, 0x00, 0x00, 0x00, 0x10},
982 {
DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
983 {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10},
984 {0xa1, 0x21, 0x12, 0xc8, 0x00, 0x00, 0x00, 0x10},
985 {
DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
986 {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10},
988 {0xd1, 0x21, 0x03, 0x80, 0x10, 0x20, 0x80, 0x10},
989 {0xb1, 0x21, 0x0c, 0x20, 0x20, 0x00, 0x00, 0x10},
992 {0xd1, 0x21, 0x11, 0x01, 0x48, 0xc3, 0x00, 0x10},
993 {0xb1, 0x21, 0x15, 0x80, 0x03, 0x00, 0x00, 0x10},
994 {0xd1, 0x21, 0x17, 0x1b, 0xbd, 0x05, 0xf6, 0x10},
995 {0xa1, 0x21, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x10},
996 {0xd1, 0x21, 0x1f, 0x00, 0x80, 0x80, 0x80, 0x10},
997 {0xd1, 0x21, 0x23, 0xde, 0x10, 0x8a, 0xa0, 0x10},
998 {0xc1, 0x21, 0x27, 0xca, 0xa2, 0x74, 0x00, 0x10},
999 {0xd1, 0x21, 0x2a, 0x88, 0x00, 0x88, 0x01, 0x10},
1000 {0xc1, 0x21, 0x2e, 0x80, 0x00, 0x18, 0x00, 0x10},
1001 {0xa1, 0x21, 0x21, 0x08, 0x00, 0x00, 0x00, 0x10},
1002 {0xa1, 0x21, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
1003 {0xa1, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x10},
1004 {0xb1, 0x21, 0x32, 0xc2, 0x08, 0x00, 0x00, 0x10},
1005 {0xb1, 0x21, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x10},
1006 {0xd1, 0x21, 0x60, 0x05, 0x40, 0x12, 0x57, 0x10},
1007 {0xa1, 0x21, 0x64, 0x73, 0x00, 0x00, 0x00, 0x10},
1008 {0xd1, 0x21, 0x65, 0x00, 0x55, 0x01, 0xac, 0x10},
1009 {0xa1, 0x21, 0x69, 0x38, 0x00, 0x00, 0x00, 0x10},
1010 {0xd1, 0x21, 0x6f, 0x1f, 0x01, 0x00, 0x10, 0x10},
1011 {0xd1, 0x21, 0x73, 0x50, 0x20, 0x02, 0x01, 0x10},
1012 {0xd1, 0x21, 0x77, 0xf3, 0x90, 0x98, 0x98, 0x10},
1013 {0xc1, 0x21, 0x7b, 0x00, 0x4c, 0xf7, 0x00, 0x10},
1014 {0xd1, 0x21, 0x17, 0x1b, 0xbd, 0x05, 0xf6, 0x10},
1015 {0xa1, 0x21, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x10},
1018 static const u8 ov7630_sensor_param1[][8] = {
1019 {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10},
1020 {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10},
1024 {0xa1, 0x21, 0x10, 0x32, 0x00, 0x00, 0x00, 0x10},
1025 {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
1026 {0xb1, 0x21, 0x01, 0x80, 0x80, 0x00, 0x00, 0x10},
1031 {0xa1, 0x21, 0x10, 0x83, 0x00, 0x00, 0x00, 0x10},
1036 static const u8 ov7648_sensor_init[][8] = {
1037 {0xa1, 0x21, 0x76, 0x00, 0x00, 0x00, 0x00, 0x10},
1038 {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10},
1039 {
DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1040 {0xa1, 0x21, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
1041 {0xd1, 0x21, 0x03, 0xa4, 0x30, 0x88, 0x00, 0x10},
1042 {0xb1, 0x21, 0x11, 0x80, 0x08, 0x00, 0x00, 0x10},
1043 {0xc1, 0x21, 0x13, 0xa0, 0x04, 0x84, 0x00, 0x10},
1044 {0xd1, 0x21, 0x17, 0x1a, 0x02, 0xba, 0xf4, 0x10},
1045 {0xa1, 0x21, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x10},
1046 {0xd1, 0x21, 0x1f, 0x41, 0xc0, 0x80, 0x80, 0x10},
1047 {0xd1, 0x21, 0x23, 0xde, 0xa0, 0x80, 0x32, 0x10},
1048 {0xd1, 0x21, 0x27, 0xfe, 0xa0, 0x00, 0x91, 0x10},
1049 {0xd1, 0x21, 0x2b, 0x00, 0x88, 0x85, 0x80, 0x10},
1050 {0xc1, 0x21, 0x2f, 0x9c, 0x00, 0xc4, 0x00, 0x10},
1051 {0xd1, 0x21, 0x60, 0xa6, 0x60, 0x88, 0x12, 0x10},
1052 {0xd1, 0x21, 0x64, 0x88, 0x00, 0x00, 0x94, 0x10},
1053 {0xd1, 0x21, 0x68, 0x7a, 0x0c, 0x00, 0x00, 0x10},
1054 {0xd1, 0x21, 0x6c, 0x11, 0x33, 0x22, 0x00, 0x10},
1055 {0xd1, 0x21, 0x70, 0x11, 0x00, 0x10, 0x50, 0x10},
1056 {0xd1, 0x21, 0x74, 0x20, 0x06, 0x00, 0xb5, 0x10},
1057 {0xd1, 0x21, 0x78, 0x8a, 0x00, 0x00, 0x00, 0x10},
1058 {0xb1, 0x21, 0x7c, 0x00, 0x43, 0x00, 0x00, 0x10},
1060 {0xd1, 0x21, 0x21, 0x86, 0x00, 0xde, 0xa0, 0x10},
1066 static const u8 ov7648_sensor_param1[][8] = {
1070 {0xa1, 0x21, 0x19, 0x02, 0x00, 0x00, 0x00, 0x10},
1071 {0xa1, 0x21, 0x10, 0x32, 0x00, 0x00, 0x00, 0x10},
1076 {0xa1, 0x21, 0x11, 0x81, 0x00, 0x00, 0x00, 0x10},
1086 static const u8 ov7660_sensor_init[][8] = {
1087 {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10},
1088 {
DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1089 {0xa1, 0x21, 0x12, 0x05, 0x00, 0x00, 0x00, 0x10},
1091 {0xa1, 0x21, 0x13, 0xb8, 0x00, 0x00, 0x00, 0x10},
1092 {0xd1, 0x21, 0x00, 0x01, 0x74, 0x92, 0x00, 0x10},
1094 {0xd1, 0x21, 0x04, 0x00, 0x7d, 0x62, 0x00, 0x10},
1096 {0xb1, 0x21, 0x08, 0x83, 0x01, 0x00, 0x00, 0x10},
1097 {0xd1, 0x21, 0x0c, 0x00, 0x08, 0x04, 0x4f, 0x10},
1098 {0xd1, 0x21, 0x10, 0x7f, 0x40, 0x05, 0xff, 0x10},
1100 {0xc1, 0x21, 0x14, 0x2c, 0x00, 0x02, 0x00, 0x10},
1101 {0xd1, 0x21, 0x17, 0x10, 0x60, 0x02, 0x7b, 0x10},
1103 {0xa1, 0x21, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x10},
1104 {0xb1, 0x21, 0x1e, 0x01, 0x0e, 0x00, 0x00, 0x10},
1105 {0xd1, 0x21, 0x20, 0x07, 0x07, 0x07, 0x07, 0x10},
1108 {0xd1, 0x21, 0x24, 0x78, 0x68, 0xd4, 0x80, 0x10},
1110 {0xd1, 0x21, 0x28, 0x80, 0x30, 0x00, 0x00, 0x10},
1112 {0xd1, 0x21, 0x2c, 0x80, 0x00, 0x00, 0x62, 0x10},
1114 {0xc1, 0x21, 0x30, 0x08, 0x30, 0xb4, 0x00, 0x10},
1116 {0xd1, 0x21, 0x33, 0x00, 0x07, 0x84, 0x00, 0x10},
1117 {0xd1, 0x21, 0x37, 0x0c, 0x02, 0x43, 0x00, 0x10},
1119 {0xd1, 0x21, 0x3b, 0x02, 0x6c, 0x19, 0x0e, 0x10},
1121 {0xd1, 0x21, 0x3f, 0x41, 0xc1, 0x22, 0x08, 0x10},
1123 {0xd1, 0x21, 0x43, 0xf0, 0x10, 0x78, 0xa8, 0x10},
1124 {0xd1, 0x21, 0x47, 0x60, 0x80, 0x00, 0x00, 0x10},
1125 {0xd1, 0x21, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x10},
1126 {0xd1, 0x21, 0x4f, 0x46, 0x36, 0x0f, 0x17, 0x10},
1127 {0xd1, 0x21, 0x53, 0x7f, 0x96, 0x40, 0x40, 0x10},
1128 {0xb1, 0x21, 0x57, 0x40, 0x0f, 0x00, 0x00, 0x10},
1129 {0xd1, 0x21, 0x59, 0xba, 0x9a, 0x22, 0xb9, 0x10},
1130 {0xd1, 0x21, 0x5d, 0x9b, 0x10, 0xf0, 0x05, 0x10},
1131 {0xa1, 0x21, 0x61, 0x60, 0x00, 0x00, 0x00, 0x10},
1132 {0xd1, 0x21, 0x62, 0x00, 0x00, 0x50, 0x30, 0x10},
1134 {0xa1, 0x21, 0x66, 0x00, 0x00, 0x00, 0x00, 0x10},
1135 {0xd1, 0x21, 0x67, 0x80, 0x7a, 0x90, 0x80, 0x10},
1136 {0xa1, 0x21, 0x6b, 0x0a, 0x00, 0x00, 0x00, 0x10},
1138 {0xd1, 0x21, 0x6c, 0x30, 0x48, 0x80, 0x74, 0x10},
1139 {0xd1, 0x21, 0x70, 0x64, 0x60, 0x5c, 0x58, 0x10},
1140 {0xd1, 0x21, 0x74, 0x54, 0x4c, 0x40, 0x38, 0x10},
1141 {0xd1, 0x21, 0x78, 0x34, 0x30, 0x2f, 0x2b, 0x10},
1142 {0xd1, 0x21, 0x7c, 0x03, 0x07, 0x17, 0x34, 0x10},
1143 {0xd1, 0x21, 0x80, 0x41, 0x4d, 0x58, 0x63, 0x10},
1144 {0xd1, 0x21, 0x84, 0x6e, 0x77, 0x87, 0x95, 0x10},
1145 {0xc1, 0x21, 0x88, 0xaf, 0xc7, 0xdf, 0x00, 0x10},
1146 {0xc1, 0x21, 0x8b, 0x99, 0x99, 0xcf, 0x00, 0x10},
1147 {0xb1, 0x21, 0x92, 0x00, 0x00, 0x00, 0x00, 0x10},
1149 {0xa1, 0x21, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x10},
1152 static const u8 ov7660_sensor_param1[][8] = {
1153 {0xa1, 0x21, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x10},
1155 {0xa1, 0x21, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x10},
1156 {0xa1, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10},
1158 {0xa1, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10},
1159 {0xa1, 0x21, 0x10, 0x20, 0x00, 0x00, 0x00, 0x10},
1160 {0xa1, 0x21, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x10},
1161 {0xa1, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x10},
1162 {0xa1, 0x21, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x10},
1166 {0xa1, 0x21, 0x93, 0x00, 0x00, 0x00, 0x00, 0x10},
1167 {0xa1, 0x21, 0x92, 0x25, 0x00, 0x00, 0x00, 0x10},
1168 {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10},
1169 {0xa1, 0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10},
1174 {0xa1, 0x21, 0x93, 0x01, 0x00, 0x00, 0x00, 0x10},
1175 {0xa1, 0x21, 0x92, 0xff, 0x00, 0x00, 0x00, 0x10},
1176 {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10},
1177 {0xa1, 0x21, 0x2b, 0xc3, 0x00, 0x00, 0x00, 0x10},
1181 static const u8 po1030_sensor_init[][8] = {
1183 {0xa1, 0x6e, 0x3f, 0x20, 0x00, 0x00, 0x00, 0x10},
1184 {
DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1185 {0xa1, 0x6e, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x10},
1186 {0xa1, 0x6e, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x10},
1187 {0xd1, 0x6e, 0x04, 0x02, 0xb1, 0x02, 0x39, 0x10},
1188 {0xd1, 0x6e, 0x08, 0x00, 0x01, 0x00, 0x00, 0x10},
1189 {0xd1, 0x6e, 0x0c, 0x02, 0x7f, 0x01, 0xe0, 0x10},
1190 {0xd1, 0x6e, 0x12, 0x03, 0x02, 0x00, 0x03, 0x10},
1191 {0xd1, 0x6e, 0x16, 0x85, 0x40, 0x4a, 0x40, 0x10},
1192 {0xc1, 0x6e, 0x1a, 0x00, 0x80, 0x00, 0x00, 0x10},
1193 {0xd1, 0x6e, 0x1d, 0x08, 0x03, 0x00, 0x00, 0x10},
1194 {0xd1, 0x6e, 0x23, 0x00, 0xb0, 0x00, 0x94, 0x10},
1195 {0xd1, 0x6e, 0x27, 0x58, 0x00, 0x00, 0x00, 0x10},
1196 {0xb1, 0x6e, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10},
1197 {0xd1, 0x6e, 0x2d, 0x14, 0x35, 0x61, 0x84, 0x10},
1198 {0xd1, 0x6e, 0x31, 0xa2, 0xbd, 0xd8, 0xff, 0x10},
1199 {0xd1, 0x6e, 0x35, 0x06, 0x1e, 0x12, 0x02, 0x10},
1200 {0xd1, 0x6e, 0x39, 0xaa, 0x53, 0x37, 0xd5, 0x10},
1201 {0xa1, 0x6e, 0x3d, 0xf2, 0x00, 0x00, 0x00, 0x10},
1202 {0xd1, 0x6e, 0x3e, 0x00, 0x00, 0x80, 0x03, 0x10},
1203 {0xd1, 0x6e, 0x42, 0x03, 0x00, 0x00, 0x00, 0x10},
1204 {0xc1, 0x6e, 0x46, 0x00, 0x80, 0x80, 0x00, 0x10},
1205 {0xd1, 0x6e, 0x4b, 0x02, 0xef, 0x08, 0xcd, 0x10},
1206 {0xd1, 0x6e, 0x4f, 0x00, 0xd0, 0x00, 0xa0, 0x10},
1207 {0xd1, 0x6e, 0x53, 0x01, 0xaa, 0x01, 0x40, 0x10},
1208 {0xd1, 0x6e, 0x5a, 0x50, 0x04, 0x30, 0x03, 0x10},
1209 {0xa1, 0x6e, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x10},
1210 {0xd1, 0x6e, 0x5f, 0x10, 0x40, 0xff, 0x00, 0x10},
1212 {0xd1, 0x6e, 0x63, 0x40, 0x40, 0x00, 0x00, 0x10},
1213 {0xd1, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x10},
1214 {0xd1, 0x6e, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x10},
1215 {0xd1, 0x6e, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x10},
1216 {0xc1, 0x6e, 0x73, 0x10, 0x80, 0xeb, 0x00, 0x10},
1219 static const u8 po1030_sensor_param1[][8] = {
1221 {0xa1, 0x6e, 0x1e, 0x03, 0x00, 0x00, 0x00, 0x10},
1222 {0xa1, 0x6e, 0x1e, 0x03, 0x00, 0x00, 0x00, 0x10},
1224 {0xc1, 0x6e, 0x1a, 0x02, 0xd4, 0xa4, 0x00, 0x10},
1225 {0xa1, 0x6e, 0x15, 0x04, 0x00, 0x00, 0x00, 0x10},
1226 {0xc1, 0x6e, 0x16, 0x40, 0x40, 0x40, 0x00, 0x10},
1228 {0xa1, 0x6e, 0x1d, 0x08, 0x00, 0x00, 0x00, 0x10},
1229 {0xa1, 0x6e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x10},
1230 {0xa1, 0x6e, 0x07, 0xd5, 0x00, 0x00, 0x00, 0x10},
1235 static const u8 po2030n_sensor_init[][8] = {
1236 {0xa1, 0x6e, 0x1e, 0x1a, 0x00, 0x00, 0x00, 0x10},
1237 {0xa1, 0x6e, 0x1f, 0x99, 0x00, 0x00, 0x00, 0x10},
1238 {
DELAY, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1239 {0xa1, 0x6e, 0x1e, 0x0a, 0x00, 0x00, 0x00, 0x10},
1240 {0xa1, 0x6e, 0x1f, 0x19, 0x00, 0x00, 0x00, 0x10},
1241 {
DELAY, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1242 {0xa1, 0x6e, 0x20, 0x44, 0x00, 0x00, 0x00, 0x10},
1243 {0xa1, 0x6e, 0x04, 0x03, 0x00, 0x00, 0x00, 0x10},
1244 {0xa1, 0x6e, 0x05, 0x70, 0x00, 0x00, 0x00, 0x10},
1245 {0xa1, 0x6e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x10},
1246 {0xa1, 0x6e, 0x07, 0x25, 0x00, 0x00, 0x00, 0x10},
1247 {0xd1, 0x6e, 0x08, 0x00, 0xd0, 0x00, 0x08, 0x10},
1248 {0xd1, 0x6e, 0x0c, 0x03, 0x50, 0x01, 0xe8, 0x10},
1249 {0xd1, 0x6e, 0x1d, 0x20, 0x0a, 0x19, 0x44, 0x10},
1250 {0xd1, 0x6e, 0x21, 0x00, 0x00, 0x00, 0x00, 0x10},
1251 {0xd1, 0x6e, 0x25, 0x00, 0x00, 0x00, 0x00, 0x10},
1252 {0xd1, 0x6e, 0x29, 0x00, 0x00, 0x00, 0x00, 0x10},
1253 {0xd1, 0x6e, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x10},
1254 {0xd1, 0x6e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x10},
1255 {0xd1, 0x6e, 0x35, 0x00, 0x00, 0x00, 0x00, 0x10},
1256 {0xd1, 0x6e, 0x39, 0x00, 0x00, 0x00, 0x00, 0x10},
1257 {0xd1, 0x6e, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x10},
1258 {0xd1, 0x6e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x10},
1259 {0xd1, 0x6e, 0x45, 0x00, 0x00, 0x00, 0x00, 0x10},
1260 {0xd1, 0x6e, 0x49, 0x00, 0x00, 0x00, 0x00, 0x10},
1261 {0xd1, 0x6e, 0x4d, 0x00, 0x00, 0x00, 0xed, 0x10},
1262 {0xd1, 0x6e, 0x51, 0x17, 0x4a, 0x2f, 0xc0, 0x10},
1263 {0xd1, 0x6e, 0x55, 0x00, 0x00, 0x00, 0x00, 0x10},
1264 {0xd1, 0x6e, 0x59, 0x00, 0x00, 0x00, 0x00, 0x10},
1265 {0xd1, 0x6e, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x10},
1266 {0xd1, 0x6e, 0x61, 0x00, 0x00, 0x00, 0x00, 0x10},
1267 {0xd1, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x10},
1268 {0xd1, 0x6e, 0x69, 0x00, 0x00, 0x00, 0x00, 0x10},
1269 {0xd1, 0x6e, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x10},
1270 {0xd1, 0x6e, 0x71, 0x00, 0x00, 0x00, 0x00, 0x10},
1271 {0xd1, 0x6e, 0x75, 0x00, 0x00, 0x00, 0x00, 0x10},
1272 {0xd1, 0x6e, 0x79, 0x00, 0x00, 0x00, 0x00, 0x10},
1273 {0xd1, 0x6e, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x10},
1274 {0xd1, 0x6e, 0x81, 0x00, 0x00, 0x00, 0x00, 0x10},
1275 {0xd1, 0x6e, 0x85, 0x00, 0x00, 0x00, 0x08, 0x10},
1276 {0xd1, 0x6e, 0x89, 0x01, 0xe8, 0x00, 0x01, 0x10},
1277 {0xa1, 0x6e, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x10},
1278 {0xd1, 0x6e, 0x21, 0x00, 0x00, 0x00, 0x00, 0x10},
1279 {0xd1, 0x6e, 0x25, 0x00, 0x00, 0x00, 0x01, 0x10},
1280 {0xd1, 0x6e, 0x29, 0xe6, 0x00, 0xbd, 0x03, 0x10},
1281 {0xd1, 0x6e, 0x2d, 0x41, 0x38, 0x68, 0x40, 0x10},
1282 {0xd1, 0x6e, 0x31, 0x2b, 0x00, 0x36, 0x00, 0x10},
1283 {0xd1, 0x6e, 0x35, 0x30, 0x30, 0x08, 0x00, 0x10},
1284 {0xd1, 0x6e, 0x39, 0x00, 0x00, 0x33, 0x06, 0x10},
1285 {0xb1, 0x6e, 0x3d, 0x06, 0x02, 0x00, 0x00, 0x10},
1288 static const u8 po2030n_sensor_param1[][8] = {
1289 {0xa1, 0x6e, 0x1a, 0x01, 0x00, 0x00, 0x00, 0x10},
1290 {
DELAY, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1291 {0xa1, 0x6e, 0x1b, 0xf4, 0x00, 0x00, 0x00, 0x10},
1292 {0xa1, 0x6e, 0x15, 0x04, 0x00, 0x00, 0x00, 0x10},
1293 {0xd1, 0x6e, 0x16, 0x40, 0x40, 0x40, 0x40, 0x10},
1295 {0xa1, 0x6e, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x10},
1296 {0xa1, 0x6e, 0x04, 0x03, 0x00, 0x00, 0x00, 0x10},
1297 {0xa1, 0x6e, 0x05, 0x6f, 0x00, 0x00, 0x00, 0x10},
1298 {0xa1, 0x6e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x10},
1299 {0xa1, 0x6e, 0x07, 0x25, 0x00, 0x00, 0x00, 0x10},
1303 static const u8 soi768_sensor_init[][8] = {
1304 {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10},
1305 {
DELAY, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1306 {0xa1, 0x21, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
1307 {0xa1, 0x21, 0x13, 0x80, 0x00, 0x00, 0x00, 0x10},
1308 {0xa1, 0x21, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x10},
1309 {0xa1, 0x21, 0x19, 0x00, 0x00, 0x00, 0x00, 0x10},
1312 static const u8 soi768_sensor_param1[][8] = {
1313 {0xa1, 0x21, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10},
1314 {0xa1, 0x21, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x10},
1315 {0xa1, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x10},
1316 {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
1317 {0xb1, 0x21, 0x01, 0x7f, 0x7f, 0x00, 0x00, 0x10},
1321 {0xa1, 0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10},
1323 {0xa1, 0x21, 0x02, 0x8d, 0x00, 0x00, 0x00, 0x10},
1325 {0xa1, 0x21, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10},
1327 {0xa1, 0x21, 0x10, 0x3f, 0x00, 0x00, 0x00, 0x10},
1328 {0xa1, 0x21, 0x04, 0x06, 0x00, 0x00, 0x00, 0x10},
1329 {0xb1, 0x21, 0x2d, 0x63, 0x03, 0x00, 0x00, 0x10},
1334 static const u8 sp80708_sensor_init[][8] = {
1335 {0xa1, 0x18, 0x06, 0xf9, 0x00, 0x00, 0x00, 0x10},
1336 {0xa1, 0x18, 0x09, 0x1f, 0x00, 0x00, 0x00, 0x10},
1337 {0xa1, 0x18, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10},
1338 {0xa1, 0x18, 0x0d, 0xc0, 0x00, 0x00, 0x00, 0x10},
1339 {0xa1, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x10},
1340 {0xa1, 0x18, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x10},
1341 {0xa1, 0x18, 0x10, 0x40, 0x00, 0x00, 0x00, 0x10},
1342 {0xa1, 0x18, 0x11, 0x4e, 0x00, 0x00, 0x00, 0x10},
1343 {0xa1, 0x18, 0x12, 0x53, 0x00, 0x00, 0x00, 0x10},
1344 {0xa1, 0x18, 0x15, 0x80, 0x00, 0x00, 0x00, 0x10},
1345 {0xa1, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x10},
1346 {0xa1, 0x18, 0x19, 0x18, 0x00, 0x00, 0x00, 0x10},
1347 {0xa1, 0x18, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x10},
1348 {0xa1, 0x18, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x10},
1349 {0xa1, 0x18, 0x1c, 0x28, 0x00, 0x00, 0x00, 0x10},
1350 {0xa1, 0x18, 0x1d, 0x02, 0x00, 0x00, 0x00, 0x10},
1351 {0xa1, 0x18, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x10},
1352 {0xa1, 0x18, 0x26, 0x04, 0x00, 0x00, 0x00, 0x10},
1353 {0xa1, 0x18, 0x27, 0x1e, 0x00, 0x00, 0x00, 0x10},
1354 {0xa1, 0x18, 0x28, 0x5a, 0x00, 0x00, 0x00, 0x10},
1355 {0xa1, 0x18, 0x29, 0x28, 0x00, 0x00, 0x00, 0x10},
1356 {0xa1, 0x18, 0x2a, 0x78, 0x00, 0x00, 0x00, 0x10},
1357 {0xa1, 0x18, 0x2b, 0x01, 0x00, 0x00, 0x00, 0x10},
1358 {0xa1, 0x18, 0x2c, 0xf7, 0x00, 0x00, 0x00, 0x10},
1359 {0xa1, 0x18, 0x2d, 0x2d, 0x00, 0x00, 0x00, 0x10},
1360 {0xa1, 0x18, 0x2e, 0xd5, 0x00, 0x00, 0x00, 0x10},
1361 {0xa1, 0x18, 0x39, 0x42, 0x00, 0x00, 0x00, 0x10},
1362 {0xa1, 0x18, 0x3a, 0x67, 0x00, 0x00, 0x00, 0x10},
1363 {0xa1, 0x18, 0x3b, 0x87, 0x00, 0x00, 0x00, 0x10},
1364 {0xa1, 0x18, 0x3c, 0xa3, 0x00, 0x00, 0x00, 0x10},
1365 {0xa1, 0x18, 0x3d, 0xb0, 0x00, 0x00, 0x00, 0x10},
1366 {0xa1, 0x18, 0x3e, 0xbc, 0x00, 0x00, 0x00, 0x10},
1367 {0xa1, 0x18, 0x3f, 0xc8, 0x00, 0x00, 0x00, 0x10},
1368 {0xa1, 0x18, 0x40, 0xd4, 0x00, 0x00, 0x00, 0x10},
1369 {0xa1, 0x18, 0x41, 0xdf, 0x00, 0x00, 0x00, 0x10},
1370 {0xa1, 0x18, 0x42, 0xea, 0x00, 0x00, 0x00, 0x10},
1371 {0xa1, 0x18, 0x43, 0xf5, 0x00, 0x00, 0x00, 0x10},
1372 {0xa1, 0x18, 0x45, 0x80, 0x00, 0x00, 0x00, 0x10},
1373 {0xa1, 0x18, 0x46, 0x60, 0x00, 0x00, 0x00, 0x10},
1374 {0xa1, 0x18, 0x47, 0x50, 0x00, 0x00, 0x00, 0x10},
1375 {0xa1, 0x18, 0x48, 0x30, 0x00, 0x00, 0x00, 0x10},
1376 {0xa1, 0x18, 0x49, 0x01, 0x00, 0x00, 0x00, 0x10},
1377 {0xa1, 0x18, 0x4d, 0xae, 0x00, 0x00, 0x00, 0x10},
1378 {0xa1, 0x18, 0x4e, 0x03, 0x00, 0x00, 0x00, 0x10},
1379 {0xa1, 0x18, 0x4f, 0x66, 0x00, 0x00, 0x00, 0x10},
1380 {0xa1, 0x18, 0x50, 0x1c, 0x00, 0x00, 0x00, 0x10},
1381 {0xa1, 0x18, 0x44, 0x10, 0x00, 0x00, 0x00, 0x10},
1382 {0xa1, 0x18, 0x4a, 0x30, 0x00, 0x00, 0x00, 0x10},
1383 {0xa1, 0x18, 0x51, 0x80, 0x00, 0x00, 0x00, 0x10},
1384 {0xa1, 0x18, 0x52, 0x80, 0x00, 0x00, 0x00, 0x10},
1385 {0xa1, 0x18, 0x53, 0x80, 0x00, 0x00, 0x00, 0x10},
1386 {0xa1, 0x18, 0x54, 0x80, 0x00, 0x00, 0x00, 0x10},
1387 {0xa1, 0x18, 0x55, 0x80, 0x00, 0x00, 0x00, 0x10},
1388 {0xa1, 0x18, 0x56, 0x80, 0x00, 0x00, 0x00, 0x10},
1389 {0xa1, 0x18, 0x57, 0xe0, 0x00, 0x00, 0x00, 0x10},
1390 {0xa1, 0x18, 0x58, 0xc0, 0x00, 0x00, 0x00, 0x10},
1391 {0xa1, 0x18, 0x59, 0xab, 0x00, 0x00, 0x00, 0x10},
1392 {0xa1, 0x18, 0x5a, 0xa0, 0x00, 0x00, 0x00, 0x10},
1393 {0xa1, 0x18, 0x5b, 0x99, 0x00, 0x00, 0x00, 0x10},
1394 {0xa1, 0x18, 0x5c, 0x90, 0x00, 0x00, 0x00, 0x10},
1395 {0xa1, 0x18, 0x5e, 0x24, 0x00, 0x00, 0x00, 0x10},
1396 {0xa1, 0x18, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x10},
1397 {0xa1, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x10},
1398 {0xa1, 0x18, 0x61, 0x73, 0x00, 0x00, 0x00, 0x10},
1399 {0xa1, 0x18, 0x63, 0x42, 0x00, 0x00, 0x00, 0x10},
1400 {0xa1, 0x18, 0x64, 0x42, 0x00, 0x00, 0x00, 0x10},
1401 {0xa1, 0x18, 0x65, 0x42, 0x00, 0x00, 0x00, 0x10},
1402 {0xa1, 0x18, 0x66, 0x24, 0x00, 0x00, 0x00, 0x10},
1403 {0xa1, 0x18, 0x67, 0x24, 0x00, 0x00, 0x00, 0x10},
1404 {0xa1, 0x18, 0x68, 0x08, 0x00, 0x00, 0x00, 0x10},
1405 {0xa1, 0x18, 0x2f, 0xc9, 0x00, 0x00, 0x00, 0x10},
1408 static const u8 sp80708_sensor_param1[][8] = {
1409 {0xa1, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x10},
1410 {0xa1, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x10},
1411 {0xa1, 0x18, 0x03, 0x01, 0x00, 0x00, 0x00, 0x10},
1412 {0xa1, 0x18, 0x04, 0xa4, 0x00, 0x00, 0x00, 0x10},
1413 {0xa1, 0x18, 0x14, 0x3f, 0x00, 0x00, 0x00, 0x10},
1414 {0xa1, 0x18, 0x5d, 0x80, 0x00, 0x00, 0x00, 0x10},
1415 {0xb1, 0x18, 0x11, 0x40, 0x40, 0x00, 0x00, 0x10},
1419 static const u8 (*sensor_init[])[8] = {
1447 pr_err(
"reg_r: buffer overflow\n");
1452 usb_rcvctrlpipe(gspca_dev->
dev, 0),
1458 PDEBUG(D_USBI,
"reg_r [%02x] -> %02x", value, gspca_dev->
usb_buf[0]);
1460 pr_err(
"reg_r err %d\n", ret);
1465 static void reg_w1(
struct gspca_dev *gspca_dev,
1473 PDEBUG(D_USBO,
"reg_w1 [%04x] = %02x", value, data);
1476 usb_sndctrlpipe(gspca_dev->
dev, 0),
1484 pr_err(
"reg_w1 err %d\n", ret);
1488 static void reg_w(
struct gspca_dev *gspca_dev,
1497 PDEBUG(D_USBO,
"reg_w [%04x] = %02x %02x ..",
1498 value, buffer[0], buffer[1]);
1501 pr_err(
"reg_w: buffer overflow\n");
1507 usb_sndctrlpipe(gspca_dev->
dev, 0),
1514 pr_err(
"reg_w err %d\n", ret);
1520 static void i2c_w1(
struct gspca_dev *gspca_dev,
u8 reg,
u8 val)
1522 struct sd *
sd = (
struct sd *) gspca_dev;
1527 PDEBUG(D_USBO,
"i2c_w1 [%02x] = %02x", reg, val);
1532 gspca_dev->
usb_buf[0] = 0x80 | (2 << 4);
1535 gspca_dev->
usb_buf[0] = 0x81 | (2 << 4);
1546 usb_sndctrlpipe(gspca_dev->
dev, 0),
1554 pr_err(
"i2c_w1 err %d\n", ret);
1560 static void i2c_w8(
struct gspca_dev *gspca_dev,
1567 PDEBUG(D_USBO,
"i2c_w8 [%02x] = %02x ..",
1568 buffer[2], buffer[3]);
1571 usb_sndctrlpipe(gspca_dev->
dev, 0),
1579 pr_err(
"i2c_w8 err %d\n", ret);
1585 static void i2c_r(
struct gspca_dev *gspca_dev,
u8 reg,
int len)
1587 struct sd *sd = (
struct sd *) gspca_dev;
1594 mode[0] = 0x80 | 0x10;
1597 mode[0] = 0x81 | 0x10;
1607 i2c_w8(gspca_dev, mode);
1609 mode[0] = (mode[0] & 0x81) | (len << 4) | 0x02;
1611 i2c_w8(gspca_dev, mode);
1613 reg_r(gspca_dev, 0x0a, 5);
1616 static void i2c_w_seq(
struct gspca_dev *gspca_dev,
1617 const u8 (*data)[8])
1619 while ((*data)[0] != 0) {
1620 if ((*data)[0] !=
DELAY)
1621 i2c_w8(gspca_dev, *data);
1630 static void hv7131r_probe(
struct gspca_dev *gspca_dev)
1632 i2c_w1(gspca_dev, 0x02, 0);
1634 reg_w1(gspca_dev, 0x02, 0x66);
1636 i2c_r(gspca_dev, 0, 5);
1637 if (gspca_dev->
usb_buf[0] == 0x02
1638 && gspca_dev->
usb_buf[1] == 0x09
1639 && gspca_dev->
usb_buf[2] == 0x01) {
1640 PDEBUG(D_PROBE,
"Sensor HV7131R found");
1643 pr_warn(
"Erroneous HV7131R ID 0x%02x 0x%02x 0x%02x\n",
1648 static void mi0360_probe(
struct gspca_dev *gspca_dev)
1650 struct sd *sd = (
struct sd *) gspca_dev;
1653 static const u8 probe_tb[][4][8] = {
1655 {0xb0, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10},
1656 {0x90, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
1657 {0xa2, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
1658 {0xb0, 0x5d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10}
1661 {0xb0, 0x5c, 0x01, 0x00, 0x04, 0x00, 0x00, 0x10},
1662 {0x90, 0x5c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x10},
1663 {0xa2, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
1669 reg_w1(gspca_dev, 0x17, 0x62);
1670 reg_w1(gspca_dev, 0x01, 0x08);
1671 for (j = 0; j < 3; j++)
1672 i2c_w8(gspca_dev, probe_tb[i][j]);
1674 reg_r(gspca_dev, 0x0a, 5);
1676 if (probe_tb[i][3][0] != 0)
1677 i2c_w8(gspca_dev, probe_tb[i][3]);
1678 reg_w1(gspca_dev, 0x01, 0x29);
1679 reg_w1(gspca_dev, 0x17, 0x42);
1687 PDEBUG(D_PROBE,
"Sensor mi0360b");
1691 PDEBUG(D_PROBE,
"Sensor mt9v111");
1695 PDEBUG(D_PROBE,
"Sensor mi0360");
1698 PDEBUG(D_PROBE,
"Unknown sensor %04x - forced to mi0360", val);
1703 static void ov7630_probe(
struct gspca_dev *gspca_dev)
1705 struct sd *sd = (
struct sd *) gspca_dev;
1709 reg_w1(gspca_dev, 0x17, 0x62);
1710 reg_w1(gspca_dev, 0x01, 0x08);
1712 i2c_r(gspca_dev, 0x0a, 2);
1714 reg_w1(gspca_dev, 0x01, 0x29);
1715 reg_w1(gspca_dev, 0x17, 0x42);
1718 if (val == 0x7628) {
1721 gspca_dev->
cam.input_flags =
1723 PDEBUG(D_PROBE,
"Sensor soi768");
1726 PDEBUG(D_PROBE,
"Sensor ov%04x", val);
1729 static void ov7648_probe(
struct gspca_dev *gspca_dev)
1731 struct sd *sd = (
struct sd *) gspca_dev;
1735 reg_w1(gspca_dev, 0x17, 0x62);
1736 reg_w1(gspca_dev, 0x01, 0x08);
1738 i2c_r(gspca_dev, 0x0a, 2);
1740 reg_w1(gspca_dev, 0x01, 0x29);
1741 reg_w1(gspca_dev, 0x17, 0x42);
1742 if ((val & 0xff00) == 0x7600) {
1743 PDEBUG(D_PROBE,
"Sensor ov%04x", val);
1748 reg_w1(gspca_dev, 0x17, 0x62);
1749 reg_w1(gspca_dev, 0x01, 0x08);
1751 i2c_r(gspca_dev, 0x00, 2);
1753 reg_w1(gspca_dev, 0x01, 0x29);
1754 reg_w1(gspca_dev, 0x17, 0x42);
1757 if (val == 0x1030) {
1758 PDEBUG(D_PROBE,
"Sensor po1030");
1762 pr_err(
"Unknown sensor %04x\n", val);
1766 static void po2030n_probe(
struct gspca_dev *gspca_dev)
1768 struct sd *sd = (
struct sd *) gspca_dev;
1772 reg_w1(gspca_dev, 0x17, 0x62);
1773 reg_w1(gspca_dev, 0x01, 0x08);
1774 reg_w1(gspca_dev, 0x02, 0x22);
1776 i2c_r(gspca_dev, 0x00, 1);
1778 reg_w1(gspca_dev, 0x01, 0x29);
1779 reg_w1(gspca_dev, 0x17, 0x42);
1781 PDEBUG(D_PROBE,
"Sensor gc0307");
1787 reg_w1(gspca_dev, 0x17, 0x62);
1788 reg_w1(gspca_dev, 0x01, 0x0a);
1790 i2c_r(gspca_dev, 0x00, 2);
1792 reg_w1(gspca_dev, 0x01, 0x29);
1793 reg_w1(gspca_dev, 0x17, 0x42);
1796 if (val == 0x2030) {
1797 PDEBUG(D_PROBE,
"Sensor po2030n");
1800 pr_err(
"Unknown sensor ID %04x\n", val);
1805 static int sd_config(
struct gspca_dev *gspca_dev,
1808 struct sd *sd = (
struct sd *) gspca_dev;
1811 sd->
bridge =
id->driver_info >> 16;
1812 sd->
sensor =
id->driver_info >> 8;
1813 sd->
flags =
id->driver_info;
1815 cam = &gspca_dev->
cam;
1835 static int sd_init(
struct gspca_dev *gspca_dev)
1837 struct sd *sd = (
struct sd *) gspca_dev;
1839 u8 regGpio[] = { 0x29, 0x70 };
1843 reg_w1(gspca_dev, 0xf1, 0x01);
1844 reg_r(gspca_dev, 0x00, 1);
1845 reg_w1(gspca_dev, 0xf1, 0x00);
1846 reg_r(gspca_dev, 0x00, 1);
1847 regF1 = gspca_dev->
usb_buf[0];
1850 PDEBUG(D_PROBE,
"Sonix chip id: %02x", regF1);
1851 if (gspca_dev->
audio)
1868 mi0360_probe(gspca_dev);
1871 ov7630_probe(gspca_dev);
1874 ov7648_probe(gspca_dev);
1877 po2030n_probe(gspca_dev);
1883 reg_w1(gspca_dev, 0x02, regGpio[1]);
1886 reg_w(gspca_dev, 0x01, regGpio, 2);
1895 reg_w1(gspca_dev, 0xf1, 0x00);
1898 sn9c1xx = sn_tb[sd->
sensor];
1908 static u32 expo_adjust(
struct gspca_dev *gspca_dev,
1911 struct sd *sd = (
struct sd *) gspca_dev;
1918 a = 19 + expo * 25 / 256;
1919 i2c_w1(gspca_dev, 0x68, a);
1922 i2c_w1(gspca_dev, 0x03, b >> 8);
1923 i2c_w1(gspca_dev, 0x04, b);
1928 { 0xc1, 0x11, 0x25, 0x00, 0x00, 0x00, 0x00, 0x16 };
1930 Expodoit[3] = expo >> 16;
1931 Expodoit[4] = expo >> 8;
1933 i2c_w8(gspca_dev, Expodoit);
1939 { 0xb1, 0x5d, 0x09, 0x00, 0x00, 0x00, 0x00, 0x16 };
1940 static const u8 doit[] =
1941 { 0xb1, 0x5d, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10 };
1942 static const u8 sensorgo[] =
1943 { 0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10 };
1947 else if (expo < 0x0001)
1949 expoMi[3] = expo >> 8;
1951 i2c_w8(gspca_dev, expoMi);
1952 i2c_w8(gspca_dev, doit);
1953 i2c_w8(gspca_dev, sensorgo);
1958 { 0xa1, 0x21, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x10 };
1960 { 0xa1, 0x21, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10 };
1961 static const u8 gainMo[] =
1962 { 0xa1, 0x21, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1d };
1966 else if (expo < 0x0001)
1968 expoMof[3] = (expo & 0x03fc) >> 2;
1969 i2c_w8(gspca_dev, expoMof);
1970 expoMo10[3] = ((expo & 0x1c00) >> 10)
1971 | ((expo & 0x0003) << 4);
1972 i2c_w8(gspca_dev, expoMo10);
1973 i2c_w8(gspca_dev, gainMo);
1974 PDEBUG(D_FRAM,
"set exposure %d",
1975 ((expoMo10[3] & 0x07) << 10)
1977 | ((expoMo10[3] & 0x30) >> 4));
1982 { 0xb1, 0x5c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x10 };
1986 else if (expo < 0x0060)
1988 expo_c1[3] = expo >> 8;
1990 i2c_w8(gspca_dev, expo_c1);
1995 { 0xa0, 0x34, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x10 };
2002 gainOm[3] = expo >> 2;
2003 i2c_w8(gspca_dev, gainOm);
2004 reg_w1(gspca_dev, 0x96, expo >> 5);
2005 PDEBUG(D_FRAM,
"set exposure %d", gainOm[3]);
2012 static void setbrightness(
struct gspca_dev *gspca_dev)
2014 struct sd *sd = (
struct sd *) gspca_dev;
2020 k2 = (brightness - 0x80) >> 2;
2027 expo = brightness << 12;
2028 if (expo > 0x002dc6c0)
2030 else if (expo < 0x02a0)
2032 sd->
exposure = expo_adjust(gspca_dev, expo);
2036 expo = brightness << 4;
2037 sd->
exposure = expo_adjust(gspca_dev, expo);
2040 expo = brightness << 2;
2041 sd->
exposure = expo_adjust(gspca_dev, expo);
2045 sd->
exposure = expo_adjust(gspca_dev, expo);
2048 expo = brightness << 2;
2049 sd->
exposure = expo_adjust(gspca_dev, expo);
2052 expo = brightness << 2;
2053 sd->
exposure = expo_adjust(gspca_dev, expo);
2057 reg_w1(gspca_dev, 0x96, k2);
2060 static void setcontrast(
struct gspca_dev *gspca_dev)
2062 struct sd *sd = (
struct sd *) gspca_dev;
2068 contrast[0] = (k2 + 1) / 2;
2072 contrast[4] = k2 / 5;
2074 reg_w(gspca_dev, 0x84, contrast,
sizeof contrast);
2077 static void setcolors(
struct gspca_dev *gspca_dev)
2079 struct sd *sd = (
struct sd *) gspca_dev;
2083 static const s16 uv_com[6] = {
2087 static const s16 uv_mi0360b[6] = {
2097 for (i = 0; i < 6; i++) {
2100 reg8a[i * 2 + 1] = (v >> 8) & 0x0f;
2102 reg_w(gspca_dev, 0x8a, reg8a,
sizeof reg8a);
2105 static void setredblue(
struct gspca_dev *gspca_dev)
2107 struct sd *sd = (
struct sd *) gspca_dev;
2111 {0xc1, 0x6e, 0x16, 0x00, 0x40, 0x00, 0x00, 0x10};
2116 i2c_w8(gspca_dev, rg1b);
2119 reg_w1(gspca_dev, 0x05, sd->
ctrls[
RED].val);
2121 reg_w1(gspca_dev, 0x06, sd->
ctrls[
BLUE].val);
2124 static void setgamma(
struct gspca_dev *gspca_dev)
2126 struct sd *sd = (
struct sd *) gspca_dev;
2129 const u8 *gamma_base;
2131 0x00, 0x14, 0x1c, 0x1c, 0x1c, 0x1c, 0x1b, 0x1a,
2132 0x18, 0x13, 0x10, 0x0e, 0x08, 0x07, 0x04, 0x02, 0x00
2137 gamma_base = gamma_spec_0;
2142 gamma_base = gamma_spec_1;
2145 gamma_base = gamma_spec_2;
2148 gamma_base = gamma_spec_3;
2151 gamma_base = gamma_def;
2156 for (i = 0; i <
sizeof gamma; i++)
2157 gamma[i] = gamma_base[i]
2158 + delta[i] * (val - GAMMA_DEF) / 32;
2159 reg_w(gspca_dev, 0x20, gamma,
sizeof gamma);
2162 static void setexposure(
struct gspca_dev *gspca_dev)
2164 struct sd *sd = (
struct sd *) gspca_dev;
2168 {0xa1, 0x6e, 0x1a, 0x00, 0x40, 0x00, 0x00, 0x10};
2171 i2c_w8(gspca_dev, rexpo);
2175 i2c_w8(gspca_dev, rexpo);
2179 static void setautogain(
struct gspca_dev *gspca_dev)
2181 struct sd *sd = (
struct sd *) gspca_dev;
2206 static void setgain(
struct gspca_dev *gspca_dev)
2208 struct sd *sd = (
struct sd *) gspca_dev;
2212 {0xa1, 0x6e, 0x15, 0x00, 0x40, 0x00, 0x00, 0x15};
2215 i2c_w8(gspca_dev, rgain);
2219 static void sethvflip(
struct gspca_dev *gspca_dev)
2221 struct sd *sd = (
struct sd *) gspca_dev;
2229 i2c_w1(gspca_dev, 0x01, comn);
2235 i2c_w1(gspca_dev, 0x75, comn);
2241 i2c_w1(gspca_dev, 0x75, comn);
2262 static void setsharpness(
struct gspca_dev *gspca_dev)
2264 struct sd *sd = (
struct sd *) gspca_dev;
2269 static void setillum(
struct gspca_dev *gspca_dev)
2271 struct sd *sd = (
struct sd *) gspca_dev;
2277 reg_w1(gspca_dev, 0x02,
2281 reg_w1(gspca_dev, 0x02,
2290 static void setfreq(
struct gspca_dev *gspca_dev)
2292 struct sd *sd = (
struct sd *) gspca_dev;
2302 i2c_w1(gspca_dev, 0x13, com8 | 0x20);
2305 i2c_w1(gspca_dev, 0x13, com8);
2306 i2c_w1(gspca_dev, 0x3b, 0x0a);
2309 i2c_w1(gspca_dev, 0x13, com8);
2310 i2c_w1(gspca_dev, 0x3b, 0x02);
2314 u8 reg2a = 0, reg2b = 0, reg2d = 0;
2341 i2c_w1(gspca_dev, 0x2a, reg2a);
2342 i2c_w1(gspca_dev, 0x2b, reg2b);
2343 i2c_w1(gspca_dev, 0x2d, reg2d);
2347 static void setjpegqual(
struct gspca_dev *gspca_dev)
2349 struct sd *sd = (
struct sd *) gspca_dev;
2353 #error "No room enough in usb_buf for quantization table"
2357 usb_sndctrlpipe(gspca_dev->
dev, 0),
2365 usb_sndctrlpipe(gspca_dev->
dev, 0),
2373 reg_w1(gspca_dev, 0x18, sd->
reg18);
2381 struct gspca_dev *gspca_dev = &sd->
gspca_dev;
2387 setjpegqual(gspca_dev);
2392 static int sd_start(
struct gspca_dev *gspca_dev)
2394 struct sd *sd = (
struct sd *) gspca_dev;
2402 static const u8 reg9a_def[] =
2403 {0x00, 0x40, 0x20, 0x00, 0x00, 0x00};
2404 static const u8 reg9a_spec[] =
2405 {0x00, 0x40, 0x38, 0x30, 0x00, 0x20};
2406 static const u8 regd4[] = {0x60, 0x00, 0x00};
2407 static const u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f };
2408 static const u8 CA[] = { 0x28, 0xd8, 0x14, 0xec };
2409 static const u8 CA_adcm1700[] =
2410 { 0x14, 0xec, 0x0a, 0xf6 };
2411 static const u8 CA_po2030n[] =
2412 { 0x1e, 0xe2, 0x14, 0xec };
2413 static const u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd };
2414 static const u8 CE_gc0307[] =
2415 { 0x32, 0xce, 0x2d, 0xd3 };
2416 static const u8 CE_ov76xx[] =
2417 { 0x32, 0xdd, 0x32, 0xdd };
2418 static const u8 CE_po2030n[] =
2419 { 0x14, 0xe7, 0x1e, 0xdd };
2426 sn9c1xx = sn_tb[sd->
sensor];
2433 reg_w1(gspca_dev, 0x01, reg01);
2437 reg0102[1] = sn9c1xx[2];
2438 if (gspca_dev->
audio)
2440 reg_w(gspca_dev, 0x01, reg0102, 2);
2441 reg_w(gspca_dev, 0x08, &sn9c1xx[8], 2);
2442 reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 5);
2456 reg_w(gspca_dev, 0x9a, reg9a, 6);
2458 reg_w(gspca_dev, 0xd4, regd4,
sizeof regd4);
2460 reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f);
2462 reg17 = sn9c1xx[0x17];
2469 reg_w1(gspca_dev, 0x02, 0x73);
2471 reg_w1(gspca_dev, 0x17, reg17);
2472 reg_w1(gspca_dev, 0x01, 0x22);
2480 reg_w1(gspca_dev, 0x01, reg01);
2482 reg_w1(gspca_dev, 0x17, reg17);
2484 reg_w1(gspca_dev, 0x01, reg01);
2486 reg_w1(gspca_dev, 0x01, reg01);
2490 hv7131r_probe(gspca_dev);
2494 reg_w1(gspca_dev, 0x01, reg01);
2495 i2c_w8(gspca_dev, om6802_init0[0]);
2496 i2c_w8(gspca_dev, om6802_init0[1]);
2498 reg_w1(gspca_dev, 0x02, 0x71);
2503 reg_w1(gspca_dev, 0x02, 0x62);
2508 i2c_w_seq(gspca_dev, sensor_init[sd->
sensor]);
2510 reg_w1(gspca_dev, 0x15, sn9c1xx[0x15]);
2511 reg_w1(gspca_dev, 0x16, sn9c1xx[0x16]);
2512 reg_w1(gspca_dev, 0x12, sn9c1xx[0x12]);
2513 reg_w1(gspca_dev, 0x13, sn9c1xx[0x13]);
2514 reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]);
2516 reg_w1(gspca_dev, 0xd2, 0x3a);
2517 reg_w1(gspca_dev, 0xd3, 0x30);
2519 reg_w1(gspca_dev, 0xd2, 0x6a);
2520 reg_w1(gspca_dev, 0xd3, 0x50);
2522 reg_w1(gspca_dev, 0xc6, 0x00);
2523 reg_w1(gspca_dev, 0xc7, 0x00);
2525 reg_w1(gspca_dev, 0xc8, 0x2c);
2526 reg_w1(gspca_dev, 0xc9, 0x24);
2528 reg_w1(gspca_dev, 0xc8, 0x50);
2529 reg_w1(gspca_dev, 0xc9, 0x3c);
2531 reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]);
2540 reg_w1(gspca_dev, 0x17, reg17);
2542 reg_w1(gspca_dev, 0x05, 0x00);
2543 reg_w1(gspca_dev, 0x07, 0x00);
2544 reg_w1(gspca_dev, 0x06, 0x00);
2545 reg_w1(gspca_dev, 0x14, sn9c1xx[0x14]);
2547 setgamma(gspca_dev);
2550 for (i = 0; i < 8; i++)
2551 reg_w(gspca_dev, 0x84, reg84,
sizeof reg84);
2556 reg_w1(gspca_dev, 0x9a, 0x05);
2561 reg_w1(gspca_dev, 0x9a, 0x07);
2565 reg_w1(gspca_dev, 0x9a, 0x0a);
2569 reg_w1(gspca_dev, 0x9a, 0x06);
2572 reg_w1(gspca_dev, 0x9a, 0x08);
2575 setsharpness(gspca_dev);
2577 reg_w(gspca_dev, 0x84, reg84,
sizeof reg84);
2578 reg_w1(gspca_dev, 0x05, 0x20);
2579 reg_w1(gspca_dev, 0x07, 0x20);
2580 reg_w1(gspca_dev, 0x06, 0x20);
2583 mode = gspca_dev->
cam.cam_mode[gspca_dev->
curr_mode].priv;
2589 init = adcm1700_sensor_param1;
2592 init = gc0307_sensor_param1;
2602 init = mi0360b_sensor_param1;
2612 init = mt9v111_sensor_param1;
2615 init = om6802_sensor_param1;
2626 init = ov7630_sensor_param1;
2629 init = ov7648_sensor_param1;
2634 init = ov7660_sensor_param1;
2637 init = po1030_sensor_param1;
2640 init = po2030n_sensor_param1;
2643 init = soi768_sensor_param1;
2646 init = sp80708_sensor_param1;
2652 i2c_w_seq(gspca_dev,
init);
2656 reg_w(gspca_dev, 0xc0, C0, 6);
2661 reg_w(gspca_dev, 0xca, CA_adcm1700, 4);
2664 reg_w(gspca_dev, 0xca, CA_po2030n, 4);
2667 reg_w(gspca_dev, 0xca, CA, 4);
2676 reg_w(gspca_dev, 0xce, CE_ov76xx, 4);
2679 reg_w(gspca_dev, 0xce, CE_gc0307, 4);
2682 reg_w(gspca_dev, 0xce, CE_po2030n, 4);
2685 reg_w(gspca_dev, 0xce, CE, 4);
2691 sd->
reg18 = sn9c1xx[0x18] | (mode << 4) | 0x40;
2692 reg_w1(gspca_dev, 0x18, sd->
reg18);
2693 setjpegqual(gspca_dev);
2695 reg_w1(gspca_dev, 0x17, reg17);
2696 reg_w1(gspca_dev, 0x01, reg01);
2700 sethvflip(gspca_dev);
2701 setbrightness(gspca_dev);
2702 setcontrast(gspca_dev);
2703 setcolors(gspca_dev);
2704 setautogain(gspca_dev);
2706 setexposure(gspca_dev);
2718 static void sd_stopN(
struct gspca_dev *gspca_dev)
2720 struct sd *sd = (
struct sd *) gspca_dev;
2721 static const u8 stophv7131[] =
2722 { 0xa1, 0x11, 0x02, 0x09, 0x00, 0x00, 0x00, 0x10 };
2723 static const u8 stopmi0360[] =
2724 { 0xb1, 0x5d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10 };
2725 static const u8 stopov7648[] =
2726 { 0xa1, 0x21, 0x76, 0x20, 0x00, 0x00, 0x00, 0x10 };
2727 static const u8 stopsoi768[] =
2728 { 0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10 };
2740 reg_w1(gspca_dev, 0x01, reg01);
2742 reg_w1(gspca_dev, 0x01, reg01);
2747 reg_w1(gspca_dev, 0x01, reg01);
2748 i2c_w8(gspca_dev, stophv7131);
2753 reg_w1(gspca_dev, 0x01, reg01);
2755 i2c_w8(gspca_dev, stopmi0360);
2761 reg_w1(gspca_dev, 0x01, reg01);
2766 reg_w1(gspca_dev, 0x01, reg01);
2767 i2c_w8(gspca_dev, stopov7648);
2771 reg_w1(gspca_dev, 0x01, reg01);
2774 i2c_w8(gspca_dev, stopsoi768);
2779 reg_w1(gspca_dev, 0x01, reg01);
2781 reg_w1(gspca_dev, 0x01, reg01);
2782 reg_w1(gspca_dev, 0x17, reg17);
2784 reg_w1(gspca_dev, 0x01, reg01);
2786 reg_w1(gspca_dev, 0x01, reg01);
2793 static void sd_stop0(
struct gspca_dev *gspca_dev)
2795 struct sd *sd = (
struct sd *) gspca_dev;
2805 #define WANT_REGULAR_AUTOGAIN
2808 static void do_autogain(
struct gspca_dev *gspca_dev)
2810 struct sd *sd = (
struct sd *) gspca_dev;
2824 PDEBUG(D_FRAM,
"mean lum %d", delta);
2827 auto_gain_n_exposure(gspca_dev, delta, luma_mean, luma_delta,
2832 if (delta < luma_mean - luma_delta ||
2833 delta > luma_mean + luma_delta) {
2837 expotimes += (luma_mean -
delta) >> 6;
2840 sd->
exposure = expo_adjust(gspca_dev,
2841 (
unsigned int) expotimes);
2845 expotimes += (luma_mean -
delta) >> 4;
2848 sd->
exposure = expo_adjust(gspca_dev,
2849 (
unsigned int) (expotimes << 8));
2854 expotimes += (luma_mean -
delta) >> 2;
2857 sd->
exposure = expo_adjust(gspca_dev,
2858 (
unsigned int) expotimes);
2859 setredblue(gspca_dev);
2866 expotimes += (luma_mean -
delta) >> 6;
2869 sd->
exposure = expo_adjust(gspca_dev,
2870 (
unsigned int) expotimes);
2871 setredblue(gspca_dev);
2878 static void set_lum(
struct sd *sd,
2887 avg_lum = (data[27] << 8) + data[28]
2889 + (data[31] << 8) + data[32]
2891 + (data[23] << 8) + data[24]
2893 + (data[35] << 8) + data[36]
2895 + (data[29] << 10) + (data[30] << 2);
2902 static void sd_pkt_scan(
struct gspca_dev *gspca_dev,
2906 struct sd *sd = (
struct sd *) gspca_dev;
2941 if (data[0] == 0xff && data[1] == 0xff) {
2952 for (i = len - 1; --i >= 0; ) {
2953 if (data[i] != 0xff) {
2957 if (data[i + 1] == 0xff) {
2960 if (i + 2 >= len || data[i + 2] == 0x00)
2967 if (data[len - 1] == 0xff)
2980 if (data[i - 2] != 0xff || data[i - 1] != 0xd9) {
2984 }
else if (i + 6 < len) {
2985 if (data[i + 6] & 0x08) {
2994 if (new_qual == 0) {
2997 r = (sd->
pktsz * 100) /
2999 gspca_dev->
urb[0]->iso_frame_desc[0].length);
3005 if (new_qual != 0) {
3006 sd->
nchg += new_qual;
3007 if (sd->
nchg < -6 || sd->
nchg >= 12) {
3014 if (new_qual != sd->
quality) {
3031 set_lum(sd, data + i);
3044 static int sd_setautogain(
struct gspca_dev *gspca_dev,
__s32 val)
3046 struct sd *sd = (
struct sd *) gspca_dev;
3054 setautogain(gspca_dev);
3058 static int sd_querymenu(
struct gspca_dev *gspca_dev,
3063 switch (menu->
index) {
3079 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
3080 static int sd_int_pkt_scan(
struct gspca_dev *gspca_dev,
3086 if (len == 1 && data[0] == 1) {
3087 input_report_key(gspca_dev->input_dev,
KEY_CAMERA, 1);
3088 input_sync(gspca_dev->input_dev);
3089 input_report_key(gspca_dev->input_dev,
KEY_CAMERA, 0);
3090 input_sync(gspca_dev->input_dev);
3103 .config = sd_config,
3108 .pkt_scan = sd_pkt_scan,
3109 .dq_callback = do_autogain,
3110 .querymenu = sd_querymenu,
3111 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
3112 .int_pkt_scan = sd_int_pkt_scan,
3117 #define BS(bridge, sensor) \
3118 .driver_info = (BRIDGE_ ## bridge << 16) \
3119 | (SENSOR_ ## sensor << 8)
3120 #define BSF(bridge, sensor, flags) \
3121 .driver_info = (BRIDGE_ ## bridge << 16) \
3122 | (SENSOR_ ## sensor << 8) \
3125 {USB_DEVICE(0x0458, 0x7025),
BSF(SN9C120, MI0360B,
F_PDN_INV)},
3126 {USB_DEVICE(0x0458, 0x702e),
BS(SN9C120, OV7660)},
3127 {USB_DEVICE(0x045e, 0x00f5),
BSF(SN9C105, OV7660,
F_PDN_INV)},
3128 {USB_DEVICE(0x045e, 0x00f7),
BSF(SN9C105, OV7660,
F_PDN_INV)},
3129 {USB_DEVICE(0x0471, 0x0327),
BS(SN9C105, MI0360)},
3130 {USB_DEVICE(0x0471, 0x0328),
BS(SN9C105, MI0360)},
3131 {USB_DEVICE(0x0471, 0x0330),
BS(SN9C105, MI0360)},
3132 {USB_DEVICE(0x06f8, 0x3004),
BS(SN9C105, OV7660)},
3133 {USB_DEVICE(0x06f8, 0x3008),
BS(SN9C105, OV7660)},
3135 {USB_DEVICE(0x0c45, 0x6040),
BS(SN9C102P, HV7131R)},
3138 {USB_DEVICE(0x0c45, 0x607c),
BS(SN9C102P, HV7131R)},
3140 {USB_DEVICE(0x0c45, 0x60c0),
BSF(SN9C105, MI0360,
F_ILLUM)},
3145 {USB_DEVICE(0x0c45, 0x60ce),
BS(SN9C105, SP80708)},
3146 {USB_DEVICE(0x0c45, 0x60ec),
BS(SN9C105, MO4000)},
3150 {USB_DEVICE(0x0c45, 0x60fb),
BS(SN9C105, OV7660)},
3151 {USB_DEVICE(0x0c45, 0x60fc),
BS(SN9C105, HV7131R)},
3152 {USB_DEVICE(0x0c45, 0x60fe),
BS(SN9C105, OV7630)},
3153 {USB_DEVICE(0x0c45, 0x6100),
BS(SN9C120, MI0360)},
3154 {USB_DEVICE(0x0c45, 0x6102),
BS(SN9C120, PO2030N)},
3156 {USB_DEVICE(0x0c45, 0x610a),
BS(SN9C120, OV7648)},
3157 {USB_DEVICE(0x0c45, 0x610b),
BS(SN9C120, OV7660)},
3158 {USB_DEVICE(0x0c45, 0x610c),
BS(SN9C120, HV7131R)},
3159 {USB_DEVICE(0x0c45, 0x610e),
BS(SN9C120, OV7630)},
3163 {USB_DEVICE(0x0c45, 0x6128),
BS(SN9C120, OM6802)},
3165 {USB_DEVICE(0x0c45, 0x612a),
BS(SN9C120, OV7648)},
3166 {USB_DEVICE(0x0c45, 0x612b),
BS(SN9C110, ADCM1700)},
3167 {USB_DEVICE(0x0c45, 0x612c),
BS(SN9C110, MO4000)},
3168 {USB_DEVICE(0x0c45, 0x612e),
BS(SN9C110, OV7630)},
3170 {USB_DEVICE(0x0c45, 0x6130),
BS(SN9C120, MI0360)},
3173 {USB_DEVICE(0x0c45, 0x6138),
BS(SN9C120, MO4000)},
3174 {USB_DEVICE(0x0c45, 0x613a),
BS(SN9C120, OV7648)},
3175 {USB_DEVICE(0x0c45, 0x613b),
BS(SN9C120, OV7660)},
3176 {USB_DEVICE(0x0c45, 0x613c),
BS(SN9C120, HV7131R)},
3177 {USB_DEVICE(0x0c45, 0x613e),
BS(SN9C120, OV7630)},
3178 {USB_DEVICE(0x0c45, 0x6142),
BS(SN9C120, PO2030N)},
3180 {USB_DEVICE(0x0c45, 0x6143),
BS(SN9C120, SP80708)},
3181 {USB_DEVICE(0x0c45, 0x6148),
BS(SN9C120, OM6802)},
3182 {USB_DEVICE(0x0c45, 0x614a),
BSF(SN9C120, ADCM1700,
F_ILLUM)},
3196 static struct usb_driver sd_driver = {
3198 .id_table = device_table,
3202 .suspend = gspca_suspend,
3203 .resume = gspca_resume,
3204 .reset_resume = gspca_resume,