2 * SPCA501 chip based cameras initialization data
4 * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24 #define MODULE_NAME "spca501"
28 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
29 MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver");
30 MODULE_LICENSE("GPL");
32 /* specific webcam descriptor */
34 struct gspca_dev gspca_dev
; /* !! must be the first item */
36 unsigned short contrast
;
43 #define Arowana300KCMOSCamera 0
44 #define IntelCreateAndShare 1
46 #define MystFromOriUnknownCamera 3
47 #define SmileIntlCamera 4
48 #define ThreeComHomeConnectLite 5
49 #define ViewQuestM318B 6
52 static const struct v4l2_pix_format vga_mode
[] = {
53 {160, 120, V4L2_PIX_FMT_SPCA501
, V4L2_FIELD_NONE
,
55 .sizeimage
= 160 * 120 * 3 / 2,
56 .colorspace
= V4L2_COLORSPACE_SRGB
,
58 {320, 240, V4L2_PIX_FMT_SPCA501
, V4L2_FIELD_NONE
,
60 .sizeimage
= 320 * 240 * 3 / 2,
61 .colorspace
= V4L2_COLORSPACE_SRGB
,
63 {640, 480, V4L2_PIX_FMT_SPCA501
, V4L2_FIELD_NONE
,
65 .sizeimage
= 640 * 480 * 3 / 2,
66 .colorspace
= V4L2_COLORSPACE_SRGB
,
70 #define SPCA50X_REG_USB 0x2 /* spca505 501 */
72 * Data to initialize a SPCA501. From a capture file provided by Bill Roehl
73 * With SPCA501 chip description
75 #define CCDSP_SET /* set CCDSP parameters */
76 #define TG_SET /* set time generator set */
77 #undef DSPWIN_SET /* set DSP windows parameters */
78 #undef ALTER_GAMA /* Set alternate set to YUV transform coeffs. */
79 #define SPCA501_SNAPBIT 0x80
80 #define SPCA501_SNAPCTRL 0x10
81 /* Frame packet header offsets for the spca501 */
82 #define SPCA501_OFFSET_GPIO 1
83 #define SPCA501_OFFSET_TYPE 2
84 #define SPCA501_OFFSET_TURN3A 3
85 #define SPCA501_OFFSET_FRAMSEQ 4
86 #define SPCA501_OFFSET_COMPRESS 5
87 #define SPCA501_OFFSET_QUANT 6
88 #define SPCA501_OFFSET_QUANT2 7
89 #define SPCA501_OFFSET_DATA 8
91 #define SPCA501_PROP_COMP_ENABLE(d) ((d) & 1)
92 #define SPCA501_PROP_SNAP(d) ((d) & 0x40)
93 #define SPCA501_PROP_SNAP_CTRL(d) ((d) & 0x10)
94 #define SPCA501_PROP_COMP_THRESH(d) (((d) & 0x0e) >> 1)
95 #define SPCA501_PROP_COMP_QUANT(d) (((d) & 0x70) >> 4)
97 /* SPCA501 CCDSP control */
98 #define SPCA501_REG_CCDSP 0x01
99 /* SPCA501 control/status registers */
100 #define SPCA501_REG_CTLRL 0x02
102 /* registers for color correction and YUV transformation */
103 #define SPCA501_A11 0x08
104 #define SPCA501_A12 0x09
105 #define SPCA501_A13 0x0A
106 #define SPCA501_A21 0x0B
107 #define SPCA501_A22 0x0C
108 #define SPCA501_A23 0x0D
109 #define SPCA501_A31 0x0E
110 #define SPCA501_A32 0x0F
111 #define SPCA501_A33 0x10
113 /* Data for video camera initialization before capturing */
114 static const __u16 spca501_open_data
[][3] = {
115 /* bmRequest,value,index */
117 {0x2, 0x50, 0x00}, /* C/S enable soft reset */
118 {0x2, 0x40, 0x00}, /* C/S disable soft reset */
119 {0x2, 0x02, 0x05}, /* C/S general purpose I/O data */
120 {0x2, 0x03, 0x05}, /* C/S general purpose I/O data */
123 {0x1, 0x38, 0x01}, /* CCDSP options */
124 {0x1, 0x05, 0x02}, /* CCDSP Optical black level for user settings */
125 {0x1, 0xC0, 0x03}, /* CCDSP Optical black settings */
128 {0x1, 0x63, 0x3f}, /* CCDSP CCD gamma enable */
129 {0x1, 0x03, 0x56}, /* Add gamma correction */
131 {0x1, 0xFF, 0x15}, /* CCDSP High luminance for white balance */
132 {0x1, 0x01, 0x16}, /* CCDSP Low luminance for white balance */
134 /* Color correction and RGB-to-YUV transformation coefficients changing */
136 {0x0, 0x00, 0x08}, /* A11 */
137 {0x0, 0x00, 0x09}, /* A12 */
138 {0x0, 0x90, 0x0A}, /* A13 */
139 {0x0, 0x12, 0x0B}, /* A21 */
140 {0x0, 0x00, 0x0C}, /* A22 */
141 {0x0, 0x00, 0x0D}, /* A23 */
142 {0x0, 0x00, 0x0E}, /* A31 */
143 {0x0, 0x02, 0x0F}, /* A32 */
144 {0x0, 0x00, 0x10}, /* A33 */
146 {0x1, 0x2a, 0x08}, /* A11 0x31 */
147 {0x1, 0xf8, 0x09}, /* A12 f8 */
148 {0x1, 0xf8, 0x0A}, /* A13 f8 */
149 {0x1, 0xf8, 0x0B}, /* A21 f8 */
150 {0x1, 0x14, 0x0C}, /* A22 0x14 */
151 {0x1, 0xf8, 0x0D}, /* A23 f8 */
152 {0x1, 0xf8, 0x0E}, /* A31 f8 */
153 {0x1, 0xf8, 0x0F}, /* A32 f8 */
154 {0x1, 0x20, 0x10}, /* A33 0x20 */
156 {0x1, 0x00, 0x11}, /* R offset */
157 {0x1, 0x00, 0x12}, /* G offset */
158 {0x1, 0x00, 0x13}, /* B offset */
159 {0x1, 0x00, 0x14}, /* GB offset */
164 /* Time generator manipulations */
165 {0x0, 0xfc, 0x0}, /* Set up high bits of shutter speed */
166 {0x0, 0x01, 0x1}, /* Set up low bits of shutter speed */
168 {0x0, 0xe4, 0x04}, /* DCLK*2 clock phase adjustment */
169 {0x0, 0x08, 0x05}, /* ADCK phase adjustment, inv. ext. VB */
170 {0x0, 0x03, 0x06}, /* FR phase adjustment */
171 {0x0, 0x01, 0x07}, /* FCDS phase adjustment */
172 {0x0, 0x39, 0x08}, /* FS phase adjustment */
173 {0x0, 0x88, 0x0a}, /* FH1 phase and delay adjustment */
174 {0x0, 0x03, 0x0f}, /* pixel identification */
175 {0x0, 0x00, 0x11}, /* clock source selection (default) */
177 /*VERY strange manipulations with
178 * select DMCLP or OBPX to be ADCLP output (0x0C)
179 * OPB always toggle or not (0x0D) but they allow
180 * us to set up brightness
188 {0x1, 0xa0, 0x01}, /* Setting image processing parameters */
189 {0x1, 0x1c, 0x17}, /* Changing Windows positions X1 */
190 {0x1, 0xe2, 0x19}, /* X2 */
191 {0x1, 0x1c, 0x1b}, /* X3 */
192 {0x1, 0xe2, 0x1d}, /* X4 */
193 {0x1, 0x5f, 0x1f}, /* X5 */
194 {0x1, 0x32, 0x20}, /* Y5 */
195 {0x1, 0x01, 0x10}, /* Changing A33 */
198 {0x2, 0x204a, 0x07},/* Setting video compression & resolution 160x120 */
199 {0x2, 0x94, 0x06}, /* Setting video no compression */
204 The SPCAxxx docs from Sunplus document these values
205 in tables, one table per register number. In the data
206 below, dmRequest is the register number, index is the Addr,
207 and value is a combination of Bit values.
219 /* Data for chip initialization (set default values) */
220 static const __u16 spca501_init_data
[][3] = {
221 /* Set all the values to powerup defaults */
222 /* bmRequest,value,index */
497 /* Strange - looks like the 501 driver doesn't do anything
498 * at insert time except read the EEPROM
503 /* Data for video camera init before capture.
504 * Capture and decoding by Colin Peart.
505 * This is is for the 3com HomeConnect Lite which is spca501a based.
507 static const __u16 spca501_3com_open_data
[][3] = {
508 /* bmRequest,value,index */
509 {0x2, 0x0050, 0x0000}, /* C/S Enable TG soft reset, timing mode=010 */
510 {0x2, 0x0043, 0x0000}, /* C/S Disable TG soft reset, timing mode=010 */
511 {0x2, 0x0002, 0x0005}, /* C/S GPIO */
512 {0x2, 0x0003, 0x0005}, /* C/S GPIO */
515 {0x1, 0x0020, 0x0001}, /* CCDSP Options */
517 {0x1, 0x0020, 0x0002}, /* CCDSP Black Level */
518 {0x1, 0x006e, 0x0007}, /* CCDSP Gamma options */
519 {0x1, 0x0090, 0x0015}, /* CCDSP Luminance Low */
520 {0x1, 0x00ff, 0x0016}, /* CCDSP Luminance High */
521 {0x1, 0x0003, 0x003F}, /* CCDSP Gamma correction toggle */
524 {0x1, 0x0010, 0x0008}, /* CCDSP YUV A11 */
525 {0x1, 0x0000, 0x0009}, /* CCDSP YUV A12 */
526 {0x1, 0x0000, 0x000a}, /* CCDSP YUV A13 */
527 {0x1, 0x0000, 0x000b}, /* CCDSP YUV A21 */
528 {0x1, 0x0010, 0x000c}, /* CCDSP YUV A22 */
529 {0x1, 0x0000, 0x000d}, /* CCDSP YUV A23 */
530 {0x1, 0x0000, 0x000e}, /* CCDSP YUV A31 */
531 {0x1, 0x0000, 0x000f}, /* CCDSP YUV A32 */
532 {0x1, 0x0010, 0x0010}, /* CCDSP YUV A33 */
533 {0x1, 0x0000, 0x0011}, /* CCDSP R Offset */
534 {0x1, 0x0000, 0x0012}, /* CCDSP G Offset */
535 {0x1, 0x0001, 0x0013}, /* CCDSP B Offset */
536 {0x1, 0x0001, 0x0014}, /* CCDSP BG Offset */
537 {0x1, 0x003f, 0x00C1}, /* CCDSP Gamma Correction Enable */
542 {0x0, 0x00fc, 0x0000}, /* TG Shutter Speed High Bits */
543 {0x0, 0x0000, 0x0001}, /* TG Shutter Speed Low Bits */
544 {0x0, 0x00e4, 0x0004}, /* TG DCLK*2 Adjust */
545 {0x0, 0x0008, 0x0005}, /* TG ADCK Adjust */
546 {0x0, 0x0003, 0x0006}, /* TG FR Phase Adjust */
547 {0x0, 0x0001, 0x0007}, /* TG FCDS Phase Adjust */
548 {0x0, 0x0039, 0x0008}, /* TG FS Phase Adjust */
549 {0x0, 0x0088, 0x000a}, /* TG MH1 */
550 {0x0, 0x0003, 0x000f}, /* TG Pixel ID */
552 /* Like below, unexplained toglleing */
553 {0x0, 0x0080, 0x000c},
554 {0x0, 0x0000, 0x000d},
555 {0x0, 0x0080, 0x000c},
556 {0x0, 0x0004, 0x000d},
557 {0x0, 0x0000, 0x000c},
558 {0x0, 0x0000, 0x000d},
559 {0x0, 0x0040, 0x000c},
560 {0x0, 0x0017, 0x000d},
561 {0x0, 0x00c0, 0x000c},
562 {0x0, 0x0000, 0x000d},
563 {0x0, 0x0080, 0x000c},
564 {0x0, 0x0006, 0x000d},
565 {0x0, 0x0080, 0x000c},
566 {0x0, 0x0004, 0x000d},
567 {0x0, 0x0002, 0x0003},
571 {0x1, 0x001c, 0x0017}, /* CCDSP W1 Start X */
572 {0x1, 0x00e2, 0x0019}, /* CCDSP W2 Start X */
573 {0x1, 0x001c, 0x001b}, /* CCDSP W3 Start X */
574 {0x1, 0x00e2, 0x001d}, /* CCDSP W4 Start X */
575 {0x1, 0x00aa, 0x001f}, /* CCDSP W5 Start X */
576 {0x1, 0x0070, 0x0020}, /* CCDSP W5 Start Y */
578 {0x0, 0x0001, 0x0010}, /* TG Start Clock */
580 /* {0x2, 0x006a, 0x0001}, * C/S Enable ISOSYNCH Packet Engine */
581 {0x2, 0x0068, 0x0001}, /* C/S Diable ISOSYNCH Packet Engine */
582 {0x2, 0x0000, 0x0005},
583 {0x2, 0x0043, 0x0000}, /* C/S Set Timing Mode, Disable TG soft reset */
584 {0x2, 0x0043, 0x0000}, /* C/S Set Timing Mode, Disable TG soft reset */
585 {0x2, 0x0002, 0x0005}, /* C/S GPIO */
586 {0x2, 0x0003, 0x0005}, /* C/S GPIO */
588 {0x2, 0x006a, 0x0001}, /* C/S Enable ISOSYNCH Packet Engine */
593 * Data used to initialize a SPCA501C with HV7131B sensor.
594 * From a capture file taken with USBSnoop v 1.5
595 * I have a "SPCA501C pc camera chipset" manual by sunplus, but some
596 * of the value meanings are obscure or simply "reserved".
598 * 1) Understand what every value means
599 * 2) Understand why some values seem to appear more than once
600 * 3) Write a small comment for each line of the following arrays.
602 static const __u16 spca501c_arowana_open_data
[][3] = {
603 /* bmRequest,value,index */
604 {0x02, 0x0007, 0x0005},
605 {0x02, 0xa048, 0x0000},
606 {0x05, 0x0022, 0x0004},
607 {0x01, 0x0006, 0x0011},
608 {0x01, 0x00ff, 0x0012},
609 {0x01, 0x0014, 0x0013},
610 {0x01, 0x0000, 0x0014},
611 {0x01, 0x0042, 0x0051},
612 {0x01, 0x0040, 0x0052},
613 {0x01, 0x0051, 0x0053},
614 {0x01, 0x0040, 0x0054},
615 {0x01, 0x0000, 0x0055},
616 {0x00, 0x0025, 0x0000},
617 {0x00, 0x0026, 0x0000},
618 {0x00, 0x0001, 0x0000},
619 {0x00, 0x0027, 0x0000},
620 {0x00, 0x008a, 0x0000},
624 static const __u16 spca501c_arowana_init_data
[][3] = {
625 /* bmRequest,value,index */
626 {0x02, 0x0007, 0x0005},
627 {0x02, 0xa048, 0x0000},
628 {0x05, 0x0022, 0x0004},
629 {0x01, 0x0006, 0x0011},
630 {0x01, 0x00ff, 0x0012},
631 {0x01, 0x0014, 0x0013},
632 {0x01, 0x0000, 0x0014},
633 {0x01, 0x0042, 0x0051},
634 {0x01, 0x0040, 0x0052},
635 {0x01, 0x0051, 0x0053},
636 {0x01, 0x0040, 0x0054},
637 {0x01, 0x0000, 0x0055},
638 {0x00, 0x0025, 0x0000},
639 {0x00, 0x0026, 0x0000},
640 {0x00, 0x0001, 0x0000},
641 {0x00, 0x0027, 0x0000},
642 {0x00, 0x008a, 0x0000},
643 {0x02, 0x0000, 0x0005},
644 {0x02, 0x0007, 0x0005},
645 {0x02, 0x2000, 0x0000},
646 {0x05, 0x0022, 0x0004},
647 {0x05, 0x0015, 0x0001},
648 {0x05, 0x00ea, 0x0000},
649 {0x05, 0x0021, 0x0001},
650 {0x05, 0x00d2, 0x0000},
651 {0x05, 0x0023, 0x0001},
652 {0x05, 0x0003, 0x0000},
653 {0x05, 0x0030, 0x0001},
654 {0x05, 0x002b, 0x0000},
655 {0x05, 0x0031, 0x0001},
656 {0x05, 0x0023, 0x0000},
657 {0x05, 0x0032, 0x0001},
658 {0x05, 0x0023, 0x0000},
659 {0x05, 0x0033, 0x0001},
660 {0x05, 0x0023, 0x0000},
661 {0x05, 0x0034, 0x0001},
662 {0x05, 0x0002, 0x0000},
663 {0x05, 0x0050, 0x0001},
664 {0x05, 0x0000, 0x0000},
665 {0x05, 0x0051, 0x0001},
666 {0x05, 0x0000, 0x0000},
667 {0x05, 0x0052, 0x0001},
668 {0x05, 0x0000, 0x0000},
669 {0x05, 0x0054, 0x0001},
670 {0x05, 0x0001, 0x0000},
671 {0x00, 0x0000, 0x0001},
672 {0x00, 0x0000, 0x0002},
673 {0x00, 0x000c, 0x0003},
674 {0x00, 0x0000, 0x0004},
675 {0x00, 0x0090, 0x0005},
676 {0x00, 0x0000, 0x0006},
677 {0x00, 0x0040, 0x0007},
678 {0x00, 0x00c0, 0x0008},
679 {0x00, 0x004a, 0x0009},
680 {0x00, 0x0000, 0x000a},
681 {0x00, 0x0000, 0x000b},
682 {0x00, 0x0001, 0x000c},
683 {0x00, 0x0001, 0x000d},
684 {0x00, 0x0000, 0x000e},
685 {0x00, 0x0002, 0x000f},
686 {0x00, 0x0001, 0x0010},
687 {0x00, 0x0000, 0x0011},
688 {0x00, 0x0000, 0x0012},
689 {0x00, 0x0002, 0x0020},
690 {0x00, 0x0080, 0x0021},
691 {0x00, 0x0001, 0x0022},
692 {0x00, 0x00e0, 0x0023},
693 {0x00, 0x0000, 0x0024},
694 {0x00, 0x00d5, 0x0025},
695 {0x00, 0x0000, 0x0026},
696 {0x00, 0x000b, 0x0027},
697 {0x00, 0x0000, 0x0046},
698 {0x00, 0x0000, 0x0047},
699 {0x00, 0x0000, 0x0048},
700 {0x00, 0x0000, 0x0049},
701 {0x00, 0x0008, 0x004a},
702 {0xff, 0x0000, 0x00d0},
703 {0xff, 0x00d8, 0x00d1},
704 {0xff, 0x0000, 0x00d4},
705 {0xff, 0x0000, 0x00d5},
706 {0x01, 0x00a6, 0x0000},
707 {0x01, 0x0028, 0x0001},
708 {0x01, 0x0000, 0x0002},
709 {0x01, 0x000a, 0x0003},
710 {0x01, 0x0040, 0x0004},
711 {0x01, 0x0066, 0x0007},
712 {0x01, 0x0011, 0x0008},
713 {0x01, 0x0032, 0x0009},
714 {0x01, 0x00fd, 0x000a},
715 {0x01, 0x0038, 0x000b},
716 {0x01, 0x00d1, 0x000c},
717 {0x01, 0x00f7, 0x000d},
718 {0x01, 0x00ed, 0x000e},
719 {0x01, 0x00d8, 0x000f},
720 {0x01, 0x0038, 0x0010},
721 {0x01, 0x00ff, 0x0015},
722 {0x01, 0x0001, 0x0016},
723 {0x01, 0x0032, 0x0017},
724 {0x01, 0x0023, 0x0018},
725 {0x01, 0x00ce, 0x0019},
726 {0x01, 0x0023, 0x001a},
727 {0x01, 0x0032, 0x001b},
728 {0x01, 0x008d, 0x001c},
729 {0x01, 0x00ce, 0x001d},
730 {0x01, 0x008d, 0x001e},
731 {0x01, 0x0000, 0x001f},
732 {0x01, 0x0000, 0x0020},
733 {0x01, 0x00ff, 0x003e},
734 {0x01, 0x0003, 0x003f},
735 {0x01, 0x0000, 0x0040},
736 {0x01, 0x0035, 0x0041},
737 {0x01, 0x0053, 0x0042},
738 {0x01, 0x0069, 0x0043},
739 {0x01, 0x007c, 0x0044},
740 {0x01, 0x008c, 0x0045},
741 {0x01, 0x009a, 0x0046},
742 {0x01, 0x00a8, 0x0047},
743 {0x01, 0x00b4, 0x0048},
744 {0x01, 0x00bf, 0x0049},
745 {0x01, 0x00ca, 0x004a},
746 {0x01, 0x00d4, 0x004b},
747 {0x01, 0x00dd, 0x004c},
748 {0x01, 0x00e7, 0x004d},
749 {0x01, 0x00ef, 0x004e},
750 {0x01, 0x00f8, 0x004f},
751 {0x01, 0x00ff, 0x0050},
752 {0x01, 0x0001, 0x0056},
753 {0x01, 0x0060, 0x0057},
754 {0x01, 0x0040, 0x0058},
755 {0x01, 0x0011, 0x0059},
756 {0x01, 0x0001, 0x005a},
757 {0x02, 0x0007, 0x0005},
758 {0x02, 0xa048, 0x0000},
759 {0x02, 0x0007, 0x0005},
760 {0x02, 0x0015, 0x0006},
761 {0x02, 0x100a, 0x0007},
762 {0x02, 0xa048, 0x0000},
763 {0x02, 0xc002, 0x0001},
764 {0x02, 0x000f, 0x0005},
765 {0x02, 0xa048, 0x0000},
766 {0x05, 0x0022, 0x0004},
767 {0x05, 0x0025, 0x0001},
768 {0x05, 0x0000, 0x0000},
769 {0x05, 0x0026, 0x0001},
770 {0x05, 0x0001, 0x0000},
771 {0x05, 0x0027, 0x0001},
772 {0x05, 0x0000, 0x0000},
773 {0x05, 0x0001, 0x0001},
774 {0x05, 0x0000, 0x0000},
775 {0x05, 0x0021, 0x0001},
776 {0x05, 0x00d2, 0x0000},
777 {0x05, 0x0020, 0x0001},
778 {0x05, 0x0000, 0x0000},
779 {0x00, 0x0090, 0x0005},
780 {0x01, 0x00a6, 0x0000},
781 {0x02, 0x0007, 0x0005},
782 {0x02, 0x2000, 0x0000},
783 {0x05, 0x0022, 0x0004},
784 {0x05, 0x0015, 0x0001},
785 {0x05, 0x00ea, 0x0000},
786 {0x05, 0x0021, 0x0001},
787 {0x05, 0x00d2, 0x0000},
788 {0x05, 0x0023, 0x0001},
789 {0x05, 0x0003, 0x0000},
790 {0x05, 0x0030, 0x0001},
791 {0x05, 0x002b, 0x0000},
792 {0x05, 0x0031, 0x0001},
793 {0x05, 0x0023, 0x0000},
794 {0x05, 0x0032, 0x0001},
795 {0x05, 0x0023, 0x0000},
796 {0x05, 0x0033, 0x0001},
797 {0x05, 0x0023, 0x0000},
798 {0x05, 0x0034, 0x0001},
799 {0x05, 0x0002, 0x0000},
800 {0x05, 0x0050, 0x0001},
801 {0x05, 0x0000, 0x0000},
802 {0x05, 0x0051, 0x0001},
803 {0x05, 0x0000, 0x0000},
804 {0x05, 0x0052, 0x0001},
805 {0x05, 0x0000, 0x0000},
806 {0x05, 0x0054, 0x0001},
807 {0x05, 0x0001, 0x0000},
808 {0x00, 0x0000, 0x0001},
809 {0x00, 0x0000, 0x0002},
810 {0x00, 0x000c, 0x0003},
811 {0x00, 0x0000, 0x0004},
812 {0x00, 0x0090, 0x0005},
813 {0x00, 0x0000, 0x0006},
814 {0x00, 0x0040, 0x0007},
815 {0x00, 0x00c0, 0x0008},
816 {0x00, 0x004a, 0x0009},
817 {0x00, 0x0000, 0x000a},
818 {0x00, 0x0000, 0x000b},
819 {0x00, 0x0001, 0x000c},
820 {0x00, 0x0001, 0x000d},
821 {0x00, 0x0000, 0x000e},
822 {0x00, 0x0002, 0x000f},
823 {0x00, 0x0001, 0x0010},
824 {0x00, 0x0000, 0x0011},
825 {0x00, 0x0000, 0x0012},
826 {0x00, 0x0002, 0x0020},
827 {0x00, 0x0080, 0x0021},
828 {0x00, 0x0001, 0x0022},
829 {0x00, 0x00e0, 0x0023},
830 {0x00, 0x0000, 0x0024},
831 {0x00, 0x00d5, 0x0025},
832 {0x00, 0x0000, 0x0026},
833 {0x00, 0x000b, 0x0027},
834 {0x00, 0x0000, 0x0046},
835 {0x00, 0x0000, 0x0047},
836 {0x00, 0x0000, 0x0048},
837 {0x00, 0x0000, 0x0049},
838 {0x00, 0x0008, 0x004a},
839 {0xff, 0x0000, 0x00d0},
840 {0xff, 0x00d8, 0x00d1},
841 {0xff, 0x0000, 0x00d4},
842 {0xff, 0x0000, 0x00d5},
843 {0x01, 0x00a6, 0x0000},
844 {0x01, 0x0028, 0x0001},
845 {0x01, 0x0000, 0x0002},
846 {0x01, 0x000a, 0x0003},
847 {0x01, 0x0040, 0x0004},
848 {0x01, 0x0066, 0x0007},
849 {0x01, 0x0011, 0x0008},
850 {0x01, 0x0032, 0x0009},
851 {0x01, 0x00fd, 0x000a},
852 {0x01, 0x0038, 0x000b},
853 {0x01, 0x00d1, 0x000c},
854 {0x01, 0x00f7, 0x000d},
855 {0x01, 0x00ed, 0x000e},
856 {0x01, 0x00d8, 0x000f},
857 {0x01, 0x0038, 0x0010},
858 {0x01, 0x00ff, 0x0015},
859 {0x01, 0x0001, 0x0016},
860 {0x01, 0x0032, 0x0017},
861 {0x01, 0x0023, 0x0018},
862 {0x01, 0x00ce, 0x0019},
863 {0x01, 0x0023, 0x001a},
864 {0x01, 0x0032, 0x001b},
865 {0x01, 0x008d, 0x001c},
866 {0x01, 0x00ce, 0x001d},
867 {0x01, 0x008d, 0x001e},
868 {0x01, 0x0000, 0x001f},
869 {0x01, 0x0000, 0x0020},
870 {0x01, 0x00ff, 0x003e},
871 {0x01, 0x0003, 0x003f},
872 {0x01, 0x0000, 0x0040},
873 {0x01, 0x0035, 0x0041},
874 {0x01, 0x0053, 0x0042},
875 {0x01, 0x0069, 0x0043},
876 {0x01, 0x007c, 0x0044},
877 {0x01, 0x008c, 0x0045},
878 {0x01, 0x009a, 0x0046},
879 {0x01, 0x00a8, 0x0047},
880 {0x01, 0x00b4, 0x0048},
881 {0x01, 0x00bf, 0x0049},
882 {0x01, 0x00ca, 0x004a},
883 {0x01, 0x00d4, 0x004b},
884 {0x01, 0x00dd, 0x004c},
885 {0x01, 0x00e7, 0x004d},
886 {0x01, 0x00ef, 0x004e},
887 {0x01, 0x00f8, 0x004f},
888 {0x01, 0x00ff, 0x0050},
889 {0x01, 0x0001, 0x0056},
890 {0x01, 0x0060, 0x0057},
891 {0x01, 0x0040, 0x0058},
892 {0x01, 0x0011, 0x0059},
893 {0x01, 0x0001, 0x005a},
894 {0x02, 0x0007, 0x0005},
895 {0x02, 0xa048, 0x0000},
896 {0x02, 0x0007, 0x0005},
897 {0x02, 0x0015, 0x0006},
898 {0x02, 0x100a, 0x0007},
899 {0x02, 0xa048, 0x0000},
900 {0x02, 0xc002, 0x0001},
901 {0x02, 0x000f, 0x0005},
902 {0x02, 0xa048, 0x0000},
903 {0x05, 0x0022, 0x0004},
904 {0x05, 0x0025, 0x0001},
905 {0x05, 0x0000, 0x0000},
906 {0x05, 0x0026, 0x0001},
907 {0x05, 0x0001, 0x0000},
908 {0x05, 0x0027, 0x0001},
909 {0x05, 0x0000, 0x0000},
910 {0x05, 0x0001, 0x0001},
911 {0x05, 0x0000, 0x0000},
912 {0x05, 0x0021, 0x0001},
913 {0x05, 0x00d2, 0x0000},
914 {0x05, 0x0020, 0x0001},
915 {0x05, 0x0000, 0x0000},
916 {0x00, 0x0090, 0x0005},
917 {0x01, 0x00a6, 0x0000},
918 {0x01, 0x0003, 0x003f},
919 {0x01, 0x0001, 0x0056},
920 {0x01, 0x0011, 0x0008},
921 {0x01, 0x0032, 0x0009},
922 {0x01, 0xfffd, 0x000a},
923 {0x01, 0x0023, 0x000b},
924 {0x01, 0xffea, 0x000c},
925 {0x01, 0xfff4, 0x000d},
926 {0x01, 0xfffc, 0x000e},
927 {0x01, 0xffe3, 0x000f},
928 {0x01, 0x001f, 0x0010},
929 {0x01, 0x00a8, 0x0001},
930 {0x01, 0x0067, 0x0007},
931 {0x01, 0x0032, 0x0017},
932 {0x01, 0x0023, 0x0018},
933 {0x01, 0x00ce, 0x0019},
934 {0x01, 0x0023, 0x001a},
935 {0x01, 0x0032, 0x001b},
936 {0x01, 0x008d, 0x001c},
937 {0x01, 0x00ce, 0x001d},
938 {0x01, 0x008d, 0x001e},
939 {0x01, 0x00c8, 0x0015},
940 {0x01, 0x0032, 0x0016},
941 {0x01, 0x0000, 0x0011},
942 {0x01, 0x0000, 0x0012},
943 {0x01, 0x0000, 0x0013},
944 {0x01, 0x000a, 0x0003},
945 {0x02, 0xc002, 0x0001},
946 {0x02, 0x0007, 0x0005},
947 {0x02, 0xc000, 0x0001},
948 {0x02, 0x0000, 0x0005},
949 {0x02, 0x0007, 0x0005},
950 {0x02, 0x2000, 0x0000},
951 {0x05, 0x0022, 0x0004},
952 {0x05, 0x0015, 0x0001},
953 {0x05, 0x00ea, 0x0000},
954 {0x05, 0x0021, 0x0001},
955 {0x05, 0x00d2, 0x0000},
956 {0x05, 0x0023, 0x0001},
957 {0x05, 0x0003, 0x0000},
958 {0x05, 0x0030, 0x0001},
959 {0x05, 0x002b, 0x0000},
960 {0x05, 0x0031, 0x0001},
961 {0x05, 0x0023, 0x0000},
962 {0x05, 0x0032, 0x0001},
963 {0x05, 0x0023, 0x0000},
964 {0x05, 0x0033, 0x0001},
965 {0x05, 0x0023, 0x0000},
966 {0x05, 0x0034, 0x0001},
967 {0x05, 0x0002, 0x0000},
968 {0x05, 0x0050, 0x0001},
969 {0x05, 0x0000, 0x0000},
970 {0x05, 0x0051, 0x0001},
971 {0x05, 0x0000, 0x0000},
972 {0x05, 0x0052, 0x0001},
973 {0x05, 0x0000, 0x0000},
974 {0x05, 0x0054, 0x0001},
975 {0x05, 0x0001, 0x0000},
976 {0x00, 0x0000, 0x0001},
977 {0x00, 0x0000, 0x0002},
978 {0x00, 0x000c, 0x0003},
979 {0x00, 0x0000, 0x0004},
980 {0x00, 0x0090, 0x0005},
981 {0x00, 0x0000, 0x0006},
982 {0x00, 0x0040, 0x0007},
983 {0x00, 0x00c0, 0x0008},
984 {0x00, 0x004a, 0x0009},
985 {0x00, 0x0000, 0x000a},
986 {0x00, 0x0000, 0x000b},
987 {0x00, 0x0001, 0x000c},
988 {0x00, 0x0001, 0x000d},
989 {0x00, 0x0000, 0x000e},
990 {0x00, 0x0002, 0x000f},
991 {0x00, 0x0001, 0x0010},
992 {0x00, 0x0000, 0x0011},
993 {0x00, 0x0000, 0x0012},
994 {0x00, 0x0002, 0x0020},
995 {0x00, 0x0080, 0x0021},
996 {0x00, 0x0001, 0x0022},
997 {0x00, 0x00e0, 0x0023},
998 {0x00, 0x0000, 0x0024},
999 {0x00, 0x00d5, 0x0025},
1000 {0x00, 0x0000, 0x0026},
1001 {0x00, 0x000b, 0x0027},
1002 {0x00, 0x0000, 0x0046},
1003 {0x00, 0x0000, 0x0047},
1004 {0x00, 0x0000, 0x0048},
1005 {0x00, 0x0000, 0x0049},
1006 {0x00, 0x0008, 0x004a},
1007 {0xff, 0x0000, 0x00d0},
1008 {0xff, 0x00d8, 0x00d1},
1009 {0xff, 0x0000, 0x00d4},
1010 {0xff, 0x0000, 0x00d5},
1011 {0x01, 0x00a6, 0x0000},
1012 {0x01, 0x0028, 0x0001},
1013 {0x01, 0x0000, 0x0002},
1014 {0x01, 0x000a, 0x0003},
1015 {0x01, 0x0040, 0x0004},
1016 {0x01, 0x0066, 0x0007},
1017 {0x01, 0x0011, 0x0008},
1018 {0x01, 0x0032, 0x0009},
1019 {0x01, 0x00fd, 0x000a},
1020 {0x01, 0x0038, 0x000b},
1021 {0x01, 0x00d1, 0x000c},
1022 {0x01, 0x00f7, 0x000d},
1023 {0x01, 0x00ed, 0x000e},
1024 {0x01, 0x00d8, 0x000f},
1025 {0x01, 0x0038, 0x0010},
1026 {0x01, 0x00ff, 0x0015},
1027 {0x01, 0x0001, 0x0016},
1028 {0x01, 0x0032, 0x0017},
1029 {0x01, 0x0023, 0x0018},
1030 {0x01, 0x00ce, 0x0019},
1031 {0x01, 0x0023, 0x001a},
1032 {0x01, 0x0032, 0x001b},
1033 {0x01, 0x008d, 0x001c},
1034 {0x01, 0x00ce, 0x001d},
1035 {0x01, 0x008d, 0x001e},
1036 {0x01, 0x0000, 0x001f},
1037 {0x01, 0x0000, 0x0020},
1038 {0x01, 0x00ff, 0x003e},
1039 {0x01, 0x0003, 0x003f},
1040 {0x01, 0x0000, 0x0040},
1041 {0x01, 0x0035, 0x0041},
1042 {0x01, 0x0053, 0x0042},
1043 {0x01, 0x0069, 0x0043},
1044 {0x01, 0x007c, 0x0044},
1045 {0x01, 0x008c, 0x0045},
1046 {0x01, 0x009a, 0x0046},
1047 {0x01, 0x00a8, 0x0047},
1048 {0x01, 0x00b4, 0x0048},
1049 {0x01, 0x00bf, 0x0049},
1050 {0x01, 0x00ca, 0x004a},
1051 {0x01, 0x00d4, 0x004b},
1052 {0x01, 0x00dd, 0x004c},
1053 {0x01, 0x00e7, 0x004d},
1054 {0x01, 0x00ef, 0x004e},
1055 {0x01, 0x00f8, 0x004f},
1056 {0x01, 0x00ff, 0x0050},
1057 {0x01, 0x0001, 0x0056},
1058 {0x01, 0x0060, 0x0057},
1059 {0x01, 0x0040, 0x0058},
1060 {0x01, 0x0011, 0x0059},
1061 {0x01, 0x0001, 0x005a},
1062 {0x02, 0x0007, 0x0005},
1063 {0x02, 0xa048, 0x0000},
1064 {0x02, 0x0007, 0x0005},
1065 {0x02, 0x0015, 0x0006},
1066 {0x02, 0x100a, 0x0007},
1067 {0x02, 0xa048, 0x0000},
1068 {0x02, 0xc002, 0x0001},
1069 {0x02, 0x000f, 0x0005},
1070 {0x02, 0xa048, 0x0000},
1071 {0x05, 0x0022, 0x0004},
1072 {0x05, 0x0025, 0x0001},
1073 {0x05, 0x0000, 0x0000},
1074 {0x05, 0x0026, 0x0001},
1075 {0x05, 0x0001, 0x0000},
1076 {0x05, 0x0027, 0x0001},
1077 {0x05, 0x0000, 0x0000},
1078 {0x05, 0x0001, 0x0001},
1079 {0x05, 0x0000, 0x0000},
1080 {0x05, 0x0021, 0x0001},
1081 {0x05, 0x00d2, 0x0000},
1082 {0x05, 0x0020, 0x0001},
1083 {0x05, 0x0000, 0x0000},
1084 {0x00, 0x0090, 0x0005},
1085 {0x01, 0x00a6, 0x0000},
1086 {0x02, 0x0007, 0x0005},
1087 {0x02, 0x2000, 0x0000},
1088 {0x05, 0x0022, 0x0004},
1089 {0x05, 0x0015, 0x0001},
1090 {0x05, 0x00ea, 0x0000},
1091 {0x05, 0x0021, 0x0001},
1092 {0x05, 0x00d2, 0x0000},
1093 {0x05, 0x0023, 0x0001},
1094 {0x05, 0x0003, 0x0000},
1095 {0x05, 0x0030, 0x0001},
1096 {0x05, 0x002b, 0x0000},
1097 {0x05, 0x0031, 0x0001},
1098 {0x05, 0x0023, 0x0000},
1099 {0x05, 0x0032, 0x0001},
1100 {0x05, 0x0023, 0x0000},
1101 {0x05, 0x0033, 0x0001},
1102 {0x05, 0x0023, 0x0000},
1103 {0x05, 0x0034, 0x0001},
1104 {0x05, 0x0002, 0x0000},
1105 {0x05, 0x0050, 0x0001},
1106 {0x05, 0x0000, 0x0000},
1107 {0x05, 0x0051, 0x0001},
1108 {0x05, 0x0000, 0x0000},
1109 {0x05, 0x0052, 0x0001},
1110 {0x05, 0x0000, 0x0000},
1111 {0x05, 0x0054, 0x0001},
1112 {0x05, 0x0001, 0x0000},
1113 {0x00, 0x0000, 0x0001},
1114 {0x00, 0x0000, 0x0002},
1115 {0x00, 0x000c, 0x0003},
1116 {0x00, 0x0000, 0x0004},
1117 {0x00, 0x0090, 0x0005},
1118 {0x00, 0x0000, 0x0006},
1119 {0x00, 0x0040, 0x0007},
1120 {0x00, 0x00c0, 0x0008},
1121 {0x00, 0x004a, 0x0009},
1122 {0x00, 0x0000, 0x000a},
1123 {0x00, 0x0000, 0x000b},
1124 {0x00, 0x0001, 0x000c},
1125 {0x00, 0x0001, 0x000d},
1126 {0x00, 0x0000, 0x000e},
1127 {0x00, 0x0002, 0x000f},
1128 {0x00, 0x0001, 0x0010},
1129 {0x00, 0x0000, 0x0011},
1130 {0x00, 0x0000, 0x0012},
1131 {0x00, 0x0002, 0x0020},
1132 {0x00, 0x0080, 0x0021},
1133 {0x00, 0x0001, 0x0022},
1134 {0x00, 0x00e0, 0x0023},
1135 {0x00, 0x0000, 0x0024},
1136 {0x00, 0x00d5, 0x0025},
1137 {0x00, 0x0000, 0x0026},
1138 {0x00, 0x000b, 0x0027},
1139 {0x00, 0x0000, 0x0046},
1140 {0x00, 0x0000, 0x0047},
1141 {0x00, 0x0000, 0x0048},
1142 {0x00, 0x0000, 0x0049},
1143 {0x00, 0x0008, 0x004a},
1144 {0xff, 0x0000, 0x00d0},
1145 {0xff, 0x00d8, 0x00d1},
1146 {0xff, 0x0000, 0x00d4},
1147 {0xff, 0x0000, 0x00d5},
1148 {0x01, 0x00a6, 0x0000},
1149 {0x01, 0x0028, 0x0001},
1150 {0x01, 0x0000, 0x0002},
1151 {0x01, 0x000a, 0x0003},
1152 {0x01, 0x0040, 0x0004},
1153 {0x01, 0x0066, 0x0007},
1154 {0x01, 0x0011, 0x0008},
1155 {0x01, 0x0032, 0x0009},
1156 {0x01, 0x00fd, 0x000a},
1157 {0x01, 0x0038, 0x000b},
1158 {0x01, 0x00d1, 0x000c},
1159 {0x01, 0x00f7, 0x000d},
1160 {0x01, 0x00ed, 0x000e},
1161 {0x01, 0x00d8, 0x000f},
1162 {0x01, 0x0038, 0x0010},
1163 {0x01, 0x00ff, 0x0015},
1164 {0x01, 0x0001, 0x0016},
1165 {0x01, 0x0032, 0x0017},
1166 {0x01, 0x0023, 0x0018},
1167 {0x01, 0x00ce, 0x0019},
1168 {0x01, 0x0023, 0x001a},
1169 {0x01, 0x0032, 0x001b},
1170 {0x01, 0x008d, 0x001c},
1171 {0x01, 0x00ce, 0x001d},
1172 {0x01, 0x008d, 0x001e},
1173 {0x01, 0x0000, 0x001f},
1174 {0x01, 0x0000, 0x0020},
1175 {0x01, 0x00ff, 0x003e},
1176 {0x01, 0x0003, 0x003f},
1177 {0x01, 0x0000, 0x0040},
1178 {0x01, 0x0035, 0x0041},
1179 {0x01, 0x0053, 0x0042},
1180 {0x01, 0x0069, 0x0043},
1181 {0x01, 0x007c, 0x0044},
1182 {0x01, 0x008c, 0x0045},
1183 {0x01, 0x009a, 0x0046},
1184 {0x01, 0x00a8, 0x0047},
1185 {0x01, 0x00b4, 0x0048},
1186 {0x01, 0x00bf, 0x0049},
1187 {0x01, 0x00ca, 0x004a},
1188 {0x01, 0x00d4, 0x004b},
1189 {0x01, 0x00dd, 0x004c},
1190 {0x01, 0x00e7, 0x004d},
1191 {0x01, 0x00ef, 0x004e},
1192 {0x01, 0x00f8, 0x004f},
1193 {0x01, 0x00ff, 0x0050},
1194 {0x01, 0x0001, 0x0056},
1195 {0x01, 0x0060, 0x0057},
1196 {0x01, 0x0040, 0x0058},
1197 {0x01, 0x0011, 0x0059},
1198 {0x01, 0x0001, 0x005a},
1199 {0x02, 0x0007, 0x0005},
1200 {0x02, 0xa048, 0x0000},
1201 {0x02, 0x0007, 0x0005},
1202 {0x02, 0x0015, 0x0006},
1203 {0x02, 0x100a, 0x0007},
1204 {0x02, 0xa048, 0x0000},
1205 {0x02, 0xc002, 0x0001},
1206 {0x02, 0x000f, 0x0005},
1207 {0x02, 0xa048, 0x0000},
1208 {0x05, 0x0022, 0x0004},
1209 {0x05, 0x0025, 0x0001},
1210 {0x05, 0x0000, 0x0000},
1211 {0x05, 0x0026, 0x0001},
1212 {0x05, 0x0001, 0x0000},
1213 {0x05, 0x0027, 0x0001},
1214 {0x05, 0x0000, 0x0000},
1215 {0x05, 0x0001, 0x0001},
1216 {0x05, 0x0000, 0x0000},
1217 {0x05, 0x0021, 0x0001},
1218 {0x05, 0x00d2, 0x0000},
1219 {0x05, 0x0020, 0x0001},
1220 {0x05, 0x0000, 0x0000},
1221 {0x00, 0x0090, 0x0005},
1222 {0x01, 0x00a6, 0x0000},
1223 {0x05, 0x0026, 0x0001},
1224 {0x05, 0x0001, 0x0000},
1225 {0x05, 0x0027, 0x0001},
1226 {0x05, 0x000f, 0x0000},
1227 {0x01, 0x0003, 0x003f},
1228 {0x01, 0x0001, 0x0056},
1229 {0x01, 0x0011, 0x0008},
1230 {0x01, 0x0032, 0x0009},
1231 {0x01, 0xfffd, 0x000a},
1232 {0x01, 0x0023, 0x000b},
1233 {0x01, 0xffea, 0x000c},
1234 {0x01, 0xfff4, 0x000d},
1235 {0x01, 0xfffc, 0x000e},
1236 {0x01, 0xffe3, 0x000f},
1237 {0x01, 0x001f, 0x0010},
1238 {0x01, 0x00a8, 0x0001},
1239 {0x01, 0x0067, 0x0007},
1240 {0x01, 0x0042, 0x0051},
1241 {0x01, 0x0051, 0x0053},
1242 {0x01, 0x000a, 0x0003},
1243 {0x02, 0xc002, 0x0001},
1244 {0x02, 0x0007, 0x0005},
1245 {0x02, 0xc000, 0x0001},
1246 {0x02, 0x0000, 0x0005},
1247 {0x02, 0x0007, 0x0005},
1248 {0x02, 0x2000, 0x0000},
1249 {0x05, 0x0022, 0x0004},
1250 {0x05, 0x0015, 0x0001},
1251 {0x05, 0x00ea, 0x0000},
1252 {0x05, 0x0021, 0x0001},
1253 {0x05, 0x00d2, 0x0000},
1254 {0x05, 0x0023, 0x0001},
1255 {0x05, 0x0003, 0x0000},
1256 {0x05, 0x0030, 0x0001},
1257 {0x05, 0x002b, 0x0000},
1258 {0x05, 0x0031, 0x0001},
1259 {0x05, 0x0023, 0x0000},
1260 {0x05, 0x0032, 0x0001},
1261 {0x05, 0x0023, 0x0000},
1262 {0x05, 0x0033, 0x0001},
1263 {0x05, 0x0023, 0x0000},
1264 {0x05, 0x0034, 0x0001},
1265 {0x05, 0x0002, 0x0000},
1266 {0x05, 0x0050, 0x0001},
1267 {0x05, 0x0000, 0x0000},
1268 {0x05, 0x0051, 0x0001},
1269 {0x05, 0x0000, 0x0000},
1270 {0x05, 0x0052, 0x0001},
1271 {0x05, 0x0000, 0x0000},
1272 {0x05, 0x0054, 0x0001},
1273 {0x05, 0x0001, 0x0000},
1274 {0x00, 0x0000, 0x0001},
1275 {0x00, 0x0000, 0x0002},
1276 {0x00, 0x000c, 0x0003},
1277 {0x00, 0x0000, 0x0004},
1278 {0x00, 0x0090, 0x0005},
1279 {0x00, 0x0000, 0x0006},
1280 {0x00, 0x0040, 0x0007},
1281 {0x00, 0x00c0, 0x0008},
1282 {0x00, 0x004a, 0x0009},
1283 {0x00, 0x0000, 0x000a},
1284 {0x00, 0x0000, 0x000b},
1285 {0x00, 0x0001, 0x000c},
1286 {0x00, 0x0001, 0x000d},
1287 {0x00, 0x0000, 0x000e},
1288 {0x00, 0x0002, 0x000f},
1289 {0x00, 0x0001, 0x0010},
1290 {0x00, 0x0000, 0x0011},
1291 {0x00, 0x0000, 0x0012},
1292 {0x00, 0x0002, 0x0020},
1293 {0x00, 0x0080, 0x0021},
1294 {0x00, 0x0001, 0x0022},
1295 {0x00, 0x00e0, 0x0023},
1296 {0x00, 0x0000, 0x0024},
1297 {0x00, 0x00d5, 0x0025},
1298 {0x00, 0x0000, 0x0026},
1299 {0x00, 0x000b, 0x0027},
1300 {0x00, 0x0000, 0x0046},
1301 {0x00, 0x0000, 0x0047},
1302 {0x00, 0x0000, 0x0048},
1303 {0x00, 0x0000, 0x0049},
1304 {0x00, 0x0008, 0x004a},
1305 {0xff, 0x0000, 0x00d0},
1306 {0xff, 0x00d8, 0x00d1},
1307 {0xff, 0x0000, 0x00d4},
1308 {0xff, 0x0000, 0x00d5},
1309 {0x01, 0x00a6, 0x0000},
1310 {0x01, 0x0028, 0x0001},
1311 {0x01, 0x0000, 0x0002},
1312 {0x01, 0x000a, 0x0003},
1313 {0x01, 0x0040, 0x0004},
1314 {0x01, 0x0066, 0x0007},
1315 {0x01, 0x0011, 0x0008},
1316 {0x01, 0x0032, 0x0009},
1317 {0x01, 0x00fd, 0x000a},
1318 {0x01, 0x0038, 0x000b},
1319 {0x01, 0x00d1, 0x000c},
1320 {0x01, 0x00f7, 0x000d},
1321 {0x01, 0x00ed, 0x000e},
1322 {0x01, 0x00d8, 0x000f},
1323 {0x01, 0x0038, 0x0010},
1324 {0x01, 0x00ff, 0x0015},
1325 {0x01, 0x0001, 0x0016},
1326 {0x01, 0x0032, 0x0017},
1327 {0x01, 0x0023, 0x0018},
1328 {0x01, 0x00ce, 0x0019},
1329 {0x01, 0x0023, 0x001a},
1330 {0x01, 0x0032, 0x001b},
1331 {0x01, 0x008d, 0x001c},
1332 {0x01, 0x00ce, 0x001d},
1333 {0x01, 0x008d, 0x001e},
1334 {0x01, 0x0000, 0x001f},
1335 {0x01, 0x0000, 0x0020},
1336 {0x01, 0x00ff, 0x003e},
1337 {0x01, 0x0003, 0x003f},
1338 {0x01, 0x0000, 0x0040},
1339 {0x01, 0x0035, 0x0041},
1340 {0x01, 0x0053, 0x0042},
1341 {0x01, 0x0069, 0x0043},
1342 {0x01, 0x007c, 0x0044},
1343 {0x01, 0x008c, 0x0045},
1344 {0x01, 0x009a, 0x0046},
1345 {0x01, 0x00a8, 0x0047},
1346 {0x01, 0x00b4, 0x0048},
1347 {0x01, 0x00bf, 0x0049},
1348 {0x01, 0x00ca, 0x004a},
1349 {0x01, 0x00d4, 0x004b},
1350 {0x01, 0x00dd, 0x004c},
1351 {0x01, 0x00e7, 0x004d},
1352 {0x01, 0x00ef, 0x004e},
1353 {0x01, 0x00f8, 0x004f},
1354 {0x01, 0x00ff, 0x0050},
1355 {0x01, 0x0001, 0x0056},
1356 {0x01, 0x0060, 0x0057},
1357 {0x01, 0x0040, 0x0058},
1358 {0x01, 0x0011, 0x0059},
1359 {0x01, 0x0001, 0x005a},
1360 {0x02, 0x0007, 0x0005},
1361 {0x02, 0xa048, 0x0000},
1362 {0x02, 0x0007, 0x0005},
1363 {0x02, 0x0015, 0x0006},
1364 {0x02, 0x100a, 0x0007},
1365 {0x02, 0xa048, 0x0000},
1366 {0x02, 0xc002, 0x0001},
1367 {0x02, 0x000f, 0x0005},
1368 {0x02, 0xa048, 0x0000},
1369 {0x05, 0x0022, 0x0004},
1370 {0x05, 0x0025, 0x0001},
1371 {0x05, 0x0000, 0x0000},
1372 {0x05, 0x0026, 0x0001},
1373 {0x05, 0x0001, 0x0000},
1374 {0x05, 0x0027, 0x0001},
1375 {0x05, 0x0000, 0x0000},
1376 {0x05, 0x0001, 0x0001},
1377 {0x05, 0x0000, 0x0000},
1378 {0x05, 0x0021, 0x0001},
1379 {0x05, 0x00d2, 0x0000},
1380 {0x05, 0x0020, 0x0001},
1381 {0x05, 0x0000, 0x0000},
1382 {0x00, 0x0090, 0x0005},
1383 {0x01, 0x00a6, 0x0000},
1384 {0x02, 0x0007, 0x0005},
1385 {0x02, 0x2000, 0x0000},
1386 {0x05, 0x0022, 0x0004},
1387 {0x05, 0x0015, 0x0001},
1388 {0x05, 0x00ea, 0x0000},
1389 {0x05, 0x0021, 0x0001},
1390 {0x05, 0x00d2, 0x0000},
1391 {0x05, 0x0023, 0x0001},
1392 {0x05, 0x0003, 0x0000},
1393 {0x05, 0x0030, 0x0001},
1394 {0x05, 0x002b, 0x0000},
1395 {0x05, 0x0031, 0x0001},
1396 {0x05, 0x0023, 0x0000},
1397 {0x05, 0x0032, 0x0001},
1398 {0x05, 0x0023, 0x0000},
1399 {0x05, 0x0033, 0x0001},
1400 {0x05, 0x0023, 0x0000},
1401 {0x05, 0x0034, 0x0001},
1402 {0x05, 0x0002, 0x0000},
1403 {0x05, 0x0050, 0x0001},
1404 {0x05, 0x0000, 0x0000},
1405 {0x05, 0x0051, 0x0001},
1406 {0x05, 0x0000, 0x0000},
1407 {0x05, 0x0052, 0x0001},
1408 {0x05, 0x0000, 0x0000},
1409 {0x05, 0x0054, 0x0001},
1410 {0x05, 0x0001, 0x0000},
1411 {0x00, 0x0000, 0x0001},
1412 {0x00, 0x0000, 0x0002},
1413 {0x00, 0x000c, 0x0003},
1414 {0x00, 0x0000, 0x0004},
1415 {0x00, 0x0090, 0x0005},
1416 {0x00, 0x0000, 0x0006},
1417 {0x00, 0x0040, 0x0007},
1418 {0x00, 0x00c0, 0x0008},
1419 {0x00, 0x004a, 0x0009},
1420 {0x00, 0x0000, 0x000a},
1421 {0x00, 0x0000, 0x000b},
1422 {0x00, 0x0001, 0x000c},
1423 {0x00, 0x0001, 0x000d},
1424 {0x00, 0x0000, 0x000e},
1425 {0x00, 0x0002, 0x000f},
1426 {0x00, 0x0001, 0x0010},
1427 {0x00, 0x0000, 0x0011},
1428 {0x00, 0x0000, 0x0012},
1429 {0x00, 0x0002, 0x0020},
1430 {0x00, 0x0080, 0x0021},
1431 {0x00, 0x0001, 0x0022},
1432 {0x00, 0x00e0, 0x0023},
1433 {0x00, 0x0000, 0x0024},
1434 {0x00, 0x00d5, 0x0025},
1435 {0x00, 0x0000, 0x0026},
1436 {0x00, 0x000b, 0x0027},
1437 {0x00, 0x0000, 0x0046},
1438 {0x00, 0x0000, 0x0047},
1439 {0x00, 0x0000, 0x0048},
1440 {0x00, 0x0000, 0x0049},
1441 {0x00, 0x0008, 0x004a},
1442 {0xff, 0x0000, 0x00d0},
1443 {0xff, 0x00d8, 0x00d1},
1444 {0xff, 0x0000, 0x00d4},
1445 {0xff, 0x0000, 0x00d5},
1446 {0x01, 0x00a6, 0x0000},
1447 {0x01, 0x0028, 0x0001},
1448 {0x01, 0x0000, 0x0002},
1449 {0x01, 0x000a, 0x0003},
1450 {0x01, 0x0040, 0x0004},
1451 {0x01, 0x0066, 0x0007},
1452 {0x01, 0x0011, 0x0008},
1453 {0x01, 0x0032, 0x0009},
1454 {0x01, 0x00fd, 0x000a},
1455 {0x01, 0x0038, 0x000b},
1456 {0x01, 0x00d1, 0x000c},
1457 {0x01, 0x00f7, 0x000d},
1458 {0x01, 0x00ed, 0x000e},
1459 {0x01, 0x00d8, 0x000f},
1460 {0x01, 0x0038, 0x0010},
1461 {0x01, 0x00ff, 0x0015},
1462 {0x01, 0x0001, 0x0016},
1463 {0x01, 0x0032, 0x0017},
1464 {0x01, 0x0023, 0x0018},
1465 {0x01, 0x00ce, 0x0019},
1466 {0x01, 0x0023, 0x001a},
1467 {0x01, 0x0032, 0x001b},
1468 {0x01, 0x008d, 0x001c},
1469 {0x01, 0x00ce, 0x001d},
1470 {0x01, 0x008d, 0x001e},
1471 {0x01, 0x0000, 0x001f},
1472 {0x01, 0x0000, 0x0020},
1473 {0x01, 0x00ff, 0x003e},
1474 {0x01, 0x0003, 0x003f},
1475 {0x01, 0x0000, 0x0040},
1476 {0x01, 0x0035, 0x0041},
1477 {0x01, 0x0053, 0x0042},
1478 {0x01, 0x0069, 0x0043},
1479 {0x01, 0x007c, 0x0044},
1480 {0x01, 0x008c, 0x0045},
1481 {0x01, 0x009a, 0x0046},
1482 {0x01, 0x00a8, 0x0047},
1483 {0x01, 0x00b4, 0x0048},
1484 {0x01, 0x00bf, 0x0049},
1485 {0x01, 0x00ca, 0x004a},
1486 {0x01, 0x00d4, 0x004b},
1487 {0x01, 0x00dd, 0x004c},
1488 {0x01, 0x00e7, 0x004d},
1489 {0x01, 0x00ef, 0x004e},
1490 {0x01, 0x00f8, 0x004f},
1491 {0x01, 0x00ff, 0x0050},
1492 {0x01, 0x0001, 0x0056},
1493 {0x01, 0x0060, 0x0057},
1494 {0x01, 0x0040, 0x0058},
1495 {0x01, 0x0011, 0x0059},
1496 {0x01, 0x0001, 0x005a},
1497 {0x02, 0x0007, 0x0005},
1498 {0x02, 0xa048, 0x0000},
1499 {0x02, 0x0007, 0x0005},
1500 {0x02, 0x0015, 0x0006},
1501 {0x02, 0x100a, 0x0007},
1502 {0x02, 0xa048, 0x0000},
1503 {0x02, 0xc002, 0x0001},
1504 {0x02, 0x000f, 0x0005},
1505 {0x02, 0xa048, 0x0000},
1506 {0x05, 0x0022, 0x0004},
1507 {0x05, 0x0025, 0x0001},
1508 {0x05, 0x0000, 0x0000},
1509 {0x05, 0x0026, 0x0001},
1510 {0x05, 0x0001, 0x0000},
1511 {0x05, 0x0027, 0x0001},
1512 {0x05, 0x0000, 0x0000},
1513 {0x05, 0x0001, 0x0001},
1514 {0x05, 0x0000, 0x0000},
1515 {0x05, 0x0021, 0x0001},
1516 {0x05, 0x00d2, 0x0000},
1517 {0x05, 0x0020, 0x0001},
1518 {0x05, 0x0000, 0x0000},
1519 {0x00, 0x0090, 0x0005},
1520 {0x01, 0x00a6, 0x0000},
1521 {0x05, 0x0026, 0x0001},
1522 {0x05, 0x0001, 0x0000},
1523 {0x05, 0x0027, 0x0001},
1524 {0x05, 0x001e, 0x0000},
1525 {0x01, 0x0003, 0x003f},
1526 {0x01, 0x0001, 0x0056},
1527 {0x01, 0x0011, 0x0008},
1528 {0x01, 0x0032, 0x0009},
1529 {0x01, 0xfffd, 0x000a},
1530 {0x01, 0x0023, 0x000b},
1531 {0x01, 0xffea, 0x000c},
1532 {0x01, 0xfff4, 0x000d},
1533 {0x01, 0xfffc, 0x000e},
1534 {0x01, 0xffe3, 0x000f},
1535 {0x01, 0x001f, 0x0010},
1536 {0x01, 0x00a8, 0x0001},
1537 {0x01, 0x0067, 0x0007},
1538 {0x01, 0x0042, 0x0051},
1539 {0x01, 0x0051, 0x0053},
1540 {0x01, 0x000a, 0x0003},
1541 {0x02, 0xc002, 0x0001},
1542 {0x02, 0x0007, 0x0005},
1543 {0x01, 0x0042, 0x0051},
1544 {0x01, 0x0051, 0x0053},
1545 {0x05, 0x0026, 0x0001},
1546 {0x05, 0x0001, 0x0000},
1547 {0x05, 0x0027, 0x0001},
1548 {0x05, 0x002d, 0x0000},
1549 {0x01, 0x0003, 0x003f},
1550 {0x01, 0x0001, 0x0056},
1551 {0x02, 0xc000, 0x0001},
1552 {0x02, 0x0000, 0x0005},
1556 /* Unknown camera from Ori Usbid 0x0000:0x0000 */
1557 /* Based on snoops from Ori Cohen */
1558 static const __u16 spca501c_mysterious_open_data
[][3] = {
1559 {0x02, 0x000f, 0x0005},
1560 {0x02, 0xa048, 0x0000},
1561 {0x05, 0x0022, 0x0004},
1563 {0x01, 0x0016, 0x0011}, /* RGB offset */
1564 {0x01, 0x0000, 0x0012},
1565 {0x01, 0x0006, 0x0013},
1566 {0x01, 0x0078, 0x0051},
1567 {0x01, 0x0040, 0x0052},
1568 {0x01, 0x0046, 0x0053},
1569 {0x01, 0x0040, 0x0054},
1570 {0x00, 0x0025, 0x0000},
1571 /* {0x00, 0x0000, 0x0000 }, */
1574 {0x00, 0x0026, 0x0000},
1575 {0x00, 0x0001, 0x0000},
1576 {0x00, 0x0027, 0x0000},
1577 {0x00, 0x008a, 0x0000},
1578 {0x02, 0x0007, 0x0005},
1579 {0x02, 0x2000, 0x0000},
1580 {0x05, 0x0022, 0x0004},
1581 {0x05, 0x0015, 0x0001},
1582 {0x05, 0x00ea, 0x0000},
1583 {0x05, 0x0021, 0x0001},
1584 {0x05, 0x00d2, 0x0000},
1585 {0x05, 0x0023, 0x0001},
1586 {0x05, 0x0003, 0x0000},
1587 {0x05, 0x0030, 0x0001},
1588 {0x05, 0x002b, 0x0000},
1589 {0x05, 0x0031, 0x0001},
1590 {0x05, 0x0023, 0x0000},
1591 {0x05, 0x0032, 0x0001},
1592 {0x05, 0x0023, 0x0000},
1593 {0x05, 0x0033, 0x0001},
1594 {0x05, 0x0023, 0x0000},
1595 {0x05, 0x0034, 0x0001},
1596 {0x05, 0x0002, 0x0000},
1597 {0x05, 0x0050, 0x0001},
1598 {0x05, 0x0000, 0x0000},
1599 {0x05, 0x0051, 0x0001},
1600 {0x05, 0x0000, 0x0000},
1601 {0x05, 0x0052, 0x0001},
1602 {0x05, 0x0000, 0x0000},
1603 {0x05, 0x0054, 0x0001},
1604 {0x05, 0x0001, 0x0000},
1608 /* Based on snoops from Ori Cohen */
1609 static const __u16 spca501c_mysterious_init_data
[][3] = {
1612 /* {0x00, 0x0000, 0x0000}, */
1613 {0x00, 0x0000, 0x0001},
1614 {0x00, 0x0000, 0x0002},
1615 {0x00, 0x0006, 0x0003},
1616 {0x00, 0x0000, 0x0004},
1617 {0x00, 0x0090, 0x0005},
1618 {0x00, 0x0000, 0x0006},
1619 {0x00, 0x0040, 0x0007},
1620 {0x00, 0x00c0, 0x0008},
1621 {0x00, 0x004a, 0x0009},
1622 {0x00, 0x0000, 0x000a},
1623 {0x00, 0x0000, 0x000b},
1624 {0x00, 0x0001, 0x000c},
1625 {0x00, 0x0001, 0x000d},
1626 {0x00, 0x0000, 0x000e},
1627 {0x00, 0x0002, 0x000f},
1628 {0x00, 0x0001, 0x0010},
1629 {0x00, 0x0000, 0x0011},
1630 {0x00, 0x0001, 0x0012},
1631 {0x00, 0x0002, 0x0020},
1632 {0x00, 0x0080, 0x0021}, /* 640 */
1633 {0x00, 0x0001, 0x0022},
1634 {0x00, 0x00e0, 0x0023}, /* 480 */
1635 {0x00, 0x0000, 0x0024}, /* Offset H hight */
1636 {0x00, 0x00d3, 0x0025}, /* low */
1637 {0x00, 0x0000, 0x0026}, /* Offset V */
1638 {0x00, 0x000d, 0x0027}, /* low */
1639 {0x00, 0x0000, 0x0046},
1640 {0x00, 0x0000, 0x0047},
1641 {0x00, 0x0000, 0x0048},
1642 {0x00, 0x0000, 0x0049},
1643 {0x00, 0x0008, 0x004a},
1645 {0x01, 0x00a6, 0x0000},
1646 {0x01, 0x0028, 0x0001},
1647 {0x01, 0x0000, 0x0002},
1648 {0x01, 0x000a, 0x0003}, /* Level Calc bit7 ->1 Auto */
1649 {0x01, 0x0040, 0x0004},
1650 {0x01, 0x0066, 0x0007},
1651 {0x01, 0x000f, 0x0008}, /* A11 Color correction coeff */
1652 {0x01, 0x002d, 0x0009}, /* A12 */
1653 {0x01, 0x0005, 0x000a}, /* A13 */
1654 {0x01, 0x0023, 0x000b}, /* A21 */
1655 {0x01, 0x00e0, 0x000c}, /* A22 */
1656 {0x01, 0x00fd, 0x000d}, /* A23 */
1657 {0x01, 0x00f4, 0x000e}, /* A31 */
1658 {0x01, 0x00e4, 0x000f}, /* A32 */
1659 {0x01, 0x0028, 0x0010}, /* A33 */
1660 {0x01, 0x00ff, 0x0015}, /* Reserved */
1661 {0x01, 0x0001, 0x0016}, /* Reserved */
1662 {0x01, 0x0032, 0x0017}, /* Win1 Start begin */
1663 {0x01, 0x0023, 0x0018},
1664 {0x01, 0x00ce, 0x0019},
1665 {0x01, 0x0023, 0x001a},
1666 {0x01, 0x0032, 0x001b},
1667 {0x01, 0x008d, 0x001c},
1668 {0x01, 0x00ce, 0x001d},
1669 {0x01, 0x008d, 0x001e},
1670 {0x01, 0x0000, 0x001f},
1671 {0x01, 0x0000, 0x0020}, /* Win1 Start end */
1672 {0x01, 0x00ff, 0x003e}, /* Reserved begin */
1673 {0x01, 0x0002, 0x003f},
1674 {0x01, 0x0000, 0x0040},
1675 {0x01, 0x0035, 0x0041},
1676 {0x01, 0x0053, 0x0042},
1677 {0x01, 0x0069, 0x0043},
1678 {0x01, 0x007c, 0x0044},
1679 {0x01, 0x008c, 0x0045},
1680 {0x01, 0x009a, 0x0046},
1681 {0x01, 0x00a8, 0x0047},
1682 {0x01, 0x00b4, 0x0048},
1683 {0x01, 0x00bf, 0x0049},
1684 {0x01, 0x00ca, 0x004a},
1685 {0x01, 0x00d4, 0x004b},
1686 {0x01, 0x00dd, 0x004c},
1687 {0x01, 0x00e7, 0x004d},
1688 {0x01, 0x00ef, 0x004e},
1689 {0x01, 0x00f8, 0x004f},
1690 {0x01, 0x00ff, 0x0050},
1691 {0x01, 0x0003, 0x0056}, /* Reserved end */
1692 {0x01, 0x0060, 0x0057}, /* Edge Gain */
1693 {0x01, 0x0040, 0x0058},
1694 {0x01, 0x0011, 0x0059}, /* Edge Bandwidth */
1695 {0x01, 0x0001, 0x005a},
1696 {0x02, 0x0007, 0x0005},
1697 {0x02, 0xa048, 0x0000},
1698 {0x02, 0x0007, 0x0005},
1699 {0x02, 0x0015, 0x0006},
1700 {0x02, 0x200a, 0x0007},
1701 {0x02, 0xa048, 0x0000},
1702 {0x02, 0xc000, 0x0001},
1703 {0x02, 0x000f, 0x0005},
1704 {0x02, 0xa048, 0x0000},
1705 {0x05, 0x0022, 0x0004},
1706 {0x05, 0x0025, 0x0001},
1707 {0x05, 0x0000, 0x0000},
1709 {0x05, 0x0026, 0x0001},
1710 {0x05, 0x0001, 0x0000},
1711 {0x05, 0x0027, 0x0001},
1712 {0x05, 0x0000, 0x0000},
1713 {0x05, 0x0001, 0x0001},
1714 {0x05, 0x0000, 0x0000},
1715 {0x05, 0x0021, 0x0001},
1716 {0x05, 0x00d2, 0x0000},
1717 {0x05, 0x0020, 0x0001},
1718 {0x05, 0x0000, 0x0000},
1719 {0x00, 0x0090, 0x0005},
1720 {0x01, 0x00a6, 0x0000},
1721 {0x02, 0x0000, 0x0005},
1722 {0x05, 0x0026, 0x0001},
1723 {0x05, 0x0001, 0x0000},
1724 {0x05, 0x0027, 0x0001},
1725 {0x05, 0x004e, 0x0000},
1727 {0x01, 0x0003, 0x003f},
1728 {0x01, 0x0001, 0x0056},
1729 {0x01, 0x000f, 0x0008},
1730 {0x01, 0x002d, 0x0009},
1731 {0x01, 0x0005, 0x000a},
1732 {0x01, 0x0023, 0x000b},
1733 {0x01, 0xffe0, 0x000c},
1734 {0x01, 0xfffd, 0x000d},
1735 {0x01, 0xfff4, 0x000e},
1736 {0x01, 0xffe4, 0x000f},
1737 {0x01, 0x0028, 0x0010},
1738 {0x01, 0x00a8, 0x0001},
1739 {0x01, 0x0066, 0x0007},
1740 {0x01, 0x0032, 0x0017},
1741 {0x01, 0x0023, 0x0018},
1742 {0x01, 0x00ce, 0x0019},
1743 {0x01, 0x0023, 0x001a},
1744 {0x01, 0x0032, 0x001b},
1745 {0x01, 0x008d, 0x001c},
1746 {0x01, 0x00ce, 0x001d},
1747 {0x01, 0x008d, 0x001e},
1748 {0x01, 0x00c8, 0x0015}, /* c8 Poids fort Luma */
1749 {0x01, 0x0032, 0x0016}, /* 32 */
1750 {0x01, 0x0016, 0x0011}, /* R 00 */
1751 {0x01, 0x0016, 0x0012}, /* G 00 */
1752 {0x01, 0x0016, 0x0013}, /* B 00 */
1753 {0x01, 0x000a, 0x0003},
1754 {0x02, 0xc002, 0x0001},
1755 {0x02, 0x0007, 0x0005},
1759 static int reg_write(struct gspca_dev
*gspca_dev
,
1760 __u16 req
, __u16 index
, __u16 value
)
1763 struct usb_device
*dev
= gspca_dev
->dev
;
1765 ret
= usb_control_msg(dev
,
1766 usb_sndctrlpipe(dev
, 0),
1768 USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
1769 value
, index
, NULL
, 0, 500);
1770 PDEBUG(D_USBO
, "reg write: 0x%02x 0x%02x 0x%02x",
1773 pr_err("reg write: error %d\n", ret
);
1778 static int write_vector(struct gspca_dev
*gspca_dev
, const __u16 data
[][3])
1782 while (data
[i
][0] != 0 || data
[i
][1] != 0 || data
[i
][2] != 0) {
1783 ret
= reg_write(gspca_dev
, data
[i
][0], data
[i
][2],
1786 PERR("Reg write failed for 0x%02x,0x%02x,0x%02x",
1787 data
[i
][0], data
[i
][1], data
[i
][2]);
1795 static void setbrightness(struct gspca_dev
*gspca_dev
, s32 val
)
1797 reg_write(gspca_dev
, SPCA501_REG_CCDSP
, 0x12, val
);
1800 static void setcontrast(struct gspca_dev
*gspca_dev
, s32 val
)
1802 reg_write(gspca_dev
, 0x00, 0x00, (val
>> 8) & 0xff);
1803 reg_write(gspca_dev
, 0x00, 0x01, val
& 0xff);
1806 static void setcolors(struct gspca_dev
*gspca_dev
, s32 val
)
1808 reg_write(gspca_dev
, SPCA501_REG_CCDSP
, 0x0c, val
);
1811 static void setblue_balance(struct gspca_dev
*gspca_dev
, s32 val
)
1813 reg_write(gspca_dev
, SPCA501_REG_CCDSP
, 0x11, val
);
1816 static void setred_balance(struct gspca_dev
*gspca_dev
, s32 val
)
1818 reg_write(gspca_dev
, SPCA501_REG_CCDSP
, 0x13, val
);
1821 /* this function is called at probe time */
1822 static int sd_config(struct gspca_dev
*gspca_dev
,
1823 const struct usb_device_id
*id
)
1825 struct sd
*sd
= (struct sd
*) gspca_dev
;
1828 cam
= &gspca_dev
->cam
;
1829 cam
->cam_mode
= vga_mode
;
1830 cam
->nmodes
= ARRAY_SIZE(vga_mode
);
1831 sd
->subtype
= id
->driver_info
;
1836 /* this function is called at probe and resume time */
1837 static int sd_init(struct gspca_dev
*gspca_dev
)
1839 struct sd
*sd
= (struct sd
*) gspca_dev
;
1841 switch (sd
->subtype
) {
1842 case Arowana300KCMOSCamera
:
1843 case SmileIntlCamera
:
1844 /* Arowana 300k CMOS Camera data */
1845 if (write_vector(gspca_dev
, spca501c_arowana_init_data
))
1848 case MystFromOriUnknownCamera
:
1849 /* Unknown Ori CMOS Camera data */
1850 if (write_vector(gspca_dev
, spca501c_mysterious_open_data
))
1854 /* generic spca501 init data */
1855 if (write_vector(gspca_dev
, spca501_init_data
))
1859 PDEBUG(D_STREAM
, "Initializing SPCA501 finished");
1865 static int sd_start(struct gspca_dev
*gspca_dev
)
1867 struct sd
*sd
= (struct sd
*) gspca_dev
;
1870 switch (sd
->subtype
) {
1871 case ThreeComHomeConnectLite
:
1872 /* Special handling for 3com data */
1873 write_vector(gspca_dev
, spca501_3com_open_data
);
1875 case Arowana300KCMOSCamera
:
1876 case SmileIntlCamera
:
1877 /* Arowana 300k CMOS Camera data */
1878 write_vector(gspca_dev
, spca501c_arowana_open_data
);
1880 case MystFromOriUnknownCamera
:
1881 /* Unknown CMOS Camera data */
1882 write_vector(gspca_dev
, spca501c_mysterious_init_data
);
1885 /* Generic 501 open data */
1886 write_vector(gspca_dev
, spca501_open_data
);
1889 /* memorize the wanted pixel format */
1890 mode
= gspca_dev
->cam
.cam_mode
[(int) gspca_dev
->curr_mode
].priv
;
1892 /* Enable ISO packet machine CTRL reg=2,
1893 * index=1 bitmask=0x2 (bit ordinal 1) */
1894 reg_write(gspca_dev
, SPCA50X_REG_USB
, 0x6, 0x94);
1896 case 0: /* 640x480 */
1897 reg_write(gspca_dev
, SPCA50X_REG_USB
, 0x07, 0x004a);
1899 case 1: /* 320x240 */
1900 reg_write(gspca_dev
, SPCA50X_REG_USB
, 0x07, 0x104a);
1903 /* case 2: * 160x120 */
1904 reg_write(gspca_dev
, SPCA50X_REG_USB
, 0x07, 0x204a);
1907 reg_write(gspca_dev
, SPCA501_REG_CTLRL
, 0x01, 0x02);
1912 static void sd_stopN(struct gspca_dev
*gspca_dev
)
1914 /* Disable ISO packet
1915 * machine CTRL reg=2, index=1 bitmask=0x0 (bit ordinal 1) */
1916 reg_write(gspca_dev
, SPCA501_REG_CTLRL
, 0x01, 0x00);
1919 /* called on streamoff with alt 0 and on disconnect */
1920 static void sd_stop0(struct gspca_dev
*gspca_dev
)
1922 if (!gspca_dev
->present
)
1924 reg_write(gspca_dev
, SPCA501_REG_CTLRL
, 0x05, 0x00);
1927 static void sd_pkt_scan(struct gspca_dev
*gspca_dev
,
1928 u8
*data
, /* isoc packet */
1929 int len
) /* iso packet length */
1932 case 0: /* start of frame */
1933 gspca_frame_add(gspca_dev
, LAST_PACKET
, NULL
, 0);
1934 data
+= SPCA501_OFFSET_DATA
;
1935 len
-= SPCA501_OFFSET_DATA
;
1936 gspca_frame_add(gspca_dev
, FIRST_PACKET
, data
, len
);
1938 case 0xff: /* drop */
1939 /* gspca_dev->last_packet_type = DISCARD_PACKET; */
1944 gspca_frame_add(gspca_dev
, INTER_PACKET
, data
, len
);
1947 static int sd_s_ctrl(struct v4l2_ctrl
*ctrl
)
1949 struct gspca_dev
*gspca_dev
=
1950 container_of(ctrl
->handler
, struct gspca_dev
, ctrl_handler
);
1952 gspca_dev
->usb_err
= 0;
1954 if (!gspca_dev
->streaming
)
1958 case V4L2_CID_BRIGHTNESS
:
1959 setbrightness(gspca_dev
, ctrl
->val
);
1961 case V4L2_CID_CONTRAST
:
1962 setcontrast(gspca_dev
, ctrl
->val
);
1964 case V4L2_CID_SATURATION
:
1965 setcolors(gspca_dev
, ctrl
->val
);
1967 case V4L2_CID_BLUE_BALANCE
:
1968 setblue_balance(gspca_dev
, ctrl
->val
);
1970 case V4L2_CID_RED_BALANCE
:
1971 setred_balance(gspca_dev
, ctrl
->val
);
1974 return gspca_dev
->usb_err
;
1977 static const struct v4l2_ctrl_ops sd_ctrl_ops
= {
1978 .s_ctrl
= sd_s_ctrl
,
1981 static int sd_init_controls(struct gspca_dev
*gspca_dev
)
1983 struct v4l2_ctrl_handler
*hdl
= &gspca_dev
->ctrl_handler
;
1985 gspca_dev
->vdev
.ctrl_handler
= hdl
;
1986 v4l2_ctrl_handler_init(hdl
, 5);
1987 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1988 V4L2_CID_BRIGHTNESS
, 0, 127, 1, 0);
1989 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1990 V4L2_CID_CONTRAST
, 0, 64725, 1, 64725);
1991 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1992 V4L2_CID_SATURATION
, 0, 63, 1, 20);
1993 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1994 V4L2_CID_BLUE_BALANCE
, 0, 127, 1, 0);
1995 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1996 V4L2_CID_RED_BALANCE
, 0, 127, 1, 0);
1999 pr_err("Could not initialize controls\n");
2005 /* sub-driver description */
2006 static const struct sd_desc sd_desc
= {
2007 .name
= MODULE_NAME
,
2008 .config
= sd_config
,
2010 .init_controls
= sd_init_controls
,
2014 .pkt_scan
= sd_pkt_scan
,
2017 /* -- module initialisation -- */
2018 static const struct usb_device_id device_table
[] = {
2019 {USB_DEVICE(0x040a, 0x0002), .driver_info
= KodakDVC325
},
2020 {USB_DEVICE(0x0497, 0xc001), .driver_info
= SmileIntlCamera
},
2021 {USB_DEVICE(0x0506, 0x00df), .driver_info
= ThreeComHomeConnectLite
},
2022 {USB_DEVICE(0x0733, 0x0401), .driver_info
= IntelCreateAndShare
},
2023 {USB_DEVICE(0x0733, 0x0402), .driver_info
= ViewQuestM318B
},
2024 {USB_DEVICE(0x1776, 0x501c), .driver_info
= Arowana300KCMOSCamera
},
2025 {USB_DEVICE(0x0000, 0x0000), .driver_info
= MystFromOriUnknownCamera
},
2028 MODULE_DEVICE_TABLE(usb
, device_table
);
2030 /* -- device connect -- */
2031 static int sd_probe(struct usb_interface
*intf
,
2032 const struct usb_device_id
*id
)
2034 return gspca_dev_probe(intf
, id
, &sd_desc
, sizeof(struct sd
),
2038 static struct usb_driver sd_driver
= {
2039 .name
= MODULE_NAME
,
2040 .id_table
= device_table
,
2042 .disconnect
= gspca_disconnect
,
2044 .suspend
= gspca_suspend
,
2045 .resume
= gspca_resume
,
2046 .reset_resume
= gspca_resume
,
2050 module_usb_driver(sd_driver
);