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