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 MODULE_NAME "spca501"
26 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
27 MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver");
28 MODULE_LICENSE("GPL");
30 /* specific webcam descriptor */
32 struct gspca_dev gspca_dev; /* !! must be the first item */
34 unsigned short contrast;
39 #define Arowana300KCMOSCamera 0
40 #define IntelCreateAndShare 1
42 #define MystFromOriUnknownCamera 3
43 #define SmileIntlCamera 4
44 #define ThreeComHomeConnectLite 5
45 #define ViewQuestM318B 6
48 /* V4L2 controls supported by the driver */
49 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
50 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
51 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
52 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
53 static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val);
54 static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val);
56 static struct ctrl sd_ctrls[] = {
57 #define MY_BRIGHTNESS 0
60 .id = V4L2_CID_BRIGHTNESS,
61 .type = V4L2_CTRL_TYPE_INTEGER,
68 .set = sd_setbrightness,
69 .get = sd_getbrightness,
74 .id = V4L2_CID_CONTRAST,
75 .type = V4L2_CTRL_TYPE_INTEGER,
80 .default_value = 0xaa00,
82 .set = sd_setcontrast,
83 .get = sd_getcontrast,
88 .id = V4L2_CID_SATURATION,
89 .type = V4L2_CTRL_TYPE_INTEGER,
101 static struct v4l2_pix_format vga_mode[] = {
102 {160, 120, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
104 .sizeimage = 160 * 120 * 3 / 2,
105 .colorspace = V4L2_COLORSPACE_SRGB,
107 {320, 240, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
109 .sizeimage = 320 * 240 * 3 / 2,
110 .colorspace = V4L2_COLORSPACE_SRGB,
112 {640, 480, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
114 .sizeimage = 640 * 480 * 3 / 2,
115 .colorspace = V4L2_COLORSPACE_SRGB,
119 #define SPCA50X_REG_USB 0x2 /* spca505 501 */
121 * Data to initialize a SPCA501. From a capture file provided by Bill Roehl
122 * With SPCA501 chip description
124 #define CCDSP_SET /* set CCDSP parameters */
125 #define TG_SET /* set time generator set */
126 #undef DSPWIN_SET /* set DSP windows parameters */
127 #undef ALTER_GAMA /* Set alternate set to YUV transform coeffs. */
128 #define SPCA501_SNAPBIT 0x80
129 #define SPCA501_SNAPCTRL 0x10
130 /* Frame packet header offsets for the spca501 */
131 #define SPCA501_OFFSET_GPIO 1
132 #define SPCA501_OFFSET_TYPE 2
133 #define SPCA501_OFFSET_TURN3A 3
134 #define SPCA501_OFFSET_FRAMSEQ 4
135 #define SPCA501_OFFSET_COMPRESS 5
136 #define SPCA501_OFFSET_QUANT 6
137 #define SPCA501_OFFSET_QUANT2 7
138 #define SPCA501_OFFSET_DATA 8
140 #define SPCA501_PROP_COMP_ENABLE(d) ((d) & 1)
141 #define SPCA501_PROP_SNAP(d) ((d) & 0x40)
142 #define SPCA501_PROP_SNAP_CTRL(d) ((d) & 0x10)
143 #define SPCA501_PROP_COMP_THRESH(d) (((d) & 0x0e) >> 1)
144 #define SPCA501_PROP_COMP_QUANT(d) (((d) & 0x70) >> 4)
146 /* SPCA501 CCDSP control */
147 #define SPCA501_REG_CCDSP 0x01
148 /* SPCA501 control/status registers */
149 #define SPCA501_REG_CTLRL 0x02
151 /* registers for color correction and YUV transformation */
152 #define SPCA501_A11 0x08
153 #define SPCA501_A12 0x09
154 #define SPCA501_A13 0x0A
155 #define SPCA501_A21 0x0B
156 #define SPCA501_A22 0x0C
157 #define SPCA501_A23 0x0D
158 #define SPCA501_A31 0x0E
159 #define SPCA501_A32 0x0F
160 #define SPCA501_A33 0x10
162 /* Data for video camera initialization before capturing */
163 static const __u16 spca501_open_data[][3] = {
164 /* bmRequest,value,index */
166 {0x2, 0x50, 0x00}, /* C/S enable soft reset */
167 {0x2, 0x40, 0x00}, /* C/S disable soft reset */
168 {0x2, 0x02, 0x05}, /* C/S general purpose I/O data */
169 {0x2, 0x03, 0x05}, /* C/S general purpose I/O data */
172 {0x1, 0x38, 0x01}, /* CCDSP options */
173 {0x1, 0x05, 0x02}, /* CCDSP Optical black level for user settings */
174 {0x1, 0xC0, 0x03}, /* CCDSP Optical black settings */
177 {0x1, 0x63, 0x3f}, /* CCDSP CCD gamma enable */
178 {0x1, 0x03, 0x56}, /* Add gamma correction */
180 {0x1, 0xFF, 0x15}, /* CCDSP High luminance for white balance */
181 {0x1, 0x01, 0x16}, /* CCDSP Low luminance for white balance */
183 /* Color correction and RGB-to-YUV transformation coefficients changing */
185 {0x0, 0x00, 0x08}, /* A11 */
186 {0x0, 0x00, 0x09}, /* A12 */
187 {0x0, 0x90, 0x0A}, /* A13 */
188 {0x0, 0x12, 0x0B}, /* A21 */
189 {0x0, 0x00, 0x0C}, /* A22 */
190 {0x0, 0x00, 0x0D}, /* A23 */
191 {0x0, 0x00, 0x0E}, /* A31 */
192 {0x0, 0x02, 0x0F}, /* A32 */
193 {0x0, 0x00, 0x10}, /* A33 */
195 {0x1, 0x2a, 0x08}, /* A11 0x31 */
196 {0x1, 0xf8, 0x09}, /* A12 f8 */
197 {0x1, 0xf8, 0x0A}, /* A13 f8 */
198 {0x1, 0xf8, 0x0B}, /* A21 f8 */
199 {0x1, 0x14, 0x0C}, /* A22 0x14 */
200 {0x1, 0xf8, 0x0D}, /* A23 f8 */
201 {0x1, 0xf8, 0x0E}, /* A31 f8 */
202 {0x1, 0xf8, 0x0F}, /* A32 f8 */
203 {0x1, 0x20, 0x10}, /* A33 0x20 */
205 {0x1, 0x00, 0x11}, /* R offset */
206 {0x1, 0x00, 0x12}, /* G offset */
207 {0x1, 0x00, 0x13}, /* B offset */
208 {0x1, 0x00, 0x14}, /* GB offset */
213 /* Time generator manipulations */
214 {0x0, 0xfc, 0x0}, /* Set up high bits of shutter speed */
215 {0x0, 0x01, 0x1}, /* Set up low bits of shutter speed */
217 {0x0, 0xe4, 0x04}, /* DCLK*2 clock phase adjustment */
218 {0x0, 0x08, 0x05}, /* ADCK phase adjustment, inv. ext. VB */
219 {0x0, 0x03, 0x06}, /* FR phase adjustment */
220 {0x0, 0x01, 0x07}, /* FCDS phase adjustment */
221 {0x0, 0x39, 0x08}, /* FS phase adjustment */
222 {0x0, 0x88, 0x0a}, /* FH1 phase and delay adjustment */
223 {0x0, 0x03, 0x0f}, /* pixel identification */
224 {0x0, 0x00, 0x11}, /* clock source selection (default) */
226 /*VERY strange manipulations with
227 * select DMCLP or OBPX to be ADCLP output (0x0C)
228 * OPB always toggle or not (0x0D) but they allow
229 * us to set up brightness
237 {0x1, 0xa0, 0x01}, /* Setting image processing parameters */
238 {0x1, 0x1c, 0x17}, /* Changing Windows positions X1 */
239 {0x1, 0xe2, 0x19}, /* X2 */
240 {0x1, 0x1c, 0x1b}, /* X3 */
241 {0x1, 0xe2, 0x1d}, /* X4 */
242 {0x1, 0x5f, 0x1f}, /* X5 */
243 {0x1, 0x32, 0x20}, /* Y5 */
244 {0x1, 0x01, 0x10}, /* Changing A33 */
247 {0x2, 0x204a, 0x07},/* Setting video compression & resolution 160x120 */
248 {0x2, 0x94, 0x06}, /* Setting video no compression */
253 The SPCAxxx docs from Sunplus document these values
254 in tables, one table per register number. In the data
255 below, dmRequest is the register number, index is the Addr,
256 and value is a combination of Bit values.
268 /* Data for chip initialization (set default values) */
269 static const __u16 spca501_init_data[][3] = {
270 /* Set all the values to powerup defaults */
271 /* bmRequest,value,index */
546 /* Strange - looks like the 501 driver doesn't do anything
547 * at insert time except read the EEPROM
552 /* Data for video camera init before capture.
553 * Capture and decoding by Colin Peart.
554 * This is is for the 3com HomeConnect Lite which is spca501a based.
556 static const __u16 spca501_3com_open_data[][3] = {
557 /* bmRequest,value,index */
558 {0x2, 0x0050, 0x0000}, /* C/S Enable TG soft reset, timing mode=010 */
559 {0x2, 0x0043, 0x0000}, /* C/S Disable TG soft reset, timing mode=010 */
560 {0x2, 0x0002, 0x0005}, /* C/S GPIO */
561 {0x2, 0x0003, 0x0005}, /* C/S GPIO */
564 {0x1, 0x0020, 0x0001}, /* CCDSP Options */
566 {0x1, 0x0020, 0x0002}, /* CCDSP Black Level */
567 {0x1, 0x006e, 0x0007}, /* CCDSP Gamma options */
568 {0x1, 0x0090, 0x0015}, /* CCDSP Luminance Low */
569 {0x1, 0x00ff, 0x0016}, /* CCDSP Luminance High */
570 {0x1, 0x0003, 0x003F}, /* CCDSP Gamma correction toggle */
573 {0x1, 0x0010, 0x0008}, /* CCDSP YUV A11 */
574 {0x1, 0x0000, 0x0009}, /* CCDSP YUV A12 */
575 {0x1, 0x0000, 0x000a}, /* CCDSP YUV A13 */
576 {0x1, 0x0000, 0x000b}, /* CCDSP YUV A21 */
577 {0x1, 0x0010, 0x000c}, /* CCDSP YUV A22 */
578 {0x1, 0x0000, 0x000d}, /* CCDSP YUV A23 */
579 {0x1, 0x0000, 0x000e}, /* CCDSP YUV A31 */
580 {0x1, 0x0000, 0x000f}, /* CCDSP YUV A32 */
581 {0x1, 0x0010, 0x0010}, /* CCDSP YUV A33 */
582 {0x1, 0x0000, 0x0011}, /* CCDSP R Offset */
583 {0x1, 0x0000, 0x0012}, /* CCDSP G Offset */
584 {0x1, 0x0001, 0x0013}, /* CCDSP B Offset */
585 {0x1, 0x0001, 0x0014}, /* CCDSP BG Offset */
586 {0x1, 0x003f, 0x00C1}, /* CCDSP Gamma Correction Enable */
591 {0x0, 0x00fc, 0x0000}, /* TG Shutter Speed High Bits */
592 {0x0, 0x0000, 0x0001}, /* TG Shutter Speed Low Bits */
593 {0x0, 0x00e4, 0x0004}, /* TG DCLK*2 Adjust */
594 {0x0, 0x0008, 0x0005}, /* TG ADCK Adjust */
595 {0x0, 0x0003, 0x0006}, /* TG FR Phase Adjust */
596 {0x0, 0x0001, 0x0007}, /* TG FCDS Phase Adjust */
597 {0x0, 0x0039, 0x0008}, /* TG FS Phase Adjust */
598 {0x0, 0x0088, 0x000a}, /* TG MH1 */
599 {0x0, 0x0003, 0x000f}, /* TG Pixel ID */
601 /* Like below, unexplained toglleing */
602 {0x0, 0x0080, 0x000c},
603 {0x0, 0x0000, 0x000d},
604 {0x0, 0x0080, 0x000c},
605 {0x0, 0x0004, 0x000d},
606 {0x0, 0x0000, 0x000c},
607 {0x0, 0x0000, 0x000d},
608 {0x0, 0x0040, 0x000c},
609 {0x0, 0x0017, 0x000d},
610 {0x0, 0x00c0, 0x000c},
611 {0x0, 0x0000, 0x000d},
612 {0x0, 0x0080, 0x000c},
613 {0x0, 0x0006, 0x000d},
614 {0x0, 0x0080, 0x000c},
615 {0x0, 0x0004, 0x000d},
616 {0x0, 0x0002, 0x0003},
620 {0x1, 0x001c, 0x0017}, /* CCDSP W1 Start X */
621 {0x1, 0x00e2, 0x0019}, /* CCDSP W2 Start X */
622 {0x1, 0x001c, 0x001b}, /* CCDSP W3 Start X */
623 {0x1, 0x00e2, 0x001d}, /* CCDSP W4 Start X */
624 {0x1, 0x00aa, 0x001f}, /* CCDSP W5 Start X */
625 {0x1, 0x0070, 0x0020}, /* CCDSP W5 Start Y */
627 {0x0, 0x0001, 0x0010}, /* TG Start Clock */
629 /* {0x2, 0x006a, 0x0001}, * C/S Enable ISOSYNCH Packet Engine */
630 {0x2, 0x0068, 0x0001}, /* C/S Diable ISOSYNCH Packet Engine */
631 {0x2, 0x0000, 0x0005},
632 {0x2, 0x0043, 0x0000}, /* C/S Set Timing Mode, Disable TG soft reset */
633 {0x2, 0x0043, 0x0000}, /* C/S Set Timing Mode, Disable TG soft reset */
634 {0x2, 0x0002, 0x0005}, /* C/S GPIO */
635 {0x2, 0x0003, 0x0005}, /* C/S GPIO */
637 {0x2, 0x006a, 0x0001}, /* C/S Enable ISOSYNCH Packet Engine */
642 * Data used to initialize a SPCA501C with HV7131B sensor.
643 * From a capture file taken with USBSnoop v 1.5
644 * I have a "SPCA501C pc camera chipset" manual by sunplus, but some
645 * of the value meanings are obscure or simply "reserved".
647 * 1) Understand what every value means
648 * 2) Understand why some values seem to appear more than once
649 * 3) Write a small comment for each line of the following arrays.
651 static const __u16 spca501c_arowana_open_data[][3] = {
652 /* bmRequest,value,index */
653 {0x02, 0x0007, 0x0005},
654 {0x02, 0xa048, 0x0000},
655 {0x05, 0x0022, 0x0004},
656 {0x01, 0x0006, 0x0011},
657 {0x01, 0x00ff, 0x0012},
658 {0x01, 0x0014, 0x0013},
659 {0x01, 0x0000, 0x0014},
660 {0x01, 0x0042, 0x0051},
661 {0x01, 0x0040, 0x0052},
662 {0x01, 0x0051, 0x0053},
663 {0x01, 0x0040, 0x0054},
664 {0x01, 0x0000, 0x0055},
665 {0x00, 0x0025, 0x0000},
666 {0x00, 0x0026, 0x0000},
667 {0x00, 0x0001, 0x0000},
668 {0x00, 0x0027, 0x0000},
669 {0x00, 0x008a, 0x0000},
673 static const __u16 spca501c_arowana_init_data[][3] = {
674 /* bmRequest,value,index */
675 {0x02, 0x0007, 0x0005},
676 {0x02, 0xa048, 0x0000},
677 {0x05, 0x0022, 0x0004},
678 {0x01, 0x0006, 0x0011},
679 {0x01, 0x00ff, 0x0012},
680 {0x01, 0x0014, 0x0013},
681 {0x01, 0x0000, 0x0014},
682 {0x01, 0x0042, 0x0051},
683 {0x01, 0x0040, 0x0052},
684 {0x01, 0x0051, 0x0053},
685 {0x01, 0x0040, 0x0054},
686 {0x01, 0x0000, 0x0055},
687 {0x00, 0x0025, 0x0000},
688 {0x00, 0x0026, 0x0000},
689 {0x00, 0x0001, 0x0000},
690 {0x00, 0x0027, 0x0000},
691 {0x00, 0x008a, 0x0000},
692 {0x02, 0x0000, 0x0005},
693 {0x02, 0x0007, 0x0005},
694 {0x02, 0x2000, 0x0000},
695 {0x05, 0x0022, 0x0004},
696 {0x05, 0x0015, 0x0001},
697 {0x05, 0x00ea, 0x0000},
698 {0x05, 0x0021, 0x0001},
699 {0x05, 0x00d2, 0x0000},
700 {0x05, 0x0023, 0x0001},
701 {0x05, 0x0003, 0x0000},
702 {0x05, 0x0030, 0x0001},
703 {0x05, 0x002b, 0x0000},
704 {0x05, 0x0031, 0x0001},
705 {0x05, 0x0023, 0x0000},
706 {0x05, 0x0032, 0x0001},
707 {0x05, 0x0023, 0x0000},
708 {0x05, 0x0033, 0x0001},
709 {0x05, 0x0023, 0x0000},
710 {0x05, 0x0034, 0x0001},
711 {0x05, 0x0002, 0x0000},
712 {0x05, 0x0050, 0x0001},
713 {0x05, 0x0000, 0x0000},
714 {0x05, 0x0051, 0x0001},
715 {0x05, 0x0000, 0x0000},
716 {0x05, 0x0052, 0x0001},
717 {0x05, 0x0000, 0x0000},
718 {0x05, 0x0054, 0x0001},
719 {0x05, 0x0001, 0x0000},
720 {0x00, 0x0000, 0x0001},
721 {0x00, 0x0000, 0x0002},
722 {0x00, 0x000c, 0x0003},
723 {0x00, 0x0000, 0x0004},
724 {0x00, 0x0090, 0x0005},
725 {0x00, 0x0000, 0x0006},
726 {0x00, 0x0040, 0x0007},
727 {0x00, 0x00c0, 0x0008},
728 {0x00, 0x004a, 0x0009},
729 {0x00, 0x0000, 0x000a},
730 {0x00, 0x0000, 0x000b},
731 {0x00, 0x0001, 0x000c},
732 {0x00, 0x0001, 0x000d},
733 {0x00, 0x0000, 0x000e},
734 {0x00, 0x0002, 0x000f},
735 {0x00, 0x0001, 0x0010},
736 {0x00, 0x0000, 0x0011},
737 {0x00, 0x0000, 0x0012},
738 {0x00, 0x0002, 0x0020},
739 {0x00, 0x0080, 0x0021},
740 {0x00, 0x0001, 0x0022},
741 {0x00, 0x00e0, 0x0023},
742 {0x00, 0x0000, 0x0024},
743 {0x00, 0x00d5, 0x0025},
744 {0x00, 0x0000, 0x0026},
745 {0x00, 0x000b, 0x0027},
746 {0x00, 0x0000, 0x0046},
747 {0x00, 0x0000, 0x0047},
748 {0x00, 0x0000, 0x0048},
749 {0x00, 0x0000, 0x0049},
750 {0x00, 0x0008, 0x004a},
751 {0xff, 0x0000, 0x00d0},
752 {0xff, 0x00d8, 0x00d1},
753 {0xff, 0x0000, 0x00d4},
754 {0xff, 0x0000, 0x00d5},
755 {0x01, 0x00a6, 0x0000},
756 {0x01, 0x0028, 0x0001},
757 {0x01, 0x0000, 0x0002},
758 {0x01, 0x000a, 0x0003},
759 {0x01, 0x0040, 0x0004},
760 {0x01, 0x0066, 0x0007},
761 {0x01, 0x0011, 0x0008},
762 {0x01, 0x0032, 0x0009},
763 {0x01, 0x00fd, 0x000a},
764 {0x01, 0x0038, 0x000b},
765 {0x01, 0x00d1, 0x000c},
766 {0x01, 0x00f7, 0x000d},
767 {0x01, 0x00ed, 0x000e},
768 {0x01, 0x00d8, 0x000f},
769 {0x01, 0x0038, 0x0010},
770 {0x01, 0x00ff, 0x0015},
771 {0x01, 0x0001, 0x0016},
772 {0x01, 0x0032, 0x0017},
773 {0x01, 0x0023, 0x0018},
774 {0x01, 0x00ce, 0x0019},
775 {0x01, 0x0023, 0x001a},
776 {0x01, 0x0032, 0x001b},
777 {0x01, 0x008d, 0x001c},
778 {0x01, 0x00ce, 0x001d},
779 {0x01, 0x008d, 0x001e},
780 {0x01, 0x0000, 0x001f},
781 {0x01, 0x0000, 0x0020},
782 {0x01, 0x00ff, 0x003e},
783 {0x01, 0x0003, 0x003f},
784 {0x01, 0x0000, 0x0040},
785 {0x01, 0x0035, 0x0041},
786 {0x01, 0x0053, 0x0042},
787 {0x01, 0x0069, 0x0043},
788 {0x01, 0x007c, 0x0044},
789 {0x01, 0x008c, 0x0045},
790 {0x01, 0x009a, 0x0046},
791 {0x01, 0x00a8, 0x0047},
792 {0x01, 0x00b4, 0x0048},
793 {0x01, 0x00bf, 0x0049},
794 {0x01, 0x00ca, 0x004a},
795 {0x01, 0x00d4, 0x004b},
796 {0x01, 0x00dd, 0x004c},
797 {0x01, 0x00e7, 0x004d},
798 {0x01, 0x00ef, 0x004e},
799 {0x01, 0x00f8, 0x004f},
800 {0x01, 0x00ff, 0x0050},
801 {0x01, 0x0001, 0x0056},
802 {0x01, 0x0060, 0x0057},
803 {0x01, 0x0040, 0x0058},
804 {0x01, 0x0011, 0x0059},
805 {0x01, 0x0001, 0x005a},
806 {0x02, 0x0007, 0x0005},
807 {0x02, 0xa048, 0x0000},
808 {0x02, 0x0007, 0x0005},
809 {0x02, 0x0015, 0x0006},
810 {0x02, 0x100a, 0x0007},
811 {0x02, 0xa048, 0x0000},
812 {0x02, 0xc002, 0x0001},
813 {0x02, 0x000f, 0x0005},
814 {0x02, 0xa048, 0x0000},
815 {0x05, 0x0022, 0x0004},
816 {0x05, 0x0025, 0x0001},
817 {0x05, 0x0000, 0x0000},
818 {0x05, 0x0026, 0x0001},
819 {0x05, 0x0001, 0x0000},
820 {0x05, 0x0027, 0x0001},
821 {0x05, 0x0000, 0x0000},
822 {0x05, 0x0001, 0x0001},
823 {0x05, 0x0000, 0x0000},
824 {0x05, 0x0021, 0x0001},
825 {0x05, 0x00d2, 0x0000},
826 {0x05, 0x0020, 0x0001},
827 {0x05, 0x0000, 0x0000},
828 {0x00, 0x0090, 0x0005},
829 {0x01, 0x00a6, 0x0000},
830 {0x02, 0x0007, 0x0005},
831 {0x02, 0x2000, 0x0000},
832 {0x05, 0x0022, 0x0004},
833 {0x05, 0x0015, 0x0001},
834 {0x05, 0x00ea, 0x0000},
835 {0x05, 0x0021, 0x0001},
836 {0x05, 0x00d2, 0x0000},
837 {0x05, 0x0023, 0x0001},
838 {0x05, 0x0003, 0x0000},
839 {0x05, 0x0030, 0x0001},
840 {0x05, 0x002b, 0x0000},
841 {0x05, 0x0031, 0x0001},
842 {0x05, 0x0023, 0x0000},
843 {0x05, 0x0032, 0x0001},
844 {0x05, 0x0023, 0x0000},
845 {0x05, 0x0033, 0x0001},
846 {0x05, 0x0023, 0x0000},
847 {0x05, 0x0034, 0x0001},
848 {0x05, 0x0002, 0x0000},
849 {0x05, 0x0050, 0x0001},
850 {0x05, 0x0000, 0x0000},
851 {0x05, 0x0051, 0x0001},
852 {0x05, 0x0000, 0x0000},
853 {0x05, 0x0052, 0x0001},
854 {0x05, 0x0000, 0x0000},
855 {0x05, 0x0054, 0x0001},
856 {0x05, 0x0001, 0x0000},
857 {0x00, 0x0000, 0x0001},
858 {0x00, 0x0000, 0x0002},
859 {0x00, 0x000c, 0x0003},
860 {0x00, 0x0000, 0x0004},
861 {0x00, 0x0090, 0x0005},
862 {0x00, 0x0000, 0x0006},
863 {0x00, 0x0040, 0x0007},
864 {0x00, 0x00c0, 0x0008},
865 {0x00, 0x004a, 0x0009},
866 {0x00, 0x0000, 0x000a},
867 {0x00, 0x0000, 0x000b},
868 {0x00, 0x0001, 0x000c},
869 {0x00, 0x0001, 0x000d},
870 {0x00, 0x0000, 0x000e},
871 {0x00, 0x0002, 0x000f},
872 {0x00, 0x0001, 0x0010},
873 {0x00, 0x0000, 0x0011},
874 {0x00, 0x0000, 0x0012},
875 {0x00, 0x0002, 0x0020},
876 {0x00, 0x0080, 0x0021},
877 {0x00, 0x0001, 0x0022},
878 {0x00, 0x00e0, 0x0023},
879 {0x00, 0x0000, 0x0024},
880 {0x00, 0x00d5, 0x0025},
881 {0x00, 0x0000, 0x0026},
882 {0x00, 0x000b, 0x0027},
883 {0x00, 0x0000, 0x0046},
884 {0x00, 0x0000, 0x0047},
885 {0x00, 0x0000, 0x0048},
886 {0x00, 0x0000, 0x0049},
887 {0x00, 0x0008, 0x004a},
888 {0xff, 0x0000, 0x00d0},
889 {0xff, 0x00d8, 0x00d1},
890 {0xff, 0x0000, 0x00d4},
891 {0xff, 0x0000, 0x00d5},
892 {0x01, 0x00a6, 0x0000},
893 {0x01, 0x0028, 0x0001},
894 {0x01, 0x0000, 0x0002},
895 {0x01, 0x000a, 0x0003},
896 {0x01, 0x0040, 0x0004},
897 {0x01, 0x0066, 0x0007},
898 {0x01, 0x0011, 0x0008},
899 {0x01, 0x0032, 0x0009},
900 {0x01, 0x00fd, 0x000a},
901 {0x01, 0x0038, 0x000b},
902 {0x01, 0x00d1, 0x000c},
903 {0x01, 0x00f7, 0x000d},
904 {0x01, 0x00ed, 0x000e},
905 {0x01, 0x00d8, 0x000f},
906 {0x01, 0x0038, 0x0010},
907 {0x01, 0x00ff, 0x0015},
908 {0x01, 0x0001, 0x0016},
909 {0x01, 0x0032, 0x0017},
910 {0x01, 0x0023, 0x0018},
911 {0x01, 0x00ce, 0x0019},
912 {0x01, 0x0023, 0x001a},
913 {0x01, 0x0032, 0x001b},
914 {0x01, 0x008d, 0x001c},
915 {0x01, 0x00ce, 0x001d},
916 {0x01, 0x008d, 0x001e},
917 {0x01, 0x0000, 0x001f},
918 {0x01, 0x0000, 0x0020},
919 {0x01, 0x00ff, 0x003e},
920 {0x01, 0x0003, 0x003f},
921 {0x01, 0x0000, 0x0040},
922 {0x01, 0x0035, 0x0041},
923 {0x01, 0x0053, 0x0042},
924 {0x01, 0x0069, 0x0043},
925 {0x01, 0x007c, 0x0044},
926 {0x01, 0x008c, 0x0045},
927 {0x01, 0x009a, 0x0046},
928 {0x01, 0x00a8, 0x0047},
929 {0x01, 0x00b4, 0x0048},
930 {0x01, 0x00bf, 0x0049},
931 {0x01, 0x00ca, 0x004a},
932 {0x01, 0x00d4, 0x004b},
933 {0x01, 0x00dd, 0x004c},
934 {0x01, 0x00e7, 0x004d},
935 {0x01, 0x00ef, 0x004e},
936 {0x01, 0x00f8, 0x004f},
937 {0x01, 0x00ff, 0x0050},
938 {0x01, 0x0001, 0x0056},
939 {0x01, 0x0060, 0x0057},
940 {0x01, 0x0040, 0x0058},
941 {0x01, 0x0011, 0x0059},
942 {0x01, 0x0001, 0x005a},
943 {0x02, 0x0007, 0x0005},
944 {0x02, 0xa048, 0x0000},
945 {0x02, 0x0007, 0x0005},
946 {0x02, 0x0015, 0x0006},
947 {0x02, 0x100a, 0x0007},
948 {0x02, 0xa048, 0x0000},
949 {0x02, 0xc002, 0x0001},
950 {0x02, 0x000f, 0x0005},
951 {0x02, 0xa048, 0x0000},
952 {0x05, 0x0022, 0x0004},
953 {0x05, 0x0025, 0x0001},
954 {0x05, 0x0000, 0x0000},
955 {0x05, 0x0026, 0x0001},
956 {0x05, 0x0001, 0x0000},
957 {0x05, 0x0027, 0x0001},
958 {0x05, 0x0000, 0x0000},
959 {0x05, 0x0001, 0x0001},
960 {0x05, 0x0000, 0x0000},
961 {0x05, 0x0021, 0x0001},
962 {0x05, 0x00d2, 0x0000},
963 {0x05, 0x0020, 0x0001},
964 {0x05, 0x0000, 0x0000},
965 {0x00, 0x0090, 0x0005},
966 {0x01, 0x00a6, 0x0000},
967 {0x01, 0x0003, 0x003f},
968 {0x01, 0x0001, 0x0056},
969 {0x01, 0x0011, 0x0008},
970 {0x01, 0x0032, 0x0009},
971 {0x01, 0xfffd, 0x000a},
972 {0x01, 0x0023, 0x000b},
973 {0x01, 0xffea, 0x000c},
974 {0x01, 0xfff4, 0x000d},
975 {0x01, 0xfffc, 0x000e},
976 {0x01, 0xffe3, 0x000f},
977 {0x01, 0x001f, 0x0010},
978 {0x01, 0x00a8, 0x0001},
979 {0x01, 0x0067, 0x0007},
980 {0x01, 0x0032, 0x0017},
981 {0x01, 0x0023, 0x0018},
982 {0x01, 0x00ce, 0x0019},
983 {0x01, 0x0023, 0x001a},
984 {0x01, 0x0032, 0x001b},
985 {0x01, 0x008d, 0x001c},
986 {0x01, 0x00ce, 0x001d},
987 {0x01, 0x008d, 0x001e},
988 {0x01, 0x00c8, 0x0015},
989 {0x01, 0x0032, 0x0016},
990 {0x01, 0x0000, 0x0011},
991 {0x01, 0x0000, 0x0012},
992 {0x01, 0x0000, 0x0013},
993 {0x01, 0x000a, 0x0003},
994 {0x02, 0xc002, 0x0001},
995 {0x02, 0x0007, 0x0005},
996 {0x02, 0xc000, 0x0001},
997 {0x02, 0x0000, 0x0005},
998 {0x02, 0x0007, 0x0005},
999 {0x02, 0x2000, 0x0000},
1000 {0x05, 0x0022, 0x0004},
1001 {0x05, 0x0015, 0x0001},
1002 {0x05, 0x00ea, 0x0000},
1003 {0x05, 0x0021, 0x0001},
1004 {0x05, 0x00d2, 0x0000},
1005 {0x05, 0x0023, 0x0001},
1006 {0x05, 0x0003, 0x0000},
1007 {0x05, 0x0030, 0x0001},
1008 {0x05, 0x002b, 0x0000},
1009 {0x05, 0x0031, 0x0001},
1010 {0x05, 0x0023, 0x0000},
1011 {0x05, 0x0032, 0x0001},
1012 {0x05, 0x0023, 0x0000},
1013 {0x05, 0x0033, 0x0001},
1014 {0x05, 0x0023, 0x0000},
1015 {0x05, 0x0034, 0x0001},
1016 {0x05, 0x0002, 0x0000},
1017 {0x05, 0x0050, 0x0001},
1018 {0x05, 0x0000, 0x0000},
1019 {0x05, 0x0051, 0x0001},
1020 {0x05, 0x0000, 0x0000},
1021 {0x05, 0x0052, 0x0001},
1022 {0x05, 0x0000, 0x0000},
1023 {0x05, 0x0054, 0x0001},
1024 {0x05, 0x0001, 0x0000},
1025 {0x00, 0x0000, 0x0001},
1026 {0x00, 0x0000, 0x0002},
1027 {0x00, 0x000c, 0x0003},
1028 {0x00, 0x0000, 0x0004},
1029 {0x00, 0x0090, 0x0005},
1030 {0x00, 0x0000, 0x0006},
1031 {0x00, 0x0040, 0x0007},
1032 {0x00, 0x00c0, 0x0008},
1033 {0x00, 0x004a, 0x0009},
1034 {0x00, 0x0000, 0x000a},
1035 {0x00, 0x0000, 0x000b},
1036 {0x00, 0x0001, 0x000c},
1037 {0x00, 0x0001, 0x000d},
1038 {0x00, 0x0000, 0x000e},
1039 {0x00, 0x0002, 0x000f},
1040 {0x00, 0x0001, 0x0010},
1041 {0x00, 0x0000, 0x0011},
1042 {0x00, 0x0000, 0x0012},
1043 {0x00, 0x0002, 0x0020},
1044 {0x00, 0x0080, 0x0021},
1045 {0x00, 0x0001, 0x0022},
1046 {0x00, 0x00e0, 0x0023},
1047 {0x00, 0x0000, 0x0024},
1048 {0x00, 0x00d5, 0x0025},
1049 {0x00, 0x0000, 0x0026},
1050 {0x00, 0x000b, 0x0027},
1051 {0x00, 0x0000, 0x0046},
1052 {0x00, 0x0000, 0x0047},
1053 {0x00, 0x0000, 0x0048},
1054 {0x00, 0x0000, 0x0049},
1055 {0x00, 0x0008, 0x004a},
1056 {0xff, 0x0000, 0x00d0},
1057 {0xff, 0x00d8, 0x00d1},
1058 {0xff, 0x0000, 0x00d4},
1059 {0xff, 0x0000, 0x00d5},
1060 {0x01, 0x00a6, 0x0000},
1061 {0x01, 0x0028, 0x0001},
1062 {0x01, 0x0000, 0x0002},
1063 {0x01, 0x000a, 0x0003},
1064 {0x01, 0x0040, 0x0004},
1065 {0x01, 0x0066, 0x0007},
1066 {0x01, 0x0011, 0x0008},
1067 {0x01, 0x0032, 0x0009},
1068 {0x01, 0x00fd, 0x000a},
1069 {0x01, 0x0038, 0x000b},
1070 {0x01, 0x00d1, 0x000c},
1071 {0x01, 0x00f7, 0x000d},
1072 {0x01, 0x00ed, 0x000e},
1073 {0x01, 0x00d8, 0x000f},
1074 {0x01, 0x0038, 0x0010},
1075 {0x01, 0x00ff, 0x0015},
1076 {0x01, 0x0001, 0x0016},
1077 {0x01, 0x0032, 0x0017},
1078 {0x01, 0x0023, 0x0018},
1079 {0x01, 0x00ce, 0x0019},
1080 {0x01, 0x0023, 0x001a},
1081 {0x01, 0x0032, 0x001b},
1082 {0x01, 0x008d, 0x001c},
1083 {0x01, 0x00ce, 0x001d},
1084 {0x01, 0x008d, 0x001e},
1085 {0x01, 0x0000, 0x001f},
1086 {0x01, 0x0000, 0x0020},
1087 {0x01, 0x00ff, 0x003e},
1088 {0x01, 0x0003, 0x003f},
1089 {0x01, 0x0000, 0x0040},
1090 {0x01, 0x0035, 0x0041},
1091 {0x01, 0x0053, 0x0042},
1092 {0x01, 0x0069, 0x0043},
1093 {0x01, 0x007c, 0x0044},
1094 {0x01, 0x008c, 0x0045},
1095 {0x01, 0x009a, 0x0046},
1096 {0x01, 0x00a8, 0x0047},
1097 {0x01, 0x00b4, 0x0048},
1098 {0x01, 0x00bf, 0x0049},
1099 {0x01, 0x00ca, 0x004a},
1100 {0x01, 0x00d4, 0x004b},
1101 {0x01, 0x00dd, 0x004c},
1102 {0x01, 0x00e7, 0x004d},
1103 {0x01, 0x00ef, 0x004e},
1104 {0x01, 0x00f8, 0x004f},
1105 {0x01, 0x00ff, 0x0050},
1106 {0x01, 0x0001, 0x0056},
1107 {0x01, 0x0060, 0x0057},
1108 {0x01, 0x0040, 0x0058},
1109 {0x01, 0x0011, 0x0059},
1110 {0x01, 0x0001, 0x005a},
1111 {0x02, 0x0007, 0x0005},
1112 {0x02, 0xa048, 0x0000},
1113 {0x02, 0x0007, 0x0005},
1114 {0x02, 0x0015, 0x0006},
1115 {0x02, 0x100a, 0x0007},
1116 {0x02, 0xa048, 0x0000},
1117 {0x02, 0xc002, 0x0001},
1118 {0x02, 0x000f, 0x0005},
1119 {0x02, 0xa048, 0x0000},
1120 {0x05, 0x0022, 0x0004},
1121 {0x05, 0x0025, 0x0001},
1122 {0x05, 0x0000, 0x0000},
1123 {0x05, 0x0026, 0x0001},
1124 {0x05, 0x0001, 0x0000},
1125 {0x05, 0x0027, 0x0001},
1126 {0x05, 0x0000, 0x0000},
1127 {0x05, 0x0001, 0x0001},
1128 {0x05, 0x0000, 0x0000},
1129 {0x05, 0x0021, 0x0001},
1130 {0x05, 0x00d2, 0x0000},
1131 {0x05, 0x0020, 0x0001},
1132 {0x05, 0x0000, 0x0000},
1133 {0x00, 0x0090, 0x0005},
1134 {0x01, 0x00a6, 0x0000},
1135 {0x02, 0x0007, 0x0005},
1136 {0x02, 0x2000, 0x0000},
1137 {0x05, 0x0022, 0x0004},
1138 {0x05, 0x0015, 0x0001},
1139 {0x05, 0x00ea, 0x0000},
1140 {0x05, 0x0021, 0x0001},
1141 {0x05, 0x00d2, 0x0000},
1142 {0x05, 0x0023, 0x0001},
1143 {0x05, 0x0003, 0x0000},
1144 {0x05, 0x0030, 0x0001},
1145 {0x05, 0x002b, 0x0000},
1146 {0x05, 0x0031, 0x0001},
1147 {0x05, 0x0023, 0x0000},
1148 {0x05, 0x0032, 0x0001},
1149 {0x05, 0x0023, 0x0000},
1150 {0x05, 0x0033, 0x0001},
1151 {0x05, 0x0023, 0x0000},
1152 {0x05, 0x0034, 0x0001},
1153 {0x05, 0x0002, 0x0000},
1154 {0x05, 0x0050, 0x0001},
1155 {0x05, 0x0000, 0x0000},
1156 {0x05, 0x0051, 0x0001},
1157 {0x05, 0x0000, 0x0000},
1158 {0x05, 0x0052, 0x0001},
1159 {0x05, 0x0000, 0x0000},
1160 {0x05, 0x0054, 0x0001},
1161 {0x05, 0x0001, 0x0000},
1162 {0x00, 0x0000, 0x0001},
1163 {0x00, 0x0000, 0x0002},
1164 {0x00, 0x000c, 0x0003},
1165 {0x00, 0x0000, 0x0004},
1166 {0x00, 0x0090, 0x0005},
1167 {0x00, 0x0000, 0x0006},
1168 {0x00, 0x0040, 0x0007},
1169 {0x00, 0x00c0, 0x0008},
1170 {0x00, 0x004a, 0x0009},
1171 {0x00, 0x0000, 0x000a},
1172 {0x00, 0x0000, 0x000b},
1173 {0x00, 0x0001, 0x000c},
1174 {0x00, 0x0001, 0x000d},
1175 {0x00, 0x0000, 0x000e},
1176 {0x00, 0x0002, 0x000f},
1177 {0x00, 0x0001, 0x0010},
1178 {0x00, 0x0000, 0x0011},
1179 {0x00, 0x0000, 0x0012},
1180 {0x00, 0x0002, 0x0020},
1181 {0x00, 0x0080, 0x0021},
1182 {0x00, 0x0001, 0x0022},
1183 {0x00, 0x00e0, 0x0023},
1184 {0x00, 0x0000, 0x0024},
1185 {0x00, 0x00d5, 0x0025},
1186 {0x00, 0x0000, 0x0026},
1187 {0x00, 0x000b, 0x0027},
1188 {0x00, 0x0000, 0x0046},
1189 {0x00, 0x0000, 0x0047},
1190 {0x00, 0x0000, 0x0048},
1191 {0x00, 0x0000, 0x0049},
1192 {0x00, 0x0008, 0x004a},
1193 {0xff, 0x0000, 0x00d0},
1194 {0xff, 0x00d8, 0x00d1},
1195 {0xff, 0x0000, 0x00d4},
1196 {0xff, 0x0000, 0x00d5},
1197 {0x01, 0x00a6, 0x0000},
1198 {0x01, 0x0028, 0x0001},
1199 {0x01, 0x0000, 0x0002},
1200 {0x01, 0x000a, 0x0003},
1201 {0x01, 0x0040, 0x0004},
1202 {0x01, 0x0066, 0x0007},
1203 {0x01, 0x0011, 0x0008},
1204 {0x01, 0x0032, 0x0009},
1205 {0x01, 0x00fd, 0x000a},
1206 {0x01, 0x0038, 0x000b},
1207 {0x01, 0x00d1, 0x000c},
1208 {0x01, 0x00f7, 0x000d},
1209 {0x01, 0x00ed, 0x000e},
1210 {0x01, 0x00d8, 0x000f},
1211 {0x01, 0x0038, 0x0010},
1212 {0x01, 0x00ff, 0x0015},
1213 {0x01, 0x0001, 0x0016},
1214 {0x01, 0x0032, 0x0017},
1215 {0x01, 0x0023, 0x0018},
1216 {0x01, 0x00ce, 0x0019},
1217 {0x01, 0x0023, 0x001a},
1218 {0x01, 0x0032, 0x001b},
1219 {0x01, 0x008d, 0x001c},
1220 {0x01, 0x00ce, 0x001d},
1221 {0x01, 0x008d, 0x001e},
1222 {0x01, 0x0000, 0x001f},
1223 {0x01, 0x0000, 0x0020},
1224 {0x01, 0x00ff, 0x003e},
1225 {0x01, 0x0003, 0x003f},
1226 {0x01, 0x0000, 0x0040},
1227 {0x01, 0x0035, 0x0041},
1228 {0x01, 0x0053, 0x0042},
1229 {0x01, 0x0069, 0x0043},
1230 {0x01, 0x007c, 0x0044},
1231 {0x01, 0x008c, 0x0045},
1232 {0x01, 0x009a, 0x0046},
1233 {0x01, 0x00a8, 0x0047},
1234 {0x01, 0x00b4, 0x0048},
1235 {0x01, 0x00bf, 0x0049},
1236 {0x01, 0x00ca, 0x004a},
1237 {0x01, 0x00d4, 0x004b},
1238 {0x01, 0x00dd, 0x004c},
1239 {0x01, 0x00e7, 0x004d},
1240 {0x01, 0x00ef, 0x004e},
1241 {0x01, 0x00f8, 0x004f},
1242 {0x01, 0x00ff, 0x0050},
1243 {0x01, 0x0001, 0x0056},
1244 {0x01, 0x0060, 0x0057},
1245 {0x01, 0x0040, 0x0058},
1246 {0x01, 0x0011, 0x0059},
1247 {0x01, 0x0001, 0x005a},
1248 {0x02, 0x0007, 0x0005},
1249 {0x02, 0xa048, 0x0000},
1250 {0x02, 0x0007, 0x0005},
1251 {0x02, 0x0015, 0x0006},
1252 {0x02, 0x100a, 0x0007},
1253 {0x02, 0xa048, 0x0000},
1254 {0x02, 0xc002, 0x0001},
1255 {0x02, 0x000f, 0x0005},
1256 {0x02, 0xa048, 0x0000},
1257 {0x05, 0x0022, 0x0004},
1258 {0x05, 0x0025, 0x0001},
1259 {0x05, 0x0000, 0x0000},
1260 {0x05, 0x0026, 0x0001},
1261 {0x05, 0x0001, 0x0000},
1262 {0x05, 0x0027, 0x0001},
1263 {0x05, 0x0000, 0x0000},
1264 {0x05, 0x0001, 0x0001},
1265 {0x05, 0x0000, 0x0000},
1266 {0x05, 0x0021, 0x0001},
1267 {0x05, 0x00d2, 0x0000},
1268 {0x05, 0x0020, 0x0001},
1269 {0x05, 0x0000, 0x0000},
1270 {0x00, 0x0090, 0x0005},
1271 {0x01, 0x00a6, 0x0000},
1272 {0x05, 0x0026, 0x0001},
1273 {0x05, 0x0001, 0x0000},
1274 {0x05, 0x0027, 0x0001},
1275 {0x05, 0x000f, 0x0000},
1276 {0x01, 0x0003, 0x003f},
1277 {0x01, 0x0001, 0x0056},
1278 {0x01, 0x0011, 0x0008},
1279 {0x01, 0x0032, 0x0009},
1280 {0x01, 0xfffd, 0x000a},
1281 {0x01, 0x0023, 0x000b},
1282 {0x01, 0xffea, 0x000c},
1283 {0x01, 0xfff4, 0x000d},
1284 {0x01, 0xfffc, 0x000e},
1285 {0x01, 0xffe3, 0x000f},
1286 {0x01, 0x001f, 0x0010},
1287 {0x01, 0x00a8, 0x0001},
1288 {0x01, 0x0067, 0x0007},
1289 {0x01, 0x0042, 0x0051},
1290 {0x01, 0x0051, 0x0053},
1291 {0x01, 0x000a, 0x0003},
1292 {0x02, 0xc002, 0x0001},
1293 {0x02, 0x0007, 0x0005},
1294 {0x02, 0xc000, 0x0001},
1295 {0x02, 0x0000, 0x0005},
1296 {0x02, 0x0007, 0x0005},
1297 {0x02, 0x2000, 0x0000},
1298 {0x05, 0x0022, 0x0004},
1299 {0x05, 0x0015, 0x0001},
1300 {0x05, 0x00ea, 0x0000},
1301 {0x05, 0x0021, 0x0001},
1302 {0x05, 0x00d2, 0x0000},
1303 {0x05, 0x0023, 0x0001},
1304 {0x05, 0x0003, 0x0000},
1305 {0x05, 0x0030, 0x0001},
1306 {0x05, 0x002b, 0x0000},
1307 {0x05, 0x0031, 0x0001},
1308 {0x05, 0x0023, 0x0000},
1309 {0x05, 0x0032, 0x0001},
1310 {0x05, 0x0023, 0x0000},
1311 {0x05, 0x0033, 0x0001},
1312 {0x05, 0x0023, 0x0000},
1313 {0x05, 0x0034, 0x0001},
1314 {0x05, 0x0002, 0x0000},
1315 {0x05, 0x0050, 0x0001},
1316 {0x05, 0x0000, 0x0000},
1317 {0x05, 0x0051, 0x0001},
1318 {0x05, 0x0000, 0x0000},
1319 {0x05, 0x0052, 0x0001},
1320 {0x05, 0x0000, 0x0000},
1321 {0x05, 0x0054, 0x0001},
1322 {0x05, 0x0001, 0x0000},
1323 {0x00, 0x0000, 0x0001},
1324 {0x00, 0x0000, 0x0002},
1325 {0x00, 0x000c, 0x0003},
1326 {0x00, 0x0000, 0x0004},
1327 {0x00, 0x0090, 0x0005},
1328 {0x00, 0x0000, 0x0006},
1329 {0x00, 0x0040, 0x0007},
1330 {0x00, 0x00c0, 0x0008},
1331 {0x00, 0x004a, 0x0009},
1332 {0x00, 0x0000, 0x000a},
1333 {0x00, 0x0000, 0x000b},
1334 {0x00, 0x0001, 0x000c},
1335 {0x00, 0x0001, 0x000d},
1336 {0x00, 0x0000, 0x000e},
1337 {0x00, 0x0002, 0x000f},
1338 {0x00, 0x0001, 0x0010},
1339 {0x00, 0x0000, 0x0011},
1340 {0x00, 0x0000, 0x0012},
1341 {0x00, 0x0002, 0x0020},
1342 {0x00, 0x0080, 0x0021},
1343 {0x00, 0x0001, 0x0022},
1344 {0x00, 0x00e0, 0x0023},
1345 {0x00, 0x0000, 0x0024},
1346 {0x00, 0x00d5, 0x0025},
1347 {0x00, 0x0000, 0x0026},
1348 {0x00, 0x000b, 0x0027},
1349 {0x00, 0x0000, 0x0046},
1350 {0x00, 0x0000, 0x0047},
1351 {0x00, 0x0000, 0x0048},
1352 {0x00, 0x0000, 0x0049},
1353 {0x00, 0x0008, 0x004a},
1354 {0xff, 0x0000, 0x00d0},
1355 {0xff, 0x00d8, 0x00d1},
1356 {0xff, 0x0000, 0x00d4},
1357 {0xff, 0x0000, 0x00d5},
1358 {0x01, 0x00a6, 0x0000},
1359 {0x01, 0x0028, 0x0001},
1360 {0x01, 0x0000, 0x0002},
1361 {0x01, 0x000a, 0x0003},
1362 {0x01, 0x0040, 0x0004},
1363 {0x01, 0x0066, 0x0007},
1364 {0x01, 0x0011, 0x0008},
1365 {0x01, 0x0032, 0x0009},
1366 {0x01, 0x00fd, 0x000a},
1367 {0x01, 0x0038, 0x000b},
1368 {0x01, 0x00d1, 0x000c},
1369 {0x01, 0x00f7, 0x000d},
1370 {0x01, 0x00ed, 0x000e},
1371 {0x01, 0x00d8, 0x000f},
1372 {0x01, 0x0038, 0x0010},
1373 {0x01, 0x00ff, 0x0015},
1374 {0x01, 0x0001, 0x0016},
1375 {0x01, 0x0032, 0x0017},
1376 {0x01, 0x0023, 0x0018},
1377 {0x01, 0x00ce, 0x0019},
1378 {0x01, 0x0023, 0x001a},
1379 {0x01, 0x0032, 0x001b},
1380 {0x01, 0x008d, 0x001c},
1381 {0x01, 0x00ce, 0x001d},
1382 {0x01, 0x008d, 0x001e},
1383 {0x01, 0x0000, 0x001f},
1384 {0x01, 0x0000, 0x0020},
1385 {0x01, 0x00ff, 0x003e},
1386 {0x01, 0x0003, 0x003f},
1387 {0x01, 0x0000, 0x0040},
1388 {0x01, 0x0035, 0x0041},
1389 {0x01, 0x0053, 0x0042},
1390 {0x01, 0x0069, 0x0043},
1391 {0x01, 0x007c, 0x0044},
1392 {0x01, 0x008c, 0x0045},
1393 {0x01, 0x009a, 0x0046},
1394 {0x01, 0x00a8, 0x0047},
1395 {0x01, 0x00b4, 0x0048},
1396 {0x01, 0x00bf, 0x0049},
1397 {0x01, 0x00ca, 0x004a},
1398 {0x01, 0x00d4, 0x004b},
1399 {0x01, 0x00dd, 0x004c},
1400 {0x01, 0x00e7, 0x004d},
1401 {0x01, 0x00ef, 0x004e},
1402 {0x01, 0x00f8, 0x004f},
1403 {0x01, 0x00ff, 0x0050},
1404 {0x01, 0x0001, 0x0056},
1405 {0x01, 0x0060, 0x0057},
1406 {0x01, 0x0040, 0x0058},
1407 {0x01, 0x0011, 0x0059},
1408 {0x01, 0x0001, 0x005a},
1409 {0x02, 0x0007, 0x0005},
1410 {0x02, 0xa048, 0x0000},
1411 {0x02, 0x0007, 0x0005},
1412 {0x02, 0x0015, 0x0006},
1413 {0x02, 0x100a, 0x0007},
1414 {0x02, 0xa048, 0x0000},
1415 {0x02, 0xc002, 0x0001},
1416 {0x02, 0x000f, 0x0005},
1417 {0x02, 0xa048, 0x0000},
1418 {0x05, 0x0022, 0x0004},
1419 {0x05, 0x0025, 0x0001},
1420 {0x05, 0x0000, 0x0000},
1421 {0x05, 0x0026, 0x0001},
1422 {0x05, 0x0001, 0x0000},
1423 {0x05, 0x0027, 0x0001},
1424 {0x05, 0x0000, 0x0000},
1425 {0x05, 0x0001, 0x0001},
1426 {0x05, 0x0000, 0x0000},
1427 {0x05, 0x0021, 0x0001},
1428 {0x05, 0x00d2, 0x0000},
1429 {0x05, 0x0020, 0x0001},
1430 {0x05, 0x0000, 0x0000},
1431 {0x00, 0x0090, 0x0005},
1432 {0x01, 0x00a6, 0x0000},
1433 {0x02, 0x0007, 0x0005},
1434 {0x02, 0x2000, 0x0000},
1435 {0x05, 0x0022, 0x0004},
1436 {0x05, 0x0015, 0x0001},
1437 {0x05, 0x00ea, 0x0000},
1438 {0x05, 0x0021, 0x0001},
1439 {0x05, 0x00d2, 0x0000},
1440 {0x05, 0x0023, 0x0001},
1441 {0x05, 0x0003, 0x0000},
1442 {0x05, 0x0030, 0x0001},
1443 {0x05, 0x002b, 0x0000},
1444 {0x05, 0x0031, 0x0001},
1445 {0x05, 0x0023, 0x0000},
1446 {0x05, 0x0032, 0x0001},
1447 {0x05, 0x0023, 0x0000},
1448 {0x05, 0x0033, 0x0001},
1449 {0x05, 0x0023, 0x0000},
1450 {0x05, 0x0034, 0x0001},
1451 {0x05, 0x0002, 0x0000},
1452 {0x05, 0x0050, 0x0001},
1453 {0x05, 0x0000, 0x0000},
1454 {0x05, 0x0051, 0x0001},
1455 {0x05, 0x0000, 0x0000},
1456 {0x05, 0x0052, 0x0001},
1457 {0x05, 0x0000, 0x0000},
1458 {0x05, 0x0054, 0x0001},
1459 {0x05, 0x0001, 0x0000},
1460 {0x00, 0x0000, 0x0001},
1461 {0x00, 0x0000, 0x0002},
1462 {0x00, 0x000c, 0x0003},
1463 {0x00, 0x0000, 0x0004},
1464 {0x00, 0x0090, 0x0005},
1465 {0x00, 0x0000, 0x0006},
1466 {0x00, 0x0040, 0x0007},
1467 {0x00, 0x00c0, 0x0008},
1468 {0x00, 0x004a, 0x0009},
1469 {0x00, 0x0000, 0x000a},
1470 {0x00, 0x0000, 0x000b},
1471 {0x00, 0x0001, 0x000c},
1472 {0x00, 0x0001, 0x000d},
1473 {0x00, 0x0000, 0x000e},
1474 {0x00, 0x0002, 0x000f},
1475 {0x00, 0x0001, 0x0010},
1476 {0x00, 0x0000, 0x0011},
1477 {0x00, 0x0000, 0x0012},
1478 {0x00, 0x0002, 0x0020},
1479 {0x00, 0x0080, 0x0021},
1480 {0x00, 0x0001, 0x0022},
1481 {0x00, 0x00e0, 0x0023},
1482 {0x00, 0x0000, 0x0024},
1483 {0x00, 0x00d5, 0x0025},
1484 {0x00, 0x0000, 0x0026},
1485 {0x00, 0x000b, 0x0027},
1486 {0x00, 0x0000, 0x0046},
1487 {0x00, 0x0000, 0x0047},
1488 {0x00, 0x0000, 0x0048},
1489 {0x00, 0x0000, 0x0049},
1490 {0x00, 0x0008, 0x004a},
1491 {0xff, 0x0000, 0x00d0},
1492 {0xff, 0x00d8, 0x00d1},
1493 {0xff, 0x0000, 0x00d4},
1494 {0xff, 0x0000, 0x00d5},
1495 {0x01, 0x00a6, 0x0000},
1496 {0x01, 0x0028, 0x0001},
1497 {0x01, 0x0000, 0x0002},
1498 {0x01, 0x000a, 0x0003},
1499 {0x01, 0x0040, 0x0004},
1500 {0x01, 0x0066, 0x0007},
1501 {0x01, 0x0011, 0x0008},
1502 {0x01, 0x0032, 0x0009},
1503 {0x01, 0x00fd, 0x000a},
1504 {0x01, 0x0038, 0x000b},
1505 {0x01, 0x00d1, 0x000c},
1506 {0x01, 0x00f7, 0x000d},
1507 {0x01, 0x00ed, 0x000e},
1508 {0x01, 0x00d8, 0x000f},
1509 {0x01, 0x0038, 0x0010},
1510 {0x01, 0x00ff, 0x0015},
1511 {0x01, 0x0001, 0x0016},
1512 {0x01, 0x0032, 0x0017},
1513 {0x01, 0x0023, 0x0018},
1514 {0x01, 0x00ce, 0x0019},
1515 {0x01, 0x0023, 0x001a},
1516 {0x01, 0x0032, 0x001b},
1517 {0x01, 0x008d, 0x001c},
1518 {0x01, 0x00ce, 0x001d},
1519 {0x01, 0x008d, 0x001e},
1520 {0x01, 0x0000, 0x001f},
1521 {0x01, 0x0000, 0x0020},
1522 {0x01, 0x00ff, 0x003e},
1523 {0x01, 0x0003, 0x003f},
1524 {0x01, 0x0000, 0x0040},
1525 {0x01, 0x0035, 0x0041},
1526 {0x01, 0x0053, 0x0042},
1527 {0x01, 0x0069, 0x0043},
1528 {0x01, 0x007c, 0x0044},
1529 {0x01, 0x008c, 0x0045},
1530 {0x01, 0x009a, 0x0046},
1531 {0x01, 0x00a8, 0x0047},
1532 {0x01, 0x00b4, 0x0048},
1533 {0x01, 0x00bf, 0x0049},
1534 {0x01, 0x00ca, 0x004a},
1535 {0x01, 0x00d4, 0x004b},
1536 {0x01, 0x00dd, 0x004c},
1537 {0x01, 0x00e7, 0x004d},
1538 {0x01, 0x00ef, 0x004e},
1539 {0x01, 0x00f8, 0x004f},
1540 {0x01, 0x00ff, 0x0050},
1541 {0x01, 0x0001, 0x0056},
1542 {0x01, 0x0060, 0x0057},
1543 {0x01, 0x0040, 0x0058},
1544 {0x01, 0x0011, 0x0059},
1545 {0x01, 0x0001, 0x005a},
1546 {0x02, 0x0007, 0x0005},
1547 {0x02, 0xa048, 0x0000},
1548 {0x02, 0x0007, 0x0005},
1549 {0x02, 0x0015, 0x0006},
1550 {0x02, 0x100a, 0x0007},
1551 {0x02, 0xa048, 0x0000},
1552 {0x02, 0xc002, 0x0001},
1553 {0x02, 0x000f, 0x0005},
1554 {0x02, 0xa048, 0x0000},
1555 {0x05, 0x0022, 0x0004},
1556 {0x05, 0x0025, 0x0001},
1557 {0x05, 0x0000, 0x0000},
1558 {0x05, 0x0026, 0x0001},
1559 {0x05, 0x0001, 0x0000},
1560 {0x05, 0x0027, 0x0001},
1561 {0x05, 0x0000, 0x0000},
1562 {0x05, 0x0001, 0x0001},
1563 {0x05, 0x0000, 0x0000},
1564 {0x05, 0x0021, 0x0001},
1565 {0x05, 0x00d2, 0x0000},
1566 {0x05, 0x0020, 0x0001},
1567 {0x05, 0x0000, 0x0000},
1568 {0x00, 0x0090, 0x0005},
1569 {0x01, 0x00a6, 0x0000},
1570 {0x05, 0x0026, 0x0001},
1571 {0x05, 0x0001, 0x0000},
1572 {0x05, 0x0027, 0x0001},
1573 {0x05, 0x001e, 0x0000},
1574 {0x01, 0x0003, 0x003f},
1575 {0x01, 0x0001, 0x0056},
1576 {0x01, 0x0011, 0x0008},
1577 {0x01, 0x0032, 0x0009},
1578 {0x01, 0xfffd, 0x000a},
1579 {0x01, 0x0023, 0x000b},
1580 {0x01, 0xffea, 0x000c},
1581 {0x01, 0xfff4, 0x000d},
1582 {0x01, 0xfffc, 0x000e},
1583 {0x01, 0xffe3, 0x000f},
1584 {0x01, 0x001f, 0x0010},
1585 {0x01, 0x00a8, 0x0001},
1586 {0x01, 0x0067, 0x0007},
1587 {0x01, 0x0042, 0x0051},
1588 {0x01, 0x0051, 0x0053},
1589 {0x01, 0x000a, 0x0003},
1590 {0x02, 0xc002, 0x0001},
1591 {0x02, 0x0007, 0x0005},
1592 {0x01, 0x0042, 0x0051},
1593 {0x01, 0x0051, 0x0053},
1594 {0x05, 0x0026, 0x0001},
1595 {0x05, 0x0001, 0x0000},
1596 {0x05, 0x0027, 0x0001},
1597 {0x05, 0x002d, 0x0000},
1598 {0x01, 0x0003, 0x003f},
1599 {0x01, 0x0001, 0x0056},
1600 {0x02, 0xc000, 0x0001},
1601 {0x02, 0x0000, 0x0005},
1605 /* Unknow camera from Ori Usbid 0x0000:0x0000 */
1606 /* Based on snoops from Ori Cohen */
1607 static const __u16 spca501c_mysterious_open_data[][3] = {
1608 {0x02, 0x000f, 0x0005},
1609 {0x02, 0xa048, 0x0000},
1610 {0x05, 0x0022, 0x0004},
1612 {0x01, 0x0016, 0x0011}, /* RGB offset */
1613 {0x01, 0x0000, 0x0012},
1614 {0x01, 0x0006, 0x0013},
1615 {0x01, 0x0078, 0x0051},
1616 {0x01, 0x0040, 0x0052},
1617 {0x01, 0x0046, 0x0053},
1618 {0x01, 0x0040, 0x0054},
1619 {0x00, 0x0025, 0x0000},
1620 /* {0x00, 0x0000, 0x0000 }, */
1623 {0x00, 0x0026, 0x0000},
1624 {0x00, 0x0001, 0x0000},
1625 {0x00, 0x0027, 0x0000},
1626 {0x00, 0x008a, 0x0000},
1627 {0x02, 0x0007, 0x0005},
1628 {0x02, 0x2000, 0x0000},
1629 {0x05, 0x0022, 0x0004},
1630 {0x05, 0x0015, 0x0001},
1631 {0x05, 0x00ea, 0x0000},
1632 {0x05, 0x0021, 0x0001},
1633 {0x05, 0x00d2, 0x0000},
1634 {0x05, 0x0023, 0x0001},
1635 {0x05, 0x0003, 0x0000},
1636 {0x05, 0x0030, 0x0001},
1637 {0x05, 0x002b, 0x0000},
1638 {0x05, 0x0031, 0x0001},
1639 {0x05, 0x0023, 0x0000},
1640 {0x05, 0x0032, 0x0001},
1641 {0x05, 0x0023, 0x0000},
1642 {0x05, 0x0033, 0x0001},
1643 {0x05, 0x0023, 0x0000},
1644 {0x05, 0x0034, 0x0001},
1645 {0x05, 0x0002, 0x0000},
1646 {0x05, 0x0050, 0x0001},
1647 {0x05, 0x0000, 0x0000},
1648 {0x05, 0x0051, 0x0001},
1649 {0x05, 0x0000, 0x0000},
1650 {0x05, 0x0052, 0x0001},
1651 {0x05, 0x0000, 0x0000},
1652 {0x05, 0x0054, 0x0001},
1653 {0x05, 0x0001, 0x0000},
1657 /* Based on snoops from Ori Cohen */
1658 static const __u16 spca501c_mysterious_init_data[][3] = {
1661 /* {0x00, 0x0000, 0x0000}, */
1662 {0x00, 0x0000, 0x0001},
1663 {0x00, 0x0000, 0x0002},
1664 {0x00, 0x0006, 0x0003},
1665 {0x00, 0x0000, 0x0004},
1666 {0x00, 0x0090, 0x0005},
1667 {0x00, 0x0000, 0x0006},
1668 {0x00, 0x0040, 0x0007},
1669 {0x00, 0x00c0, 0x0008},
1670 {0x00, 0x004a, 0x0009},
1671 {0x00, 0x0000, 0x000a},
1672 {0x00, 0x0000, 0x000b},
1673 {0x00, 0x0001, 0x000c},
1674 {0x00, 0x0001, 0x000d},
1675 {0x00, 0x0000, 0x000e},
1676 {0x00, 0x0002, 0x000f},
1677 {0x00, 0x0001, 0x0010},
1678 {0x00, 0x0000, 0x0011},
1679 {0x00, 0x0001, 0x0012},
1680 {0x00, 0x0002, 0x0020},
1681 {0x00, 0x0080, 0x0021}, /* 640 */
1682 {0x00, 0x0001, 0x0022},
1683 {0x00, 0x00e0, 0x0023}, /* 480 */
1684 {0x00, 0x0000, 0x0024}, /* Offset H hight */
1685 {0x00, 0x00d3, 0x0025}, /* low */
1686 {0x00, 0x0000, 0x0026}, /* Offset V */
1687 {0x00, 0x000d, 0x0027}, /* low */
1688 {0x00, 0x0000, 0x0046},
1689 {0x00, 0x0000, 0x0047},
1690 {0x00, 0x0000, 0x0048},
1691 {0x00, 0x0000, 0x0049},
1692 {0x00, 0x0008, 0x004a},
1694 {0x01, 0x00a6, 0x0000},
1695 {0x01, 0x0028, 0x0001},
1696 {0x01, 0x0000, 0x0002},
1697 {0x01, 0x000a, 0x0003}, /* Level Calc bit7 ->1 Auto */
1698 {0x01, 0x0040, 0x0004},
1699 {0x01, 0x0066, 0x0007},
1700 {0x01, 0x000f, 0x0008}, /* A11 Color correction coeff */
1701 {0x01, 0x002d, 0x0009}, /* A12 */
1702 {0x01, 0x0005, 0x000a}, /* A13 */
1703 {0x01, 0x0023, 0x000b}, /* A21 */
1704 {0x01, 0x00e0, 0x000c}, /* A22 */
1705 {0x01, 0x00fd, 0x000d}, /* A23 */
1706 {0x01, 0x00f4, 0x000e}, /* A31 */
1707 {0x01, 0x00e4, 0x000f}, /* A32 */
1708 {0x01, 0x0028, 0x0010}, /* A33 */
1709 {0x01, 0x00ff, 0x0015}, /* Reserved */
1710 {0x01, 0x0001, 0x0016}, /* Reserved */
1711 {0x01, 0x0032, 0x0017}, /* Win1 Start begin */
1712 {0x01, 0x0023, 0x0018},
1713 {0x01, 0x00ce, 0x0019},
1714 {0x01, 0x0023, 0x001a},
1715 {0x01, 0x0032, 0x001b},
1716 {0x01, 0x008d, 0x001c},
1717 {0x01, 0x00ce, 0x001d},
1718 {0x01, 0x008d, 0x001e},
1719 {0x01, 0x0000, 0x001f},
1720 {0x01, 0x0000, 0x0020}, /* Win1 Start end */
1721 {0x01, 0x00ff, 0x003e}, /* Reserved begin */
1722 {0x01, 0x0002, 0x003f},
1723 {0x01, 0x0000, 0x0040},
1724 {0x01, 0x0035, 0x0041},
1725 {0x01, 0x0053, 0x0042},
1726 {0x01, 0x0069, 0x0043},
1727 {0x01, 0x007c, 0x0044},
1728 {0x01, 0x008c, 0x0045},
1729 {0x01, 0x009a, 0x0046},
1730 {0x01, 0x00a8, 0x0047},
1731 {0x01, 0x00b4, 0x0048},
1732 {0x01, 0x00bf, 0x0049},
1733 {0x01, 0x00ca, 0x004a},
1734 {0x01, 0x00d4, 0x004b},
1735 {0x01, 0x00dd, 0x004c},
1736 {0x01, 0x00e7, 0x004d},
1737 {0x01, 0x00ef, 0x004e},
1738 {0x01, 0x00f8, 0x004f},
1739 {0x01, 0x00ff, 0x0050},
1740 {0x01, 0x0003, 0x0056}, /* Reserved end */
1741 {0x01, 0x0060, 0x0057}, /* Edge Gain */
1742 {0x01, 0x0040, 0x0058},
1743 {0x01, 0x0011, 0x0059}, /* Edge Bandwidth */
1744 {0x01, 0x0001, 0x005a},
1745 {0x02, 0x0007, 0x0005},
1746 {0x02, 0xa048, 0x0000},
1747 {0x02, 0x0007, 0x0005},
1748 {0x02, 0x0015, 0x0006},
1749 {0x02, 0x200a, 0x0007},
1750 {0x02, 0xa048, 0x0000},
1751 {0x02, 0xc000, 0x0001},
1752 {0x02, 0x000f, 0x0005},
1753 {0x02, 0xa048, 0x0000},
1754 {0x05, 0x0022, 0x0004},
1755 {0x05, 0x0025, 0x0001},
1756 {0x05, 0x0000, 0x0000},
1758 {0x05, 0x0026, 0x0001},
1759 {0x05, 0x0001, 0x0000},
1760 {0x05, 0x0027, 0x0001},
1761 {0x05, 0x0000, 0x0000},
1762 {0x05, 0x0001, 0x0001},
1763 {0x05, 0x0000, 0x0000},
1764 {0x05, 0x0021, 0x0001},
1765 {0x05, 0x00d2, 0x0000},
1766 {0x05, 0x0020, 0x0001},
1767 {0x05, 0x0000, 0x0000},
1768 {0x00, 0x0090, 0x0005},
1769 {0x01, 0x00a6, 0x0000},
1770 {0x02, 0x0000, 0x0005},
1771 {0x05, 0x0026, 0x0001},
1772 {0x05, 0x0001, 0x0000},
1773 {0x05, 0x0027, 0x0001},
1774 {0x05, 0x004e, 0x0000},
1776 {0x01, 0x0003, 0x003f},
1777 {0x01, 0x0001, 0x0056},
1778 {0x01, 0x000f, 0x0008},
1779 {0x01, 0x002d, 0x0009},
1780 {0x01, 0x0005, 0x000a},
1781 {0x01, 0x0023, 0x000b},
1782 {0x01, 0xffe0, 0x000c},
1783 {0x01, 0xfffd, 0x000d},
1784 {0x01, 0xfff4, 0x000e},
1785 {0x01, 0xffe4, 0x000f},
1786 {0x01, 0x0028, 0x0010},
1787 {0x01, 0x00a8, 0x0001},
1788 {0x01, 0x0066, 0x0007},
1789 {0x01, 0x0032, 0x0017},
1790 {0x01, 0x0023, 0x0018},
1791 {0x01, 0x00ce, 0x0019},
1792 {0x01, 0x0023, 0x001a},
1793 {0x01, 0x0032, 0x001b},
1794 {0x01, 0x008d, 0x001c},
1795 {0x01, 0x00ce, 0x001d},
1796 {0x01, 0x008d, 0x001e},
1797 {0x01, 0x00c8, 0x0015}, /* c8 Poids fort Luma */
1798 {0x01, 0x0032, 0x0016}, /* 32 */
1799 {0x01, 0x0016, 0x0011}, /* R 00 */
1800 {0x01, 0x0016, 0x0012}, /* G 00 */
1801 {0x01, 0x0016, 0x0013}, /* B 00 */
1802 {0x01, 0x000a, 0x0003},
1803 {0x02, 0xc002, 0x0001},
1804 {0x02, 0x0007, 0x0005},
1808 static int reg_write(struct usb_device *dev,
1809 __u16 req, __u16 index, __u16 value)
1813 ret = usb_control_msg(dev,
1814 usb_sndctrlpipe(dev, 0),
1816 USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1817 value, index, NULL, 0, 500);
1818 PDEBUG(D_USBO, "reg write: 0x%02x 0x%02x 0x%02x",
1821 PDEBUG(D_ERR, "reg write: error %d", ret);
1826 static int write_vector(struct gspca_dev *gspca_dev,
1827 const __u16 data[][3])
1829 struct usb_device *dev = gspca_dev->dev;
1832 while (data[i][0] != 0 || data[i][1] != 0 || data[i][2] != 0) {
1833 ret = reg_write(dev, data[i][0], data[i][2], data[i][1]);
1836 "Reg write failed for 0x%02x,0x%02x,0x%02x",
1837 data[i][0], data[i][1], data[i][2]);
1845 static void setbrightness(struct gspca_dev *gspca_dev)
1847 struct sd *sd = (struct sd *) gspca_dev;
1849 reg_write(gspca_dev->dev, SPCA501_REG_CCDSP, 0x11, sd->brightness);
1850 reg_write(gspca_dev->dev, SPCA501_REG_CCDSP, 0x12, sd->brightness);
1851 reg_write(gspca_dev->dev, SPCA501_REG_CCDSP, 0x13, sd->brightness);
1854 static void getbrightness(struct gspca_dev *gspca_dev)
1858 static void setcontrast(struct gspca_dev *gspca_dev)
1860 struct sd *sd = (struct sd *) gspca_dev;
1862 reg_write(gspca_dev->dev, 0x00, 0x00,
1863 (sd->contrast >> 8) & 0xff);
1864 reg_write(gspca_dev->dev, 0x00, 0x01,
1865 sd->contrast & 0xff);
1868 static void getcontrast(struct gspca_dev *gspca_dev)
1872 static void setcolors(struct gspca_dev *gspca_dev)
1874 struct sd *sd = (struct sd *) gspca_dev;
1876 reg_write(gspca_dev->dev, SPCA501_REG_CCDSP, 0x0c, sd->colors);
1879 static void getcolors(struct gspca_dev *gspca_dev)
1883 /* this function is called at probe time */
1884 static int sd_config(struct gspca_dev *gspca_dev,
1885 const struct usb_device_id *id)
1887 struct sd *sd = (struct sd *) gspca_dev;
1890 cam = &gspca_dev->cam;
1892 cam->cam_mode = vga_mode;
1893 cam->nmodes = sizeof vga_mode / sizeof vga_mode[0];
1894 sd->subtype = id->driver_info;
1895 sd->brightness = sd_ctrls[MY_BRIGHTNESS].qctrl.default_value;
1896 sd->contrast = sd_ctrls[MY_CONTRAST].qctrl.default_value;
1897 sd->colors = sd_ctrls[MY_COLOR].qctrl.default_value;
1902 /* this function is called at probe and resume time */
1903 static int sd_init(struct gspca_dev *gspca_dev)
1905 struct sd *sd = (struct sd *) gspca_dev;
1907 switch (sd->subtype) {
1908 case Arowana300KCMOSCamera:
1909 case SmileIntlCamera:
1910 /* Arowana 300k CMOS Camera data */
1911 if (write_vector(gspca_dev, spca501c_arowana_init_data))
1914 case MystFromOriUnknownCamera:
1915 /* UnKnow Ori CMOS Camera data */
1916 if (write_vector(gspca_dev, spca501c_mysterious_open_data))
1920 /* generic spca501 init data */
1921 if (write_vector(gspca_dev, spca501_init_data))
1925 PDEBUG(D_STREAM, "Initializing SPCA501 finished");
1931 static int sd_start(struct gspca_dev *gspca_dev)
1933 struct sd *sd = (struct sd *) gspca_dev;
1934 struct usb_device *dev = gspca_dev->dev;
1937 switch (sd->subtype) {
1938 case ThreeComHomeConnectLite:
1939 /* Special handling for 3com data */
1940 write_vector(gspca_dev, spca501_3com_open_data);
1942 case Arowana300KCMOSCamera:
1943 case SmileIntlCamera:
1944 /* Arowana 300k CMOS Camera data */
1945 write_vector(gspca_dev, spca501c_arowana_open_data);
1947 case MystFromOriUnknownCamera:
1948 /* UnKnow CMOS Camera data */
1949 write_vector(gspca_dev, spca501c_mysterious_init_data);
1952 /* Generic 501 open data */
1953 write_vector(gspca_dev, spca501_open_data);
1956 /* memorize the wanted pixel format */
1957 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
1959 /* Enable ISO packet machine CTRL reg=2,
1960 * index=1 bitmask=0x2 (bit ordinal 1) */
1961 reg_write(dev, SPCA50X_REG_USB, 0x6, 0x94);
1963 case 0: /* 640x480 */
1964 reg_write(dev, SPCA50X_REG_USB, 0x07, 0x004a);
1966 case 1: /* 320x240 */
1967 reg_write(dev, SPCA50X_REG_USB, 0x07, 0x104a);
1970 /* case 2: * 160x120 */
1971 reg_write(dev, SPCA50X_REG_USB, 0x07, 0x204a);
1974 reg_write(dev, SPCA501_REG_CTLRL, 0x01, 0x02);
1976 /* HDG atleast the Intel CreateAndShare needs to have one of its
1977 * brightness / contrast / color set otherwise it assumes what seems
1978 * max contrast. Note that strange enough setting any of these is
1979 * enough to fix the max contrast problem, to be sure we set all 3 */
1980 setbrightness(gspca_dev);
1981 setcontrast(gspca_dev);
1982 setcolors(gspca_dev);
1986 static void sd_stopN(struct gspca_dev *gspca_dev)
1988 /* Disable ISO packet
1989 * machine CTRL reg=2, index=1 bitmask=0x0 (bit ordinal 1) */
1990 reg_write(gspca_dev->dev, SPCA501_REG_CTLRL, 0x01, 0x00);
1993 /* called on streamoff with alt 0 and on disconnect */
1994 static void sd_stop0(struct gspca_dev *gspca_dev)
1996 if (!gspca_dev->present)
1998 reg_write(gspca_dev->dev, SPCA501_REG_CTLRL, 0x05, 0x00);
2001 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2002 struct gspca_frame *frame, /* target */
2003 __u8 *data, /* isoc packet */
2004 int len) /* iso packet length */
2007 case 0: /* start of frame */
2008 frame = gspca_frame_add(gspca_dev,
2012 data += SPCA501_OFFSET_DATA;
2013 len -= SPCA501_OFFSET_DATA;
2014 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
2017 case 0xff: /* drop */
2018 /* gspca_dev->last_packet_type = DISCARD_PACKET; */
2023 gspca_frame_add(gspca_dev, INTER_PACKET, frame,
2027 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
2029 struct sd *sd = (struct sd *) gspca_dev;
2031 sd->brightness = val;
2032 if (gspca_dev->streaming)
2033 setbrightness(gspca_dev);
2037 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
2039 struct sd *sd = (struct sd *) gspca_dev;
2041 getbrightness(gspca_dev);
2042 *val = sd->brightness;
2046 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
2048 struct sd *sd = (struct sd *) gspca_dev;
2051 if (gspca_dev->streaming)
2052 setcontrast(gspca_dev);
2056 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
2058 struct sd *sd = (struct sd *) gspca_dev;
2060 getcontrast(gspca_dev);
2061 *val = sd->contrast;
2065 static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val)
2067 struct sd *sd = (struct sd *) gspca_dev;
2070 if (gspca_dev->streaming)
2071 setcolors(gspca_dev);
2075 static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val)
2077 struct sd *sd = (struct sd *) gspca_dev;
2079 getcolors(gspca_dev);
2084 /* sub-driver description */
2085 static const struct sd_desc sd_desc = {
2086 .name = MODULE_NAME,
2088 .nctrls = ARRAY_SIZE(sd_ctrls),
2089 .config = sd_config,
2094 .pkt_scan = sd_pkt_scan,
2097 /* -- module initialisation -- */
2098 static const __devinitdata struct usb_device_id device_table[] = {
2099 {USB_DEVICE(0x040a, 0x0002), .driver_info = KodakDVC325},
2100 {USB_DEVICE(0x0497, 0xc001), .driver_info = SmileIntlCamera},
2101 {USB_DEVICE(0x0506, 0x00df), .driver_info = ThreeComHomeConnectLite},
2102 {USB_DEVICE(0x0733, 0x0401), .driver_info = IntelCreateAndShare},
2103 {USB_DEVICE(0x0733, 0x0402), .driver_info = ViewQuestM318B},
2104 {USB_DEVICE(0x1776, 0x501c), .driver_info = Arowana300KCMOSCamera},
2105 {USB_DEVICE(0x0000, 0x0000), .driver_info = MystFromOriUnknownCamera},
2108 MODULE_DEVICE_TABLE(usb, device_table);
2110 /* -- device connect -- */
2111 static int sd_probe(struct usb_interface *intf,
2112 const struct usb_device_id *id)
2114 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
2118 static struct usb_driver sd_driver = {
2119 .name = MODULE_NAME,
2120 .id_table = device_table,
2122 .disconnect = gspca_disconnect,
2124 .suspend = gspca_suspend,
2125 .resume = gspca_resume,
2129 /* -- module insert / remove -- */
2130 static int __init sd_mod_init(void)
2132 if (usb_register(&sd_driver) < 0)
2134 PDEBUG(D_PROBE, "registered");
2137 static void __exit sd_mod_exit(void)
2139 usb_deregister(&sd_driver);
2140 PDEBUG(D_PROBE, "deregistered");
2143 module_init(sd_mod_init);
2144 module_exit(sd_mod_exit);