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