V4L/DVB (8191): gspca: Make CONFIG_VIDEO_ADV_DEBUG actually work.
[linux-2.6] / drivers / media / video / gspca / zc3xx.c
1 /*
2  *      Z-Star/Vimicro zc301/zc302p/vc30x library
3  *      Copyright (C) 2004 2005 2006 Michel Xhaard
4  *              mxhaard@magic.fr
5  *
6  * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22
23 #define MODULE_NAME "zc3xx"
24
25 #include "gspca.h"
26
27 #define DRIVER_VERSION_NUMBER   KERNEL_VERSION(2, 1, 0)
28 static const char version[] = "2.1.0";
29
30 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, "
31                 "Serge A. Suchkov <Serge.A.S@tochka.ru>");
32 MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
33 MODULE_LICENSE("GPL");
34
35 static int force_sensor = -1;
36
37 #include "jpeg.h"
38
39 /* specific webcam descriptor */
40 struct sd {
41         struct gspca_dev gspca_dev;     /* !! must be the first item */
42
43         __u8 brightness;
44         __u8 contrast;
45         __u8 gamma;
46         __u8 autogain;
47         __u8 lightfreq;
48         __u8 sharpness;
49
50         char qindex;
51         char sensor;                    /* Type of image sensor chip */
52 /* !! values used in different tables */
53 #define SENSOR_CS2102 0
54 #define SENSOR_CS2102K 1
55 #define SENSOR_GC0305 2
56 #define SENSOR_HDCS2020 3
57 #define SENSOR_HDCS2020b 4
58 #define SENSOR_HV7131B 5
59 #define SENSOR_HV7131C 6
60 #define SENSOR_ICM105A 7
61 #define SENSOR_MC501CB 8
62 #define SENSOR_OV7620 9
63 /*#define SENSOR_OV7648 9 - same values */
64 #define SENSOR_OV7630C 10
65 #define SENSOR_PAS106 11
66 #define SENSOR_PB0330 12
67 #define SENSOR_PO2030 13
68 #define SENSOR_TAS5130CK 14
69 #define SENSOR_TAS5130CXX 15
70 #define SENSOR_TAS5130C_VF0250 16
71 #define SENSOR_MAX 17
72         unsigned short chip_revision;
73 };
74
75 /* V4L2 controls supported by the driver */
76 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
77 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
78 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
79 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
80 static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
81 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
82 static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val);
83 static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val);
84 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
85 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
86 static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
87 static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
88
89 static struct ctrl sd_ctrls[] = {
90 #define SD_BRIGHTNESS 0
91         {
92             {
93                 .id      = V4L2_CID_BRIGHTNESS,
94                 .type    = V4L2_CTRL_TYPE_INTEGER,
95                 .name    = "Brightness",
96                 .minimum = 0,
97                 .maximum = 255,
98                 .step    = 1,
99                 .default_value = 128,
100             },
101             .set = sd_setbrightness,
102             .get = sd_getbrightness,
103         },
104 #define SD_CONTRAST 1
105         {
106             {
107                 .id      = V4L2_CID_CONTRAST,
108                 .type    = V4L2_CTRL_TYPE_INTEGER,
109                 .name    = "Contrast",
110                 .minimum = 0,
111                 .maximum = 256,
112                 .step    = 1,
113                 .default_value = 128,
114             },
115             .set = sd_setcontrast,
116             .get = sd_getcontrast,
117         },
118 #define SD_GAMMA 2
119         {
120             {
121                 .id      = V4L2_CID_GAMMA,
122                 .type    = V4L2_CTRL_TYPE_INTEGER,
123                 .name    = "Gamma",
124                 .minimum = 1,
125                 .maximum = 6,
126                 .step    = 1,
127                 .default_value = 4,
128             },
129             .set = sd_setgamma,
130             .get = sd_getgamma,
131         },
132 #define SD_AUTOGAIN 3
133         {
134             {
135                 .id      = V4L2_CID_AUTOGAIN,
136                 .type    = V4L2_CTRL_TYPE_BOOLEAN,
137                 .name    = "Auto Gain",
138                 .minimum = 0,
139                 .maximum = 1,
140                 .step    = 1,
141                 .default_value = 1,
142             },
143             .set = sd_setautogain,
144             .get = sd_getautogain,
145         },
146 #define SD_FREQ 4
147         {
148             {
149                 .id      = V4L2_CID_POWER_LINE_FREQUENCY,
150                 .type    = V4L2_CTRL_TYPE_MENU,
151                 .name    = "Light frequency filter",
152                 .minimum = 0,
153                 .maximum = 2,   /* 0: 0, 1: 50Hz, 2:60Hz */
154                 .step    = 1,
155                 .default_value = 1,
156             },
157             .set = sd_setfreq,
158             .get = sd_getfreq,
159         },
160 #define SD_SHARPNESS 5
161         {
162             {
163                 .id      = V4L2_CID_SHARPNESS,
164                 .type    = V4L2_CTRL_TYPE_INTEGER,
165                 .name    = "Sharpness",
166                 .minimum = 0,
167                 .maximum = 3,
168                 .step    = 1,
169                 .default_value = 2,
170             },
171             .set = sd_setsharpness,
172             .get = sd_getsharpness,
173         },
174 };
175
176 static struct cam_mode vga_mode[] = {
177         {V4L2_PIX_FMT_JPEG, 320, 240, 1},
178         {V4L2_PIX_FMT_JPEG, 640, 480, 0},
179 };
180
181 static struct cam_mode sif_mode[] = {
182         {V4L2_PIX_FMT_JPEG, 176, 144, 1},
183         {V4L2_PIX_FMT_JPEG, 352, 288, 0},
184 };
185
186 /* usb exchanges */
187 struct usb_action {
188         __u8    req;
189         __u8    val;
190         __u16   idx;
191 };
192
193 static struct usb_action cs2102_Initial[] = {
194         {0xa1, 0x01, 0x0008},
195         {0xa1, 0x01, 0x0008},
196         {0xa0, 0x01, 0x0000},
197         {0xa0, 0x10, 0x0002},
198         {0xa0, 0x00, 0x0010},
199         {0xa0, 0x01, 0x0001},
200         {0xa0, 0x20, 0x0080},
201         {0xa0, 0x21, 0x0081},
202         {0xa0, 0x30, 0x0083},
203         {0xa0, 0x31, 0x0084},
204         {0xa0, 0x32, 0x0085},
205         {0xa0, 0x23, 0x0086},
206         {0xa0, 0x24, 0x0087},
207         {0xa0, 0x25, 0x0088},
208         {0xa0, 0xb3, 0x008b},
209         {0xa0, 0x03, 0x0008},   /* 00 */
210         {0xa0, 0x03, 0x0012},
211         {0xa0, 0x01, 0x0012},
212         {0xa0, 0x02, 0x0003},
213         {0xa0, 0x80, 0x0004},
214         {0xa0, 0x01, 0x0005},
215         {0xa0, 0xe0, 0x0006},
216         {0xa0, 0x00, 0x0098},
217         {0xa0, 0x00, 0x009a},
218         {0xa0, 0x00, 0x011a},
219         {0xa0, 0x00, 0x011c},
220         {0xaa, 0x02, 0x0008},
221         {0xaa, 0x03, 0x0000},
222         {0xaa, 0x11, 0x0000},
223         {0xaa, 0x12, 0x0089},
224         {0xaa, 0x13, 0x0000},
225         {0xaa, 0x14, 0x00e9},
226         {0xaa, 0x20, 0x0000},
227         {0xaa, 0x22, 0x0000},
228         {0xaa, 0x0b, 0x0004},
229         {0xaa, 0x30, 0x0030},
230         {0xaa, 0x31, 0x0030},
231         {0xaa, 0x32, 0x0030},
232         {0xa0, 0x37, 0x0101},
233         {0xa0, 0x00, 0x0019},
234         {0xa0, 0x05, 0x0012},
235         {0xa0, 0x0d, 0x0100},
236         {0xa0, 0x06, 0x0189},
237         {0xa0, 0x03, 0x01c5},
238         {0xa0, 0x13, 0x01cb},
239         {0xa0, 0x10, 0x01ae},
240         {0xa0, 0x08, 0x0250},
241         {0xa0, 0x08, 0x0301},
242         {0xa0, 0x68, 0x018d},
243         {0xa0, 0x00, 0x01ad},
244         {0xa1, 0x01, 0x0002},
245         {0xa1, 0x01, 0x0008},
246         {0xa0, 0x03, 0x0008},   /* 00 */
247         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
248         {0xa1, 0x01, 0x01c8},
249         {0xa1, 0x01, 0x01c9},
250         {0xa1, 0x01, 0x01ca},
251         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
252         {0xa0, 0x24, 0x0120},   /* gamma 5 */
253         {0xa0, 0x44, 0x0121},
254         {0xa0, 0x64, 0x0122},
255         {0xa0, 0x84, 0x0123},
256         {0xa0, 0x9d, 0x0124},
257         {0xa0, 0xb2, 0x0125},
258         {0xa0, 0xc4, 0x0126},
259         {0xa0, 0xd3, 0x0127},
260         {0xa0, 0xe0, 0x0128},
261         {0xa0, 0xeb, 0x0129},
262         {0xa0, 0xf4, 0x012a},
263         {0xa0, 0xfb, 0x012b},
264         {0xa0, 0xff, 0x012c},
265         {0xa0, 0xff, 0x012d},
266         {0xa0, 0xff, 0x012e},
267         {0xa0, 0xff, 0x012f},
268         {0xa0, 0x18, 0x0130},
269         {0xa0, 0x20, 0x0131},
270         {0xa0, 0x20, 0x0132},
271         {0xa0, 0x1c, 0x0133},
272         {0xa0, 0x16, 0x0134},
273         {0xa0, 0x13, 0x0135},
274         {0xa0, 0x10, 0x0136},
275         {0xa0, 0x0e, 0x0137},
276         {0xa0, 0x0b, 0x0138},
277         {0xa0, 0x09, 0x0139},
278         {0xa0, 0x07, 0x013a},
279         {0xa0, 0x06, 0x013b},
280         {0xa0, 0x00, 0x013c},
281         {0xa0, 0x00, 0x013d},
282         {0xa0, 0x00, 0x013e},
283         {0xa0, 0x01, 0x013f},
284         {0xa0, 0x58, 0x010a},   /* matrix */
285         {0xa0, 0xf4, 0x010b},
286         {0xa0, 0xf4, 0x010c},
287         {0xa0, 0xf4, 0x010d},
288         {0xa0, 0x58, 0x010e},
289         {0xa0, 0xf4, 0x010f},
290         {0xa0, 0xf4, 0x0110},
291         {0xa0, 0xf4, 0x0111},
292         {0xa0, 0x58, 0x0112},
293         {0xa1, 0x01, 0x0180},
294         {0xa0, 0x00, 0x0180},
295         {0xa0, 0x00, 0x0019},
296         {0xaa, 0x23, 0x0001},
297         {0xaa, 0x24, 0x0055},
298         {0xaa, 0x25, 0x00cc},
299         {0xaa, 0x21, 0x003f},
300         {0xa0, 0x02, 0x0190},
301         {0xa0, 0xab, 0x0191},
302         {0xa0, 0x98, 0x0192},
303         {0xa0, 0x00, 0x0195},
304         {0xa0, 0x30, 0x0196},
305         {0xa0, 0xd4, 0x0197},
306         {0xa0, 0x10, 0x018c},
307         {0xa0, 0x20, 0x018f},
308         {0xa0, 0x10, 0x01a9},
309         {0xa0, 0x24, 0x01aa},
310         {0xa0, 0x39, 0x001d},
311         {0xa0, 0x70, 0x001e},
312         {0xa0, 0xb0, 0x001f},
313         {0xa0, 0xff, 0x0020},
314         {0xa0, 0x40, 0x0180},
315         {0xa1, 0x01, 0x0180},
316         {0xa0, 0x42, 0x0180},
317         {0xa0, 0x40, 0x0116},
318         {0xa0, 0x40, 0x0117},
319         {0xa0, 0x40, 0x0118},
320         {}
321 };
322
323 static struct usb_action cs2102_InitialScale[] = {
324         {0xa1, 0x01, 0x0008},
325         {0xa1, 0x01, 0x0008},
326         {0xa0, 0x01, 0x0000},
327         {0xa0, 0x00, 0x0002},
328         {0xa0, 0x00, 0x0010},
329         {0xa0, 0x01, 0x0001},
330         {0xa0, 0x20, 0x0080},
331         {0xa0, 0x21, 0x0081},
332         {0xa0, 0x30, 0x0083},
333         {0xa0, 0x31, 0x0084},
334         {0xa0, 0x32, 0x0085},
335         {0xa0, 0x23, 0x0086},
336         {0xa0, 0x24, 0x0087},
337         {0xa0, 0x25, 0x0088},
338         {0xa0, 0xb3, 0x008b},
339         {0xa0, 0x03, 0x0008},   /* 00 */
340         {0xa0, 0x03, 0x0012},
341         {0xa0, 0x01, 0x0012},
342         {0xa0, 0x02, 0x0003},
343         {0xa0, 0x80, 0x0004},
344         {0xa0, 0x01, 0x0005},
345         {0xa0, 0xe0, 0x0006},
346         {0xa0, 0x00, 0x0098},
347         {0xa0, 0x00, 0x009a},
348         {0xa0, 0x00, 0x011a},
349         {0xa0, 0x00, 0x011c},
350         {0xaa, 0x02, 0x0008},
351         {0xaa, 0x03, 0x0000},
352         {0xaa, 0x11, 0x0001},
353         {0xaa, 0x12, 0x0087},
354         {0xaa, 0x13, 0x0001},
355         {0xaa, 0x14, 0x00e7},
356         {0xaa, 0x20, 0x0000},
357         {0xaa, 0x22, 0x0000},
358         {0xaa, 0x0b, 0x0004},
359         {0xaa, 0x30, 0x0030},
360         {0xaa, 0x31, 0x0030},
361         {0xaa, 0x32, 0x0030},
362         {0xa0, 0x77, 0x0101},
363         {0xa0, 0x00, 0x0019},
364         {0xa0, 0x05, 0x0012},
365         {0xa0, 0x0d, 0x0100},
366         {0xa0, 0x06, 0x0189},
367         {0xa0, 0x03, 0x01c5},
368         {0xa0, 0x13, 0x01cb},
369         {0xa0, 0x15, 0x01ae},
370         {0xa0, 0x08, 0x0250},
371         {0xa0, 0x08, 0x0301},
372         {0xa0, 0x68, 0x018d},
373         {0xa0, 0x00, 0x01ad},
374         {0xa1, 0x01, 0x0002},
375         {0xa1, 0x01, 0x0008},
376         {0xa0, 0x03, 0x0008},   /* 00 */
377         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
378         {0xa1, 0x01, 0x01c8},
379         {0xa1, 0x01, 0x01c9},
380         {0xa1, 0x01, 0x01ca},
381         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
382         {0xa0, 0x24, 0x0120},   /* gamma 5 */
383         {0xa0, 0x44, 0x0121},
384         {0xa0, 0x64, 0x0122},
385         {0xa0, 0x84, 0x0123},
386         {0xa0, 0x9d, 0x0124},
387         {0xa0, 0xb2, 0x0125},
388         {0xa0, 0xc4, 0x0126},
389         {0xa0, 0xd3, 0x0127},
390         {0xa0, 0xe0, 0x0128},
391         {0xa0, 0xeb, 0x0129},
392         {0xa0, 0xf4, 0x012a},
393         {0xa0, 0xfb, 0x012b},
394         {0xa0, 0xff, 0x012c},
395         {0xa0, 0xff, 0x012d},
396         {0xa0, 0xff, 0x012e},
397         {0xa0, 0xff, 0x012f},
398         {0xa0, 0x18, 0x0130},
399         {0xa0, 0x20, 0x0131},
400         {0xa0, 0x20, 0x0132},
401         {0xa0, 0x1c, 0x0133},
402         {0xa0, 0x16, 0x0134},
403         {0xa0, 0x13, 0x0135},
404         {0xa0, 0x10, 0x0136},
405         {0xa0, 0x0e, 0x0137},
406         {0xa0, 0x0b, 0x0138},
407         {0xa0, 0x09, 0x0139},
408         {0xa0, 0x07, 0x013a},
409         {0xa0, 0x06, 0x013b},
410         {0xa0, 0x00, 0x013c},
411         {0xa0, 0x00, 0x013d},
412         {0xa0, 0x00, 0x013e},
413         {0xa0, 0x01, 0x013f},
414         {0xa0, 0x58, 0x010a},   /* matrix */
415         {0xa0, 0xf4, 0x010b},
416         {0xa0, 0xf4, 0x010c},
417         {0xa0, 0xf4, 0x010d},
418         {0xa0, 0x58, 0x010e},
419         {0xa0, 0xf4, 0x010f},
420         {0xa0, 0xf4, 0x0110},
421         {0xa0, 0xf4, 0x0111},
422         {0xa0, 0x58, 0x0112},
423         {0xa1, 0x01, 0x0180},
424         {0xa0, 0x00, 0x0180},
425         {0xa0, 0x00, 0x0019},
426         {0xaa, 0x23, 0x0000},
427         {0xaa, 0x24, 0x00aa},
428         {0xaa, 0x25, 0x00e6},
429         {0xaa, 0x21, 0x003f},
430         {0xa0, 0x01, 0x0190},
431         {0xa0, 0x55, 0x0191},
432         {0xa0, 0xcc, 0x0192},
433         {0xa0, 0x00, 0x0195},
434         {0xa0, 0x18, 0x0196},
435         {0xa0, 0x6a, 0x0197},
436         {0xa0, 0x10, 0x018c},
437         {0xa0, 0x20, 0x018f},
438         {0xa0, 0x10, 0x01a9},
439         {0xa0, 0x24, 0x01aa},
440         {0xa0, 0x3f, 0x001d},
441         {0xa0, 0xa5, 0x001e},
442         {0xa0, 0xf0, 0x001f},
443         {0xa0, 0xff, 0x0020},
444         {0xa0, 0x40, 0x0180},
445         {0xa1, 0x01, 0x0180},
446         {0xa0, 0x42, 0x0180},
447         {0xa0, 0x40, 0x0116},
448         {0xa0, 0x40, 0x0117},
449         {0xa0, 0x40, 0x0118},
450         {}
451 };
452 static struct usb_action cs2102_50HZ[] = {
453         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
454         {0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */
455         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
456         {0xaa, 0x04, 0x00ac}, /* 00,04,ac,aa */
457         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
458         {0xaa, 0x11, 0x00ac}, /* 00,11,ac,aa */
459         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
460         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
461         {0xaa, 0x1d, 0x00ac}, /* 00,1d,ac,aa */
462         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
463         {0xa0, 0x3f, 0x0191}, /* 01,91,3f,cc */
464         {0xa0, 0xf0, 0x0192}, /* 01,92,f0,cc */
465         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
466         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
467         {0xa0, 0x42, 0x0197}, /* 01,97,42,cc */
468         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
469         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
470         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
471         {0xa0, 0x24, 0x01aa}, /* 01,aa,24,cc */
472         {0xa0, 0x8c, 0x001d}, /* 00,1d,8c,cc */
473         {0xa0, 0xb0, 0x001e}, /* 00,1e,b0,cc */
474         {0xa0, 0xd0, 0x001f}, /* 00,1f,d0,cc */
475         {}
476 };
477 static struct usb_action cs2102_50HZScale[] = {
478         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
479         {0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */
480         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
481         {0xaa, 0x04, 0x00a1}, /* 00,04,a1,aa */
482         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
483         {0xaa, 0x11, 0x00a1}, /* 00,11,a1,aa */
484         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
485         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
486         {0xaa, 0x1d, 0x00a1}, /* 00,1d,a1,aa */
487         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
488         {0xa0, 0x3f, 0x0191}, /* 01,91,3f,cc */
489         {0xa0, 0xf7, 0x0192}, /* 01,92,f7,cc */
490         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
491         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
492         {0xa0, 0x83, 0x0197}, /* 01,97,83,cc */
493         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
494         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
495         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
496         {0xa0, 0x24, 0x01aa}, /* 01,aa,24,cc */
497         {0xa0, 0x93, 0x001d}, /* 00,1d,93,cc */
498         {0xa0, 0xb0, 0x001e}, /* 00,1e,b0,cc */
499         {0xa0, 0xd0, 0x001f}, /* 00,1f,d0,cc */
500         {}
501 };
502 static struct usb_action cs2102_60HZ[] = {
503         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
504         {0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */
505         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
506         {0xaa, 0x04, 0x00aa}, /* 00,04,aa,aa */
507         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
508         {0xaa, 0x11, 0x00aa}, /* 00,11,aa,aa */
509         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
510         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
511         {0xaa, 0x1d, 0x00aa}, /* 00,1d,aa,aa */
512         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
513         {0xa0, 0x3f, 0x0191}, /* 01,91,3f,cc */
514         {0xa0, 0xe4, 0x0192}, /* 01,92,e4,cc */
515         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
516         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
517         {0xa0, 0x3a, 0x0197}, /* 01,97,3a,cc */
518         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
519         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
520         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
521         {0xa0, 0x24, 0x01aa}, /* 01,aa,24,cc */
522         {0xa0, 0x5d, 0x001d}, /* 00,1d,5d,cc */
523         {0xa0, 0x90, 0x001e}, /* 00,1e,90,cc */
524         {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */
525         {}
526 };
527 static struct usb_action cs2102_60HZScale[] = {
528         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
529         {0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */
530         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
531         {0xaa, 0x04, 0x00be}, /* 00,04,be,aa */
532         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
533         {0xaa, 0x11, 0x00be}, /* 00,11,be,aa */
534         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
535         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
536         {0xaa, 0x1d, 0x00be}, /* 00,1d,be,aa */
537         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
538         {0xa0, 0x3f, 0x0191}, /* 01,91,3f,cc */
539         {0xa0, 0xfc, 0x0192}, /* 01,92,fc,cc */
540         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
541         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
542         {0xa0, 0x69, 0x0197}, /* 01,97,69,cc */
543         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
544         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
545         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
546         {0xa0, 0x24, 0x01aa}, /* 01,aa,24,cc */
547         {0xa0, 0xb7, 0x001d}, /* 00,1d,b7,cc */
548         {0xa0, 0xd0, 0x001e}, /* 00,1e,d0,cc */
549         {0xa0, 0xe8, 0x001f}, /* 00,1f,e8,cc */
550         {}
551 };
552 static struct usb_action cs2102_NoFliker[] = {
553         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
554         {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
555         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
556         {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
557         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
558         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
559         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
560         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
561         {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
562         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
563         {0xa0, 0x3f, 0x0191}, /* 01,91,3f,cc */
564         {0xa0, 0xf0, 0x0192}, /* 01,92,f0,cc */
565         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
566         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
567         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
568         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
569         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
570         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
571         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
572         {0xa0, 0x59, 0x001d}, /* 00,1d,59,cc */
573         {0xa0, 0x90, 0x001e}, /* 00,1e,90,cc */
574         {0xa0, 0xc8, 0x001f}, /* 00,1f,c8,cc */
575         {}
576 };
577 static struct usb_action cs2102_NoFlikerScale[] = {
578         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
579         {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
580         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
581         {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
582         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
583         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
584         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
585         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
586         {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
587         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
588         {0xa0, 0x3f, 0x0191}, /* 01,91,3f,cc */
589         {0xa0, 0xf0, 0x0192}, /* 01,92,f0,cc */
590         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
591         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
592         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
593         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
594         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
595         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
596         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
597         {0xa0, 0x59, 0x001d}, /* 00,1d,59,cc */
598         {0xa0, 0x90, 0x001e}, /* 00,1e,90,cc */
599         {0xa0, 0xc8, 0x001f}, /* 00,1f,c8,cc */
600         {}
601 };
602
603 /* CS2102_KOCOM */
604 static struct usb_action cs2102K_Initial[] = {
605         {0xa0, 0x11, 0x0002},
606         {0xa0, 0x03, 0x0008},
607         {0xa0, 0x08, 0x0010},
608         {0xa0, 0x02, 0x0003},
609         {0xa0, 0x80, 0x0004},
610         {0xa0, 0x01, 0x0005},
611         {0xa0, 0xe0, 0x0006},
612         {0xa0, 0x01, 0x0001},
613         {0xa0, 0x03, 0x0012},
614         {0xa0, 0x01, 0x0012},
615         {0xa0, 0x00, 0x0098},
616         {0xa0, 0x00, 0x009a},
617         {0xa0, 0x00, 0x011a},
618         {0xa0, 0x00, 0x011c},
619         {0xa0, 0xe8, 0x009c},
620         {0xa0, 0x88, 0x009e},
621         {0xa0, 0x55, 0x008b},
622         {0xa0, 0x18, 0x0092},
623         {0xa0, 0x00, 0x0093},
624         {0xa0, 0x00, 0x0094},
625         {0xa0, 0x01, 0x0090},
626         {0xa0, 0x0a, 0x0092},
627         {0xa0, 0x02, 0x0093},
628         {0xa0, 0x00, 0x0094},
629         {0xa0, 0x01, 0x0090},
630         {0xa0, 0x0b, 0x0092},
631         {0xa0, 0x02, 0x0093},
632         {0xa0, 0x00, 0x0094},
633         {0xa0, 0x01, 0x0090},
634         {0xa0, 0x0c, 0x0092},
635         {0xa0, 0x7c, 0x0093},
636         {0xa0, 0x00, 0x0094},
637         {0xa0, 0x01, 0x0090},
638         {0xa0, 0x0d, 0x0092},
639         {0xa0, 0xa3, 0x0093},
640         {0xa0, 0x00, 0x0094},
641         {0xa0, 0x01, 0x0090},
642         {0xa0, 0x03, 0x0092},
643         {0xa0, 0xfb, 0x0093},
644         {0xa0, 0x00, 0x0094},
645         {0xa0, 0x01, 0x0090},
646         {0xa0, 0x05, 0x0092},
647         {0xa0, 0x00, 0x0093},
648         {0xa0, 0x00, 0x0094},
649         {0xa0, 0x01, 0x0090},
650         {0xa0, 0x06, 0x0092},
651         {0xa0, 0x03, 0x0093},
652         {0xa0, 0x00, 0x0094},
653         {0xa0, 0x01, 0x0090},
654         {0xa0, 0x09, 0x0092},
655         {0xa0, 0x08, 0x0093},
656         {0xa0, 0x00, 0x0094},
657         {0xa0, 0x01, 0x0090},
658         {0xa0, 0x0e, 0x0092},
659         {0xa0, 0x04, 0x0093},
660         {0xa0, 0x00, 0x0094},
661         {0xa0, 0x01, 0x0090},
662         {0xa0, 0x0f, 0x0092},
663         {0xa0, 0x18, 0x0093},
664         {0xa0, 0x00, 0x0094},
665         {0xa0, 0x01, 0x0090},
666         {0xa0, 0x10, 0x0092},
667         {0xa0, 0x18, 0x0093},
668         {0xa0, 0x00, 0x0094},
669         {0xa0, 0x01, 0x0090},
670         {0xa0, 0x11, 0x0092},
671         {0xa0, 0x18, 0x0093},
672         {0xa0, 0x00, 0x0094},
673         {0xa0, 0x01, 0x0090},
674         {0xa0, 0x12, 0x0092},
675         {0xa0, 0x18, 0x0093},
676         {0xa0, 0x00, 0x0094},
677         {0xa0, 0x01, 0x0090},
678         {0xa0, 0x15, 0x0092},
679         {0xa0, 0x00, 0x0093},
680         {0xa0, 0x00, 0x0094},
681         {0xa0, 0x01, 0x0090},
682         {0xa0, 0x16, 0x0092},
683         {0xa0, 0x0c, 0x0093},
684         {0xa0, 0x00, 0x0094},
685         {0xa0, 0x01, 0x0090},
686         {0xa0, 0x17, 0x0092},
687         {0xa0, 0x0c, 0x0093},
688         {0xa0, 0x00, 0x0094},
689         {0xa0, 0x01, 0x0090},
690         {0xa0, 0x18, 0x0092},
691         {0xa0, 0x04, 0x0093},
692         {0xa0, 0x00, 0x0094},
693         {0xa0, 0x01, 0x0090},
694         {0xa0, 0xb7, 0x0101},
695         {0xa0, 0x05, 0x0012},
696         {0xa0, 0x78, 0x018d},
697         {0xa0, 0x0d, 0x0100},
698         {0xa0, 0x06, 0x0189},
699         {0xa0, 0x03, 0x01c5},
700         {0xa0, 0x13, 0x01cb},
701         {0xa0, 0x20, 0x0087},
702         {0xa0, 0x21, 0x0088},
703         {0xa0, 0x08, 0x0250},
704         {0xa0, 0x08, 0x0301},
705         {0xa0, 0x00, 0x01ad},
706         {0xa0, 0x01, 0x01b1},
707         {0xa0, 0x02, 0x0180},
708         {0xa0, 0x60, 0x0116},
709         {0xa0, 0x40, 0x0117},
710         {0xa0, 0x4c, 0x0118},
711         {0xa0, 0x03, 0x0008},   /* clock ? */
712         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
713         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
714         {0xa0, 0x13, 0x0120},   /* gamma 4 */
715         {0xa0, 0x38, 0x0121},
716         {0xa0, 0x59, 0x0122},
717         {0xa0, 0x79, 0x0123},
718         {0xa0, 0x92, 0x0124},
719         {0xa0, 0xa7, 0x0125},
720         {0xa0, 0xb9, 0x0126},
721         {0xa0, 0xc8, 0x0127},
722         {0xa0, 0xd4, 0x0128},
723         {0xa0, 0xdf, 0x0129},
724         {0xa0, 0xe7, 0x012a},
725         {0xa0, 0xee, 0x012b},
726         {0xa0, 0xf4, 0x012c},
727         {0xa0, 0xf9, 0x012d},
728         {0xa0, 0xfc, 0x012e},
729         {0xa0, 0xff, 0x012f},
730         {0xa0, 0x26, 0x0130},
731         {0xa0, 0x22, 0x0131},
732         {0xa0, 0x20, 0x0132},
733         {0xa0, 0x1c, 0x0133},
734         {0xa0, 0x16, 0x0134},
735         {0xa0, 0x13, 0x0135},
736         {0xa0, 0x10, 0x0136},
737         {0xa0, 0x0d, 0x0137},
738         {0xa0, 0x0b, 0x0138},
739         {0xa0, 0x09, 0x0139},
740         {0xa0, 0x07, 0x013a},
741         {0xa0, 0x06, 0x013b},
742         {0xa0, 0x05, 0x013c},
743         {0xa0, 0x04, 0x013d},
744         {0xa0, 0x03, 0x013e},
745         {0xa0, 0x02, 0x013f},
746         {0xa0, 0x58, 0x010a},   /* matrix */
747         {0xa0, 0xf4, 0x010b},
748         {0xa0, 0xf4, 0x010c},
749         {0xa0, 0xf4, 0x010d},
750         {0xa0, 0x58, 0x010e},
751         {0xa0, 0xf4, 0x010f},
752         {0xa0, 0xf4, 0x0110},
753         {0xa0, 0xf4, 0x0111},
754         {0xa0, 0x58, 0x0112},
755         {0xa0, 0x00, 0x0180},
756         {0xa0, 0x00, 0x0019},
757         {0xa0, 0x18, 0x0092},
758         {0xa0, 0x00, 0x0093},
759         {0xa0, 0x00, 0x0094},
760         {0xa0, 0x01, 0x0090},
761         {0xa0, 0x13, 0x0092},
762         {0xa0, 0x22, 0x0093},
763         {0xa0, 0x00, 0x0094},
764         {0xa0, 0x01, 0x0090},
765         {0xa0, 0x14, 0x0092},
766         {0xa0, 0x01, 0x0093},
767         {0xa0, 0x00, 0x0094},
768         {0xa0, 0x01, 0x0090},
769         {0xa0, 0x20, 0x0092},
770         {0xa0, 0x01, 0x0093},
771         {0xa0, 0x00, 0x0094},
772         {0xa0, 0x01, 0x0090},
773         {0xa0, 0x21, 0x0092},
774         {0xa0, 0x22, 0x0093},
775         {0xa0, 0x00, 0x0094},
776         {0xa0, 0x01, 0x0090},
777         {0xa0, 0x18, 0x0092},
778         {0xa0, 0x04, 0x0093},
779         {0xa0, 0x00, 0x0094},
780         {0xa0, 0x01, 0x0090},
781         {0xa0, 0x01, 0x00a3},
782         {0xa0, 0x22, 0x00a4},
783         {0xa0, 0x00, 0x0190},
784         {0xa0, 0x07, 0x0191},
785         {0xa0, 0xee, 0x0192},
786         {0xa0, 0x00, 0x0195},
787         {0xa0, 0x00, 0x0196},
788         {0xa0, 0x3a, 0x0197},
789         {0xa0, 0x10, 0x018c},
790         {0xa0, 0x20, 0x018f},
791         {0xa0, 0x0c, 0x01a9},
792         {0xa0, 0x28, 0x01aa},
793         {0xa0, 0x04, 0x001d},
794         {0xa0, 0x0f, 0x001e},
795         {0xa0, 0x19, 0x001f},
796         {0xa0, 0x1f, 0x0020},
797         {0xa0, 0x60, 0x011d},
798         {0xa0, 0x60, 0x011d},
799         {0xa0, 0x42, 0x0180},
800         {0xa0, 0x42, 0x0180},
801         {0xa0, 0x60, 0x0116},
802         {0xa0, 0x40, 0x0117},
803         {0xa0, 0x4c, 0x0118},
804         {0xa0, 0x04, 0x01a7},
805         {0xa0, 0x20, 0x0092},
806         {0xa0, 0x01, 0x0093},
807         {0xa0, 0x00, 0x0094},
808         {0xa0, 0x01, 0x0090},
809         {0xa0, 0x21, 0x0092},
810         {0xa0, 0x5c, 0x0093},
811         {0xa0, 0x00, 0x0094},
812         {0xa0, 0x01, 0x0090},
813         {0xa0, 0x18, 0x0092},
814         {0xa0, 0x00, 0x0093},
815         {0xa0, 0x00, 0x0094},
816         {0xa0, 0x01, 0x0090},
817         {0xa0, 0x13, 0x0092},
818         {0xa0, 0x5c, 0x0093},
819         {0xa0, 0x00, 0x0094},
820         {0xa0, 0x01, 0x0090},
821         {0xa0, 0x14, 0x0092},
822         {0xa0, 0x01, 0x0093},
823         {0xa0, 0x00, 0x0094},
824         {0xa0, 0x01, 0x0090},
825         {0xa0, 0x18, 0x0092},
826         {0xa0, 0x04, 0x0093},
827         {0xa0, 0x00, 0x0094},
828         {0xa0, 0x01, 0x0090},
829         {0xa0, 0x00, 0x01a7},
830         {0xa0, 0x04, 0x01a7},
831         {0xa0, 0x00, 0x01a7},
832         {0xa0, 0x04, 0x01a7},
833         {0xa0, 0x20, 0x0092},
834         {0xa0, 0x01, 0x0093},
835         {0xa0, 0x00, 0x0094},
836         {0xa0, 0x01, 0x0090},
837         {0xa0, 0x21, 0x0092},
838         {0xa0, 0x96, 0x0093},
839         {0xa0, 0x00, 0x0094},
840         {0xa0, 0x01, 0x0090},
841         {0xa0, 0x18, 0x0092},
842         {0xa0, 0x00, 0x0093},
843         {0xa0, 0x00, 0x0094},
844         {0xa0, 0x01, 0x0090},
845         {0xa0, 0x13, 0x0092},
846         {0xa0, 0x96, 0x0093},
847         {0xa0, 0x00, 0x0094},
848         {0xa0, 0x01, 0x0090},
849         {0xa0, 0x14, 0x0092},
850         {0xa0, 0x01, 0x0093},
851         {0xa0, 0x00, 0x0094},
852         {0xa0, 0x01, 0x0090},
853         {0xa0, 0x18, 0x0092},
854         {0xa0, 0x04, 0x0093},
855         {0xa0, 0x00, 0x0094},
856         {0xa0, 0x01, 0x0090},
857         {0xa0, 0x00, 0x01a7},
858         {0xa0, 0x04, 0x01a7},
859         {0xa0, 0x00, 0x01a7},
860         {}
861 };
862
863 static struct usb_action cs2102K_InitialScale[] = {
864         {0xa0, 0x11, 0x0002},
865         {0xa0, 0x00, 0x0002},
866         {0xa0, 0x03, 0x0008},
867         {0xa0, 0x08, 0x0010},
868         {0xa0, 0x02, 0x0003},
869         {0xa0, 0x80, 0x0004},
870         {0xa0, 0x01, 0x0005},
871         {0xa0, 0xe0, 0x0006},
872         {0xa0, 0x01, 0x0001},
873         {0xa0, 0x03, 0x0012},
874         {0xa0, 0x01, 0x0012},
875         {0xa0, 0x00, 0x0098},
876         {0xa0, 0x00, 0x009a},
877         {0xa0, 0x00, 0x011a},
878         {0xa0, 0x00, 0x011c},
879         {0xa0, 0xe8, 0x009c},
880         {0xa0, 0x88, 0x009e},
881         {0xa0, 0x55, 0x008b},
882         {0xa0, 0x18, 0x0092},
883         {0xa0, 0x00, 0x0093},
884         {0xa0, 0x00, 0x0094},
885         {0xa0, 0x01, 0x0090},
886         {0xa0, 0x0a, 0x0092},
887         {0xa0, 0x02, 0x0093},
888         {0xa0, 0x00, 0x0094},
889         {0xa0, 0x01, 0x0090},
890         {0xa0, 0x0b, 0x0092},
891         {0xa0, 0x02, 0x0093},
892         {0xa0, 0x00, 0x0094},
893         {0xa0, 0x01, 0x0090},
894         {0xa0, 0x0c, 0x0092},
895         {0xa0, 0x7b, 0x0093},
896         {0xa0, 0x00, 0x0094},
897         {0xa0, 0x01, 0x0090},
898         {0xa0, 0x0d, 0x0092},
899         {0xa0, 0xa3, 0x0093},
900         {0xa0, 0x00, 0x0094},
901         {0xa0, 0x01, 0x0090},
902         {0xa0, 0x03, 0x0092},
903         {0xa0, 0xfb, 0x0093},
904         {0xa0, 0x00, 0x0094},
905         {0xa0, 0x01, 0x0090},
906         {0xa0, 0x05, 0x0092},
907         {0xa0, 0x00, 0x0093},
908         {0xa0, 0x00, 0x0094},
909         {0xa0, 0x01, 0x0090},
910         {0xa0, 0x06, 0x0092},
911         {0xa0, 0x03, 0x0093},
912         {0xa0, 0x00, 0x0094},
913         {0xa0, 0x01, 0x0090},
914         {0xa0, 0x09, 0x0092},
915         {0xa0, 0x08, 0x0093},
916         {0xa0, 0x00, 0x0094},
917         {0xa0, 0x01, 0x0090},
918         {0xa0, 0x0e, 0x0092},
919         {0xa0, 0x04, 0x0093},
920         {0xa0, 0x00, 0x0094},
921         {0xa0, 0x01, 0x0090},
922         {0xa0, 0x0f, 0x0092},
923         {0xa0, 0x18, 0x0093},
924         {0xa0, 0x00, 0x0094},
925         {0xa0, 0x01, 0x0090},
926         {0xa0, 0x10, 0x0092},
927         {0xa0, 0x18, 0x0093},
928         {0xa0, 0x00, 0x0094},
929         {0xa0, 0x01, 0x0090},
930         {0xa0, 0x11, 0x0092},
931         {0xa0, 0x18, 0x0093},
932         {0xa0, 0x00, 0x0094},
933         {0xa0, 0x01, 0x0090},
934         {0xa0, 0x12, 0x0092},
935         {0xa0, 0x18, 0x0093},
936         {0xa0, 0x00, 0x0094},
937         {0xa0, 0x01, 0x0090},
938         {0xa0, 0x15, 0x0092},
939         {0xa0, 0x00, 0x0093},
940         {0xa0, 0x00, 0x0094},
941         {0xa0, 0x01, 0x0090},
942         {0xa0, 0x16, 0x0092},
943         {0xa0, 0x0c, 0x0093},
944         {0xa0, 0x00, 0x0094},
945         {0xa0, 0x01, 0x0090},
946         {0xa0, 0x17, 0x0092},
947         {0xa0, 0x0c, 0x0093},
948         {0xa0, 0x00, 0x0094},
949         {0xa0, 0x01, 0x0090},
950         {0xa0, 0x18, 0x0092},
951         {0xa0, 0x04, 0x0093},
952         {0xa0, 0x00, 0x0094},
953         {0xa0, 0x01, 0x0090},
954         {0xa0, 0xf7, 0x0101},
955         {0xa0, 0x05, 0x0012},
956         {0xa0, 0x78, 0x018d},
957         {0xa0, 0x0d, 0x0100},
958         {0xa0, 0x06, 0x0189},
959         {0xa0, 0x03, 0x01c5},
960         {0xa0, 0x13, 0x01cb},
961         {0xa0, 0x20, 0x0087},
962         {0xa0, 0x21, 0x0088},
963         {0xa0, 0x08, 0x0250},
964         {0xa0, 0x08, 0x0301},
965         {0xa0, 0x00, 0x01ad},
966         {0xa0, 0x01, 0x01b1},
967         {0xa0, 0x02, 0x0180},
968         {0xa0, 0x60, 0x0116},
969         {0xa0, 0x40, 0x0117},
970         {0xa0, 0x4c, 0x0118},
971         {0xa0, 0x03, 0x0008},   /* clock ? */
972         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
973         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
974         {0xa0, 0x13, 0x0120},   /* gamma 4 */
975         {0xa0, 0x38, 0x0121},
976         {0xa0, 0x59, 0x0122},
977         {0xa0, 0x79, 0x0123},
978         {0xa0, 0x92, 0x0124},
979         {0xa0, 0xa7, 0x0125},
980         {0xa0, 0xb9, 0x0126},
981         {0xa0, 0xc8, 0x0127},
982         {0xa0, 0xd4, 0x0128},
983         {0xa0, 0xdf, 0x0129},
984         {0xa0, 0xe7, 0x012a},
985         {0xa0, 0xee, 0x012b},
986         {0xa0, 0xf4, 0x012c},
987         {0xa0, 0xf9, 0x012d},
988         {0xa0, 0xfc, 0x012e},
989         {0xa0, 0xff, 0x012f},
990         {0xa0, 0x26, 0x0130},
991         {0xa0, 0x22, 0x0131},
992         {0xa0, 0x20, 0x0132},
993         {0xa0, 0x1c, 0x0133},
994         {0xa0, 0x16, 0x0134},
995         {0xa0, 0x13, 0x0135},
996         {0xa0, 0x10, 0x0136},
997         {0xa0, 0x0d, 0x0137},
998         {0xa0, 0x0b, 0x0138},
999         {0xa0, 0x09, 0x0139},
1000         {0xa0, 0x07, 0x013a},
1001         {0xa0, 0x06, 0x013b},
1002         {0xa0, 0x05, 0x013c},
1003         {0xa0, 0x04, 0x013d},
1004         {0xa0, 0x03, 0x013e},
1005         {0xa0, 0x02, 0x013f},
1006         {0xa0, 0x58, 0x010a},   /* matrix */
1007         {0xa0, 0xf4, 0x010b},
1008         {0xa0, 0xf4, 0x010c},
1009         {0xa0, 0xf4, 0x010d},
1010         {0xa0, 0x58, 0x010e},
1011         {0xa0, 0xf4, 0x010f},
1012         {0xa0, 0xf4, 0x0110},
1013         {0xa0, 0xf4, 0x0111},
1014         {0xa0, 0x58, 0x0112},
1015         {0xa0, 0x00, 0x0180},
1016         {0xa0, 0x00, 0x0019},
1017         {0xa0, 0x18, 0x0092},
1018         {0xa0, 0x00, 0x0093},
1019         {0xa0, 0x00, 0x0094},
1020         {0xa0, 0x01, 0x0090},
1021         {0xa0, 0x13, 0x0092},
1022         {0xa0, 0x22, 0x0093},
1023         {0xa0, 0x00, 0x0094},
1024         {0xa0, 0x01, 0x0090},
1025         {0xa0, 0x14, 0x0092},
1026         {0xa0, 0x01, 0x0093},
1027         {0xa0, 0x00, 0x0094},
1028         {0xa0, 0x01, 0x0090},
1029         {0xa0, 0x20, 0x0092},
1030         {0xa0, 0x01, 0x0093},
1031         {0xa0, 0x00, 0x0094},
1032         {0xa0, 0x01, 0x0090},
1033         {0xa0, 0x21, 0x0092},
1034         {0xa0, 0x22, 0x0093},
1035         {0xa0, 0x00, 0x0094},
1036         {0xa0, 0x01, 0x0090},
1037         {0xa0, 0x18, 0x0092},
1038         {0xa0, 0x04, 0x0093},
1039         {0xa0, 0x00, 0x0094},
1040         {0xa0, 0x01, 0x0090},
1041         {0xa0, 0x01, 0x00a3},
1042         {0xa0, 0x22, 0x00a4},
1043         {0xa0, 0x00, 0x0190},
1044         {0xa0, 0x07, 0x0191},
1045         {0xa0, 0xee, 0x0192},
1046         {0xa0, 0x00, 0x0195},
1047         {0xa0, 0x00, 0x0196},
1048         {0xa0, 0x3a, 0x0197},
1049         {0xa0, 0x10, 0x018c},
1050         {0xa0, 0x20, 0x018f},
1051         {0xa0, 0x0c, 0x01a9},
1052         {0xa0, 0x28, 0x01aa},
1053         {0xa0, 0x04, 0x001d},
1054         {0xa0, 0x0f, 0x001e},
1055         {0xa0, 0x19, 0x001f},
1056         {0xa0, 0x1f, 0x0020},
1057         {0xa0, 0x60, 0x011d},
1058         {0xa0, 0x60, 0x011d},
1059         {0xa0, 0x42, 0x0180},
1060         {0xa0, 0x42, 0x0180},
1061         {0xa0, 0x60, 0x0116},
1062         {0xa0, 0x40, 0x0117},
1063         {0xa0, 0x4c, 0x0118},
1064         {0xa0, 0x01, 0x0000},
1065         {0xa0, 0x01, 0x0000},
1066         {0xa0, 0x00, 0x0002},
1067         {0xa0, 0x03, 0x0008},
1068         {0xa0, 0x08, 0x0010},
1069         {0xa0, 0x02, 0x0003},
1070         {0xa0, 0x80, 0x0004},
1071         {0xa0, 0x01, 0x0005},
1072         {0xa0, 0xe0, 0x0006},
1073         {0xa0, 0x01, 0x0001},
1074         {0xa0, 0x03, 0x0012},
1075         {0xa0, 0x01, 0x0012},
1076         {0xa0, 0x00, 0x0098},
1077         {0xa0, 0x00, 0x009a},
1078         {0xa0, 0x00, 0x011a},
1079         {0xa0, 0x00, 0x011c},
1080         {0xa0, 0xe8, 0x009c},
1081         {0xa0, 0x88, 0x009e},
1082         {0xa0, 0x55, 0x008b},
1083         {0xa0, 0x18, 0x0092},
1084         {0xa0, 0x00, 0x0093},
1085         {0xa0, 0x00, 0x0094},
1086         {0xa0, 0x01, 0x0090},
1087         {0xa0, 0x0A, 0x0092},
1088         {0xa0, 0x02, 0x0093},
1089         {0xa0, 0x00, 0x0094},
1090         {0xa0, 0x01, 0x0090},
1091         {0xa0, 0x0B, 0x0092},
1092         {0xa0, 0x02, 0x0093},
1093         {0xa0, 0x00, 0x0094},
1094         {0xa0, 0x01, 0x0090},
1095         {0xa0, 0x0C, 0x0092},
1096         {0xa0, 0x7b, 0x0093},
1097         {0xa0, 0x00, 0x0094},
1098         {0xa0, 0x01, 0x0090},
1099         {0xa0, 0x0D, 0x0092},
1100         {0xa0, 0xA3, 0x0093},
1101         {0xa0, 0x00, 0x0094},
1102         {0xa0, 0x01, 0x0090},
1103         {0xa0, 0x03, 0x0092},
1104         {0xa0, 0xfb, 0x0093},
1105         {0xa0, 0x00, 0x0094},
1106         {0xa0, 0x01, 0x0090},
1107         {0xa0, 0x05, 0x0092},
1108         {0xa0, 0x00, 0x0093},
1109         {0xa0, 0x00, 0x0094},
1110         {0xa0, 0x01, 0x0090},
1111         {0xa0, 0x06, 0x0092},
1112         {0xa0, 0x03, 0x0093},
1113         {0xa0, 0x00, 0x0094},
1114         {0xa0, 0x01, 0x0090},
1115         {0xa0, 0x09, 0x0092},
1116         {0xa0, 0x08, 0x0093},
1117         {0xa0, 0x00, 0x0094},
1118         {0xa0, 0x01, 0x0090},
1119         {0xa0, 0x0E, 0x0092},
1120         {0xa0, 0x04, 0x0093},
1121         {0xa0, 0x00, 0x0094},
1122         {0xa0, 0x01, 0x0090},
1123         {0xa0, 0x0f, 0x0092},
1124         {0xa0, 0x18, 0x0093},
1125         {0xa0, 0x00, 0x0094},
1126         {0xa0, 0x01, 0x0090},
1127         {0xa0, 0x10, 0x0092},
1128         {0xa0, 0x18, 0x0093},
1129         {0xa0, 0x00, 0x0094},
1130         {0xa0, 0x01, 0x0090},
1131         {0xa0, 0x11, 0x0092},
1132         {0xa0, 0x18, 0x0093},
1133         {0xa0, 0x00, 0x0094},
1134         {0xa0, 0x01, 0x0090},
1135         {0xa0, 0x12, 0x0092},
1136         {0xa0, 0x18, 0x0093},
1137         {0xa0, 0x00, 0x0094},
1138         {0xa0, 0x01, 0x0090},
1139         {0xa0, 0x15, 0x0092},
1140         {0xa0, 0x00, 0x0093},
1141         {0xa0, 0x00, 0x0094},
1142         {0xa0, 0x01, 0x0090},
1143         {0xa0, 0x16, 0x0092},
1144         {0xa0, 0x0c, 0x0093},
1145         {0xa0, 0x00, 0x0094},
1146         {0xa0, 0x01, 0x0090},
1147         {0xa0, 0x17, 0x0092},
1148         {0xa0, 0x0C, 0x0093},
1149         {0xa0, 0x00, 0x0094},
1150         {0xa0, 0x01, 0x0090},
1151         {0xa0, 0x18, 0x0092},
1152         {0xa0, 0x04, 0x0093},
1153         {0xa0, 0x00, 0x0094},
1154         {0xa0, 0x01, 0x0090},
1155         {0xa0, 0xf7, 0x0101},
1156         {0xa0, 0x05, 0x0012},
1157         {0xa0, 0x78, 0x018d},
1158         {0xa0, 0x0d, 0x0100},
1159         {0xa0, 0x06, 0x0189},
1160         {0xa0, 0x03, 0x01c5},
1161         {0xa0, 0x13, 0x01cb},
1162         {0xa0, 0x20, 0x0087},
1163         {0xa0, 0x21, 0x0088},
1164         {0xa0, 0x08, 0x0250},
1165         {0xa0, 0x08, 0x0301},
1166         {0xa0, 0x00, 0x01ad},
1167         {0xa0, 0x01, 0x01b1},
1168         {0xa0, 0x02, 0x0180},
1169         {0xa0, 0x60, 0x0116},
1170         {0xa0, 0x40, 0x0117},
1171         {0xa0, 0x4c, 0x0118},
1172         {0xa0, 0x03, 0x0008},   /* clock ? */
1173         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
1174         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
1175         {0xa0, 0x13, 0x0120},   /* gamma 4 */
1176         {0xa0, 0x38, 0x0121},
1177         {0xa0, 0x59, 0x0122},
1178         {0xa0, 0x79, 0x0123},
1179         {0xa0, 0x92, 0x0124},
1180         {0xa0, 0xa7, 0x0125},
1181         {0xa0, 0xb9, 0x0126},
1182         {0xa0, 0xc8, 0x0127},
1183         {0xa0, 0xd4, 0x0128},
1184         {0xa0, 0xdf, 0x0129},
1185         {0xa0, 0xe7, 0x012a},
1186         {0xa0, 0xee, 0x012b},
1187         {0xa0, 0xf4, 0x012c},
1188         {0xa0, 0xf9, 0x012d},
1189         {0xa0, 0xfc, 0x012e},
1190         {0xa0, 0xff, 0x012f},
1191         {0xa0, 0x26, 0x0130},
1192         {0xa0, 0x22, 0x0131},
1193         {0xa0, 0x20, 0x0132},
1194         {0xa0, 0x1c, 0x0133},
1195         {0xa0, 0x16, 0x0134},
1196         {0xa0, 0x13, 0x0135},
1197         {0xa0, 0x10, 0x0136},
1198         {0xa0, 0x0d, 0x0137},
1199         {0xa0, 0x0b, 0x0138},
1200         {0xa0, 0x09, 0x0139},
1201         {0xa0, 0x07, 0x013a},
1202         {0xa0, 0x06, 0x013b},
1203         {0xa0, 0x05, 0x013c},
1204         {0xa0, 0x04, 0x013d},
1205         {0xa0, 0x03, 0x013e},
1206         {0xa0, 0x02, 0x013f},
1207         {0xa0, 0x58, 0x010a},   /* matrix */
1208         {0xa0, 0xf4, 0x010b},
1209         {0xa0, 0xf4, 0x010c},
1210         {0xa0, 0xf4, 0x010d},
1211         {0xa0, 0x58, 0x010e},
1212         {0xa0, 0xf4, 0x010f},
1213         {0xa0, 0xf4, 0x0110},
1214         {0xa0, 0xf4, 0x0111},
1215         {0xa0, 0x58, 0x0112},
1216         {0xa0, 0x00, 0x0180},
1217         {0xa0, 0x00, 0x0019},
1218         {0xa0, 0x18, 0x0092},
1219         {0xa0, 0x00, 0x0093},
1220         {0xa0, 0x00, 0x0094},
1221         {0xa0, 0x01, 0x0090},
1222         {0xa0, 0x13, 0x0092},
1223         {0xa0, 0x22, 0x0093},
1224         {0xa0, 0x00, 0x0094},
1225         {0xa0, 0x01, 0x0090},
1226         {0xa0, 0x14, 0x0092},
1227         {0xa0, 0x01, 0x0093},
1228         {0xa0, 0x00, 0x0094},
1229         {0xa0, 0x01, 0x0090},
1230         {0xa0, 0x20, 0x0092},
1231         {0xa0, 0x01, 0x0093},
1232         {0xa0, 0x00, 0x0094},
1233         {0xa0, 0x01, 0x0090},
1234         {0xa0, 0x21, 0x0092},
1235         {0xa0, 0x22, 0x0093},
1236         {0xa0, 0x00, 0x0094},
1237         {0xa0, 0x01, 0x0090},
1238         {0xa0, 0x18, 0x0092},
1239         {0xa0, 0x04, 0x0093},
1240         {0xa0, 0x00, 0x0094},
1241         {0xa0, 0x01, 0x0090},
1242         {0xa0, 0x01, 0x00a3},
1243         {0xa0, 0x22, 0x00a4},
1244         {0xa0, 0x00, 0x0190},
1245         {0xa0, 0x07, 0x0191},
1246         {0xa0, 0xee, 0x0192},
1247         {0xa0, 0x00, 0x0195},
1248         {0xa0, 0x00, 0x0196},
1249         {0xa0, 0x3a, 0x0197},
1250         {0xa0, 0x10, 0x018c},
1251         {0xa0, 0x20, 0x018f},
1252         {0xa0, 0x0c, 0x01a9},
1253         {0xa0, 0x28, 0x01aa},
1254         {0xa0, 0x04, 0x001d},
1255         {0xa0, 0x0f, 0x001e},
1256         {0xa0, 0x19, 0x001f},
1257         {0xa0, 0x1f, 0x0020},
1258         {0xa0, 0x60, 0x011d},
1259         {0xa0, 0x60, 0x011d},
1260         {0xa0, 0x42, 0x0180},
1261         {0xa0, 0x42, 0x0180},
1262         {0xa0, 0x60, 0x0116},
1263         {0xa0, 0x40, 0x0117},
1264         {0xa0, 0x4c, 0x0118},
1265         {0xa0, 0x04, 0x01a7},
1266         {0xa0, 0x20, 0x0092},
1267         {0xa0, 0x01, 0x0093},
1268         {0xa0, 0x00, 0x0094},
1269         {0xa0, 0x01, 0x0090},
1270         {0xa0, 0x21, 0x0092},
1271         {0xa0, 0x5c, 0x0093},
1272         {0xa0, 0x00, 0x0094},
1273         {0xa0, 0x01, 0x0090},
1274         {0xa0, 0x18, 0x0092},
1275         {0xa0, 0x00, 0x0093},
1276         {0xa0, 0x00, 0x0094},
1277         {0xa0, 0x01, 0x0090},
1278         {0xa0, 0x13, 0x0092},
1279         {0xa0, 0x5c, 0x0093},
1280         {0xa0, 0x00, 0x0094},
1281         {0xa0, 0x01, 0x0090},
1282         {0xa0, 0x14, 0x0092},
1283         {0xa0, 0x01, 0x0093},
1284         {0xa0, 0x00, 0x0094},
1285         {0xa0, 0x01, 0x0090},
1286         {0xa0, 0x18, 0x0092},
1287         {0xa0, 0x04, 0x0093},
1288         {0xa0, 0x00, 0x0094},
1289         {0xa0, 0x01, 0x0090},
1290         {0xa0, 0x00, 0x01a7},
1291         {0xa0, 0x04, 0x01a7},
1292         {0xa0, 0x00, 0x01a7},
1293         {0xa0, 0x04, 0x01a7},
1294         {0xa0, 0x20, 0x0092},
1295         {0xa0, 0x01, 0x0093},
1296         {0xa0, 0x00, 0x0094},
1297         {0xa0, 0x01, 0x0090},
1298         {0xa0, 0x21, 0x0092},
1299         {0xa0, 0x96, 0x0093},
1300         {0xa0, 0x00, 0x0094},
1301         {0xa0, 0x01, 0x0090},
1302         {0xa0, 0x18, 0x0092},
1303         {0xa0, 0x00, 0x0093},
1304         {0xa0, 0x00, 0x0094},
1305         {0xa0, 0x01, 0x0090},
1306         {0xa0, 0x13, 0x0092},
1307         {0xa0, 0x96, 0x0093},
1308         {0xa0, 0x00, 0x0094},
1309         {0xa0, 0x01, 0x0090},
1310         {0xa0, 0x14, 0x0092},
1311         {0xa0, 0x01, 0x0093},
1312         {0xa0, 0x00, 0x0094},
1313         {0xa0, 0x01, 0x0090},
1314         {0xa0, 0x18, 0x0092},
1315         {0xa0, 0x04, 0x0093},
1316         {0xa0, 0x00, 0x0094},
1317         {0xa0, 0x01, 0x0090},
1318         {0xa0, 0x00, 0x01a7},
1319         {0xa0, 0x04, 0x01a7},
1320         {0xa0, 0x00, 0x01a7},
1321         {0xa0, 0x04, 0x01a7},
1322         {0xa0, 0x00, 0x01a7},
1323         {0xa0, 0x04, 0x01a7},
1324         {0xa0, 0x20, 0x0092},
1325         {0xa0, 0x01, 0x0093},
1326         {0xa0, 0x00, 0x0094},
1327         {0xa0, 0x01, 0x0090},
1328         {0xa0, 0x21, 0x0092},
1329         {0xa0, 0xd0, 0x0093},
1330         {0xa0, 0x00, 0x0094},
1331         {0xa0, 0x01, 0x0090},
1332         {0xa0, 0x18, 0x0092},
1333         {0xa0, 0x00, 0x0093},
1334         {0xa0, 0x00, 0x0094},
1335         {0xa0, 0x01, 0x0090},
1336         {0xa0, 0x13, 0x0092},
1337         {0xa0, 0xd0, 0x0093},
1338         {0xa0, 0x00, 0x0094},
1339         {0xa0, 0x01, 0x0090},
1340         {0xa0, 0x14, 0x0092},
1341         {0xa0, 0x01, 0x0093},
1342         {0xa0, 0x00, 0x0094},
1343         {0xa0, 0x01, 0x0090},
1344         {0xa0, 0x18, 0x0092},
1345         {0xa0, 0x04, 0x0093},
1346         {0xa0, 0x00, 0x0094},
1347         {0xa0, 0x01, 0x0090},
1348         {0xa0, 0x00, 0x01a7},
1349         {0xa0, 0x02, 0x0008},
1350         {0xa0, 0x04, 0x01a7},
1351         {0xa0, 0x00, 0x01a7},
1352         {0xa0, 0x04, 0x01a7},
1353         {0xa0, 0x20, 0x0092},
1354         {0xa0, 0x02, 0x0093},
1355         {0xa0, 0x00, 0x0094},
1356         {0xa0, 0x01, 0x0090},
1357         {0xa0, 0x21, 0x0092},
1358         {0xa0, 0x0a, 0x0093},
1359         {0xa0, 0x00, 0x0094},
1360         {0xa0, 0x01, 0x0090},
1361         {0xa0, 0x18, 0x0092},
1362         {0xa0, 0x00, 0x0093},
1363         {0xa0, 0x00, 0x0094},
1364         {0xa0, 0x01, 0x0090},
1365         {0xa0, 0x13, 0x0092},
1366         {0xa0, 0x0a, 0x0093},
1367         {0xa0, 0x00, 0x0094},
1368         {0xa0, 0x01, 0x0090},
1369         {0xa0, 0x14, 0x0092},
1370         {0xa0, 0x02, 0x0093},
1371         {0xa0, 0x00, 0x0094},
1372         {0xa0, 0x01, 0x0090},
1373         {0xa0, 0x18, 0x0092},
1374         {0xa0, 0x04, 0x0093},
1375         {0xa0, 0x00, 0x0094},
1376         {0xa0, 0x01, 0x0090},
1377         {0xa0, 0x00, 0x01a7},
1378         {0xa0, 0x04, 0x01a7},
1379         {0xa0, 0x00, 0x01a7},
1380         {0xa0, 0x04, 0x01a7},
1381         {0xa0, 0x20, 0x0092},
1382         {0xa0, 0x02, 0x0093},
1383         {0xa0, 0x00, 0x0094},
1384         {0xa0, 0x01, 0x0090},
1385         {0xa0, 0x21, 0x0092},
1386         {0xa0, 0x44, 0x0093},
1387         {0xa0, 0x00, 0x0094},
1388         {0xa0, 0x01, 0x0090},
1389         {0xa0, 0x18, 0x0092},
1390         {0xa0, 0x00, 0x0093},
1391         {0xa0, 0x00, 0x0094},
1392         {0xa0, 0x01, 0x0090},
1393         {0xa0, 0x13, 0x0092},
1394         {0xa0, 0x44, 0x0093},
1395         {0xa0, 0x00, 0x0094},
1396         {0xa0, 0x01, 0x0090},
1397         {0xa0, 0x14, 0x0092},
1398         {0xa0, 0x02, 0x0093},
1399         {0xa0, 0x00, 0x0094},
1400         {0xa0, 0x01, 0x0090},
1401         {0xa0, 0x18, 0x0092},
1402         {0xa0, 0x04, 0x0093},
1403         {0xa0, 0x00, 0x0094},
1404         {0xa0, 0x01, 0x0090},
1405         {0xa0, 0x00, 0x01a7},
1406         {0xa0, 0x04, 0x01a7},
1407         {0xa0, 0x00, 0x01a7},
1408         {0xa0, 0x04, 0x01a7},
1409         {0xa0, 0x20, 0x0092},
1410         {0xa0, 0x02, 0x0093},
1411         {0xa0, 0x00, 0x0094},
1412         {0xa0, 0x01, 0x0090},
1413         {0xa0, 0x21, 0x0092},
1414         {0xa0, 0x7e, 0x0093},
1415         {0xa0, 0x00, 0x0094},
1416         {0xa0, 0x01, 0x0090},
1417         {0xa0, 0x18, 0x0092},
1418         {0xa0, 0x00, 0x0093},
1419         {0xa0, 0x00, 0x0094},
1420         {0xa0, 0x01, 0x0090},
1421         {0xa0, 0x13, 0x0092},
1422         {0xa0, 0x7e, 0x0093},
1423         {0xa0, 0x00, 0x0094},
1424         {0xa0, 0x01, 0x0090},
1425         {0xa0, 0x14, 0x0092},
1426         {0xa0, 0x02, 0x0093},
1427         {0xa0, 0x00, 0x0094},
1428         {0xa0, 0x01, 0x0090},
1429         {0xa0, 0x18, 0x0092},
1430         {0xa0, 0x04, 0x0093},
1431         {0xa0, 0x00, 0x0094},
1432         {0xa0, 0x01, 0x0090},
1433         {0xa0, 0x00, 0x01a7},
1434         {0xa0, 0x04, 0x01a7},
1435         {0xa0, 0x00, 0x01a7},
1436         {0xa0, 0x04, 0x01a7},
1437         {}
1438 };
1439
1440 static struct usb_action gc0305_Initial[] = {           /* 640x480 */
1441         {0xa0, 0x01, 0x0000},   /* 00,00,01,cc */
1442         {0xa0, 0x03, 0x0008},   /* 00,08,03,cc */
1443         {0xa0, 0x01, 0x0010},   /* 00,10,01,cc */
1444         {0xa0, 0x04, 0x0002},   /* 00,02,04,cc */
1445         {0xa0, 0x02, 0x0003},   /* 00,03,02,cc */
1446         {0xa0, 0x80, 0x0004},   /* 00,04,80,cc */
1447         {0xa0, 0x01, 0x0005},   /* 00,05,01,cc */
1448         {0xa0, 0xe0, 0x0006},   /* 00,06,e0,cc */
1449         {0xa0, 0x01, 0x0001},   /* 00,01,01,cc */
1450         {0xa0, 0x03, 0x0012},   /* 00,12,03,cc */
1451         {0xa0, 0x01, 0x0012},   /* 00,12,01,cc */
1452         {0xa0, 0x00, 0x0098},   /* 00,98,00,cc */
1453         {0xa0, 0x00, 0x009a},   /* 00,9a,00,cc */
1454         {0xa0, 0x00, 0x011a},   /* 01,1a,00,cc */
1455         {0xa0, 0x00, 0x011c},   /* 01,1c,00,cc */
1456         {0xa0, 0xe6, 0x009c},   /* 00,9c,e6,cc */
1457         {0xa0, 0x86, 0x009e},   /* 00,9e,86,cc */
1458         {0xa0, 0x98, 0x008b},   /* 00,8b,98,cc */
1459         {0xaa, 0x13, 0x0002},   /* 00,13,02,aa */
1460         {0xaa, 0x15, 0x0003},   /* 00,15,03,aa */
1461         {0xaa, 0x01, 0x0000},   /* 00,01,00,aa */
1462         {0xaa, 0x02, 0x0000},   /* 00,02,00,aa */
1463         {0xaa, 0x1a, 0x0000},   /* 00,1a,00,aa */
1464         {0xaa, 0x1c, 0x0017},   /* 00,1c,17,aa */
1465         {0xaa, 0x1d, 0x0080},   /* 00,1d,80,aa */
1466         {0xaa, 0x1f, 0x0008},   /* 00,1f,08,aa */
1467         {0xaa, 0x21, 0x0012},   /* 00,21,12,aa */
1468         {0xa0, 0x82, 0x0086},   /* 00,86,82,cc */
1469         {0xa0, 0x83, 0x0087},   /* 00,87,83,cc */
1470         {0xa0, 0x84, 0x0088},   /* 00,88,84,cc */
1471         {0xaa, 0x05, 0x0000},   /* 00,05,00,aa */
1472         {0xaa, 0x0a, 0x0000},   /* 00,0a,00,aa */
1473         {0xaa, 0x0b, 0x00b0},   /* 00,0b,b0,aa */
1474         {0xaa, 0x0c, 0x0000},   /* 00,0c,00,aa */
1475         {0xaa, 0x0d, 0x00b0},   /* 00,0d,b0,aa */
1476         {0xaa, 0x0e, 0x0000},   /* 00,0e,00,aa */
1477         {0xaa, 0x0f, 0x00b0},   /* 00,0f,b0,aa */
1478         {0xaa, 0x10, 0x0000},   /* 00,10,00,aa */
1479         {0xaa, 0x11, 0x00b0},   /* 00,11,b0,aa */
1480         {0xaa, 0x16, 0x0001},   /* 00,16,01,aa */
1481         {0xaa, 0x17, 0x00e6},   /* 00,17,e6,aa */
1482         {0xaa, 0x18, 0x0002},   /* 00,18,02,aa */
1483         {0xaa, 0x19, 0x0086},   /* 00,19,86,aa */
1484         {0xaa, 0x20, 0x0000},   /* 00,20,00,aa */
1485         {0xaa, 0x1b, 0x0020},   /* 00,1b,20,aa */
1486         {0xa0, 0xb7, 0x0101},   /* 01,01,b7,cc */
1487         {0xa0, 0x05, 0x0012},   /* 00,12,05,cc */
1488         {0xa0, 0x0d, 0x0100},   /* 01,00,0d,cc */
1489         {0xa0, 0x76, 0x0189},   /* 01,89,76,cc */
1490         {0xa0, 0x09, 0x01ad},   /* 01,ad,09,cc */
1491         {0xa0, 0x03, 0x01c5},   /* 01,c5,03,cc */
1492         {0xa0, 0x13, 0x01cb},   /* 01,cb,13,cc */
1493         {0xa0, 0x08, 0x0250},   /* 02,50,08,cc */
1494         {0xa0, 0x08, 0x0301},   /* 03,01,08,cc */
1495         {0xa0, 0x60, 0x01a8},   /* 01,a8,60,cc */
1496         {0xa0, 0x85, 0x018d},   /* 01,8d,85,cc */
1497         {0xa0, 0x00, 0x011e},   /* 01,1e,00,cc */
1498         {0xa0, 0x52, 0x0116},   /* 01,16,52,cc */
1499         {0xa0, 0x40, 0x0117},   /* 01,17,40,cc */
1500         {0xa0, 0x52, 0x0118},   /* 01,18,52,cc */
1501         {0xa0, 0x03, 0x0113},   /* 01,13,03,cc */
1502         {}
1503 };
1504 static struct usb_action gc0305_InitialScale[] = {      /* 320x240 */
1505         {0xa0, 0x01, 0x0000},   /* 00,00,01,cc */
1506         {0xa0, 0x03, 0x0008},   /* 00,08,03,cc */
1507         {0xa0, 0x01, 0x0010},   /* 00,10,01,cc */
1508         {0xa0, 0x10, 0x0002},   /* 00,02,10,cc */
1509         {0xa0, 0x02, 0x0003},   /* 00,03,02,cc */
1510         {0xa0, 0x80, 0x0004},   /* 00,04,80,cc */
1511         {0xa0, 0x01, 0x0005},   /* 00,05,01,cc */
1512         {0xa0, 0xe0, 0x0006},   /* 00,06,e0,cc */
1513         {0xa0, 0x01, 0x0001},   /* 00,01,01,cc */
1514         {0xa0, 0x03, 0x0012},   /* 00,12,03,cc */
1515         {0xa0, 0x01, 0x0012},   /* 00,12,01,cc */
1516         {0xa0, 0x00, 0x0098},   /* 00,98,00,cc */
1517         {0xa0, 0x00, 0x009a},   /* 00,9a,00,cc */
1518         {0xa0, 0x00, 0x011a},   /* 01,1a,00,cc */
1519         {0xa0, 0x00, 0x011c},   /* 01,1c,00,cc */
1520         {0xa0, 0xe8, 0x009c},   /* 00,9c,e8,cc */
1521         {0xa0, 0x88, 0x009e},   /* 00,9e,88,cc */
1522         {0xa0, 0x98, 0x008b},   /* 00,8b,98,cc */
1523         {0xaa, 0x13, 0x0000},   /* 00,13,00,aa */
1524         {0xaa, 0x15, 0x0001},   /* 00,15,01,aa */
1525         {0xaa, 0x01, 0x0000},   /* 00,01,00,aa */
1526         {0xaa, 0x02, 0x0000},   /* 00,02,00,aa */
1527         {0xaa, 0x1a, 0x0000},   /* 00,1a,00,aa */
1528         {0xaa, 0x1c, 0x0017},   /* 00,1c,17,aa */
1529         {0xaa, 0x1d, 0x0080},   /* 00,1d,80,aa */
1530         {0xaa, 0x1f, 0x0008},   /* 00,1f,08,aa */
1531         {0xaa, 0x21, 0x0012},   /* 00,21,12,aa */
1532         {0xa0, 0x82, 0x0086},   /* 00,86,82,cc */
1533         {0xa0, 0x83, 0x0087},   /* 00,87,83,cc */
1534         {0xa0, 0x84, 0x0088},   /* 00,88,84,cc */
1535         {0xaa, 0x05, 0x0000},   /* 00,05,00,aa */
1536         {0xaa, 0x0a, 0x0000},   /* 00,0a,00,aa */
1537         {0xaa, 0x0b, 0x00b0},   /* 00,0b,b0,aa */
1538         {0xaa, 0x0c, 0x0000},   /* 00,0c,00,aa */
1539         {0xaa, 0x0d, 0x00b0},   /* 00,0d,b0,aa */
1540         {0xaa, 0x0e, 0x0000},   /* 00,0e,00,aa */
1541         {0xaa, 0x0f, 0x00b0},   /* 00,0f,b0,aa */
1542         {0xaa, 0x10, 0x0000},   /* 00,10,00,aa */
1543         {0xaa, 0x11, 0x00b0},   /* 00,11,b0,aa */
1544         {0xaa, 0x16, 0x0001},   /* 00,16,01,aa */
1545         {0xaa, 0x17, 0x00e8},   /* 00,17,e8,aa */
1546         {0xaa, 0x18, 0x0002},   /* 00,18,02,aa */
1547         {0xaa, 0x19, 0x0088},   /* 00,19,88,aa */
1548         {0xaa, 0x20, 0x0000},   /* 00,20,00,aa */
1549         {0xaa, 0x1b, 0x0020},   /* 00,1b,20,aa */
1550         {0xa0, 0xb7, 0x0101},   /* 01,01,b7,cc */
1551         {0xa0, 0x05, 0x0012},   /* 00,12,05,cc */
1552         {0xa0, 0x0d, 0x0100},   /* 01,00,0d,cc */
1553         {0xa0, 0x76, 0x0189},   /* 01,89,76,cc */
1554         {0xa0, 0x09, 0x01ad},   /* 01,ad,09,cc */
1555         {0xa0, 0x03, 0x01c5},   /* 01,c5,03,cc */
1556         {0xa0, 0x13, 0x01cb},   /* 01,cb,13,cc */
1557         {0xa0, 0x08, 0x0250},   /* 02,50,08,cc */
1558         {0xa0, 0x08, 0x0301},   /* 03,01,08,cc */
1559         {0xa0, 0x60, 0x01a8},   /* 01,a8,60,cc */
1560         {0xa0, 0x00, 0x011e},   /* 01,1e,00,cc */
1561         {0xa0, 0x52, 0x0116},   /* 01,16,52,cc */
1562         {0xa0, 0x40, 0x0117},   /* 01,17,40,cc */
1563         {0xa0, 0x52, 0x0118},   /* 01,18,52,cc */
1564         {0xa0, 0x03, 0x0113},   /* 01,13,03,cc */
1565         {}
1566 };
1567 static struct usb_action gc0305_50HZ[] = {
1568         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1569         {0xaa, 0x83, 0x0002},   /* 00,83,02,aa */
1570         {0xaa, 0x84, 0x0038},   /* 00,84,38,aa */       /* win: 00,84,ec */
1571         {0xa0, 0x00, 0x0190},   /* 01,90,00,cc */
1572         {0xa0, 0x0b, 0x0191},   /* 01,91,0b,cc */
1573         {0xa0, 0x18, 0x0192},   /* 01,92,18,cc */       /* win: 01,92,10 */
1574         {0xa0, 0x00, 0x0195},   /* 01,95,00,cc */
1575         {0xa0, 0x00, 0x0196},   /* 01,96,00,cc */
1576         {0xa0, 0x8e, 0x0197},   /* 01,97,8e,cc */       /* win: 01,97,ec */
1577         {0xa0, 0x0e, 0x018c},   /* 01,8c,0e,cc */
1578         {0xa0, 0x15, 0x018f},   /* 01,8f,15,cc */
1579         {0xa0, 0x10, 0x01a9},   /* 01,a9,10,cc */
1580         {0xa0, 0x24, 0x01aa},   /* 01,aa,24,cc */
1581         {0xa0, 0x62, 0x001d},   /* 00,1d,62,cc */
1582         {0xa0, 0x90, 0x001e},   /* 00,1e,90,cc */
1583         {0xa0, 0xc8, 0x001f},   /* 00,1f,c8,cc */
1584         {0xa0, 0xff, 0x0020},   /* 00,20,ff,cc */
1585         {0xa0, 0x60, 0x011d},   /* 01,1d,60,cc */
1586         {0xa0, 0x42, 0x0180},   /* 01,80,42,cc */
1587 /*      {0xa0, 0x85, 0x018d},    * 01,8d,85,cc *         * if 640x480 */
1588         {}
1589 };
1590 static struct usb_action gc0305_60HZ[] = {
1591         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1592         {0xaa, 0x83, 0x0000},   /* 00,83,00,aa */
1593         {0xaa, 0x84, 0x00ec},   /* 00,84,ec,aa */
1594         {0xa0, 0x00, 0x0190},   /* 01,90,00,cc */
1595         {0xa0, 0x0b, 0x0191},   /* 01,91,0b,cc */
1596         {0xa0, 0x10, 0x0192},   /* 01,92,10,cc */
1597         {0xa0, 0x00, 0x0195},   /* 01,95,00,cc */
1598         {0xa0, 0x00, 0x0196},   /* 01,96,00,cc */
1599         {0xa0, 0xec, 0x0197},   /* 01,97,ec,cc */
1600         {0xa0, 0x0e, 0x018c},   /* 01,8c,0e,cc */
1601         {0xa0, 0x15, 0x018f},   /* 01,8f,15,cc */
1602         {0xa0, 0x10, 0x01a9},   /* 01,a9,10,cc */
1603         {0xa0, 0x24, 0x01aa},   /* 01,aa,24,cc */
1604         {0xa0, 0x62, 0x001d},   /* 00,1d,62,cc */
1605         {0xa0, 0x90, 0x001e},   /* 00,1e,90,cc */
1606         {0xa0, 0xc8, 0x001f},   /* 00,1f,c8,cc */
1607         {0xa0, 0xff, 0x0020},   /* 00,20,ff,cc */
1608         {0xa0, 0x60, 0x011d},   /* 01,1d,60,cc */
1609         {0xa0, 0x42, 0x0180},   /* 01,80,42,cc */
1610         {0xa0, 0x80, 0x018d},   /* 01,8d,80,cc */
1611         {}
1612 };
1613
1614 static struct usb_action gc0305_NoFliker[] = {
1615         {0xa0, 0x0c, 0x0100},   /* 01,00,0c,cc */
1616         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1617         {0xaa, 0x83, 0x0000},   /* 00,83,00,aa */
1618         {0xaa, 0x84, 0x0020},   /* 00,84,20,aa */
1619         {0xa0, 0x00, 0x0190},   /* 01,90,00,cc */
1620         {0xa0, 0x00, 0x0191},   /* 01,91,00,cc */
1621         {0xa0, 0x48, 0x0192},   /* 01,92,48,cc */
1622         {0xa0, 0x00, 0x0195},   /* 01,95,00,cc */
1623         {0xa0, 0x00, 0x0196},   /* 01,96,00,cc */
1624         {0xa0, 0x10, 0x0197},   /* 01,97,10,cc */
1625         {0xa0, 0x0e, 0x018c},   /* 01,8c,0e,cc */
1626         {0xa0, 0x15, 0x018f},   /* 01,8f,15,cc */
1627         {0xa0, 0x62, 0x001d},   /* 00,1d,62,cc */
1628         {0xa0, 0x90, 0x001e},   /* 00,1e,90,cc */
1629         {0xa0, 0xc8, 0x001f},   /* 00,1f,c8,cc */
1630         {0xa0, 0xff, 0x0020},   /* 00,20,ff,cc */
1631         {0xa0, 0x60, 0x011d},   /* 01,1d,60,cc */
1632         {0xa0, 0x03, 0x0180},   /* 01,80,03,cc */
1633         {0xa0, 0x80, 0x018d},   /* 01,8d,80,cc */
1634         {}
1635 };
1636
1637 /* play poker with registers at your own risk !! */
1638 static struct usb_action hdcs2020xx_Initial[] = {
1639         {0xa0, 0x01, 0x0000},
1640         {0xa0, 0x03, 0x0008},
1641         {0xa0, 0x0e, 0x0010},
1642         {0xa0, 0x10, 0x0002},
1643         {0xa0, 0x02, 0x0003},
1644         {0xa0, 0x80, 0x0004},
1645         {0xa0, 0x01, 0x0005},
1646         {0xa0, 0xd0, 0x0006},   /* D0 ?? E0 did not start */
1647         {0xa0, 0x01, 0x0001},
1648         {0xa0, 0x03, 0x0012},
1649         {0xa0, 0x01, 0x0012},
1650         {0xa0, 0x08, 0x008d},
1651         {0xa0, 0x08, 0x0098},
1652         {0xa0, 0x02, 0x009a},
1653         {0xa0, 0x08, 0x011a},
1654         {0xa0, 0x02, 0x011c},
1655         {0xa0, 0x01, 0x009b},
1656         {0xa0, 0xd8, 0x009c},
1657         {0xa0, 0x02, 0x009d},
1658         {0xa0, 0x88, 0x009e},
1659         {0xaa, 0x02, 0x0002},
1660         {0xaa, 0x07, 0x0006},
1661         {0xaa, 0x08, 0x0002},
1662         {0xaa, 0x09, 0x0006},
1663         {0xaa, 0x0a, 0x0001},
1664         {0xaa, 0x0b, 0x0001},
1665         {0xaa, 0x0c, 0x0008},
1666         {0xaa, 0x0d, 0x0000},
1667         {0xaa, 0x10, 0x0000},
1668         {0xaa, 0x12, 0x0005},
1669         {0xaa, 0x13, 0x0063},
1670         {0xaa, 0x15, 0x0070},
1671         {0xa0, 0x37, 0x0101},
1672         {0xa0, 0x0d, 0x0100},
1673         {0xa0, 0x06, 0x0189},
1674         {0xa0, 0x00, 0x01ad},
1675         {0xa0, 0x03, 0x01c5},
1676         {0xa0, 0x13, 0x01cb},
1677         {0xa0, 0x08, 0x0250},
1678         {0xa0, 0x08, 0x0301},
1679         {0xa0, 0x70, 0x018d},
1680         {0xa1, 0x01, 0x0002},
1681         {0xa1, 0x01, 0x0008},
1682         {0xa0, 0x03, 0x0008},   /* clock ? */
1683         {0xa0, 0x04, 0x01c6},   /* sharpness+ */
1684         {0xa1, 0x01, 0x01c8},
1685         {0xa1, 0x01, 0x01c9},
1686         {0xa1, 0x01, 0x01ca},
1687         {0xa0, 0x07, 0x01cb},   /* sharpness- */
1688         {0xa0, 0x11, 0x0120},   /* gamma ~4 */
1689         {0xa0, 0x37, 0x0121},
1690         {0xa0, 0x58, 0x0122},
1691         {0xa0, 0x79, 0x0123},
1692         {0xa0, 0x91, 0x0124},
1693         {0xa0, 0xa6, 0x0125},
1694         {0xa0, 0xb8, 0x0126},
1695         {0xa0, 0xc7, 0x0127},
1696         {0xa0, 0xd3, 0x0128},
1697         {0xa0, 0xde, 0x0129},
1698         {0xa0, 0xe6, 0x012a},
1699         {0xa0, 0xed, 0x012b},
1700         {0xa0, 0xf3, 0x012c},
1701         {0xa0, 0xf8, 0x012d},
1702         {0xa0, 0xfb, 0x012e},
1703         {0xa0, 0xff, 0x012f},
1704         {0xa0, 0x26, 0x0130},
1705         {0xa0, 0x23, 0x0131},
1706         {0xa0, 0x20, 0x0132},
1707         {0xa0, 0x1c, 0x0133},
1708         {0xa0, 0x16, 0x0134},
1709         {0xa0, 0x13, 0x0135},
1710         {0xa0, 0x10, 0x0136},
1711         {0xa0, 0x0d, 0x0137},
1712         {0xa0, 0x0b, 0x0138},
1713         {0xa0, 0x09, 0x0139},
1714         {0xa0, 0x07, 0x013a},
1715         {0xa0, 0x06, 0x013b},
1716         {0xa0, 0x05, 0x013c},
1717         {0xa0, 0x04, 0x013d},
1718         {0xa0, 0x03, 0x013e},
1719         {0xa0, 0x02, 0x013f},
1720
1721         {0xa0, 0x4c, 0x010a},   /* matrix */
1722         {0xa0, 0xf5, 0x010b},
1723         {0xa0, 0xff, 0x010c},
1724         {0xa0, 0xf9, 0x010d},
1725         {0xa0, 0x51, 0x010e},
1726         {0xa0, 0xf5, 0x010f},
1727         {0xa0, 0xfb, 0x0110},
1728         {0xa0, 0xed, 0x0111},
1729         {0xa0, 0x5f, 0x0112},
1730
1731         {0xa1, 0x01, 0x0180},
1732         {0xa0, 0x00, 0x0180},
1733         {0xa0, 0x00, 0x0019},
1734         {0xa0, 0x20, 0x0087},
1735         {0xa0, 0x21, 0x0088},
1736         {0xaa, 0x20, 0x0004},
1737         {0xaa, 0x21, 0x003d},
1738         {0xaa, 0x03, 0x0041},
1739         {0xaa, 0x04, 0x0010},
1740         {0xaa, 0x05, 0x003d},
1741         {0xaa, 0x0e, 0x0001},
1742         {0xaa, 0x0f, 0x0000},
1743         {0xa0, 0x14, 0x01a9},
1744         {0xa0, 0x24, 0x01aa},
1745         {0xa0, 0x00, 0x0190},
1746         {0xa0, 0x04, 0x0191},
1747         {0xa0, 0x3d, 0x0192},
1748         {0xa0, 0x00, 0x0195},
1749         {0xa0, 0x00, 0x0196},
1750         {0xa0, 0x9b, 0x0197},
1751         {0xa0, 0x10, 0x018c},
1752         {0xa0, 0x20, 0x018f},
1753         {0xa0, 0x41, 0x001d},
1754         {0xa0, 0x6f, 0x001e},
1755         {0xa0, 0xad, 0x001f},
1756         {0xa0, 0xff, 0x0020},
1757         {0xa0, 0x0f, 0x0087},
1758         {0xa0, 0x0e, 0x0088},
1759         {0xa0, 0x40, 0x0180},
1760         {0xa1, 0x01, 0x0195},
1761         {0xa1, 0x01, 0x0196},
1762         {0xa1, 0x01, 0x0197},
1763         {0xa0, 0x3d, 0x0192},
1764         {0xa0, 0x04, 0x0191},
1765         {0xa0, 0x00, 0x0190},
1766         {0xa0, 0x1d, 0x0116},
1767         {0xa0, 0x40, 0x0117},
1768         {0xa0, 0x85, 0x0118},
1769         {0xa1, 0x01, 0x0116},
1770         {0xa1, 0x01, 0x0118},
1771         {0xa1, 0x01, 0x0180},
1772         {0xa0, 0x42, 0x0180},
1773         {0xa0, 0x1d, 0x0116},
1774         {0xa0, 0x40, 0x0117},
1775         {0xa0, 0x85, 0x0118},
1776         {0xa1, 0x01, 0x0116},
1777         {0xa1, 0x01, 0x0118},
1778 /*      {0xa0, 0x02, 0x0008}, */
1779         {0xa0, 0x00, 0x0007},
1780         {}
1781 };
1782
1783 static struct usb_action hdcs2020xx_InitialScale[] = {
1784         {0xa0, 0x01, 0x0000},
1785         {0xa0, 0x03, 0x0008},
1786         {0xa0, 0x0e, 0x0010},
1787         {0xa0, 0x00, 0x0002},
1788         {0xa0, 0x02, 0x0003},
1789         {0xa0, 0x80, 0x0004},
1790         {0xa0, 0x01, 0x0005},
1791         {0xa0, 0xe0, 0x0006},
1792         {0xa0, 0x01, 0x0001},
1793         {0xa0, 0x03, 0x0012},
1794         {0xa0, 0x01, 0x0012},
1795         {0xa0, 0x08, 0x008d},
1796         {0xa0, 0x00, 0x0098},
1797         {0xa0, 0x03, 0x009a},
1798         {0xa0, 0x00, 0x011a},
1799         {0xa0, 0x03, 0x011c},
1800         {0xa0, 0x01, 0x009b},
1801         {0xa0, 0xe6, 0x009c},
1802         {0xa0, 0x02, 0x009d},
1803         {0xa0, 0x86, 0x009e},
1804         {0xaa, 0x02, 0x0002},
1805         {0xaa, 0x07, 0x0006},
1806         {0xaa, 0x08, 0x0002},
1807         {0xaa, 0x09, 0x0006},
1808         {0xaa, 0x0a, 0x0001},
1809         {0xaa, 0x0b, 0x0001},
1810         {0xaa, 0x0c, 0x0008},
1811         {0xaa, 0x0d, 0x0000},
1812         {0xaa, 0x10, 0x0000},
1813         {0xaa, 0x12, 0x0005},
1814         {0xaa, 0x13, 0x0063},
1815         {0xaa, 0x15, 0x0070},
1816         {0xa0, 0xb7, 0x0101},
1817         {0xa0, 0x0d, 0x0100},
1818         {0xa0, 0x06, 0x0189},
1819         {0xa0, 0x00, 0x01ad},
1820         {0xa0, 0x03, 0x01c5},
1821         {0xa0, 0x13, 0x01cb},
1822         {0xa0, 0x08, 0x0250},
1823         {0xa0, 0x08, 0x0301},
1824         {0xa0, 0x70, 0x018d},
1825         {0xa1, 0x01, 0x0002},
1826         {0xa1, 0x01, 0x0008},
1827         {0xa0, 0x03, 0x0008},   /* clock ? */
1828         {0xa0, 0x04, 0x01c6},   /* sharpness+ */
1829         {0xa1, 0x01, 0x01c8},
1830         {0xa1, 0x01, 0x01c9},
1831         {0xa1, 0x01, 0x01ca},
1832         {0xa0, 0x07, 0x01cb},   /* sharpness- */
1833         {0xa0, 0x11, 0x0120},   /* gamma ~4*/
1834         {0xa0, 0x37, 0x0121},
1835         {0xa0, 0x58, 0x0122},
1836         {0xa0, 0x79, 0x0123},
1837         {0xa0, 0x91, 0x0124},
1838         {0xa0, 0xa6, 0x0125},
1839         {0xa0, 0xb8, 0x0126},
1840         {0xa0, 0xc7, 0x0127},
1841         {0xa0, 0xd3, 0x0128},
1842         {0xa0, 0xde, 0x0129},
1843         {0xa0, 0xe6, 0x012a},
1844         {0xa0, 0xed, 0x012b},
1845         {0xa0, 0xf3, 0x012c},
1846         {0xa0, 0xf8, 0x012d},
1847         {0xa0, 0xfb, 0x012e},
1848         {0xa0, 0xff, 0x012f},
1849         {0xa0, 0x26, 0x0130},
1850         {0xa0, 0x23, 0x0131},
1851         {0xa0, 0x20, 0x0132},
1852         {0xa0, 0x1c, 0x0133},
1853         {0xa0, 0x16, 0x0134},
1854         {0xa0, 0x13, 0x0135},
1855         {0xa0, 0x10, 0x0136},
1856         {0xa0, 0x0d, 0x0137},
1857         {0xa0, 0x0b, 0x0138},
1858         {0xa0, 0x09, 0x0139},
1859         {0xa0, 0x07, 0x013a},
1860         {0xa0, 0x06, 0x013b},
1861         {0xa0, 0x05, 0x013c},
1862         {0xa0, 0x04, 0x013d},
1863         {0xa0, 0x03, 0x013e},
1864         {0xa0, 0x02, 0x013f},
1865         {0xa0, 0x60, 0x010a},   /* matrix */
1866         {0xa0, 0xff, 0x010b},
1867         {0xa0, 0xff, 0x010c},
1868         {0xa0, 0xff, 0x010d},
1869         {0xa0, 0x60, 0x010e},
1870         {0xa0, 0xff, 0x010f},
1871         {0xa0, 0xff, 0x0110},
1872         {0xa0, 0xff, 0x0111},
1873         {0xa0, 0x60, 0x0112},
1874
1875         {0xa1, 0x01, 0x0180},
1876         {0xa0, 0x00, 0x0180},
1877         {0xa0, 0x00, 0x0019},
1878         {0xa0, 0x20, 0x0087},
1879         {0xa0, 0x21, 0x0088},
1880         {0xaa, 0x20, 0x0002},
1881         {0xaa, 0x21, 0x001b},
1882         {0xaa, 0x03, 0x0044},
1883         {0xaa, 0x04, 0x0008},
1884         {0xaa, 0x05, 0x001b},
1885         {0xaa, 0x0e, 0x0001},
1886         {0xaa, 0x0f, 0x0000},
1887         {0xa0, 0x14, 0x01a9},
1888         {0xa0, 0x24, 0x01aa},
1889         {0xa0, 0x00, 0x0190},
1890         {0xa0, 0x02, 0x0191},
1891         {0xa0, 0x1b, 0x0192},
1892         {0xa0, 0x00, 0x0195},
1893         {0xa0, 0x00, 0x0196},
1894         {0xa0, 0x4d, 0x0197},
1895         {0xa0, 0x10, 0x018c},
1896         {0xa0, 0x20, 0x018f},
1897         {0xa0, 0x44, 0x001d},
1898         {0xa0, 0x6f, 0x001e},
1899         {0xa0, 0xad, 0x001f},
1900         {0xa0, 0xeb, 0x0020},
1901         {0xa0, 0x0f, 0x0087},
1902         {0xa0, 0x0e, 0x0088},
1903         {0xa0, 0x40, 0x0180},
1904         {0xa1, 0x01, 0x0195},
1905         {0xa1, 0x01, 0x0196},
1906         {0xa1, 0x01, 0x0197},
1907         {0xa0, 0x1b, 0x0192},
1908         {0xa0, 0x02, 0x0191},
1909         {0xa0, 0x00, 0x0190},
1910         {0xa0, 0x1d, 0x0116},
1911         {0xa0, 0x40, 0x0117},
1912         {0xa0, 0x99, 0x0118},
1913         {0xa1, 0x01, 0x0116},
1914         {0xa1, 0x01, 0x0118},
1915         {0xa1, 0x01, 0x0180},
1916         {0xa0, 0x42, 0x0180},
1917         {0xa0, 0x1d, 0x0116},
1918         {0xa0, 0x40, 0x0117},
1919         {0xa0, 0x99, 0x0118},
1920 /*      {0xa0, 0x02, 0x0008}, */
1921         {0xa0, 0x00, 0x0007},
1922 /*      {0xa0, 0x18, 0x00fe}, */
1923         {}
1924 };
1925 static struct usb_action hdcs2020xb_Initial[] = {
1926         {0xa0, 0x01, 0x0000},
1927         {0xa0, 0x11, 0x0002},
1928         {0xa0, 0x03, 0x0008},   /* qtable 0x05 */
1929         {0xa0, 0x08, 0x0010},
1930         {0xa0, 0x02, 0x0003},
1931         {0xa0, 0x80, 0x0004},
1932         {0xa0, 0x01, 0x0005},
1933         {0xa0, 0xe0, 0x0006},
1934         {0xa0, 0x01, 0x0001},
1935         {0xa0, 0x03, 0x0012},
1936         {0xa0, 0x01, 0x0012},
1937         {0xa0, 0x00, 0x0098},
1938         {0xa0, 0x00, 0x009a},
1939         {0xa0, 0x00, 0x011a},
1940         {0xa0, 0x00, 0x011c},
1941         {0xa0, 0xe8, 0x009c},
1942         {0xa0, 0x88, 0x009e},
1943         {0xaa, 0x1c, 0x0000},
1944         {0xaa, 0x0a, 0x0001},
1945         {0xaa, 0x0b, 0x0006},
1946         {0xaa, 0x0c, 0x007b},
1947         {0xaa, 0x0d, 0x00a7},
1948         {0xaa, 0x03, 0x00fb},
1949         {0xaa, 0x05, 0x0000},
1950         {0xaa, 0x06, 0x0003},
1951         {0xaa, 0x09, 0x0008},
1952
1953         {0xaa, 0x0f, 0x0018},   /* set sensor gain */
1954         {0xaa, 0x10, 0x0018},
1955         {0xaa, 0x11, 0x0018},
1956         {0xaa, 0x12, 0x0018},
1957
1958         {0xaa, 0x15, 0x004e},
1959         {0xaa, 0x1c, 0x0004},
1960         {0xa0, 0xb7, 0x0101},
1961         {0xa0, 0x05, 0x0012},
1962         {0xa0, 0x70, 0x018d},
1963         {0xa0, 0x0d, 0x0100},
1964         {0xa0, 0x06, 0x0189},
1965         {0xa0, 0x03, 0x01c5},
1966         {0xa0, 0x13, 0x01cb},
1967         {0xa0, 0x08, 0x0250},
1968         {0xa0, 0x08, 0x0301},
1969         {0xa1, 0x01, 0x0002},
1970         {0xa1, 0x01, 0x0008},
1971         {0xa1, 0x01, 0x0180},
1972         {0xa0, 0x02, 0x0180},
1973         {0xa0, 0x40, 0x0116},
1974         {0xa0, 0x40, 0x0117},
1975         {0xa0, 0x40, 0x0118},
1976         {0xa1, 0x01, 0x0008},
1977         {0xa0, 0x03, 0x0008},   /* clock ? */
1978         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
1979         {0xa1, 0x01, 0x01c8},
1980         {0xa1, 0x01, 0x01c9},
1981         {0xa1, 0x01, 0x01ca},
1982         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
1983         {0xa0, 0x13, 0x0120},   /* gamma 4 */
1984         {0xa0, 0x38, 0x0121},
1985         {0xa0, 0x59, 0x0122},
1986         {0xa0, 0x79, 0x0123},
1987         {0xa0, 0x92, 0x0124},
1988         {0xa0, 0xa7, 0x0125},
1989         {0xa0, 0xb9, 0x0126},
1990         {0xa0, 0xc8, 0x0127},
1991         {0xa0, 0xd4, 0x0128},
1992         {0xa0, 0xdf, 0x0129},
1993         {0xa0, 0xe7, 0x012a},
1994         {0xa0, 0xee, 0x012b},
1995         {0xa0, 0xf4, 0x012c},
1996         {0xa0, 0xf9, 0x012d},
1997         {0xa0, 0xfc, 0x012e},
1998         {0xa0, 0xff, 0x012f},
1999         {0xa0, 0x26, 0x0130},
2000         {0xa0, 0x22, 0x0131},
2001         {0xa0, 0x20, 0x0132},
2002         {0xa0, 0x1c, 0x0133},
2003         {0xa0, 0x16, 0x0134},
2004         {0xa0, 0x13, 0x0135},
2005         {0xa0, 0x10, 0x0136},
2006         {0xa0, 0x0d, 0x0137},
2007         {0xa0, 0x0b, 0x0138},
2008         {0xa0, 0x09, 0x0139},
2009         {0xa0, 0x07, 0x013a},
2010         {0xa0, 0x06, 0x013b},
2011         {0xa0, 0x05, 0x013c},
2012         {0xa0, 0x04, 0x013d},
2013         {0xa0, 0x03, 0x013e},
2014         {0xa0, 0x02, 0x013f},
2015
2016         {0xa0, 0x66, 0x010a},   /* matrix */
2017         {0xa0, 0xed, 0x010b},
2018         {0xa0, 0xed, 0x010c},
2019         {0xa0, 0xed, 0x010d},
2020         {0xa0, 0x66, 0x010e},
2021         {0xa0, 0xed, 0x010f},
2022         {0xa0, 0xed, 0x0110},
2023         {0xa0, 0xed, 0x0111},
2024         {0xa0, 0x66, 0x0112},
2025
2026         {0xa1, 0x01, 0x0180},
2027         {0xa0, 0x00, 0x0180},
2028         {0xa0, 0x00, 0x0019},
2029         {0xaa, 0x13, 0x0031},
2030         {0xaa, 0x14, 0x0001},
2031         {0xaa, 0x0e, 0x0004},
2032         {0xaa, 0x19, 0x00cd},
2033         {0xa0, 0x00, 0x0190},
2034         {0xa0, 0x02, 0x0191},
2035         {0xa0, 0x62, 0x0192},
2036         {0xa0, 0x00, 0x0195},
2037         {0xa0, 0x00, 0x0196},
2038         {0xa0, 0x3d, 0x0197},
2039         {0xa0, 0x10, 0x018c},
2040         {0xa0, 0x20, 0x018f},
2041
2042         {0xa0, 0x0c, 0x01a9},   /* 0x14 */
2043         {0xa0, 0x28, 0x01aa},
2044         {0xa0, 0x04, 0x001d},
2045         {0xa0, 0x18, 0x001e},
2046         {0xa0, 0x2c, 0x001f},
2047         {0xa0, 0x41, 0x0020},
2048         {0xa0, 0x60, 0x011d},
2049         {0xa0, 0x42, 0x0180},
2050         {0xa1, 0x01, 0x0180},
2051         {0xa0, 0x42, 0x0180},
2052         {0xa0, 0x40, 0x0116},
2053         {0xa0, 0x40, 0x0117},
2054         {0xa0, 0x40, 0x0118},
2055         {}
2056 };
2057 static struct usb_action hdcs2020xb_InitialScale[] = {
2058         {0xa0, 0x01, 0x0000},
2059         {0xa0, 0x00, 0x0002},
2060         {0xa0, 0x03, 0x0008},
2061         {0xa0, 0x08, 0x0010},
2062         {0xa0, 0x02, 0x0003},
2063         {0xa0, 0x80, 0x0004},
2064         {0xa0, 0x01, 0x0005},
2065         {0xa0, 0xe0, 0x0006},
2066         {0xa0, 0x01, 0x0001},
2067         {0xa0, 0x03, 0x0012},
2068         {0xa0, 0x01, 0x0012},
2069         {0xa0, 0x00, 0x0098},
2070         {0xa0, 0x00, 0x009a},
2071         {0xa0, 0x00, 0x011a},
2072         {0xa0, 0x00, 0x011c},
2073         {0xa0, 0xe8, 0x009c},
2074         {0xa0, 0x88, 0x009e},
2075         {0xaa, 0x1c, 0x0000},
2076         {0xaa, 0x0a, 0x0001},
2077         {0xaa, 0x0b, 0x0006},
2078         {0xaa, 0x0c, 0x007a},
2079         {0xaa, 0x0d, 0x00a7},
2080         {0xaa, 0x03, 0x00fb},
2081         {0xaa, 0x05, 0x0000},
2082         {0xaa, 0x06, 0x0003},
2083         {0xaa, 0x09, 0x0008},
2084         {0xaa, 0x0f, 0x0018},   /* original setting */
2085         {0xaa, 0x10, 0x0018},
2086         {0xaa, 0x11, 0x0018},
2087         {0xaa, 0x12, 0x0018},
2088         {0xaa, 0x15, 0x004e},
2089         {0xaa, 0x1c, 0x0004},
2090         {0xa0, 0xf7, 0x0101},
2091         {0xa0, 0x05, 0x0012},
2092         {0xa0, 0x70, 0x018d},
2093         {0xa0, 0x0d, 0x0100},
2094         {0xa0, 0x06, 0x0189},
2095         {0xa0, 0x03, 0x01c5},
2096         {0xa0, 0x13, 0x01cb},
2097         {0xa0, 0x08, 0x0250},
2098         {0xa0, 0x08, 0x0301},
2099         {0xa1, 0x01, 0x0002},
2100         {0xa1, 0x01, 0x0008},
2101         {0xa1, 0x01, 0x0180},
2102         {0xa0, 0x02, 0x0180},
2103         {0xa0, 0x40, 0x0116},
2104         {0xa0, 0x40, 0x0117},
2105         {0xa0, 0x40, 0x0118},
2106         {0xa1, 0x01, 0x0008},
2107         {0xa0, 0x03, 0x0008},   /* clock ? */
2108         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
2109         {0xa1, 0x01, 0x01c8},
2110         {0xa1, 0x01, 0x01c9},
2111         {0xa1, 0x01, 0x01ca},
2112         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
2113         {0xa0, 0x13, 0x0120},   /* gamma 4 */
2114         {0xa0, 0x38, 0x0121},
2115         {0xa0, 0x59, 0x0122},
2116         {0xa0, 0x79, 0x0123},
2117         {0xa0, 0x92, 0x0124},
2118         {0xa0, 0xa7, 0x0125},
2119         {0xa0, 0xb9, 0x0126},
2120         {0xa0, 0xc8, 0x0127},
2121         {0xa0, 0xd4, 0x0128},
2122         {0xa0, 0xdf, 0x0129},
2123         {0xa0, 0xe7, 0x012a},
2124         {0xa0, 0xee, 0x012b},
2125         {0xa0, 0xf4, 0x012c},
2126         {0xa0, 0xf9, 0x012d},
2127         {0xa0, 0xfc, 0x012e},
2128         {0xa0, 0xff, 0x012f},
2129         {0xa0, 0x26, 0x0130},
2130         {0xa0, 0x22, 0x0131},
2131         {0xa0, 0x20, 0x0132},
2132         {0xa0, 0x1c, 0x0133},
2133         {0xa0, 0x16, 0x0134},
2134         {0xa0, 0x13, 0x0135},
2135         {0xa0, 0x10, 0x0136},
2136         {0xa0, 0x0d, 0x0137},
2137         {0xa0, 0x0b, 0x0138},
2138         {0xa0, 0x09, 0x0139},
2139         {0xa0, 0x07, 0x013a},
2140         {0xa0, 0x06, 0x013b},
2141         {0xa0, 0x05, 0x013c},
2142         {0xa0, 0x04, 0x013d},
2143         {0xa0, 0x03, 0x013e},
2144         {0xa0, 0x02, 0x013f},
2145         {0xa0, 0x66, 0x010a},   /* matrix */
2146         {0xa0, 0xed, 0x010b},
2147         {0xa0, 0xed, 0x010c},
2148         {0xa0, 0xed, 0x010d},
2149         {0xa0, 0x66, 0x010e},
2150         {0xa0, 0xed, 0x010f},
2151         {0xa0, 0xed, 0x0110},
2152         {0xa0, 0xed, 0x0111},
2153         {0xa0, 0x66, 0x0112},
2154         {0xa1, 0x01, 0x0180},
2155         {0xa0, 0x00, 0x0180},
2156         {0xa0, 0x00, 0x0019},
2157  /**** set exposure ***/
2158         {0xaa, 0x13, 0x0031},
2159         {0xaa, 0x14, 0x0001},
2160         {0xaa, 0x0e, 0x0004},
2161         {0xaa, 0x19, 0x00cd},
2162         {0xa0, 0x00, 0x0190},
2163         {0xa0, 0x02, 0x0191},
2164         {0xa0, 0x62, 0x0192},
2165         {0xa0, 0x00, 0x0195},
2166         {0xa0, 0x00, 0x0196},
2167         {0xa0, 0x3d, 0x0197},
2168         {0xa0, 0x10, 0x018c},
2169         {0xa0, 0x20, 0x018f},
2170         {0xa0, 0x0c, 0x01a9},
2171         {0xa0, 0x28, 0x01aa},
2172         {0xa0, 0x04, 0x001d},
2173         {0xa0, 0x18, 0x001e},
2174         {0xa0, 0x2c, 0x001f},
2175         {0xa0, 0x41, 0x0020},
2176         {0xa0, 0x60, 0x011d},
2177         {0xa0, 0x42, 0x0180},
2178         {0xa1, 0x01, 0x0180},
2179         {0xa0, 0x42, 0x0180},
2180         {0xa0, 0x40, 0x0116},
2181         {0xa0, 0x40, 0x0117},
2182         {0xa0, 0x40, 0x0118},
2183         {}
2184 };
2185 static struct usb_action hdcs2020b_50HZ[] = {
2186         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
2187         {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
2188         {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2189         {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */
2190         {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */
2191         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
2192         {0xa0, 0x02, 0x0191}, /* 01,91,02,cc */
2193         {0xa0, 0x76, 0x0192}, /* 01,92,76,cc */
2194         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
2195         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
2196         {0xa0, 0x46, 0x0197}, /* 01,97,46,cc */
2197         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
2198         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
2199         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
2200         {0xa0, 0x28, 0x01aa}, /* 01,aa,28,cc */
2201         {0xa0, 0x05, 0x001d}, /* 00,1d,05,cc */
2202         {0xa0, 0x1a, 0x001e}, /* 00,1e,1a,cc */
2203         {0xa0, 0x2f, 0x001f}, /* 00,1f,2f,cc */
2204         {}
2205 };
2206 static struct usb_action hdcs2020b_60HZ[] = {
2207         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
2208         {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
2209         {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2210         {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
2211         {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */
2212         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
2213         {0xa0, 0x02, 0x0191}, /* 01,91,02,cc */
2214         {0xa0, 0x62, 0x0192}, /* 01,92,62,cc */
2215         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
2216         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
2217         {0xa0, 0x3d, 0x0197}, /* 01,97,3d,cc */
2218         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
2219         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
2220         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
2221         {0xa0, 0x28, 0x01aa}, /* 01,aa,28,cc */
2222         {0xa0, 0x04, 0x001d}, /* 00,1d,04,cc */
2223         {0xa0, 0x18, 0x001e}, /* 00,1e,18,cc */
2224         {0xa0, 0x2c, 0x001f}, /* 00,1f,2c,cc */
2225         {}
2226 };
2227 static struct usb_action hdcs2020b_NoFliker[] = {
2228         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
2229         {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
2230         {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2231         {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
2232         {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */
2233         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
2234         {0xa0, 0x02, 0x0191}, /* 01,91,02,cc */
2235         {0xa0, 0x70, 0x0192}, /* 01,92,70,cc */
2236         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
2237         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
2238         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
2239         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
2240         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
2241         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
2242         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
2243         {0xa0, 0x04, 0x001d}, /* 00,1d,04,cc */
2244         {0xa0, 0x17, 0x001e}, /* 00,1e,17,cc */
2245         {0xa0, 0x2a, 0x001f}, /* 00,1f,2a,cc */
2246         {}
2247 };
2248
2249 static struct usb_action hv7131bxx_Initial[] = {
2250         {0xa0, 0x01, 0x0000},
2251         {0xa0, 0x10, 0x0002},
2252         {0xa0, 0x00, 0x0010},
2253         {0xa0, 0x01, 0x0001},
2254         {0xa0, 0x77, 0x0101},
2255         {0xa0, 0x03, 0x0008},   /* 00 */
2256         {0xa0, 0x03, 0x0012},
2257         {0xa0, 0x01, 0x0012},
2258         {0xa0, 0x02, 0x0003},
2259         {0xa0, 0x80, 0x0004},
2260         {0xa0, 0x01, 0x0005},
2261         {0xa0, 0xe0, 0x0006},
2262         {0xa0, 0x00, 0x0098},
2263         {0xa0, 0x00, 0x009a},
2264         {0xa0, 0x00, 0x011a},
2265         {0xa0, 0x00, 0x011c},
2266         {0xaa, 0x30, 0x002d},
2267         {0xaa, 0x01, 0x0005},
2268         {0xaa, 0x11, 0x0000},
2269         {0xaa, 0x13, 0x0001},   /* {0xaa, 0x13, 0x0000}, */
2270         {0xaa, 0x14, 0x0001},
2271         {0xaa, 0x15, 0x00e8},
2272         {0xaa, 0x16, 0x0002},
2273         {0xaa, 0x17, 0x0086},
2274         {0xaa, 0x31, 0x0038},
2275         {0xaa, 0x32, 0x0038},
2276         {0xaa, 0x33, 0x0038},
2277         {0xaa, 0x5b, 0x0001},
2278         {0xa0, 0x00, 0x0019},
2279         {0xa0, 0x05, 0x0012},
2280         {0xa0, 0x0d, 0x0100},
2281         {0xa0, 0x68, 0x018d},
2282         {0xa0, 0x60, 0x01a8},
2283         {0xa0, 0x00, 0x01ad},
2284         {0xa0, 0xc0, 0x019b},
2285         {0xa0, 0xa0, 0x019c},
2286         {0xa0, 0x02, 0x0188},
2287         {0xa0, 0x06, 0x0189},
2288         {0xa0, 0x03, 0x01c5},
2289         {0xa0, 0x13, 0x01cb},
2290         {0xa0, 0x08, 0x0250},
2291         {0xa0, 0x08, 0x0301},
2292         {0xaa, 0x02, 0x0080},   /* {0xaa, 0x02, 0x0090}; */
2293         {0xa1, 0x01, 0x0002},
2294         {0xa0, 0x00, 0x0092},
2295         {0xa0, 0x02, 0x0090},
2296         {0xa1, 0x01, 0x0091},
2297         {0xa1, 0x01, 0x0095},
2298         {0xa1, 0x01, 0x0096},
2299
2300         {0xa1, 0x01, 0x0008},
2301         {0xa0, 0x03, 0x0008},   /* clock ? */
2302         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
2303         {0xa1, 0x01, 0x01c8},
2304         {0xa1, 0x01, 0x01c9},
2305         {0xa1, 0x01, 0x01ca},
2306         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
2307
2308         {0xa0, 0x50, 0x010a},   /* matrix */
2309         {0xa0, 0xf8, 0x010b},
2310         {0xa0, 0xf8, 0x010c},
2311         {0xa0, 0xf8, 0x010d},
2312         {0xa0, 0x50, 0x010e},
2313         {0xa0, 0xf8, 0x010f},
2314         {0xa0, 0xf8, 0x0110},
2315         {0xa0, 0xf8, 0x0111},
2316         {0xa0, 0x50, 0x0112},
2317         {0xa1, 0x01, 0x0180},
2318         {0xa0, 0x10, 0x0180},
2319         {0xa0, 0x00, 0x0019},
2320         {0xaa, 0x25, 0x0007},
2321         {0xaa, 0x26, 0x00a1},
2322         {0xaa, 0x27, 0x0020},
2323         {0xaa, 0x20, 0x0000},
2324         {0xaa, 0x21, 0x00a0},
2325         {0xaa, 0x22, 0x0016},
2326         {0xaa, 0x23, 0x0040},
2327
2328         {0xa0, 0x10, 0x0190},   /* 2F */
2329         {0xa0, 0x04, 0x0191},   /* 4d */
2330         {0xa0, 0x60, 0x0192},
2331         {0xa0, 0x01, 0x0195},
2332         {0xa0, 0x86, 0x0196},
2333         {0xa0, 0xa0, 0x0197},
2334         {0xa0, 0x07, 0x018c},
2335         {0xa0, 0x0f, 0x018f},
2336         {0xa0, 0x18, 0x01a9},
2337         {0xa0, 0x24, 0x01aa},
2338         {0xa0, 0x00, 0x001d},
2339         {0xa0, 0xa0, 0x001e},
2340         {0xa0, 0x16, 0x001f},
2341         {0xa0, 0x40, 0x0020},
2342         {0xa0, 0x60, 0x011d},
2343         {0xa1, 0x01, 0x001d},
2344         {0xa1, 0x01, 0x001e},
2345         {0xa1, 0x01, 0x001f},
2346         {0xa1, 0x01, 0x0020},
2347         {0xa0, 0x40, 0x0180},
2348         {0xa1, 0x01, 0x0180},
2349         {0xa0, 0x42, 0x0180},
2350         {0xa0, 0x40, 0x0116},
2351         {0xa0, 0x40, 0x0117},
2352         {0xa0, 0x40, 0x0118},
2353 /*      {0xa0, 0x02, 0x0008}, */
2354         {}
2355 };
2356
2357 static struct usb_action hv7131bxx_InitialScale[] = {
2358         {0xa0, 0x01, 0x0000},
2359         {0xa0, 0x00, 0x0002},
2360         {0xa0, 0x00, 0x0010},
2361         {0xa0, 0x01, 0x0001},
2362         {0xa0, 0x37, 0x0101},
2363         {0xa0, 0x03, 0x0008},   /* 00 */
2364         {0xa0, 0x03, 0x0012},
2365         {0xa0, 0x01, 0x0012},
2366         {0xa0, 0x02, 0x0003},
2367         {0xa0, 0x80, 0x0004},
2368         {0xa0, 0x01, 0x0005},
2369         {0xa0, 0xe0, 0x0006},
2370         {0xa0, 0x00, 0x0098},
2371         {0xa0, 0x00, 0x009a},
2372         {0xa0, 0x00, 0x011a},
2373         {0xa0, 0x00, 0x011c},
2374         {0xaa, 0x30, 0x002d},
2375         {0xaa, 0x01, 0x0005},
2376         {0xaa, 0x11, 0x0001},
2377         {0xaa, 0x13, 0x0000},   /* {0xaa, 0x13, 0x0001}; */
2378         {0xaa, 0x14, 0x0001},
2379         {0xaa, 0x15, 0x00e6},
2380         {0xaa, 0x16, 0x0002},
2381         {0xaa, 0x17, 0x0086},
2382         {0xaa, 0x31, 0x0038},
2383         {0xaa, 0x32, 0x0038},
2384         {0xaa, 0x33, 0x0038},
2385         {0xaa, 0x5b, 0x0001},
2386         {0xa0, 0x00, 0x0019},
2387         {0xa0, 0x05, 0x0012},
2388         {0xa0, 0x0d, 0x0100},
2389         {0xa0, 0x70, 0x018d},
2390         {0xa0, 0x60, 0x01a8},
2391         {0xa0, 0x00, 0x01ad},
2392         {0xa0, 0xc0, 0x019b},
2393         {0xa0, 0xa0, 0x019c},
2394         {0xa0, 0x02, 0x0188},
2395         {0xa0, 0x06, 0x0189},
2396         {0xa0, 0x03, 0x01c5},
2397         {0xa0, 0x13, 0x01cb},
2398         {0xa0, 0x08, 0x0250},
2399         {0xa0, 0x08, 0x0301},
2400         {0xaa, 0x02, 0x0090},   /* {0xaa, 0x02, 0x0080}, */
2401         {0xa1, 0x01, 0x0002},
2402         {0xa0, 0x00, 0x0092},
2403         {0xa0, 0x02, 0x0090},
2404         {0xa1, 0x01, 0x0091},
2405         {0xa1, 0x01, 0x0095},
2406         {0xa1, 0x01, 0x0096},
2407         {0xa1, 0x01, 0x0008},
2408         {0xa0, 0x03, 0x0008},   /* clock ? */
2409         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
2410         {0xa1, 0x01, 0x01c8},
2411         {0xa1, 0x01, 0x01c9},
2412         {0xa1, 0x01, 0x01ca},
2413         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
2414
2415         {0xa0, 0x50, 0x010a},   /* matrix */
2416         {0xa0, 0xf8, 0x010b},
2417         {0xa0, 0xf8, 0x010c},
2418         {0xa0, 0xf8, 0x010d},
2419         {0xa0, 0x50, 0x010e},
2420         {0xa0, 0xf8, 0x010f},
2421         {0xa0, 0xf8, 0x0110},
2422         {0xa0, 0xf8, 0x0111},
2423         {0xa0, 0x50, 0x0112},
2424         {0xa1, 0x01, 0x0180},
2425         {0xa0, 0x10, 0x0180},
2426         {0xa0, 0x00, 0x0019},
2427         {0xaa, 0x25, 0x0007},
2428         {0xaa, 0x26, 0x00a1},
2429         {0xaa, 0x27, 0x0020},
2430         {0xaa, 0x20, 0x0000},
2431         {0xaa, 0x21, 0x0040},
2432         {0xaa, 0x22, 0x0013},
2433         {0xaa, 0x23, 0x004c},
2434         {0xa0, 0x10, 0x0190},   /* 2f */
2435         {0xa0, 0x04, 0x0191},   /* 4d */
2436         {0xa0, 0x60, 0x0192},   /* 60 */
2437         {0xa0, 0x00, 0x0195},
2438         {0xa0, 0xc3, 0x0196},
2439         {0xa0, 0x50, 0x0197},
2440         {0xa0, 0x0c, 0x018c},
2441         {0xa0, 0x18, 0x018f},
2442         {0xa0, 0x18, 0x01a9},
2443         {0xa0, 0x24, 0x01aa},
2444         {0xa0, 0x00, 0x001d},
2445         {0xa0, 0x40, 0x001e},
2446         {0xa0, 0x13, 0x001f},
2447         {0xa0, 0x4c, 0x0020},
2448         {0xa0, 0x60, 0x011d},
2449         {0xa1, 0x01, 0x001d},
2450         {0xa1, 0x01, 0x001e},
2451         {0xa1, 0x01, 0x001f},
2452         {0xa1, 0x01, 0x0020},
2453         {0xa0, 0x40, 0x0180},
2454         {0xa1, 0x01, 0x0180},
2455         {0xa0, 0x42, 0x0180},
2456         {0xa0, 0x40, 0x0116},
2457         {0xa0, 0x40, 0x0117},
2458         {0xa0, 0x40, 0x0118},
2459 /*      {0xa0, 0x02, 0x0008}, */
2460         {}
2461 };
2462
2463 static struct usb_action hv7131cxx_Initial[] = {
2464         {0xa0, 0x01, 0x0000},
2465         {0xa0, 0x10, 0x0002},
2466         {0xa0, 0x01, 0x0010},
2467         {0xa0, 0x01, 0x0001},
2468         {0xa0, 0x77, 0x0101},
2469         {0xa0, 0x03, 0x0008},
2470         {0xa0, 0x05, 0x0012},
2471         {0xa0, 0x07, 0x0012},
2472         {0xa0, 0x02, 0x0003},
2473         {0xa0, 0x80, 0x0004},
2474         {0xa0, 0x01, 0x0005},
2475         {0xa0, 0xe0, 0x0006},
2476         {0xa0, 0x00, 0x0098},
2477         {0xa0, 0x00, 0x009a},
2478         {0xa0, 0x01, 0x009b},
2479         {0xa0, 0xe8, 0x009c},
2480         {0xa0, 0x02, 0x009d},
2481         {0xa0, 0x88, 0x009e},
2482         {0xa0, 0x00, 0x011a},
2483         {0xa0, 0x00, 0x011c},
2484         {0xa0, 0x05, 0x0012},
2485         {0xaa, 0x01, 0x000c},
2486         {0xaa, 0x11, 0x0000},
2487         {0xaa, 0x13, 0x0000},
2488         {0xaa, 0x14, 0x0001},
2489         {0xaa, 0x15, 0x00e8},
2490         {0xaa, 0x16, 0x0002},
2491         {0xaa, 0x17, 0x0088},
2492
2493         {0xa0, 0x00, 0x0019},
2494         {0xa0, 0x0d, 0x0100},
2495         {0xa0, 0x89, 0x018d},
2496         {0xa0, 0x50, 0x01a8},
2497         {0xa0, 0x00, 0x01ad},
2498         {0xa0, 0xc0, 0x019b},
2499         {0xa0, 0xa0, 0x019c},
2500         {0xa0, 0x06, 0x0189},
2501         {0xa0, 0x03, 0x01c5},
2502         {0xa0, 0x13, 0x01cb},
2503         {0xa0, 0x08, 0x0250},
2504         {0xa0, 0x08, 0x0301},
2505         {0xa1, 0x01, 0x0002},
2506         {0xa0, 0x00, 0x0092},
2507         {0xa0, 0x02, 0x0090},
2508         {0xa1, 0x01, 0x0091},
2509         {0xa1, 0x01, 0x0095},
2510         {0xa1, 0x01, 0x0096},
2511
2512         {0xa1, 0x01, 0x0008},
2513         {0xa0, 0x03, 0x0008},   /* clock ? */
2514         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
2515         {0xa1, 0x01, 0x01c8},
2516         {0xa1, 0x01, 0x01c9},
2517         {0xa1, 0x01, 0x01ca},
2518         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
2519
2520         {0xa0, 0x60, 0x010a},   /* matrix */
2521         {0xa0, 0xf0, 0x010b},
2522         {0xa0, 0xf0, 0x010c},
2523         {0xa0, 0xf0, 0x010d},
2524         {0xa0, 0x60, 0x010e},
2525         {0xa0, 0xf0, 0x010f},
2526         {0xa0, 0xf0, 0x0110},
2527         {0xa0, 0xf0, 0x0111},
2528         {0xa0, 0x60, 0x0112},
2529         {0xa1, 0x01, 0x0180},
2530         {0xa0, 0x10, 0x0180},
2531         {0xa0, 0x00, 0x0019},
2532         {0xaa, 0x25, 0x0007},
2533         {0xaa, 0x26, 0x0053},
2534         {0xaa, 0x27, 0x0000},
2535
2536         {0xa0, 0x10, 0x0190},   /* 2f */
2537         {0xa0, 0x04, 0x0191},   /* 9b */
2538         {0xa0, 0x60, 0x0192},   /* 80 */
2539         {0xa0, 0x01, 0x0195},
2540         {0xa0, 0xd4, 0x0196},
2541         {0xa0, 0xc0, 0x0197},
2542         {0xa0, 0x10, 0x018c},
2543         {0xa0, 0x20, 0x018f},
2544         {0xa0, 0x60, 0x01a8},
2545         {0xa0, 0x10, 0x01a9},
2546         {0xa0, 0x13, 0x01aa},
2547         {0xa1, 0x01, 0x001d},
2548         {0xa1, 0x01, 0x001e},
2549         {0xa1, 0x01, 0x001f},
2550         {0xa1, 0x01, 0x0020},
2551         {0xa0, 0x40, 0x0180},
2552         {0xa1, 0x01, 0x0180},
2553         {0xa0, 0x42, 0x0180},
2554         {}
2555 };
2556
2557 static struct usb_action hv7131cxx_InitialScale[] = {
2558         {0xa0, 0x01, 0x0000},
2559
2560         {0xa0, 0x00, 0x0002},   /* diff */
2561         {0xa0, 0x01, 0x0010},
2562         {0xa0, 0x01, 0x0001},
2563         {0xa0, 0x77, 0x0101},
2564         {0xa0, 0x03, 0x0008},
2565
2566         {0xa0, 0x05, 0x0012},
2567         {0xa0, 0x07, 0x0012},
2568
2569         {0xa0, 0x02, 0x0003},
2570         {0xa0, 0x80, 0x0004},
2571         {0xa0, 0x01, 0x0005},
2572         {0xa0, 0xe0, 0x0006},   /* 1e0 */
2573
2574         {0xa0, 0x00, 0x0098},
2575         {0xa0, 0x00, 0x009a},
2576         {0xa0, 0x01, 0x009b},
2577         {0xa0, 0xe8, 0x009c},
2578         {0xa0, 0x02, 0x009d},
2579         {0xa0, 0x88, 0x009e},
2580         {0xa0, 0x00, 0x011a},
2581         {0xa0, 0x00, 0x011c},
2582         {0xa0, 0x05, 0x0012},
2583         {0xaa, 0x01, 0x000c},
2584         {0xaa, 0x11, 0x0000},
2585         {0xaa, 0x13, 0x0000},
2586         {0xaa, 0x14, 0x0001},
2587         {0xaa, 0x15, 0x00e8},
2588         {0xaa, 0x16, 0x0002},
2589         {0xaa, 0x17, 0x0088},
2590
2591         {0xa0, 0x00, 0x0019},   /* 00 */
2592
2593         {0xa0, 0x0d, 0x0100},
2594         {0xa0, 0x89, 0x018d},
2595         {0xa0, 0x50, 0x01a8},
2596         {0xa0, 0x00, 0x01ad},
2597         {0xa0, 0xc0, 0x019b},
2598         {0xa0, 0xa0, 0x019c},
2599         {0xa0, 0x06, 0x0189},
2600         {0xa0, 0x03, 0x01c5},
2601         {0xa0, 0x13, 0x01cb},
2602         {0xa0, 0x08, 0x0250},
2603         {0xa0, 0x08, 0x0301},
2604         {0xa1, 0x01, 0x0002},
2605         {0xa0, 0x00, 0x0092},   /* read the i2c chips ident */
2606         {0xa0, 0x02, 0x0090},
2607         {0xa1, 0x01, 0x0091},
2608         {0xa1, 0x01, 0x0095},
2609         {0xa1, 0x01, 0x0096},
2610
2611         {0xa1, 0x01, 0x0008},
2612         {0xa0, 0x03, 0x0008},   /* clock ? */
2613         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
2614         {0xa1, 0x01, 0x01c8},
2615         {0xa1, 0x01, 0x01c9},
2616         {0xa1, 0x01, 0x01ca},
2617         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
2618
2619         {0xa0, 0x60, 0x010a},   /* matrix */
2620         {0xa0, 0xf0, 0x010b},
2621         {0xa0, 0xf0, 0x010c},
2622         {0xa0, 0xf0, 0x010d},
2623         {0xa0, 0x60, 0x010e},
2624         {0xa0, 0xf0, 0x010f},
2625         {0xa0, 0xf0, 0x0110},
2626         {0xa0, 0xf0, 0x0111},
2627         {0xa0, 0x60, 0x0112},
2628         {0xa1, 0x01, 0x0180},
2629         {0xa0, 0x10, 0x0180},
2630         {0xa0, 0x00, 0x0019},
2631         {0xaa, 0x25, 0x0007},
2632         {0xaa, 0x26, 0x0053},
2633         {0xaa, 0x27, 0x0000},
2634
2635         {0xa0, 0x10, 0x0190},   /* 2f */
2636         {0xa0, 0x04, 0x0191},   /* 9b */
2637         {0xa0, 0x60, 0x0192},   /* 80 */
2638
2639         {0xa0, 0x01, 0x0195},
2640         {0xa0, 0xd4, 0x0196},
2641         {0xa0, 0xc0, 0x0197},
2642
2643         {0xa0, 0x10, 0x018c},
2644         {0xa0, 0x20, 0x018f},
2645         {0xa0, 0x60, 0x01a8},
2646         {0xa0, 0x10, 0x01a9},
2647         {0xa0, 0x13, 0x01aa},
2648         {0xa1, 0x01, 0x001d},
2649         {0xa1, 0x01, 0x001e},
2650         {0xa1, 0x01, 0x001f},
2651         {0xa1, 0x01, 0x0020},
2652         {0xa0, 0x40, 0x0180},
2653         {0xa1, 0x01, 0x0180},
2654         {0xa0, 0x42, 0x0180},
2655         {}
2656 };
2657
2658 static struct usb_action icm105axx_Initial[] = {
2659         {0xa0, 0x01, 0x0000},
2660         {0xa0, 0x10, 0x0002},
2661         {0xa0, 0x03, 0x0008},
2662         {0xa0, 0x0c, 0x0010},
2663         {0xa0, 0x02, 0x0003},
2664         {0xa0, 0x80, 0x0004},
2665         {0xa0, 0x01, 0x0005},
2666         {0xa0, 0xe0, 0x0006},
2667         {0xa0, 0x01, 0x0001},
2668         {0xa0, 0x03, 0x0012},
2669         {0xa0, 0x01, 0x0012},
2670         {0xa0, 0xa1, 0x008b},
2671         {0xa0, 0x00, 0x0097},
2672         {0xa0, 0x01, 0x0098},
2673         {0xa0, 0x00, 0x0099},
2674         {0xa0, 0x01, 0x009a},
2675         {0xa0, 0x01, 0x011a},
2676         {0xa0, 0x01, 0x011c},
2677         {0xa0, 0x01, 0x009b},
2678         {0xa0, 0xe8, 0x009c},
2679         {0xa0, 0x02, 0x009d},
2680         {0xa0, 0x88, 0x009e},
2681         {0xa0, 0x37, 0x0101},
2682         {0xa0, 0x0d, 0x0100},
2683         {0xa0, 0x06, 0x0189},
2684         {0xa0, 0x03, 0x01c5},
2685         {0xa0, 0x13, 0x01cb},
2686         {0xaa, 0x01, 0x0010},
2687         {0xaa, 0x03, 0x0000},
2688         {0xaa, 0x04, 0x0001},
2689         {0xaa, 0x05, 0x0020},
2690         {0xaa, 0x06, 0x0001},
2691         {0xaa, 0x08, 0x0000},
2692         {0xaa, 0x03, 0x0001},
2693         {0xaa, 0x04, 0x0011},
2694         {0xaa, 0x05, 0x00a0},
2695         {0xaa, 0x06, 0x0001},
2696         {0xaa, 0x08, 0x0000},
2697         {0xaa, 0x03, 0x0002},
2698         {0xaa, 0x04, 0x0013},
2699         {0xaa, 0x05, 0x0020},
2700         {0xaa, 0x06, 0x0001},
2701         {0xaa, 0x08, 0x0000},
2702         {0xaa, 0x03, 0x0003},
2703         {0xaa, 0x04, 0x0015},
2704         {0xaa, 0x05, 0x0020},
2705         {0xaa, 0x06, 0x0005},
2706         {0xaa, 0x08, 0x0000},
2707         {0xaa, 0x03, 0x0004},
2708         {0xaa, 0x04, 0x0017},
2709         {0xaa, 0x05, 0x0020},
2710         {0xaa, 0x06, 0x000d},
2711         {0xaa, 0x08, 0x0000},
2712         {0xaa, 0x03, 0x0005},
2713         {0xaa, 0x04, 0x0019},
2714         {0xaa, 0x05, 0x0020},
2715         {0xaa, 0x06, 0x0005},
2716         {0xaa, 0x08, 0x0000},
2717         {0xaa, 0x03, 0x0006},
2718         {0xaa, 0x04, 0x0017},
2719         {0xaa, 0x05, 0x0026},
2720         {0xaa, 0x06, 0x0005},
2721         {0xaa, 0x08, 0x0000},
2722         {0xaa, 0x03, 0x0007},
2723         {0xaa, 0x04, 0x0019},
2724         {0xaa, 0x05, 0x0022},
2725         {0xaa, 0x06, 0x0005},
2726         {0xaa, 0x08, 0x0000},
2727         {0xaa, 0x03, 0x0008},
2728         {0xaa, 0x04, 0x0021},
2729         {0xaa, 0x05, 0x00aa},
2730         {0xaa, 0x06, 0x0005},
2731         {0xaa, 0x08, 0x0000},
2732         {0xaa, 0x03, 0x0009},
2733         {0xaa, 0x04, 0x0023},
2734         {0xaa, 0x05, 0x00aa},
2735         {0xaa, 0x06, 0x000d},
2736         {0xaa, 0x08, 0x0000},
2737         {0xaa, 0x03, 0x000a},
2738         {0xaa, 0x04, 0x0025},
2739         {0xaa, 0x05, 0x00aa},
2740         {0xaa, 0x06, 0x0005},
2741         {0xaa, 0x08, 0x0000},
2742         {0xaa, 0x03, 0x000b},
2743         {0xaa, 0x04, 0x00ec},
2744         {0xaa, 0x05, 0x002e},
2745         {0xaa, 0x06, 0x0005},
2746         {0xaa, 0x08, 0x0000},
2747         {0xaa, 0x03, 0x000c},
2748         {0xaa, 0x04, 0x00fa},
2749         {0xaa, 0x05, 0x002a},
2750         {0xaa, 0x06, 0x0005},
2751         {0xaa, 0x08, 0x0000},
2752         {0xaa, 0x07, 0x000d},
2753         {0xaa, 0x01, 0x0005},
2754         {0xaa, 0x94, 0x0002},
2755         {0xaa, 0x90, 0x0000},
2756         {0xaa, 0x91, 0x001f},
2757         {0xaa, 0x10, 0x0064},
2758         {0xaa, 0x9b, 0x00f0},
2759         {0xaa, 0x9c, 0x0002},
2760         {0xaa, 0x14, 0x001a},
2761         {0xaa, 0x20, 0x0080},
2762         {0xaa, 0x22, 0x0080},
2763         {0xaa, 0x24, 0x0080},
2764         {0xaa, 0x26, 0x0080},
2765         {0xaa, 0x00, 0x0084},
2766         {0xa0, 0x08, 0x0250},
2767         {0xa0, 0x08, 0x0301},
2768         {0xaa, 0xa8, 0x00c0},
2769         {0xa1, 0x01, 0x0002},
2770         {0xa1, 0x01, 0x0008},
2771         {0xa1, 0x01, 0x0180},
2772         {0xa0, 0x02, 0x0180},
2773         {0xa0, 0x40, 0x0116},
2774         {0xa0, 0x40, 0x0117},
2775         {0xa0, 0x40, 0x0118},
2776         {0xa1, 0x01, 0x0008},
2777
2778         {0xa0, 0x03, 0x0008},   /* clock ? */
2779         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
2780         {0xa1, 0x01, 0x01c8},
2781         {0xa1, 0x01, 0x01c9},
2782         {0xa1, 0x01, 0x01ca},
2783         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
2784         {0xa0, 0x52, 0x010a},   /* matrix */
2785         {0xa0, 0xf7, 0x010b},
2786         {0xa0, 0xf7, 0x010c},
2787         {0xa0, 0xf7, 0x010d},
2788         {0xa0, 0x52, 0x010e},
2789         {0xa0, 0xf7, 0x010f},
2790         {0xa0, 0xf7, 0x0110},
2791         {0xa0, 0xf7, 0x0111},
2792         {0xa0, 0x52, 0x0112},
2793         {0xa1, 0x01, 0x0180},
2794         {0xa0, 0x00, 0x0180},
2795         {0xa0, 0x00, 0x0019},
2796         {0xaa, 0x0d, 0x0003},
2797         {0xaa, 0x0c, 0x008c},
2798         {0xaa, 0x0e, 0x0095},
2799         {0xaa, 0x0f, 0x0002},
2800         {0xaa, 0x1c, 0x0094},
2801         {0xaa, 0x1d, 0x0002},
2802         {0xaa, 0x20, 0x0080},
2803         {0xaa, 0x22, 0x0080},
2804         {0xaa, 0x24, 0x0080},
2805         {0xaa, 0x26, 0x0080},
2806         {0xaa, 0x00, 0x0084},
2807         {0xa0, 0x02, 0x00a3},
2808         {0xa0, 0x94, 0x00a4},
2809         {0xa0, 0x00, 0x0190},
2810         {0xa0, 0x04, 0x0191},
2811         {0xa0, 0x20, 0x0192},
2812         {0xa0, 0x00, 0x0195},
2813         {0xa0, 0x00, 0x0196},
2814         {0xa0, 0x84, 0x0197},
2815         {0xa0, 0x10, 0x018c},
2816         {0xa0, 0x20, 0x018f},
2817         {0xa0, 0x10, 0x01a9},
2818         {0xa0, 0x12, 0x01aa},
2819         {0xa0, 0xe3, 0x001d},
2820         {0xa0, 0xec, 0x001e},
2821         {0xa0, 0xf5, 0x001f},
2822         {0xa0, 0xff, 0x0020},
2823         {0xa0, 0x00, 0x01a7},
2824         {0xa0, 0xc0, 0x01a8},
2825         {0xa0, 0xc0, 0x011d},
2826         {0xa0, 0x42, 0x0180},
2827         {0xa1, 0x01, 0x0180},
2828         {0xa0, 0x42, 0x0180},
2829         {0xa0, 0x40, 0x0116},
2830         {0xa0, 0x40, 0x0117},
2831         {0xa0, 0x40, 0x0118},
2832         {}
2833 };
2834
2835 static struct usb_action icm105axx_InitialScale[] = {
2836         {0xa0, 0x01, 0x0000},
2837         {0xa0, 0x00, 0x0002},
2838         {0xa0, 0x03, 0x0008},
2839         {0xa0, 0x0c, 0x0010},
2840         {0xa0, 0x02, 0x0003},
2841         {0xa0, 0x80, 0x0004},
2842         {0xa0, 0x01, 0x0005},
2843         {0xa0, 0xe0, 0x0006},
2844         {0xa0, 0x01, 0x0001},
2845         {0xa0, 0x03, 0x0012},
2846         {0xa0, 0x01, 0x0012},
2847         {0xa0, 0xa1, 0x008b},
2848         {0xa0, 0x00, 0x0097},
2849         {0xa0, 0x02, 0x0098},
2850         {0xa0, 0x00, 0x0099},
2851         {0xa0, 0x02, 0x009a},
2852         {0xa0, 0x02, 0x011a},
2853         {0xa0, 0x02, 0x011c},
2854         {0xa0, 0x01, 0x009b},
2855         {0xa0, 0xe6, 0x009c},
2856         {0xa0, 0x02, 0x009d},
2857         {0xa0, 0x86, 0x009e},
2858         {0xa0, 0x77, 0x0101},
2859         {0xa0, 0x0d, 0x0100},
2860         {0xa0, 0x06, 0x0189},
2861         {0xa0, 0x03, 0x01c5},
2862         {0xa0, 0x13, 0x01cb},
2863         {0xaa, 0x01, 0x0010},
2864         {0xaa, 0x03, 0x0000},
2865         {0xaa, 0x04, 0x0001},
2866         {0xaa, 0x05, 0x0020},
2867         {0xaa, 0x06, 0x0001},
2868         {0xaa, 0x08, 0x0000},
2869         {0xaa, 0x03, 0x0001},
2870         {0xaa, 0x04, 0x0011},
2871         {0xaa, 0x05, 0x00a0},
2872         {0xaa, 0x06, 0x0001},
2873         {0xaa, 0x08, 0x0000},
2874         {0xaa, 0x03, 0x0002},
2875         {0xaa, 0x04, 0x0013},
2876         {0xaa, 0x05, 0x0020},
2877         {0xaa, 0x06, 0x0001},
2878         {0xaa, 0x08, 0x0000},
2879         {0xaa, 0x03, 0x0003},
2880         {0xaa, 0x04, 0x0015},
2881         {0xaa, 0x05, 0x0020},
2882         {0xaa, 0x06, 0x0005},
2883         {0xaa, 0x08, 0x0000},
2884         {0xaa, 0x03, 0x0004},
2885         {0xaa, 0x04, 0x0017},
2886         {0xaa, 0x05, 0x0020},
2887         {0xaa, 0x06, 0x000d},
2888         {0xaa, 0x08, 0x0000},
2889         {0xaa, 0x03, 0x0005},
2890         {0xa0, 0x04, 0x0092},
2891         {0xa0, 0x19, 0x0093},
2892         {0xa0, 0x01, 0x0090},
2893         {0xa1, 0x01, 0x0091},
2894         {0xaa, 0x05, 0x0020},
2895         {0xaa, 0x06, 0x0005},
2896         {0xaa, 0x08, 0x0000},
2897         {0xaa, 0x03, 0x0006},
2898         {0xaa, 0x04, 0x0017},
2899         {0xaa, 0x05, 0x0026},
2900         {0xaa, 0x06, 0x0005},
2901         {0xaa, 0x08, 0x0000},
2902         {0xaa, 0x03, 0x0007},
2903         {0xaa, 0x04, 0x0019},
2904         {0xaa, 0x05, 0x0022},
2905         {0xaa, 0x06, 0x0005},
2906         {0xaa, 0x08, 0x0000},
2907         {0xaa, 0x03, 0x0008},
2908         {0xaa, 0x04, 0x0021},
2909         {0xaa, 0x05, 0x00aa},
2910         {0xaa, 0x06, 0x0005},
2911         {0xaa, 0x08, 0x0000},
2912         {0xaa, 0x03, 0x0009},
2913         {0xaa, 0x04, 0x0023},
2914         {0xaa, 0x05, 0x00aa},
2915         {0xaa, 0x06, 0x000d},
2916         {0xaa, 0x08, 0x0000},
2917         {0xaa, 0x03, 0x000a},
2918         {0xaa, 0x04, 0x0025},
2919         {0xaa, 0x05, 0x00aa},
2920         {0xaa, 0x06, 0x0005},
2921         {0xaa, 0x08, 0x0000},
2922         {0xaa, 0x03, 0x000b},
2923         {0xaa, 0x04, 0x00ec},
2924         {0xaa, 0x05, 0x002e},
2925         {0xaa, 0x06, 0x0005},
2926         {0xaa, 0x08, 0x0000},
2927         {0xaa, 0x03, 0x000c},
2928         {0xaa, 0x04, 0x00fa},
2929         {0xaa, 0x05, 0x002a},
2930         {0xaa, 0x06, 0x0005},
2931         {0xaa, 0x08, 0x0000},
2932         {0xaa, 0x07, 0x000d},
2933         {0xaa, 0x01, 0x0005},
2934         {0xaa, 0x94, 0x0002},
2935         {0xaa, 0x90, 0x0000},
2936         {0xaa, 0x91, 0x0010},
2937         {0xaa, 0x10, 0x0064},
2938         {0xaa, 0x9b, 0x00f0},
2939         {0xaa, 0x9c, 0x0002},
2940         {0xaa, 0x14, 0x001a},
2941         {0xaa, 0x20, 0x0080},
2942         {0xaa, 0x22, 0x0080},
2943         {0xaa, 0x24, 0x0080},
2944         {0xaa, 0x26, 0x0080},
2945         {0xaa, 0x00, 0x0084},
2946         {0xa0, 0x08, 0x0250},
2947         {0xa0, 0x08, 0x0301},
2948         {0xaa, 0xa8, 0x0080},
2949         {0xa0, 0x78, 0x018d},
2950         {0xa1, 0x01, 0x0002},
2951         {0xa1, 0x01, 0x0008},
2952         {0xa1, 0x01, 0x0180},
2953         {0xa0, 0x02, 0x0180},
2954         {0xa0, 0x40, 0x0116},
2955         {0xa0, 0x40, 0x0117},
2956         {0xa0, 0x40, 0x0118},
2957         {0xa1, 0x01, 0x0008},
2958
2959         {0xa0, 0x03, 0x0008},   /* clock ? */
2960         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
2961         {0xa1, 0x01, 0x01c8},
2962         {0xa1, 0x01, 0x01c9},
2963         {0xa1, 0x01, 0x01ca},
2964         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
2965
2966         {0xa0, 0x52, 0x010a},   /* matrix */
2967         {0xa0, 0xf7, 0x010b},
2968         {0xa0, 0xf7, 0x010c},
2969         {0xa0, 0xf7, 0x010d},
2970         {0xa0, 0x52, 0x010e},
2971         {0xa0, 0xf7, 0x010f},
2972         {0xa0, 0xf7, 0x0110},
2973         {0xa0, 0xf7, 0x0111},
2974         {0xa0, 0x52, 0x0112},
2975         {0xa1, 0x01, 0x0180},
2976         {0xa0, 0x00, 0x0180},
2977         {0xa0, 0x00, 0x0019},
2978         {0xaa, 0x0d, 0x0003},
2979         {0xaa, 0x0c, 0x0020},
2980         {0xaa, 0x0e, 0x000e},
2981         {0xaa, 0x0f, 0x0002},
2982         {0xaa, 0x1c, 0x000d},
2983         {0xaa, 0x1d, 0x0002},
2984         {0xaa, 0x20, 0x0080},
2985         {0xaa, 0x22, 0x0080},
2986         {0xaa, 0x24, 0x0080},
2987         {0xaa, 0x26, 0x0080},
2988         {0xaa, 0x00, 0x0084},
2989         {0xa0, 0x02, 0x00a3},
2990         {0xa0, 0x0d, 0x00a4},
2991         {0xa0, 0x00, 0x0190},
2992         {0xa0, 0x04, 0x0191},
2993         {0xa0, 0x1a, 0x0192},
2994         {0xa0, 0x00, 0x0195},
2995         {0xa0, 0x00, 0x0196},
2996         {0xa0, 0x4b, 0x0197},
2997         {0xa0, 0x10, 0x018c},
2998         {0xa0, 0x20, 0x018f},
2999         {0xa0, 0x10, 0x01a9},
3000         {0xa0, 0x12, 0x01aa},
3001         {0xa0, 0xc8, 0x001d},
3002         {0xa0, 0xd8, 0x001e},
3003         {0xa0, 0xea, 0x001f},
3004         {0xa0, 0xff, 0x0020},
3005         {0xa0, 0x00, 0x01a7},
3006         {0xa0, 0x42, 0x0180},
3007         {0xa1, 0x01, 0x0180},
3008         {0xa0, 0x42, 0x0180},
3009         {0xa0, 0x40, 0x0116},
3010         {0xa0, 0x40, 0x0117},
3011         {0xa0, 0x40, 0x0118},
3012         {}
3013 };
3014 static struct usb_action icm105a_50HZ[] = {
3015         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
3016         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3017         {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
3018         {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
3019         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3020         {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
3021         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3022         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3023         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3024         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3025         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3026         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3027         {0xa0, 0x02, 0x00a3}, /* 00,a3,02,cc */
3028         {0xa0, 0x0d, 0x00a4}, /* 00,a4,0d,cc */
3029         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
3030         {0xa0, 0x04, 0x0191}, /* 01,91,04,cc */
3031         {0xa0, 0x1a, 0x0192}, /* 01,92,1a,cc */
3032         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
3033         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
3034         {0xa0, 0x4b, 0x0197}, /* 01,97,4b,cc */
3035         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
3036         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
3037         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
3038         {0xa0, 0x12, 0x01aa}, /* 01,aa,12,cc */
3039         {0xa0, 0xc8, 0x001d}, /* 00,1d,c8,cc */
3040         {0xa0, 0xd8, 0x001e}, /* 00,1e,d8,cc */
3041         {0xa0, 0xea, 0x001f}, /* 00,1f,ea,cc */
3042         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
3043         {}
3044 };
3045 static struct usb_action icm105a_50HZScale[] = {
3046         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
3047         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3048         {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
3049         {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
3050         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3051         {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
3052         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3053         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3054         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3055         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3056         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3057         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3058         {0xa0, 0x02, 0x00a3}, /* 00,a3,02,cc */
3059         {0xa0, 0x94, 0x00a4}, /* 00,a4,94,cc */
3060         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
3061         {0xa0, 0x04, 0x0191}, /* 01,91,04,cc */
3062         {0xa0, 0x20, 0x0192}, /* 01,92,20,cc */
3063         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
3064         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
3065         {0xa0, 0x84, 0x0197}, /* 01,97,84,cc */
3066         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
3067         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
3068         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
3069         {0xa0, 0x12, 0x01aa}, /* 01,aa,12,cc */
3070         {0xa0, 0xe3, 0x001d}, /* 00,1d,e3,cc */
3071         {0xa0, 0xec, 0x001e}, /* 00,1e,ec,cc */
3072         {0xa0, 0xf5, 0x001f}, /* 00,1f,f5,cc */
3073         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
3074         {0xa0, 0x00, 0x01a7}, /* 01,a7,00,cc */
3075         {0xa0, 0xc0, 0x01a8}, /* 01,a8,c0,cc */
3076         {}
3077 };
3078 static struct usb_action icm105a_60HZ[] = {
3079         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
3080         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3081         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3082         {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
3083         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3084         {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
3085         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3086         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3087         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3088         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3089         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3090         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3091         {0xa0, 0x02, 0x00a3}, /* 00,a3,02,cc */
3092         {0xa0, 0x08, 0x00a4}, /* 00,a4,08,cc */
3093         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
3094         {0xa0, 0x04, 0x0191}, /* 01,91,04,cc */
3095         {0xa0, 0x10, 0x0192}, /* 01,92,10,cc */
3096         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
3097         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
3098         {0xa0, 0x41, 0x0197}, /* 01,97,41,cc */
3099         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
3100         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
3101         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
3102         {0xa0, 0x12, 0x01aa}, /* 01,aa,12,cc */
3103         {0xa0, 0xc1, 0x001d}, /* 00,1d,c1,cc */
3104         {0xa0, 0xd4, 0x001e}, /* 00,1e,d4,cc */
3105         {0xa0, 0xe8, 0x001f}, /* 00,1f,e8,cc */
3106         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
3107         {}
3108 };
3109 static struct usb_action icm105a_60HZScale[] = {
3110         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
3111         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3112         {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
3113         {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
3114         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3115         {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
3116         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3117         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3118         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3119         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3120         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3121         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3122         {0xa0, 0x02, 0x00a3}, /* 00,a3,02,cc */
3123         {0xa0, 0x85, 0x00a4}, /* 00,a4,85,cc */
3124         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
3125         {0xa0, 0x04, 0x0191}, /* 01,91,04,cc */
3126         {0xa0, 0x08, 0x0192}, /* 01,92,08,cc */
3127         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
3128         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
3129         {0xa0, 0x81, 0x0197}, /* 01,97,81,cc */
3130         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
3131         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
3132         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
3133         {0xa0, 0x12, 0x01aa}, /* 01,aa,12,cc */
3134         {0xa0, 0xc2, 0x001d}, /* 00,1d,c2,cc */
3135         {0xa0, 0xd6, 0x001e}, /* 00,1e,d6,cc */
3136         {0xa0, 0xea, 0x001f}, /* 00,1f,ea,cc */
3137         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
3138         {0xa0, 0x00, 0x01a7}, /* 01,a7,00,cc */
3139         {0xa0, 0xc0, 0x01a8}, /* 01,a8,c0,cc */
3140         {}
3141 };
3142 static struct usb_action icm105a_NoFliker[] = {
3143         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
3144         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3145         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3146         {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
3147         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3148         {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
3149         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3150         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3151         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3152         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3153         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3154         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3155         {0xa0, 0x02, 0x00a3}, /* 00,a3,02,cc */
3156         {0xa0, 0x00, 0x00a4}, /* 00,a4,00,cc */
3157         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
3158         {0xa0, 0x04, 0x0191}, /* 01,91,04,cc */
3159         {0xa0, 0x20, 0x0192}, /* 01,92,20,cc */
3160         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
3161         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
3162         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
3163         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
3164         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
3165         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
3166         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
3167         {0xa0, 0xc1, 0x001d}, /* 00,1d,c1,cc */
3168         {0xa0, 0xd4, 0x001e}, /* 00,1e,d4,cc */
3169         {0xa0, 0xe8, 0x001f}, /* 00,1f,e8,cc */
3170         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
3171         {}
3172 };
3173 static struct usb_action icm105a_NoFlikerScale[] = {
3174         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
3175         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3176         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3177         {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
3178         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3179         {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
3180         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3181         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3182         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3183         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3184         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3185         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3186         {0xa0, 0x02, 0x00a3}, /* 00,a3,02,cc */
3187         {0xa0, 0x80, 0x00a4}, /* 00,a4,80,cc */
3188         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
3189         {0xa0, 0x04, 0x0191}, /* 01,91,04,cc */
3190         {0xa0, 0x20, 0x0192}, /* 01,92,20,cc */
3191         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
3192         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
3193         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
3194         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
3195         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
3196         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
3197         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
3198         {0xa0, 0xc1, 0x001d}, /* 00,1d,c1,cc */
3199         {0xa0, 0xd4, 0x001e}, /* 00,1e,d4,cc */
3200         {0xa0, 0xe8, 0x001f}, /* 00,1f,e8,cc */
3201         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
3202         {0xa0, 0x00, 0x01a7}, /* 01,a7,00,cc */
3203         {0xa0, 0xc0, 0x01a8}, /* 01,a8,c0,cc */
3204         {}
3205 };
3206
3207 static struct usb_action MC501CB_InitialScale[] = {
3208         {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */
3209         {0xa0, 0x00, 0x0002}, /* 00,02,00,cc */
3210         {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */
3211         {0xa0, 0x01, 0x0001}, /* 00,01,01,cc */
3212         {0xa0, 0x03, 0x0008}, /* 00,08,03,cc */
3213         {0xa0, 0x01, 0x0012}, /* 00,12,01,cc */
3214         {0xa0, 0x05, 0x0012}, /* 00,12,05,cc */
3215         {0xa0, 0x02, 0x0003}, /* 00,03,02,cc */
3216         {0xa0, 0x80, 0x0004}, /* 00,04,80,cc */
3217         {0xa0, 0x01, 0x0005}, /* 00,05,01,cc */
3218         {0xa0, 0xd8, 0x0006}, /* 00,06,d8,cc */
3219         {0xa0, 0x00, 0x0098}, /* 00,98,00,cc */
3220         {0xa0, 0x00, 0x009a}, /* 00,9a,00,cc */
3221         {0xa0, 0x00, 0x011a}, /* 01,1a,00,cc */
3222         {0xa0, 0x00, 0x011c}, /* 01,1c,00,cc */
3223         {0xa0, 0x01, 0x009b}, /* 00,9b,01,cc */
3224         {0xa0, 0xde, 0x009c}, /* 00,9c,de,cc */
3225         {0xa0, 0x02, 0x009d}, /* 00,9d,02,cc */
3226         {0xa0, 0x86, 0x009e}, /* 00,9e,86,cc */
3227         {0xa0, 0x33, 0x0086}, /* 00,86,33,cc */
3228         {0xa0, 0x34, 0x0087}, /* 00,87,34,cc */
3229         {0xa0, 0x35, 0x0088}, /* 00,88,35,cc */
3230         {0xa0, 0xb0, 0x008b}, /* 00,8b,b0,cc */
3231         {0xa0, 0x05, 0x0012}, /* 00,12,05,cc */
3232         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3233         {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3234         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3235         {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3236         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3237         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3238         {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3239         {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3240         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3241         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3242         {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3243         {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3244         {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
3245         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3246         {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
3247         {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3248         {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3249         {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3250         {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3251         {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3252         {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3253         {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3254         {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3255         {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3256         {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3257         {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3258         {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3259         {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3260         {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3261         {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3262         {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3263         {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3264         {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3265         {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3266         {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3267         {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
3268         {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3269         {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3270         {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3271         {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3272         {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3273         {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3274         {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3275         {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3276         {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3277         {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3278         {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3279         {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3280         {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3281         {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3282         {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3283         {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3284         {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3285         {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3286         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3287         {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3288         {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3289         {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3290         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3291         {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
3292         {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3293         {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
3294         {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
3295         {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
3296         {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
3297         {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3298         {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3299         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
3300         {0xa0, 0x0d, 0x0100}, /* 01,00,0d,cc */
3301         {0xa0, 0x37, 0x0101}, /* 01,01,37,cc */
3302         {0xa0, 0x06, 0x0189}, /* 01,89,06,cc */
3303         {0xa0, 0x03, 0x01c5}, /* 01,c5,03,cc */
3304         {0xa0, 0x13, 0x01cb}, /* 01,cb,13,cc */
3305         {0xa0, 0x08, 0x0250}, /* 02,50,08,cc */
3306         {0xa0, 0x08, 0x0301}, /* 03,01,08,cc */
3307         {0xa0, 0x02, 0x0180}, /* 01,80,02,cc */
3308         {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3309         {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
3310         {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
3311         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3312         {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3313         {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3314         {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3315         {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3316         {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3317         {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3318
3319         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3320         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3321         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3322         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3323         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3324         {}
3325 };
3326
3327 static struct usb_action MC501CB_Initial[] = {   /* 320x240 */
3328         {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */
3329         {0xa0, 0x10, 0x0002}, /* 00,02,10,cc */
3330         {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */
3331         {0xa0, 0x01, 0x0001}, /* 00,01,01,cc */
3332         {0xa0, 0x03, 0x0008}, /* 00,08,03,cc */
3333         {0xa0, 0x01, 0x0012}, /* 00,12,01,cc */
3334         {0xa0, 0x05, 0x0012}, /* 00,12,05,cc */
3335         {0xa0, 0x02, 0x0003}, /* 00,03,02,cc */
3336         {0xa0, 0x80, 0x0004}, /* 00,04,80,cc */
3337         {0xa0, 0x01, 0x0005}, /* 00,05,01,cc */
3338         {0xa0, 0xd0, 0x0006}, /* 00,06,d0,cc */
3339         {0xa0, 0x00, 0x0098}, /* 00,98,00,cc */
3340         {0xa0, 0x00, 0x009a}, /* 00,9a,00,cc */
3341         {0xa0, 0x00, 0x011a}, /* 01,1a,00,cc */
3342         {0xa0, 0x00, 0x011c}, /* 01,1c,00,cc */
3343         {0xa0, 0x01, 0x009b}, /* 00,9b,01,cc */
3344         {0xa0, 0xd8, 0x009c}, /* 00,9c,d8,cc */
3345         {0xa0, 0x02, 0x009d}, /* 00,9d,02,cc */
3346         {0xa0, 0x88, 0x009e}, /* 00,9e,88,cc */
3347         {0xa0, 0x33, 0x0086}, /* 00,86,33,cc */
3348         {0xa0, 0x34, 0x0087}, /* 00,87,34,cc */
3349         {0xa0, 0x35, 0x0088}, /* 00,88,35,cc */
3350         {0xa0, 0xb0, 0x008b}, /* 00,8b,b0,cc */
3351         {0xa0, 0x05, 0x0012}, /* 00,12,05,cc */
3352         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3353         {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3354         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3355         {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3356         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3357         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3358         {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3359         {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3360         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3361         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3362         {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3363         {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3364         {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
3365         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3366         {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
3367         {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3368         {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3369         {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3370         {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3371         {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3372         {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3373         {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3374         {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3375         {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3376         {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3377         {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3378         {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3379         {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3380         {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3381         {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3382         {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3383         {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3384         {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3385         {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3386         {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3387         {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
3388         {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3389         {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3390         {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3391         {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3392         {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3393         {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3394         {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3395         {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3396         {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3397         {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3398         {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3399         {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3400         {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3401         {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3402         {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3403         {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3404         {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3405         {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3406         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3407         {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3408         {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3409         {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3410         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3411         {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
3412         {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3413         {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
3414         {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
3415         {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
3416         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3417         {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3418         {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3419         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
3420         {0xa0, 0x0d, 0x0100}, /* 01,00,0d,cc */
3421         {0xa0, 0x37, 0x0101}, /* 01,01,37,cc */
3422         {0xa0, 0x06, 0x0189}, /* 01,89,06,cc */
3423         {0xa0, 0x03, 0x01c5}, /* 01,c5,03,cc */
3424         {0xa0, 0x13, 0x01cb}, /* 01,cb,13,cc */
3425         {0xa0, 0x08, 0x0250}, /* 02,50,08,cc */
3426         {0xa0, 0x08, 0x0301}, /* 03,01,08,cc */
3427         {0xa0, 0x02, 0x0180}, /* 01,80,02,cc */
3428         {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3429         {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
3430         {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
3431         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3432         {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3433         {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3434         {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3435         {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3436         {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3437         {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3438         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3439         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3440         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3441         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3442         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3443         {}
3444 };
3445
3446 static struct usb_action MC501CB_50HZ[] = {
3447         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3448         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3449         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3450         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3451         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3452         {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
3453         {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
3454         {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
3455         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3456         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3457         {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3458         {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3459         {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3460         {}
3461 };
3462
3463 static struct usb_action MC501CB_50HZScale[] = {
3464         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3465         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3466         {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3467         {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3468         {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3469         {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
3470         {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
3471         {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
3472         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3473         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3474         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3475         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3476         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3477         {}
3478 };
3479
3480 static struct usb_action MC501CB_60HZ[] = {
3481         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3482         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3483         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3484         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3485         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3486         {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3487         {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3488         {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3489         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3490         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3491         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3492         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3493         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3494         {}
3495 };
3496
3497 static struct usb_action MC501CB_60HZScale[] = {
3498         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3499         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3500         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3501         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3502         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3503         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3504         {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3505         {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3506         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3507         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3508         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3509         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3510         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3511         {}
3512 };
3513
3514 static struct usb_action MC501CB_NoFliker[] = {
3515         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3516         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3517         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3518         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3519         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3520         {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3521         {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3522         {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3523         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3524         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3525         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3526         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3527         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3528         {}
3529 };
3530
3531 static struct usb_action MC501CB_NoFlikerScale[] = {
3532         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3533         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3534         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3535         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3536         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3537         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3538         {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3539         {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3540         {}
3541 };
3542
3543 /* from zs211.inf - HKR,%OV7620%,Initial - 640x480 */
3544 static struct usb_action OV7620_mode0[] = {
3545         {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */
3546         {0xa0, 0x40, 0x0002}, /* 00,02,40,cc */
3547         {0xa0, 0x00, 0x0008}, /* 00,08,00,cc */
3548         {0xa0, 0x01, 0x0001}, /* 00,01,01,cc */
3549         {0xa0, 0x06, 0x0010}, /* 00,10,06,cc */
3550         {0xa0, 0x02, 0x0083}, /* 00,83,02,cc */
3551         {0xa0, 0x01, 0x0085}, /* 00,85,01,cc */
3552         {0xa0, 0x80, 0x0086}, /* 00,86,80,cc */
3553         {0xa0, 0x81, 0x0087}, /* 00,87,81,cc */
3554         {0xa0, 0x10, 0x0088}, /* 00,88,10,cc */
3555         {0xa0, 0xa1, 0x008b}, /* 00,8b,a1,cc */
3556         {0xa0, 0x08, 0x008d}, /* 00,8d,08,cc */
3557         {0xa0, 0x02, 0x0003}, /* 00,03,02,cc */
3558         {0xa0, 0x80, 0x0004}, /* 00,04,80,cc */
3559         {0xa0, 0x01, 0x0005}, /* 00,05,01,cc */
3560         {0xa0, 0xd8, 0x0006}, /* 00,06,d8,cc */
3561         {0xa0, 0x03, 0x0012}, /* 00,12,03,cc */
3562         {0xa0, 0x01, 0x0012}, /* 00,12,01,cc */
3563         {0xa0, 0x00, 0x0098}, /* 00,98,00,cc */
3564         {0xa0, 0x00, 0x009a}, /* 00,9a,00,cc */
3565         {0xa0, 0x00, 0x011a}, /* 01,1a,00,cc */
3566         {0xa0, 0x00, 0x011c}, /* 01,1c,00,cc */
3567         {0xa0, 0xde, 0x009c}, /* 00,9c,de,cc */
3568         {0xa0, 0x86, 0x009e}, /* 00,9e,86,cc */
3569         {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3570         {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3571         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3572         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3573         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3574         {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3575         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3576         {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3577         {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3578         {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3579         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3580         {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3581         {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3582         {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3583         {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3584         {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3585         {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3586         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3587         {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3588         {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3589         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3590         {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3591         {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3592         {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3593         {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3594         {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3595         {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3596         {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3597         {0xa0, 0x77, 0x0101}, /* 01,01,77,cc */
3598         {0xa0, 0x05, 0x0012}, /* 00,12,05,cc */
3599         {0xa0, 0x0d, 0x0100}, /* 01,00,0d,cc */
3600         {0xa0, 0x06, 0x0189}, /* 01,89,06,cc */
3601         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3602         {0xa0, 0x03, 0x01c5}, /* 01,c5,03,cc */
3603         {0xa0, 0x13, 0x01cb}, /* 01,cb,13,cc */
3604         {0xa0, 0x08, 0x0250}, /* 02,50,08,cc */
3605         {0xa0, 0x08, 0x0301}, /* 03,01,08,cc */
3606         {0xa0, 0x68, 0x0116}, /* 01,16,68,cc */
3607         {0xa0, 0x52, 0x0118}, /* 01,18,52,cc */
3608         {0xa0, 0x40, 0x011d}, /* 01,1d,40,cc */
3609         {0xa0, 0x02, 0x0180}, /* 01,80,02,cc */
3610         {0xa0, 0x50, 0x01a8}, /* 01,a8,50,cc */
3611         {}
3612 };
3613
3614 /* from zs211.inf - HKR,%OV7620%,InitialScale - 320x240 */
3615 static struct usb_action OV7620_mode1[] = {
3616         {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */
3617         {0xa0, 0x50, 0x0002}, /* 00,02,50,cc */
3618         {0xa0, 0x03, 0x0008}, /* 00,08,00,cc */         /* mx change? */
3619         {0xa0, 0x01, 0x0001}, /* 00,01,01,cc */
3620         {0xa0, 0x06, 0x0010}, /* 00,10,06,cc */
3621         {0xa0, 0x02, 0x0083}, /* 00,83,02,cc */
3622         {0xa0, 0x01, 0x0085}, /* 00,85,01,cc */
3623         {0xa0, 0x80, 0x0086}, /* 00,86,80,cc */
3624         {0xa0, 0x81, 0x0087}, /* 00,87,81,cc */
3625         {0xa0, 0x10, 0x0088}, /* 00,88,10,cc */
3626         {0xa0, 0xa1, 0x008b}, /* 00,8b,a1,cc */
3627         {0xa0, 0x08, 0x008d}, /* 00,8d,08,cc */
3628         {0xa0, 0x02, 0x0003}, /* 00,03,02,cc */
3629         {0xa0, 0x80, 0x0004}, /* 00,04,80,cc */
3630         {0xa0, 0x01, 0x0005}, /* 00,05,01,cc */
3631         {0xa0, 0xd0, 0x0006}, /* 00,06,d0,cc */
3632         {0xa0, 0x03, 0x0012}, /* 00,12,03,cc */
3633         {0xa0, 0x01, 0x0012}, /* 00,12,01,cc */
3634         {0xa0, 0x00, 0x0098}, /* 00,98,00,cc */
3635         {0xa0, 0x00, 0x009a}, /* 00,9a,00,cc */
3636         {0xa0, 0x00, 0x011a}, /* 01,1a,00,cc */
3637         {0xa0, 0x00, 0x011c}, /* 01,1c,00,cc */
3638         {0xa0, 0xd6, 0x009c}, /* 00,9c,d6,cc */         /* OV7648 00,9c,d8,cc */
3639         {0xa0, 0x88, 0x009e}, /* 00,9e,88,cc */
3640         {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3641         {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3642         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3643         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3644         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3645         {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3646         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3647         {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3648         {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3649         {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3650         {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3651         {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3652         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3653         {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3654         {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3655         {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3656         {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3657         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3658         {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3659         {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3660         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3661         {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3662         {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3663         {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3664         {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3665         {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3666         {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3667         {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3668         {0xa0, 0x77, 0x0101}, /* 01,01,77,cc */
3669         {0xa0, 0x05, 0x0012}, /* 00,12,05,cc */
3670         {0xa0, 0x0d, 0x0100}, /* 01,00,0d,cc */
3671         {0xa0, 0x06, 0x0189}, /* 01,89,06,cc */
3672         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3673         {0xa0, 0x03, 0x01c5}, /* 01,c5,03,cc */
3674         {0xa0, 0x13, 0x01cb}, /* 01,cb,13,cc */
3675         {0xa0, 0x08, 0x0250}, /* 02,50,08,cc */
3676         {0xa0, 0x08, 0x0301}, /* 03,01,08,cc */
3677         {0xa0, 0x68, 0x0116}, /* 01,16,68,cc */
3678         {0xa0, 0x52, 0x0118}, /* 01,18,52,cc */
3679         {0xa0, 0x50, 0x011d}, /* 01,1d,50,cc */
3680         {0xa0, 0x02, 0x0180}, /* 01,80,02,cc */
3681         {0xa0, 0x50, 0x01a8}, /* 01,a8,50,cc */
3682         {}
3683 };
3684
3685 /* from zs211.inf - HKR,%OV7620%\AE,50HZ */
3686 static struct usb_action OV7620_50HZ[] = {
3687         {0xaa, 0x13, 0x00a3},   /* 00,13,a3,aa */
3688         {0xdd, 0x00, 0x0100},   /* 00,01,00,dd */
3689         {0xaa, 0x2b, 0x0096},   /* 00,2b,96,aa */
3690         {0xaa, 0x75, 0x008a},   /* 00,75,8a,aa */
3691         {0xaa, 0x2d, 0x0005},   /* 00,2d,05,aa */
3692         {0xa0, 0x00, 0x0190},   /* 01,90,00,cc */
3693         {0xa0, 0x04, 0x0191},   /* 01,91,04,cc */
3694         {0xa0, 0x18, 0x0192},   /* 01,92,18,cc */
3695         {0xa0, 0x00, 0x0195},   /* 01,95,00,cc */
3696         {0xa0, 0x00, 0x0196},   /* 01,96,00,cc */
3697         {0xa0, 0x83, 0x0197},   /* 01,97,83,cc */
3698         {0xaa, 0x10, 0x0082},   /* 00,10,82,aa */
3699         {0xaa, 0x76, 0x0003},   /* 00,76,03,aa */
3700 /*      {0xa0, 0x40, 0x0002},    * 00,02,40,cc - if mode0 (640x480) */
3701         {}
3702 };
3703
3704 /* from zs211.inf - HKR,%OV7620%\AE,60HZ */
3705 static struct usb_action OV7620_60HZ[] = {
3706         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */ /* (bug in zs211.inf) */
3707         {0xdd, 0x00, 0x0100},   /* 00,01,00,dd */
3708         {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3709         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3710         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3711         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
3712         {0xa0, 0x04, 0x0191}, /* 01,91,04,cc */
3713         {0xa0, 0x18, 0x0192}, /* 01,92,18,cc */
3714         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
3715         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
3716         {0xa0, 0x83, 0x0197}, /* 01,97,83,cc */
3717         {0xaa, 0x10, 0x0020}, /* 00,10,20,aa */
3718         {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3719 /*      {0xa0, 0x40, 0x0002},  * 00,02,40,cc - if mode0 (640x480) */
3720 /* ?? in gspca v1, it was
3721         {0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3722         {0xa1, 0x01, 0x0037},           */
3723         {}
3724 };
3725
3726 /* from zs211.inf - HKR,%OV7620%\AE,NoFliker */
3727 static struct usb_action OV7620_NoFliker[] = {
3728         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */ /* (bug in zs211.inf) */
3729         {0xdd, 0x00, 0x0100},   /* 00,01,00,dd */
3730         {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3731         {0xaa, 0x75, 0x008e}, /* 00,75,8e,aa */
3732         {0xaa, 0x2d, 0x0001}, /* 00,2d,01,aa */
3733         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
3734         {0xa0, 0x04, 0x0191}, /* 01,91,04,cc */
3735         {0xa0, 0x18, 0x0192}, /* 01,92,18,cc */
3736         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
3737         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
3738         {0xa0, 0x01, 0x0197}, /* 01,97,01,cc */
3739 /*      {0xa0, 0x44, 0x0002},  * 00,02,44,cc - if mode1 (320x240) */
3740 /* ?? was
3741         {0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3742         {0xa1, 0x01, 0x0037},           */
3743         {}
3744 };
3745
3746 static struct usb_action ov7630c_Initial[] = {
3747         {0xa0, 0x01, 0x0000},
3748         {0xa0, 0x10, 0x0002},
3749         {0xa0, 0x01, 0x0000},
3750         {0xa0, 0x10, 0x0002},
3751         {0xa0, 0x03, 0x0008},
3752         {0xa0, 0x01, 0x0001},
3753         {0xa0, 0x06, 0x0010},
3754         {0xa0, 0xa1, 0x008b},
3755         {0xa0, 0x08, 0x008d},
3756         {0xa0, 0x02, 0x0003},
3757         {0xa0, 0x80, 0x0004},
3758         {0xa0, 0x01, 0x0005},
3759         {0xa0, 0xe0, 0x0006},
3760         {0xa0, 0x01, 0x0012},
3761         {0xaa, 0x12, 0x0080},
3762         {0xa0, 0x02, 0x0083},
3763         {0xa0, 0x01, 0x0085},
3764         {0xa0, 0x90, 0x0086},
3765         {0xa0, 0x91, 0x0087},
3766         {0xa0, 0x10, 0x0088},
3767         {0xa0, 0x00, 0x0098},
3768         {0xa0, 0x00, 0x009a},
3769         {0xa0, 0x00, 0x011a},
3770         {0xa0, 0x00, 0x011c},
3771         {0xa0, 0xd8, 0x009c},
3772         {0xa0, 0x88, 0x009e},
3773         {0xaa, 0x12, 0x0069},
3774         {0xaa, 0x04, 0x0020},
3775         {0xaa, 0x06, 0x0050},
3776         {0xaa, 0x13, 0x0083},
3777         {0xaa, 0x14, 0x0000},
3778         {0xaa, 0x15, 0x0024},
3779         {0xaa, 0x17, 0x0018},
3780         {0xaa, 0x18, 0x00ba},
3781         {0xaa, 0x19, 0x0002},
3782         {0xaa, 0x1a, 0x00f6},
3783         {0xaa, 0x1b, 0x0002},
3784         {0xaa, 0x20, 0x00c2},
3785         {0xaa, 0x24, 0x0060},
3786         {0xaa, 0x25, 0x0040},
3787         {0xaa, 0x26, 0x0030},
3788         {0xaa, 0x27, 0x00ea},
3789         {0xaa, 0x28, 0x00a0},
3790         {0xaa, 0x21, 0x0000},
3791         {0xaa, 0x2a, 0x0081},
3792         {0xaa, 0x2b, 0x0096},
3793         {0xaa, 0x2d, 0x0094},
3794         {0xaa, 0x2f, 0x003d},
3795         {0xaa, 0x30, 0x0024},
3796         {0xaa, 0x60, 0x0000},
3797         {0xaa, 0x61, 0x0040},
3798         {0xaa, 0x68, 0x007c},
3799         {0xaa, 0x6f, 0x0015},
3800         {0xaa, 0x75, 0x0088},
3801         {0xaa, 0x77, 0x00b5},
3802         {0xaa, 0x01, 0x0060},
3803         {0xaa, 0x02, 0x0060},
3804         {0xa0, 0x05, 0x0012},
3805         {0xa0, 0x77, 0x0101},
3806         {0xa0, 0x0d, 0x0100},
3807         {0xa0, 0x06, 0x0189},
3808         {0xa0, 0x04, 0x01a7},
3809         {0xa0, 0x00, 0x01ad},
3810         {0xa0, 0x03, 0x01c5},
3811         {0xa0, 0x13, 0x01cb},
3812         {0xa0, 0x08, 0x0250},
3813         {0xa0, 0x08, 0x0301},
3814         {0xa0, 0x60, 0x0116},
3815         {0xa0, 0x46, 0x0118},
3816         {0xa0, 0x04, 0x0113},
3817 /* 0x10, */
3818         {0xa1, 0x01, 0x0002},
3819         {0xa0, 0x50, 0x010a},   /* matrix */
3820         {0xa0, 0xf8, 0x010b},
3821         {0xa0, 0xf8, 0x010c},
3822         {0xa0, 0xf8, 0x010d},
3823         {0xa0, 0x50, 0x010e},
3824         {0xa0, 0xf8, 0x010f},
3825         {0xa0, 0xf8, 0x0110},
3826         {0xa0, 0xf8, 0x0111},
3827         {0xa0, 0x50, 0x0112},
3828 /* 0x03, */
3829         {0xa1, 0x01, 0x0008},
3830         {0xa0, 0x03, 0x0008},   /* clock ? */
3831         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
3832         {0xa1, 0x01, 0x01c8},
3833         {0xa1, 0x01, 0x01c9},
3834         {0xa1, 0x01, 0x01ca},
3835         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
3836         {0xa0, 0x01, 0x0120},   /* gamma 2 ?*/
3837         {0xa0, 0x0c, 0x0121},
3838         {0xa0, 0x1f, 0x0122},
3839         {0xa0, 0x3a, 0x0123},
3840         {0xa0, 0x53, 0x0124},
3841         {0xa0, 0x6d, 0x0125},
3842         {0xa0, 0x85, 0x0126},
3843         {0xa0, 0x9c, 0x0127},
3844         {0xa0, 0xb0, 0x0128},
3845         {0xa0, 0xc2, 0x0129},
3846         {0xa0, 0xd1, 0x012a},
3847         {0xa0, 0xde, 0x012b},
3848         {0xa0, 0xe9, 0x012c},
3849         {0xa0, 0xf2, 0x012d},
3850         {0xa0, 0xf9, 0x012e},
3851         {0xa0, 0xff, 0x012f},
3852         {0xa0, 0x05, 0x0130},
3853         {0xa0, 0x0f, 0x0131},
3854         {0xa0, 0x16, 0x0132},
3855         {0xa0, 0x1a, 0x0133},
3856         {0xa0, 0x19, 0x0134},
3857         {0xa0, 0x19, 0x0135},
3858         {0xa0, 0x17, 0x0136},
3859         {0xa0, 0x15, 0x0137},
3860         {0xa0, 0x12, 0x0138},
3861         {0xa0, 0x10, 0x0139},
3862         {0xa0, 0x0e, 0x013a},
3863         {0xa0, 0x0b, 0x013b},
3864         {0xa0, 0x09, 0x013c},
3865         {0xa0, 0x08, 0x013d},
3866         {0xa0, 0x06, 0x013e},
3867         {0xa0, 0x03, 0x013f},
3868         {0xa0, 0x50, 0x010a},   /* matrix */
3869         {0xa0, 0xf8, 0x010b},
3870         {0xa0, 0xf8, 0x010c},
3871         {0xa0, 0xf8, 0x010d},
3872         {0xa0, 0x50, 0x010e},
3873         {0xa0, 0xf8, 0x010f},
3874         {0xa0, 0xf8, 0x0110},
3875         {0xa0, 0xf8, 0x0111},
3876         {0xa0, 0x50, 0x0112},
3877
3878         {0xa1, 0x01, 0x0180},
3879         {0xa0, 0x00, 0x0180},
3880         {0xaa, 0x10, 0x001b},
3881         {0xaa, 0x76, 0x0002},
3882         {0xaa, 0x2a, 0x0081},
3883         {0xaa, 0x2b, 0x0000},
3884         {0xa0, 0x00, 0x0190},
3885         {0xa0, 0x01, 0x0191},
3886         {0xa0, 0xb8, 0x0192},
3887         {0xa0, 0x00, 0x0195},
3888         {0xa0, 0x00, 0x0196},
3889         {0xa0, 0x37, 0x0197},
3890         {0xa0, 0x10, 0x018c},
3891         {0xa0, 0x20, 0x018f},
3892         {0xa0, 0x10, 0x01a9},
3893         {0xa0, 0x26, 0x01aa},
3894         {0xa0, 0x50, 0x011d},
3895         {0xa0, 0x02, 0x0180},
3896         {0xa0, 0x40, 0x0180},
3897         {0xaa, 0x13, 0x0083},   /* 40 */
3898         {0xa1, 0x01, 0x0180},
3899         {0xa0, 0x42, 0x0180},
3900         {}
3901 };
3902
3903 static struct usb_action ov7630c_InitialScale[] = {
3904         {0xa0, 0x01, 0x0000},
3905         {0xa0, 0x00, 0x0002},
3906         {0xa0, 0x03, 0x0008},
3907         {0xa0, 0x01, 0x0001},
3908         {0xa0, 0x06, 0x0010},
3909         {0xa0, 0xa1, 0x008b},
3910         {0xa0, 0x08, 0x008d},
3911         {0xa0, 0x02, 0x0003},
3912         {0xa0, 0x80, 0x0004},
3913         {0xa0, 0x01, 0x0005},
3914         {0xa0, 0xe0, 0x0006},
3915         {0xa0, 0x01, 0x0012},
3916
3917         {0xaa, 0x12, 0x0080},
3918         {0xa0, 0x02, 0x0083},
3919         {0xa0, 0x01, 0x0085},
3920         {0xa0, 0x90, 0x0086},
3921         {0xa0, 0x91, 0x0087},
3922         {0xa0, 0x10, 0x0088},
3923         {0xa0, 0x00, 0x0098},
3924         {0xa0, 0x00, 0x009a},
3925         {0xa0, 0x00, 0x011a},
3926         {0xa0, 0x00, 0x011c},
3927         {0xa0, 0xe6, 0x009c},
3928         {0xa0, 0x86, 0x009e},
3929         {0xaa, 0x12, 0x0069},   /* i2c */
3930         {0xaa, 0x04, 0x0020},
3931         {0xaa, 0x06, 0x0050},
3932         {0xaa, 0x13, 0x00c3},
3933         {0xaa, 0x14, 0x0000},
3934         {0xaa, 0x15, 0x0024},
3935         {0xaa, 0x19, 0x0003},
3936         {0xaa, 0x1a, 0x00f6},
3937         {0xaa, 0x1b, 0x0002},
3938         {0xaa, 0x20, 0x00c2},
3939         {0xaa, 0x24, 0x0060},
3940         {0xaa, 0x25, 0x0040},
3941         {0xaa, 0x26, 0x0030},
3942         {0xaa, 0x27, 0x00ea},
3943         {0xaa, 0x28, 0x00a0},
3944         {0xaa, 0x21, 0x0000},
3945         {0xaa, 0x2a, 0x0081},
3946         {0xaa, 0x2b, 0x0096},
3947         {0xaa, 0x2d, 0x0084},
3948         {0xaa, 0x2f, 0x003d},
3949         {0xaa, 0x30, 0x0024},
3950         {0xaa, 0x60, 0x0000},
3951         {0xaa, 0x61, 0x0040},
3952         {0xaa, 0x68, 0x007c},
3953         {0xaa, 0x6f, 0x0015},
3954         {0xaa, 0x75, 0x0088},
3955         {0xaa, 0x77, 0x00b5},
3956         {0xaa, 0x01, 0x0060},
3957         {0xaa, 0x02, 0x0060},
3958         {0xaa, 0x17, 0x0018},
3959         {0xaa, 0x18, 0x00ba},
3960         {0xa0, 0x05, 0x0012},
3961         {0xa0, 0x77, 0x0101},
3962         {0xa0, 0x0d, 0x0100},
3963         {0xa0, 0x06, 0x0189},
3964         {0xa0, 0x04, 0x01a7},
3965         {0xa0, 0x00, 0x01ad},
3966         {0xa0, 0x03, 0x01c5},
3967         {0xa0, 0x13, 0x01cb},
3968         {0xa0, 0x08, 0x0250},
3969         {0xa0, 0x08, 0x0301},
3970         {0xa0, 0x60, 0x0116},
3971         {0xa0, 0x46, 0x0118},
3972         {0xa0, 0x04, 0x0113},
3973
3974         {0xa1, 0x01, 0x0002},
3975         {0xa0, 0x4e, 0x010a},   /* matrix */
3976         {0xa0, 0xfe, 0x010b},
3977         {0xa0, 0xf4, 0x010c},
3978         {0xa0, 0xf7, 0x010d},
3979         {0xa0, 0x4d, 0x010e},
3980         {0xa0, 0xfc, 0x010f},
3981         {0xa0, 0x00, 0x0110},
3982         {0xa0, 0xf6, 0x0111},
3983         {0xa0, 0x4a, 0x0112},
3984
3985         {0xa1, 0x01, 0x0008},
3986         {0xa0, 0x03, 0x0008},   /* clock ? */
3987         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
3988         {0xa1, 0x01, 0x01c8},
3989         {0xa1, 0x01, 0x01c9},
3990         {0xa1, 0x01, 0x01ca},
3991         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
3992         {0xa0, 0x16, 0x0120},   /* gamma ~4 */
3993         {0xa0, 0x3a, 0x0121},
3994         {0xa0, 0x5b, 0x0122},
3995         {0xa0, 0x7c, 0x0123},
3996         {0xa0, 0x94, 0x0124},
3997         {0xa0, 0xa9, 0x0125},
3998         {0xa0, 0xbb, 0x0126},
3999         {0xa0, 0xca, 0x0127},
4000         {0xa0, 0xd7, 0x0128},
4001         {0xa0, 0xe1, 0x0129},
4002         {0xa0, 0xea, 0x012a},
4003         {0xa0, 0xf1, 0x012b},
4004         {0xa0, 0xf7, 0x012c},
4005         {0xa0, 0xfc, 0x012d},
4006         {0xa0, 0xff, 0x012e},
4007         {0xa0, 0xff, 0x012f},
4008         {0xa0, 0x20, 0x0130},
4009         {0xa0, 0x22, 0x0131},
4010         {0xa0, 0x20, 0x0132},
4011         {0xa0, 0x1c, 0x0133},
4012         {0xa0, 0x16, 0x0134},
4013         {0xa0, 0x13, 0x0135},
4014         {0xa0, 0x10, 0x0136},
4015         {0xa0, 0x0d, 0x0137},
4016         {0xa0, 0x0b, 0x0138},
4017         {0xa0, 0x09, 0x0139},
4018         {0xa0, 0x07, 0x013a},
4019         {0xa0, 0x06, 0x013b},
4020         {0xa0, 0x05, 0x013c},
4021         {0xa0, 0x04, 0x013d},
4022         {0xa0, 0x00, 0x013e},
4023         {0xa0, 0x01, 0x013f},
4024         {0xa0, 0x4e, 0x010a},   /* matrix */
4025         {0xa0, 0xfe, 0x010b},
4026         {0xa0, 0xf4, 0x010c},
4027         {0xa0, 0xf7, 0x010d},
4028         {0xa0, 0x4d, 0x010e},
4029         {0xa0, 0xfc, 0x010f},
4030         {0xa0, 0x00, 0x0110},
4031         {0xa0, 0xf6, 0x0111},
4032         {0xa0, 0x4a, 0x0112},
4033
4034         {0xa1, 0x01, 0x0180},
4035         {0xa0, 0x00, 0x0180},
4036         {0xaa, 0x10, 0x000d},
4037         {0xaa, 0x76, 0x0002},
4038         {0xaa, 0x2a, 0x0081},
4039         {0xaa, 0x2b, 0x0000},
4040         {0xa0, 0x00, 0x0190},
4041         {0xa0, 0x00, 0x0191},
4042         {0xa0, 0xd8, 0x0192},
4043         {0xa0, 0x00, 0x0195},
4044         {0xa0, 0x00, 0x0196},
4045         {0xa0, 0x1b, 0x0197},
4046         {0xa0, 0x10, 0x018c},
4047         {0xa0, 0x20, 0x018f},
4048         {0xa0, 0x10, 0x01a9},
4049         {0xa0, 0x26, 0x01aa},
4050         {0xa0, 0x50, 0x011d},
4051         {0xa0, 0x02, 0x0180},
4052         {0xa0, 0x40, 0x0180},
4053         {0xaa, 0x13, 0x00c3},
4054
4055         {0xa1, 0x01, 0x0180},
4056         {0xa0, 0x42, 0x0180},
4057         {}
4058 };
4059
4060 static struct usb_action pas106b_Initial_com[] = {
4061 /* Sream and Sensor specific */
4062         {0xa1, 0x01, 0x0010},   /* CMOSSensorSelect */
4063 /* System */
4064         {0xa0, 0x01, 0x0000},   /* SystemControl */
4065         {0xa0, 0x01, 0x0000},   /* SystemControl */
4066 /* Picture size */
4067         {0xa0, 0x00, 0x0002},   /* ClockSelect */
4068         {0xa0, 0x03, 0x003a},
4069         {0xa0, 0x0c, 0x003b},
4070         {0xa0, 0x04, 0x0038},
4071         {}
4072 };
4073
4074 static struct usb_action pas106b_Initial[] = {  /* 176x144 */
4075 /* JPEG control */
4076         {0xa0, 0x03, 0x0008},   /* ClockSetting */
4077 /* Sream and Sensor specific */
4078         {0xa0, 0x0f, 0x0010},   /* CMOSSensorSelect */
4079 /* Picture size */
4080         {0xa0, 0x00, 0x0003},   /* FrameWidthHigh 00 */
4081         {0xa0, 0xb0, 0x0004},   /* FrameWidthLow B0 */
4082         {0xa0, 0x00, 0x0005},   /* FrameHeightHigh 00 */
4083         {0xa0, 0x90, 0x0006},   /* FrameHightLow 90 */
4084 /* System */
4085         {0xa0, 0x01, 0x0001},   /* SystemOperating */
4086 /* Sream and Sensor specific */
4087         {0xa0, 0x03, 0x0012},   /* VideoControlFunction */
4088         {0xa0, 0x01, 0x0012},   /* VideoControlFunction */
4089 /* Sensor Interface */
4090         {0xa0, 0x08, 0x008d},   /* Compatibily Mode */
4091 /* Window inside sensor array */
4092         {0xa0, 0x03, 0x009a},   /* WinXStartLow */
4093         {0xa0, 0x00, 0x011a},   /* FirstYLow */
4094         {0xa0, 0x03, 0x011c},   /* FirstxLow */
4095         {0xa0, 0x28, 0x009c},   /* WinHeightLow */
4096         {0xa0, 0x68, 0x009e},   /* WinWidthLow */
4097 /* Init the sensor */
4098         {0xaa, 0x02, 0x0004},
4099         {0xaa, 0x08, 0x0000},
4100         {0xaa, 0x09, 0x0005},
4101         {0xaa, 0x0a, 0x0002},
4102         {0xaa, 0x0b, 0x0002},
4103         {0xaa, 0x0c, 0x0005},
4104         {0xaa, 0x0d, 0x0000},
4105         {0xaa, 0x0e, 0x0002},
4106         {0xaa, 0x14, 0x0081},
4107
4108 /* Other registors */
4109         {0xa0, 0x37, 0x0101},   /* SensorCorrection */
4110 /* Frame retreiving */
4111         {0xa0, 0x00, 0x0019},   /* AutoAdjustFPS */
4112 /* Gains */
4113         {0xa0, 0xa0, 0x01a8},   /* DigitalGain */
4114 /* Unknown */
4115         {0xa0, 0x00, 0x01ad},
4116 /* Sharpness */
4117         {0xa0, 0x03, 0x01c5},   /* SharpnessMode */
4118         {0xa0, 0x13, 0x01cb},   /* Sharpness05 */
4119 /* Other registors */
4120         {0xa0, 0x0d, 0x0100},   /* OperationMode */
4121 /* Auto exposure and white balance */
4122         {0xa0, 0x06, 0x0189},   /* AWBStatus */
4123 /*Dead pixels */
4124         {0xa0, 0x08, 0x0250},   /* DeadPixelsMode */
4125 /* EEPROM */
4126         {0xa0, 0x08, 0x0301},   /* EEPROMAccess */
4127 /* JPEG control */
4128         {0xa0, 0x03, 0x0008},   /* ClockSetting */
4129         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
4130         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
4131 /* Other registers */
4132         {0xa0, 0x0d, 0x0100},   /* OperationMode */
4133 /* Auto exposure and white balance */
4134         {0xa0, 0x06, 0x0189},   /* AWBStatus */
4135 /*Dead pixels */
4136         {0xa0, 0x08, 0x0250},   /* DeadPixelsMode */
4137 /* EEPROM */
4138         {0xa0, 0x08, 0x0301},   /* EEPROMAccess */
4139 /* JPEG control */
4140         {0xa0, 0x03, 0x0008},   /* ClockSetting */
4141         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
4142         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
4143
4144         {0xa0, 0x58, 0x010a},   /* matrix */
4145         {0xa0, 0xf4, 0x010b},
4146         {0xa0, 0xf4, 0x010c},
4147         {0xa0, 0xf4, 0x010d},
4148         {0xa0, 0x58, 0x010e},
4149         {0xa0, 0xf4, 0x010f},
4150         {0xa0, 0xf4, 0x0110},
4151         {0xa0, 0xf4, 0x0111},
4152         {0xa0, 0x58, 0x0112},
4153 /* Auto correction */
4154         {0xa0, 0x03, 0x0181},   /* WinXstart */
4155         {0xa0, 0x08, 0x0182},   /* WinXWidth */
4156         {0xa0, 0x16, 0x0183},   /* WinXCenter */
4157         {0xa0, 0x03, 0x0184},   /* WinYStart */
4158         {0xa0, 0x05, 0x0185},   /* WinYWidth */
4159         {0xa0, 0x14, 0x0186},   /* WinYCenter */
4160         {0xa0, 0x00, 0x0180},   /* AutoCorrectEnable */
4161
4162 /* Auto exposure and white balance */
4163         {0xa0, 0x00, 0x0190},   /* ExposureLimitHigh */
4164         {0xa0, 0x03, 0x0191},   /* ExposureLimitMid */
4165         {0xa0, 0xb1, 0x0192},   /* ExposureLimitLow */
4166         {0xa0, 0x00, 0x0195},   /* AntiFlickerHigh */
4167         {0xa0, 0x00, 0x0196},   /* AntiFlickerLow */
4168         {0xa0, 0x87, 0x0197},   /* AntiFlickerLow */
4169         {0xa0, 0x0c, 0x018c},   /* AEBFreeze */
4170         {0xa0, 0x18, 0x018f},   /* AEBUnfreeze */
4171 /* sensor on */
4172         {0xaa, 0x07, 0x00b1},
4173         {0xaa, 0x05, 0x0003},
4174         {0xaa, 0x04, 0x0001},
4175         {0xaa, 0x03, 0x003b},
4176 /* Gains */
4177         {0xa0, 0x20, 0x01a9},   /* DigitalLimitDiff */
4178         {0xa0, 0x26, 0x01aa},   /* DigitalGainStep */
4179         {0xa0, 0xa0, 0x011d},   /* GlobalGain */
4180         {0xa0, 0x60, 0x011d},   /* GlobalGain */
4181 /* Auto correction */
4182         {0xa0, 0x40, 0x0180},   /* AutoCorrectEnable */
4183         {0xa1, 0x01, 0x0180},   /* AutoCorrectEnable */
4184         {0xa0, 0x42, 0x0180},   /* AutoCorrectEnable */
4185 /* Gains */
4186         {0xa0, 0x40, 0x0116},   /* RGain */
4187         {0xa0, 0x40, 0x0117},   /* GGain */
4188         {0xa0, 0x40, 0x0118},   /* BGain */
4189         {}
4190 };
4191
4192 static struct usb_action pas106b_InitialScale[] = {     /* 352x288 */
4193 /* JPEG control */
4194         {0xa0, 0x03, 0x0008},   /* ClockSetting */
4195 /* Sream and Sensor specific */
4196         {0xa0, 0x0f, 0x0010},   /* CMOSSensorSelect */
4197 /* Picture size */
4198         {0xa0, 0x01, 0x0003},   /* FrameWidthHigh */
4199         {0xa0, 0x60, 0x0004},   /* FrameWidthLow */
4200         {0xa0, 0x01, 0x0005},   /* FrameHeightHigh */
4201         {0xa0, 0x20, 0x0006},   /* FrameHightLow */
4202 /* System */
4203         {0xa0, 0x01, 0x0001},   /* SystemOperating */
4204 /* Sream and Sensor specific */
4205         {0xa0, 0x03, 0x0012},   /* VideoControlFunction */
4206         {0xa0, 0x01, 0x0012},   /* VideoControlFunction */
4207 /* Sensor Interface */
4208         {0xa0, 0x08, 0x008d},   /* Compatibily Mode */
4209 /* Window inside sensor array */
4210         {0xa0, 0x03, 0x009a},   /* WinXStartLow */
4211         {0xa0, 0x00, 0x011a},   /* FirstYLow */
4212         {0xa0, 0x03, 0x011c},   /* FirstxLow */
4213         {0xa0, 0x28, 0x009c},   /* WinHeightLow */
4214         {0xa0, 0x68, 0x009e},   /* WinWidthLow */
4215 /* Init the sensor */
4216         {0xaa, 0x02, 0x0004},
4217         {0xaa, 0x08, 0x0000},
4218         {0xaa, 0x09, 0x0005},
4219         {0xaa, 0x0a, 0x0002},
4220         {0xaa, 0x0b, 0x0002},
4221         {0xaa, 0x0c, 0x0005},
4222         {0xaa, 0x0d, 0x0000},
4223         {0xaa, 0x0e, 0x0002},
4224         {0xaa, 0x14, 0x0081},
4225
4226 /* Other registors */
4227         {0xa0, 0x37, 0x0101},   /* SensorCorrection */
4228 /* Frame retreiving */
4229         {0xa0, 0x00, 0x0019},   /* AutoAdjustFPS */
4230 /* Gains */
4231         {0xa0, 0xa0, 0x01a8},   /* DigitalGain */
4232 /* Unknown */
4233         {0xa0, 0x00, 0x01ad},
4234 /* Sharpness */
4235         {0xa0, 0x03, 0x01c5},   /* SharpnessMode */
4236         {0xa0, 0x13, 0x01cb},   /* Sharpness05 */
4237 /* Other registors */
4238         {0xa0, 0x0d, 0x0100},   /* OperationMode */
4239 /* Auto exposure and white balance */
4240         {0xa0, 0x06, 0x0189},   /* AWBStatus */
4241         {0xa0, 0x80, 0x018d},   /* ????????? */
4242 /*Dead pixels */
4243         {0xa0, 0x08, 0x0250},   /* DeadPixelsMode */
4244 /* EEPROM */
4245         {0xa0, 0x08, 0x0301},   /* EEPROMAccess */
4246 /* JPEG control */
4247         {0xa0, 0x03, 0x0008},   /* ClockSetting */
4248         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
4249         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
4250 /* Other registers */
4251         {0xa0, 0x0d, 0x0100},   /* OperationMode */
4252 /* Auto exposure and white balance */
4253         {0xa0, 0x06, 0x0189},   /* AWBStatus */
4254 /*Dead pixels */
4255         {0xa0, 0x08, 0x0250},   /* DeadPixelsMode */
4256 /* EEPROM */
4257         {0xa0, 0x08, 0x0301},   /* EEPROMAccess */
4258 /* JPEG control */
4259         {0xa0, 0x03, 0x0008},   /* ClockSetting */
4260         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
4261         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
4262
4263         {0xa0, 0x58, 0x010a},   /* matrix */
4264         {0xa0, 0xf4, 0x010b},
4265         {0xa0, 0xf4, 0x010c},
4266         {0xa0, 0xf4, 0x010d},
4267         {0xa0, 0x58, 0x010e},
4268         {0xa0, 0xf4, 0x010f},
4269         {0xa0, 0xf4, 0x0110},
4270         {0xa0, 0xf4, 0x0111},
4271         {0xa0, 0x58, 0x0112},
4272 /* Auto correction */
4273         {0xa0, 0x03, 0x0181},   /* WinXstart */
4274         {0xa0, 0x08, 0x0182},   /* WinXWidth */
4275         {0xa0, 0x16, 0x0183},   /* WinXCenter */
4276         {0xa0, 0x03, 0x0184},   /* WinYStart */
4277         {0xa0, 0x05, 0x0185},   /* WinYWidth */
4278         {0xa0, 0x14, 0x0186},   /* WinYCenter */
4279         {0xa0, 0x00, 0x0180},   /* AutoCorrectEnable */
4280
4281 /* Auto exposure and white balance */
4282         {0xa0, 0x00, 0x0190},   /* ExposureLimitHigh 0 */
4283         {0xa0, 0x03, 0x0191},   /* ExposureLimitMid */
4284         {0xa0, 0xb1, 0x0192},   /* ExposureLimitLow 0xb1 */
4285
4286         {0xa0, 0x00, 0x0195},   /* AntiFlickerHigh 0x00 */
4287         {0xa0, 0x00, 0x0196},   /* AntiFlickerLow 0x00 */
4288         {0xa0, 0x87, 0x0197},   /* AntiFlickerLow 0x87 */
4289
4290         {0xa0, 0x10, 0x018c},   /* AEBFreeze 0x10 0x0c */
4291         {0xa0, 0x20, 0x018f},   /* AEBUnfreeze 0x30 0x18 */
4292 /* sensor on */
4293         {0xaa, 0x07, 0x00b1},
4294         {0xaa, 0x05, 0x0003},
4295         {0xaa, 0x04, 0x0001},
4296         {0xaa, 0x03, 0x003b},
4297 /* Gains */
4298         {0xa0, 0x20, 0x01a9},   /* DigitalLimitDiff */
4299         {0xa0, 0x26, 0x01aa},   /* DigitalGainStep */
4300         {0xa0, 0xa0, 0x011d},   /* GlobalGain */
4301         {0xa0, 0x60, 0x011d},   /* GlobalGain */
4302 /* Auto correction */
4303         {0xa0, 0x40, 0x0180},   /* AutoCorrectEnable */
4304         {0xa1, 0x01, 0x0180},   /* AutoCorrectEnable */
4305         {0xa0, 0x42, 0x0180},   /* AutoCorrectEnable */
4306 /* Gains */
4307         {0xa0, 0x40, 0x0116},   /* RGain */
4308         {0xa0, 0x40, 0x0117},   /* GGain */
4309         {0xa0, 0x40, 0x0118},   /* BGain */
4310
4311         {0xa0, 0x00, 0x0007},   /* AutoCorrectEnable */
4312         {0xa0, 0xff, 0x0018},   /* Frame adjust */
4313         {}
4314 };
4315 static struct usb_action pas106b_50HZ[] = {
4316         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4317         {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */
4318         {0xa0, 0x54, 0x0192}, /* 01,92,54,cc */
4319         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4320         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4321         {0xa0, 0x87, 0x0197}, /* 01,97,87,cc */
4322         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4323         {0xa0, 0x30, 0x018f}, /* 01,8f,30,cc */
4324         {0xaa, 0x03, 0x0021}, /* 00,03,21,aa */
4325         {0xaa, 0x04, 0x000c}, /* 00,04,0c,aa */
4326         {0xaa, 0x05, 0x0002}, /* 00,05,02,aa */
4327         {0xaa, 0x07, 0x001c}, /* 00,07,1c,aa */
4328         {0xa0, 0x04, 0x01a9}, /* 01,a9,04,cc */
4329         {}
4330 };
4331 static struct usb_action pas106b_60HZ[] = {
4332         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4333         {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */
4334         {0xa0, 0x2e, 0x0192}, /* 01,92,2e,cc */
4335         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4336         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4337         {0xa0, 0x71, 0x0197}, /* 01,97,71,cc */
4338         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4339         {0xa0, 0x30, 0x018f}, /* 01,8f,30,cc */
4340         {0xaa, 0x03, 0x001c}, /* 00,03,1c,aa */
4341         {0xaa, 0x04, 0x0004}, /* 00,04,04,aa */
4342         {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
4343         {0xaa, 0x07, 0x00c4}, /* 00,07,c4,aa */
4344         {0xa0, 0x04, 0x01a9}, /* 01,a9,04,cc */
4345         {}
4346 };
4347 static struct usb_action pas106b_NoFliker[] = {
4348         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4349         {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */
4350         {0xa0, 0x50, 0x0192}, /* 01,92,50,cc */
4351         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4352         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4353         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
4354         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4355         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
4356         {0xaa, 0x03, 0x0013}, /* 00,03,13,aa */
4357         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
4358         {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
4359         {0xaa, 0x07, 0x0030}, /* 00,07,30,aa */
4360         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
4361         {}
4362 };
4363
4364 static struct usb_action pb03303x_Initial[] = {
4365         {0xa0, 0x01, 0x0000},
4366         {0xa0, 0x03, 0x0008},
4367         {0xa0, 0x0a, 0x0010},
4368         {0xa0, 0x10, 0x0002},
4369         {0xa0, 0x02, 0x0003},
4370         {0xa0, 0x80, 0x0004},
4371         {0xa0, 0x01, 0x0005},
4372         {0xa0, 0xe0, 0x0006},
4373         {0xa0, 0xdc, 0x008b},   /* 8b -> dc */
4374         {0xa0, 0x01, 0x0001},
4375         {0xa0, 0x03, 0x0012},
4376         {0xa0, 0x01, 0x0012},
4377         {0xa0, 0x00, 0x0098},
4378         {0xa0, 0x00, 0x009a},
4379         {0xa0, 0x00, 0x011a},
4380         {0xa0, 0x00, 0x011c},
4381         {0xa0, 0xdc, 0x008b},
4382         {0xaa, 0x01, 0x0001},
4383         {0xaa, 0x06, 0x0000},
4384         {0xaa, 0x08, 0x0483},
4385         {0xaa, 0x01, 0x0004},
4386         {0xaa, 0x08, 0x0006},
4387         {0xaa, 0x02, 0x0011},
4388         {0xaa, 0x03, 0x01e7},
4389         {0xaa, 0x04, 0x0287},
4390         {0xaa, 0x07, 0x3002},
4391         {0xaa, 0x20, 0x1100},
4392         {0xaa, 0x35, 0x0050},
4393         {0xaa, 0x30, 0x0005},
4394         {0xaa, 0x31, 0x0000},
4395         {0xaa, 0x58, 0x0078},
4396         {0xaa, 0x62, 0x0411},
4397         {0xaa, 0x2b, 0x0028},
4398         {0xaa, 0x2c, 0x0030},
4399         {0xaa, 0x2d, 0x0030},
4400         {0xaa, 0x2e, 0x0028},
4401         {0xa0, 0x10, 0x0087},
4402         {0xa0, 0x37, 0x0101},
4403         {0xa0, 0x05, 0x0012},
4404         {0xa0, 0x0d, 0x0100},
4405         {0xa0, 0x06, 0x0189},
4406         {0xa0, 0x00, 0x01ad},
4407         {0xa0, 0x03, 0x01c5},
4408         {0xa0, 0x13, 0x01cb},
4409         {0xa0, 0x08, 0x0250},
4410         {0xa0, 0x08, 0x0301},
4411         {0xa0, 0x60, 0x01a8},
4412         {0xa0, 0x78, 0x018d},
4413         {0xa0, 0x61, 0x0116},
4414         {0xa0, 0x65, 0x0118},
4415
4416         {0xa1, 0x01, 0x0002},
4417         {0xa0, 0x09, 0x01ad},
4418         {0xa0, 0x15, 0x01ae},
4419         {0xa0, 0x0d, 0x003a},
4420         {0xa0, 0x02, 0x003b},
4421         {0xa0, 0x00, 0x0038},
4422         {0xa0, 0x50, 0x010a},   /* matrix */
4423         {0xa0, 0xf8, 0x010b},
4424         {0xa0, 0xf8, 0x010c},
4425         {0xa0, 0xf8, 0x010d},
4426         {0xa0, 0x50, 0x010e},
4427         {0xa0, 0xf8, 0x010f},
4428         {0xa0, 0xf8, 0x0110},
4429         {0xa0, 0xf8, 0x0111},
4430         {0xa0, 0x50, 0x0112},
4431
4432         {0xa1, 0x01, 0x0008},
4433         {0xa0, 0x03, 0x0008},   /* clock ? */
4434         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
4435         {0xa1, 0x01, 0x01c8},
4436         {0xa1, 0x01, 0x01c9},
4437         {0xa1, 0x01, 0x01ca},
4438         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
4439         {0xa0, 0x13, 0x0120},   /* gamma 4 */
4440         {0xa0, 0x38, 0x0121},
4441         {0xa0, 0x59, 0x0122},
4442         {0xa0, 0x79, 0x0123},
4443         {0xa0, 0x92, 0x0124},
4444         {0xa0, 0xa7, 0x0125},
4445         {0xa0, 0xb9, 0x0126},
4446         {0xa0, 0xc8, 0x0127},
4447         {0xa0, 0xd4, 0x0128},
4448         {0xa0, 0xdf, 0x0129},
4449         {0xa0, 0xe7, 0x012a},
4450         {0xa0, 0xee, 0x012b},
4451         {0xa0, 0xf4, 0x012c},
4452         {0xa0, 0xf9, 0x012d},
4453         {0xa0, 0xfc, 0x012e},
4454         {0xa0, 0xff, 0x012f},
4455         {0xa0, 0x26, 0x0130},
4456         {0xa0, 0x22, 0x0131},
4457         {0xa0, 0x20, 0x0132},
4458         {0xa0, 0x1c, 0x0133},
4459         {0xa0, 0x16, 0x0134},
4460         {0xa0, 0x13, 0x0135},
4461         {0xa0, 0x10, 0x0136},
4462         {0xa0, 0x0d, 0x0137},
4463         {0xa0, 0x0b, 0x0138},
4464         {0xa0, 0x09, 0x0139},
4465         {0xa0, 0x07, 0x013a},
4466         {0xa0, 0x06, 0x013b},
4467         {0xa0, 0x05, 0x013c},
4468         {0xa0, 0x04, 0x013d},
4469         {0xa0, 0x03, 0x013e},
4470         {0xa0, 0x02, 0x013f},
4471         {0xa0, 0x50, 0x010a},   /* matrix */
4472         {0xa0, 0xf8, 0x010b},
4473         {0xa0, 0xf8, 0x010c},
4474         {0xa0, 0xf8, 0x010d},
4475         {0xa0, 0x50, 0x010e},
4476         {0xa0, 0xf8, 0x010f},
4477         {0xa0, 0xf8, 0x0110},
4478         {0xa0, 0xf8, 0x0111},
4479         {0xa0, 0x50, 0x0112},
4480
4481         {0xa1, 0x01, 0x0180},
4482         {0xa0, 0x00, 0x0180},
4483         {0xa0, 0x00, 0x0180},
4484         {0xa0, 0x00, 0x0019},
4485         {0xaa, 0x05, 0x0009},
4486         {0xaa, 0x09, 0x0134},
4487         {0xa0, 0x00, 0x0190},
4488         {0xa0, 0x07, 0x0191},
4489         {0xa0, 0xec, 0x0192},
4490         {0xa0, 0x00, 0x0195},
4491         {0xa0, 0x00, 0x0196},
4492         {0xa0, 0x9c, 0x0197},
4493         {0xa0, 0x0e, 0x018c},
4494         {0xa0, 0x1c, 0x018f},
4495         {0xa0, 0x14, 0x01a9},
4496         {0xa0, 0x24, 0x01aa},
4497         {0xa0, 0xd7, 0x001d},
4498         {0xa0, 0xf4, 0x001e},
4499         {0xa0, 0xf9, 0x001f},
4500         {0xa0, 0xff, 0x0020},
4501         {0xa0, 0x42, 0x0180},
4502         {0xa0, 0x09, 0x01ad},
4503         {0xa0, 0x15, 0x01ae},
4504         {0xa0, 0x40, 0x0180},
4505         {0xa1, 0x01, 0x0180},
4506         {0xa0, 0x42, 0x0180},
4507         {}
4508 };
4509
4510 static struct usb_action pb03303x_InitialScale[] = {
4511         {0xa0, 0x01, 0x0000},
4512         {0xa0, 0x03, 0x0008},
4513         {0xa0, 0x0a, 0x0010},
4514         {0xa0, 0x00, 0x0002},
4515         {0xa0, 0x02, 0x0003},
4516         {0xa0, 0x80, 0x0004},
4517         {0xa0, 0x01, 0x0005},
4518         {0xa0, 0xe0, 0x0006},
4519         {0xa0, 0xdc, 0x008b},   /* 8b -> dc */
4520         {0xa0, 0x01, 0x0001},
4521         {0xa0, 0x03, 0x0012},
4522         {0xa0, 0x01, 0x0012},
4523         {0xa0, 0x00, 0x0098},
4524         {0xa0, 0x00, 0x009a},
4525         {0xa0, 0x00, 0x011a},
4526         {0xa0, 0x00, 0x011c},
4527         {0xa0, 0xdc, 0x008b},
4528         {0xaa, 0x01, 0x0001},
4529         {0xaa, 0x06, 0x0000},
4530         {0xaa, 0x08, 0x0483},
4531         {0xaa, 0x01, 0x0004},
4532         {0xaa, 0x08, 0x0006},
4533         {0xaa, 0x02, 0x0011},
4534         {0xaa, 0x03, 0x01e7},
4535         {0xaa, 0x04, 0x0287},
4536         {0xaa, 0x07, 0x3002},
4537         {0xaa, 0x20, 0x1100},
4538         {0xaa, 0x35, 0x0050},
4539         {0xaa, 0x30, 0x0005},
4540         {0xaa, 0x31, 0x0000},
4541         {0xaa, 0x58, 0x0078},
4542         {0xaa, 0x62, 0x0411},
4543         {0xaa, 0x2b, 0x0028},
4544         {0xaa, 0x2c, 0x0030},
4545         {0xaa, 0x2d, 0x0030},
4546         {0xaa, 0x2e, 0x0028},
4547         {0xa0, 0x10, 0x0087},
4548         {0xa0, 0x37, 0x0101},
4549         {0xa0, 0x05, 0x0012},
4550         {0xa0, 0x0d, 0x0100},
4551         {0xa0, 0x06, 0x0189},
4552         {0xa0, 0x00, 0x01ad},
4553         {0xa0, 0x03, 0x01c5},
4554         {0xa0, 0x13, 0x01cb},
4555         {0xa0, 0x08, 0x0250},
4556         {0xa0, 0x08, 0x0301},
4557         {0xa0, 0x60, 0x01a8},
4558         {0xa0, 0x78, 0x018d},
4559         {0xa0, 0x61, 0x0116},
4560         {0xa0, 0x65, 0x0118},
4561
4562         {0xa1, 0x01, 0x0002},
4563
4564         {0xa0, 0x09, 0x01ad},
4565         {0xa0, 0x15, 0x01ae},
4566
4567         {0xa0, 0x0d, 0x003a},
4568         {0xa0, 0x02, 0x003b},
4569         {0xa0, 0x00, 0x0038},
4570         {0xa0, 0x50, 0x010a},   /* matrix */
4571         {0xa0, 0xf8, 0x010b},
4572         {0xa0, 0xf8, 0x010c},
4573         {0xa0, 0xf8, 0x010d},
4574         {0xa0, 0x50, 0x010e},
4575         {0xa0, 0xf8, 0x010f},
4576         {0xa0, 0xf8, 0x0110},
4577         {0xa0, 0xf8, 0x0111},
4578         {0xa0, 0x50, 0x0112},
4579
4580         {0xa1, 0x01, 0x0008},
4581         {0xa0, 0x03, 0x0008},   /* clock ? */
4582         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
4583         {0xa1, 0x01, 0x01c8},
4584         {0xa1, 0x01, 0x01c9},
4585         {0xa1, 0x01, 0x01ca},
4586         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
4587
4588         {0xa0, 0x13, 0x0120},   /* gamma 4 */
4589         {0xa0, 0x38, 0x0121},
4590         {0xa0, 0x59, 0x0122},
4591         {0xa0, 0x79, 0x0123},
4592         {0xa0, 0x92, 0x0124},
4593         {0xa0, 0xa7, 0x0125},
4594         {0xa0, 0xb9, 0x0126},
4595         {0xa0, 0xc8, 0x0127},
4596         {0xa0, 0xd4, 0x0128},
4597         {0xa0, 0xdf, 0x0129},
4598         {0xa0, 0xe7, 0x012a},
4599         {0xa0, 0xee, 0x012b},
4600         {0xa0, 0xf4, 0x012c},
4601         {0xa0, 0xf9, 0x012d},
4602         {0xa0, 0xfc, 0x012e},
4603         {0xa0, 0xff, 0x012f},
4604         {0xa0, 0x26, 0x0130},
4605         {0xa0, 0x22, 0x0131},
4606         {0xa0, 0x20, 0x0132},
4607         {0xa0, 0x1c, 0x0133},
4608         {0xa0, 0x16, 0x0134},
4609         {0xa0, 0x13, 0x0135},
4610         {0xa0, 0x10, 0x0136},
4611         {0xa0, 0x0d, 0x0137},
4612         {0xa0, 0x0b, 0x0138},
4613         {0xa0, 0x09, 0x0139},
4614         {0xa0, 0x07, 0x013a},
4615         {0xa0, 0x06, 0x013b},
4616         {0xa0, 0x05, 0x013c},
4617         {0xa0, 0x04, 0x013d},
4618         {0xa0, 0x03, 0x013e},
4619         {0xa0, 0x02, 0x013f},
4620         {0xa0, 0x50, 0x010a},   /* matrix */
4621         {0xa0, 0xf8, 0x010b},
4622         {0xa0, 0xf8, 0x010c},
4623         {0xa0, 0xf8, 0x010d},
4624         {0xa0, 0x50, 0x010e},
4625         {0xa0, 0xf8, 0x010f},
4626         {0xa0, 0xf8, 0x0110},
4627         {0xa0, 0xf8, 0x0111},
4628         {0xa0, 0x50, 0x0112},
4629
4630         {0xa1, 0x01, 0x0180},
4631         {0xa0, 0x00, 0x0180},
4632         {0xa0, 0x00, 0x0180},
4633         {0xa0, 0x00, 0x0019},
4634         {0xaa, 0x05, 0x0009},
4635         {0xaa, 0x09, 0x0134},
4636         {0xa0, 0x00, 0x0190},
4637         {0xa0, 0x07, 0x0191},
4638         {0xa0, 0xec, 0x0192},
4639         {0xa0, 0x00, 0x0195},
4640         {0xa0, 0x00, 0x0196},
4641         {0xa0, 0x9c, 0x0197},
4642         {0xa0, 0x0e, 0x018c},
4643         {0xa0, 0x1c, 0x018f},
4644         {0xa0, 0x14, 0x01a9},
4645         {0xa0, 0x24, 0x01aa},
4646         {0xa0, 0xd7, 0x001d},
4647         {0xa0, 0xf4, 0x001e},
4648         {0xa0, 0xf9, 0x001f},
4649         {0xa0, 0xff, 0x0020},
4650         {0xa0, 0x42, 0x0180},
4651         {0xa0, 0x09, 0x01ad},
4652         {0xa0, 0x15, 0x01ae},
4653         {0xa0, 0x40, 0x0180},
4654         {0xa1, 0x01, 0x0180},
4655         {0xa0, 0x42, 0x0180},
4656         {}
4657 };
4658 static struct usb_action pb0330xx_Initial[] = {
4659         {0xa1, 0x01, 0x0008},
4660         {0xa1, 0x01, 0x0008},
4661         {0xa0, 0x01, 0x0000},
4662         {0xa0, 0x03, 0x0008},   /* 00 */
4663         {0xa0, 0x0a, 0x0010},
4664         {0xa0, 0x10, 0x0002},
4665         {0xa0, 0x02, 0x0003},
4666         {0xa0, 0x80, 0x0004},
4667         {0xa0, 0x01, 0x0005},
4668         {0xa0, 0xe0, 0x0006},
4669         {0xa0, 0x01, 0x0001},
4670         {0xa0, 0x05, 0x0012},
4671         {0xa0, 0x07, 0x0012},
4672         {0xa0, 0x00, 0x0098},
4673         {0xa0, 0x00, 0x009a},
4674         {0xa0, 0x00, 0x011a},
4675         {0xa0, 0x00, 0x011c},
4676         {0xa0, 0x05, 0x0012},
4677         {0xaa, 0x01, 0x0006},
4678         {0xaa, 0x02, 0x0011},
4679         {0xaa, 0x03, 0x01e7},
4680         {0xaa, 0x04, 0x0287},
4681         {0xaa, 0x06, 0x0003},
4682         {0xaa, 0x07, 0x3002},
4683         {0xaa, 0x20, 0x1100},
4684         {0xaa, 0x2f, 0xf7b0},
4685         {0xaa, 0x30, 0x0005},
4686         {0xaa, 0x31, 0x0000},
4687         {0xaa, 0x34, 0x0100},
4688         {0xaa, 0x35, 0x0060},
4689         {0xaa, 0x3d, 0x068f},
4690         {0xaa, 0x40, 0x01e0},
4691         {0xaa, 0x58, 0x0078},
4692         {0xaa, 0x62, 0x0411},
4693         {0xa0, 0x10, 0x0087},
4694         {0xa0, 0x37, 0x0101},
4695         {0xa0, 0x05, 0x0012},
4696         {0xa0, 0x0d, 0x0100},
4697         {0xa0, 0x06, 0x0189},
4698         {0xa0, 0x00, 0x01ad},
4699         {0xa0, 0x03, 0x01c5},
4700         {0xa0, 0x13, 0x01cb},
4701         {0xa0, 0x08, 0x0250},
4702         {0xa0, 0x08, 0x0301},
4703         {0xa0, 0x60, 0x01a8},
4704         {0xa0, 0x6c, 0x018d},
4705         {0xa1, 0x01, 0x0002},
4706         {0xa0, 0x09, 0x01ad},
4707         {0xa0, 0x15, 0x01ae},
4708         {0xa0, 0x00, 0x0092},
4709         {0xa0, 0x02, 0x0090},
4710         {0xa1, 0x01, 0x0091},
4711         {0xa1, 0x01, 0x0095},
4712         {0xa1, 0x01, 0x0096},
4713         {0xa0, 0x50, 0x010a},   /* matrix */
4714         {0xa0, 0xf8, 0x010b},
4715         {0xa0, 0xf8, 0x010c},
4716         {0xa0, 0xf8, 0x010d},
4717         {0xa0, 0x50, 0x010e},
4718         {0xa0, 0xf8, 0x010f},
4719         {0xa0, 0xf8, 0x0110},
4720         {0xa0, 0xf8, 0x0111},
4721         {0xa0, 0x50, 0x0112},
4722         {0xa1, 0x01, 0x0008},
4723         {0xa0, 0x03, 0x0008},   /* clock ? */
4724         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
4725         {0xa1, 0x01, 0x01c8},
4726         {0xa1, 0x01, 0x01c9},
4727         {0xa1, 0x01, 0x01ca},
4728         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
4729
4730         {0xa0, 0x50, 0x010a},   /* matrix */
4731         {0xa0, 0xf8, 0x010b},
4732         {0xa0, 0xf8, 0x010c},
4733         {0xa0, 0xf8, 0x010d},
4734         {0xa0, 0x50, 0x010e},
4735         {0xa0, 0xf8, 0x010f},
4736         {0xa0, 0xf8, 0x0110},
4737         {0xa0, 0xf8, 0x0111},
4738         {0xa0, 0x50, 0x0112},
4739         {0xa1, 0x01, 0x0180},
4740         {0xa0, 0x00, 0x0180},
4741         {0xa0, 0x00, 0x0019},
4742         {0xaa, 0x05, 0x0066},
4743         {0xaa, 0x09, 0x02b2},
4744         {0xaa, 0x10, 0x0002},
4745
4746         {0xa0, 0x60, 0x011d},
4747         {0xa0, 0x00, 0x0190},
4748         {0xa0, 0x07, 0x0191},
4749         {0xa0, 0x8c, 0x0192},
4750         {0xa0, 0x00, 0x0195},
4751         {0xa0, 0x00, 0x0196},
4752         {0xa0, 0x8a, 0x0197},
4753         {0xa0, 0x10, 0x018c},
4754         {0xa0, 0x20, 0x018f},
4755         {0xa0, 0x14, 0x01a9},
4756         {0xa0, 0x24, 0x01aa},
4757         {0xa0, 0xd7, 0x001d},
4758         {0xa0, 0xf0, 0x001e},
4759         {0xa0, 0xf8, 0x001f},
4760         {0xa0, 0xff, 0x0020},
4761         {0xa0, 0x09, 0x01ad},
4762         {0xa0, 0x15, 0x01ae},
4763         {0xa0, 0x40, 0x0180},
4764         {0xa1, 0x01, 0x0180},
4765         {0xa0, 0x42, 0x0180},
4766         {0xa1, 0x01, 0x0008},
4767         {0xa1, 0x01, 0x0007},
4768 /*      {0xa0, 0x30, 0x0007}, */
4769 /*      {0xa0, 0x00, 0x0007}, */
4770         {}
4771 };
4772
4773 static struct usb_action pb0330xx_InitialScale[] = {
4774         {0xa1, 0x01, 0x0008},
4775         {0xa1, 0x01, 0x0008},
4776         {0xa0, 0x01, 0x0000},
4777         {0xa0, 0x03, 0x0008},   /* 00 */
4778         {0xa0, 0x0a, 0x0010},
4779         {0xa0, 0x00, 0x0002},   /* 10 */
4780         {0xa0, 0x02, 0x0003},
4781         {0xa0, 0x80, 0x0004},
4782         {0xa0, 0x01, 0x0005},
4783         {0xa0, 0xe0, 0x0006},
4784         {0xa0, 0x01, 0x0001},
4785         {0xa0, 0x05, 0x0012},
4786         {0xa0, 0x07, 0x0012},
4787         {0xa0, 0x00, 0x0098},
4788         {0xa0, 0x00, 0x009a},
4789         {0xa0, 0x00, 0x011a},
4790         {0xa0, 0x00, 0x011c},
4791         {0xa0, 0x05, 0x0012},
4792         {0xaa, 0x01, 0x0006},
4793         {0xaa, 0x02, 0x0011},
4794         {0xaa, 0x03, 0x01e7},
4795         {0xaa, 0x04, 0x0287},
4796         {0xaa, 0x06, 0x0003},
4797         {0xaa, 0x07, 0x3002},
4798         {0xaa, 0x20, 0x1100},
4799         {0xaa, 0x2f, 0xf7b0},
4800         {0xaa, 0x30, 0x0005},
4801         {0xaa, 0x31, 0x0000},
4802         {0xaa, 0x34, 0x0100},
4803         {0xaa, 0x35, 0x0060},
4804         {0xaa, 0x3d, 0x068f},
4805         {0xaa, 0x40, 0x01e0},
4806         {0xaa, 0x58, 0x0078},
4807         {0xaa, 0x62, 0x0411},
4808         {0xa0, 0x10, 0x0087},
4809         {0xa0, 0x37, 0x0101},
4810         {0xa0, 0x05, 0x0012},
4811         {0xa0, 0x0d, 0x0100},
4812         {0xa0, 0x06, 0x0189},
4813         {0xa0, 0x00, 0x01ad},
4814         {0xa0, 0x03, 0x01c5},
4815         {0xa0, 0x13, 0x01cb},
4816         {0xa0, 0x08, 0x0250},
4817         {0xa0, 0x08, 0x0301},
4818         {0xa0, 0x60, 0x01a8},
4819         {0xa0, 0x6c, 0x018d},
4820         {0xa1, 0x01, 0x0002},
4821         {0xa0, 0x09, 0x01ad},
4822         {0xa0, 0x15, 0x01ae},
4823         {0xa0, 0x00, 0x0092},
4824         {0xa0, 0x02, 0x0090},
4825         {0xa1, 0x01, 0x0091},
4826         {0xa1, 0x01, 0x0095},
4827         {0xa1, 0x01, 0x0096},
4828         {0xa0, 0x50, 0x010a},   /* matrix */
4829         {0xa0, 0xf8, 0x010b},
4830         {0xa0, 0xf8, 0x010c},
4831         {0xa0, 0xf8, 0x010d},
4832         {0xa0, 0x50, 0x010e},
4833         {0xa0, 0xf8, 0x010f},
4834         {0xa0, 0xf8, 0x0110},
4835         {0xa0, 0xf8, 0x0111},
4836         {0xa0, 0x50, 0x0112},
4837         {0xa1, 0x01, 0x0008},
4838         {0xa0, 0x03, 0x0008},   /* clock ? */
4839         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
4840         {0xa1, 0x01, 0x01c8},
4841         {0xa1, 0x01, 0x01c9},
4842         {0xa1, 0x01, 0x01ca},
4843         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
4844
4845         {0xa0, 0x50, 0x010a},   /* matrix */
4846         {0xa0, 0xf8, 0x010b},
4847         {0xa0, 0xf8, 0x010c},
4848         {0xa0, 0xf8, 0x010d},
4849         {0xa0, 0x50, 0x010e},
4850         {0xa0, 0xf8, 0x010f},
4851         {0xa0, 0xf8, 0x0110},
4852         {0xa0, 0xf8, 0x0111},
4853         {0xa0, 0x50, 0x0112},
4854         {0xa1, 0x01, 0x0180},
4855         {0xa0, 0x00, 0x0180},
4856         {0xa0, 0x00, 0x0019},
4857         {0xaa, 0x05, 0x0066},
4858         {0xaa, 0x09, 0x02b2},
4859         {0xaa, 0x10, 0x0002},
4860         {0xa0, 0x60, 0x011d},
4861         {0xa0, 0x00, 0x0190},
4862         {0xa0, 0x07, 0x0191},
4863         {0xa0, 0x8c, 0x0192},
4864         {0xa0, 0x00, 0x0195},
4865         {0xa0, 0x00, 0x0196},
4866         {0xa0, 0x8a, 0x0197},
4867         {0xa0, 0x10, 0x018c},
4868         {0xa0, 0x20, 0x018f},
4869         {0xa0, 0x14, 0x01a9},
4870         {0xa0, 0x24, 0x01aa},
4871         {0xa0, 0xd7, 0x001d},
4872         {0xa0, 0xf0, 0x001e},
4873         {0xa0, 0xf8, 0x001f},
4874         {0xa0, 0xff, 0x0020},
4875         {0xa0, 0x09, 0x01ad},
4876         {0xa0, 0x15, 0x01ae},
4877         {0xa0, 0x40, 0x0180},
4878         {0xa1, 0x01, 0x0180},
4879         {0xa0, 0x42, 0x0180},
4880         {0xa1, 0x01, 0x0008},
4881         {0xa1, 0x01, 0x0007},
4882 /*      {0xa0, 0x30, 0x0007}, */
4883 /*      {0xa0, 0x00, 0x0007}, */
4884         {}
4885 };
4886 static struct usb_action pb0330_50HZ[] = {
4887         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4888         {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */
4889         {0xa0, 0xee, 0x0192}, /* 01,92,ee,cc */
4890         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4891         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4892         {0xa0, 0x46, 0x0197}, /* 01,97,46,cc */
4893         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4894         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
4895         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
4896         {0xa0, 0x26, 0x01aa}, /* 01,aa,26,cc */
4897         {0xa0, 0x68, 0x001d}, /* 00,1d,68,cc */
4898         {0xa0, 0x90, 0x001e}, /* 00,1e,90,cc */
4899         {0xa0, 0xc8, 0x001f}, /* 00,1f,c8,cc */
4900         {}
4901 };
4902 static struct usb_action pb0330_50HZScale[] = {
4903         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
4904         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4905         {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */
4906         {0xa0, 0xa0, 0x0192}, /* 01,92,a0,cc */
4907         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4908         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4909         {0xa0, 0x7a, 0x0197}, /* 01,97,7a,cc */
4910         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4911         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
4912         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
4913         {0xa0, 0x26, 0x01aa}, /* 01,aa,26,cc */
4914         {0xa0, 0xe5, 0x001d}, /* 00,1d,e5,cc */
4915         {0xa0, 0xf0, 0x001e}, /* 00,1e,f0,cc */
4916         {0xa0, 0xf8, 0x001f}, /* 00,1f,f8,cc */
4917         {}
4918 };
4919 static struct usb_action pb0330_60HZ[] = {
4920         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
4921         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4922         {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */
4923         {0xa0, 0xdd, 0x0192}, /* 01,92,dd,cc */
4924         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4925         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4926         {0xa0, 0x3d, 0x0197}, /* 01,97,3d,cc */
4927         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4928         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
4929         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
4930         {0xa0, 0x26, 0x01aa}, /* 01,aa,26,cc */
4931         {0xa0, 0x43, 0x001d}, /* 00,1d,43,cc */
4932         {0xa0, 0x50, 0x001e}, /* 00,1e,50,cc */
4933         {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */
4934         {}
4935 };
4936 static struct usb_action pb0330_60HZScale[] = {
4937         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
4938         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4939         {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */
4940         {0xa0, 0xa0, 0x0192}, /* 01,92,a0,cc */
4941         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4942         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4943         {0xa0, 0x7a, 0x0197}, /* 01,97,7a,cc */
4944         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4945         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
4946         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
4947         {0xa0, 0x26, 0x01aa}, /* 01,aa,26,cc */
4948         {0xa0, 0x41, 0x001d}, /* 00,1d,41,cc */
4949         {0xa0, 0x50, 0x001e}, /* 00,1e,50,cc */
4950         {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */
4951         {}
4952 };
4953 static struct usb_action pb0330_NoFliker[] = {
4954         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
4955         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4956         {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */
4957         {0xa0, 0xf0, 0x0192}, /* 01,92,f0,cc */
4958         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4959         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4960         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
4961         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4962         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
4963         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
4964         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
4965         {0xa0, 0x09, 0x001d}, /* 00,1d,09,cc */
4966         {0xa0, 0x40, 0x001e}, /* 00,1e,40,cc */
4967         {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */
4968         {}
4969 };
4970 static struct usb_action pb0330_NoFlikerScale[] = {
4971         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
4972         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
4973         {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */
4974         {0xa0, 0xf0, 0x0192}, /* 01,92,f0,cc */
4975         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
4976         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
4977         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
4978         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
4979         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
4980         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
4981         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
4982         {0xa0, 0x09, 0x001d}, /* 00,1d,09,cc */
4983         {0xa0, 0x40, 0x001e}, /* 00,1e,40,cc */
4984         {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */
4985         {}
4986 };
4987
4988 /* from oem9.inf - HKR,%PO2030%,Initial - 640x480 - (close to CS2102) */
4989 static struct usb_action PO2030_mode0[] = {
4990         {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */
4991         {0xa0, 0x04, 0x0002}, /* 00,02,04,cc */
4992         {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */
4993         {0xa0, 0x01, 0x0001}, /* 00,01,01,cc */
4994         {0xa0, 0x04, 0x0080}, /* 00,80,04,cc */
4995         {0xa0, 0x05, 0x0081}, /* 00,81,05,cc */
4996         {0xa0, 0x16, 0x0083}, /* 00,83,16,cc */
4997         {0xa0, 0x18, 0x0085}, /* 00,85,18,cc */
4998         {0xa0, 0x1a, 0x0086}, /* 00,86,1a,cc */
4999         {0xa0, 0x1b, 0x0087}, /* 00,87,1b,cc */
5000         {0xa0, 0x1c, 0x0088}, /* 00,88,1c,cc */
5001         {0xa0, 0xee, 0x008b}, /* 00,8b,ee,cc */
5002         {0xa0, 0x03, 0x0008}, /* 00,08,03,cc */
5003         {0xa0, 0x03, 0x0012}, /* 00,12,03,cc */
5004         {0xa0, 0x01, 0x0012}, /* 00,12,01,cc */
5005         {0xa0, 0x02, 0x0003}, /* 00,03,02,cc */
5006         {0xa0, 0x80, 0x0004}, /* 00,04,80,cc */
5007         {0xa0, 0x01, 0x0005}, /* 00,05,01,cc */
5008         {0xa0, 0xe0, 0x0006}, /* 00,06,e0,cc */
5009         {0xa0, 0x42, 0x0180}, /* 01,80,42,cc */
5010         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5011         {0xa0, 0x00, 0x0098}, /* 00,98,00,cc */
5012         {0xa0, 0x00, 0x009a}, /* 00,9a,00,cc */
5013         {0xa0, 0x00, 0x011a}, /* 01,1a,00,cc */
5014         {0xa0, 0x00, 0x011c}, /* 01,1c,00,cc */
5015         {0xa0, 0xe6, 0x009c}, /* 00,9c,e6,cc */
5016         {0xa0, 0x86, 0x009e}, /* 00,9e,86,cc */
5017         {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
5018         {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5019         {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
5020         {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
5021         {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5022         {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5023         {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5024         {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5025         {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5026         {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5027         {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5028         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5029         {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5030         {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5031         {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5032         {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5033         {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5034         {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5035         {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5036         {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5037         {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5038         {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5039         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5040         {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5041         {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5042         {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5043         {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5044         {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5045         {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5046         {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5047         {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5048         {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5049         {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5050         {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5051         {0xa0, 0xf7, 0x0101}, /* 01,01,f7,cc */
5052         {0xa0, 0x05, 0x0012}, /* 00,12,05,cc */
5053         {0xa0, 0x0d, 0x0100}, /* 01,00,0d,cc */
5054         {0xa0, 0x06, 0x0189}, /* 01,89,06,cc */
5055         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5056         {0xa0, 0x03, 0x01c5}, /* 01,c5,03,cc */
5057         {0xa0, 0x13, 0x01cb}, /* 01,cb,13,cc */
5058         {0xa0, 0x08, 0x0250}, /* 02,50,08,cc */
5059         {0xa0, 0x08, 0x0301}, /* 03,01,08,cc */
5060         {0xa0, 0x7a, 0x0116}, /* 01,16,7a,cc */
5061         {0xa0, 0x4a, 0x0118}, /* 01,18,4a,cc */
5062         {}
5063 };
5064
5065 /* from oem9.inf - HKR,%PO2030%,InitialScale - 320x240 */
5066 static struct usb_action PO2030_mode1[] = {
5067         {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */
5068         {0xa0, 0x10, 0x0002}, /* 00,02,10,cc */
5069         {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */
5070         {0xa0, 0x01, 0x0001}, /* 00,01,01,cc */
5071         {0xa0, 0x04, 0x0080}, /* 00,80,04,cc */
5072         {0xa0, 0x05, 0x0081}, /* 00,81,05,cc */
5073         {0xa0, 0x16, 0x0083}, /* 00,83,16,cc */
5074         {0xa0, 0x18, 0x0085}, /* 00,85,18,cc */
5075         {0xa0, 0x1a, 0x0086}, /* 00,86,1a,cc */
5076         {0xa0, 0x1b, 0x0087}, /* 00,87,1b,cc */
5077         {0xa0, 0x1c, 0x0088}, /* 00,88,1c,cc */
5078         {0xa0, 0xee, 0x008b}, /* 00,8b,ee,cc */
5079         {0xa0, 0x03, 0x0008}, /* 00,08,03,cc */
5080         {0xa0, 0x03, 0x0012}, /* 00,12,03,cc */
5081         {0xa0, 0x01, 0x0012}, /* 00,12,01,cc */
5082         {0xa0, 0x02, 0x0003}, /* 00,03,02,cc */
5083         {0xa0, 0x80, 0x0004}, /* 00,04,80,cc */
5084         {0xa0, 0x01, 0x0005}, /* 00,05,01,cc */
5085         {0xa0, 0xe0, 0x0006}, /* 00,06,e0,cc */
5086         {0xa0, 0x42, 0x0180}, /* 01,80,42,cc */
5087         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5088         {0xa0, 0x00, 0x0098}, /* 00,98,00,cc */
5089         {0xa0, 0x00, 0x009a}, /* 00,9a,00,cc */
5090         {0xa0, 0x00, 0x011a}, /* 01,1a,00,cc */
5091         {0xa0, 0x00, 0x011c}, /* 01,1c,00,cc */
5092         {0xa0, 0xe8, 0x009c}, /* 00,9c,e8,cc */
5093         {0xa0, 0x88, 0x009e}, /* 00,9e,88,cc */
5094         {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
5095         {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5096         {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
5097         {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
5098         {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5099         {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5100         {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5101         {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5102         {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5103         {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5104         {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5105         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5106         {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5107         {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5108         {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5109         {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5110         {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5111         {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5112         {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5113         {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5114         {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5115         {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5116         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5117         {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5118         {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5119         {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5120         {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5121         {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5122         {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5123         {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5124         {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5125         {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5126         {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5127         {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5128         {0xa0, 0xf7, 0x0101}, /* 01,01,f7,cc */
5129         {0xa0, 0x05, 0x0012}, /* 00,12,05,cc */
5130         {0xa0, 0x0d, 0x0100}, /* 01,00,0d,cc */
5131         {0xa0, 0x06, 0x0189}, /* 01,89,06,cc */
5132         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5133         {0xa0, 0x03, 0x01c5}, /* 01,c5,03,cc */
5134         {0xa0, 0x13, 0x01cb}, /* 01,cb,13,cc */
5135         {0xa0, 0x08, 0x0250}, /* 02,50,08,cc */
5136         {0xa0, 0x08, 0x0301}, /* 03,01,08,cc */
5137         {0xa0, 0x7a, 0x0116}, /* 01,16,7a,cc */
5138         {0xa0, 0x4a, 0x0118}, /* 01,18,4a,cc */
5139         {}
5140 };
5141
5142 static struct usb_action PO2030_50HZ[] = {
5143         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5144         {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
5145         {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
5146         {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
5147         {0xa0, 0x05, 0x0190}, /* 01,90,05,cc */
5148         {0xa0, 0x35, 0x0191}, /* 01,91,35,cc */
5149         {0xa0, 0x70, 0x0192}, /* 01,92,70,cc */
5150         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
5151         {0xa0, 0x85, 0x0196}, /* 01,96,85,cc */
5152         {0xa0, 0x58, 0x0197}, /* 01,97,58,cc */
5153         {0xa0, 0x0c, 0x018c}, /* 01,8c,0c,cc */
5154         {0xa0, 0x18, 0x018f}, /* 01,8f,18,cc */
5155         {0xa0, 0x60, 0x01a8}, /* 01,a8,60,cc */
5156         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
5157         {0xa0, 0x22, 0x01aa}, /* 01,aa,22,cc */
5158         {0xa0, 0x88, 0x018d}, /* 01,8d,88,cc */
5159         {0xa0, 0x58, 0x011d}, /* 01,1d,58,cc */
5160         {0xa0, 0x42, 0x0180}, /* 01,80,42,cc */
5161         {}
5162 };
5163
5164 static struct usb_action PO2030_60HZ[] = {
5165         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5166         {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5167         {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
5168         {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
5169         {0xa0, 0x08, 0x0190}, /* 01,90,08,cc */
5170         {0xa0, 0xae, 0x0191}, /* 01,91,ae,cc */
5171         {0xa0, 0x80, 0x0192}, /* 01,92,80,cc */
5172         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
5173         {0xa0, 0x6f, 0x0196}, /* 01,96,6f,cc */
5174         {0xa0, 0x20, 0x0197}, /* 01,97,20,cc */
5175         {0xa0, 0x0c, 0x018c}, /* 01,8c,0c,cc */
5176         {0xa0, 0x18, 0x018f}, /* 01,8f,18,cc */
5177         {0xa0, 0x60, 0x01a8}, /* 01,a8,60,cc */
5178         {0xa0, 0x10, 0x01a9}, /* 01,a9,10,cc */
5179         {0xa0, 0x22, 0x01aa}, /* 01,aa,22,cc */
5180         {0xa0, 0x88, 0x018d}, /* 01,8d,88,cc */ /* win: 01,8d,80 */
5181         {0xa0, 0x58, 0x011d}, /* 01,1d,58,cc */
5182         {0xa0, 0x42, 0x0180}, /* 01,80,42,cc */
5183         {}
5184 };
5185
5186 static struct usb_action PO2030_NoFliker[] = {
5187         {0xa0, 0x02, 0x0180}, /* 01,80,02,cc */
5188         {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
5189         {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5190         {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
5191         {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
5192         {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
5193         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
5194         {}
5195 };
5196
5197 /* TEST */
5198 static struct usb_action tas5130CK_Initial[] = {
5199         {0xa0, 0x01, 0x0000},
5200         {0xa0, 0x01, 0x003b},
5201         {0xa0, 0x0e, 0x003a},
5202         {0xa0, 0x01, 0x0038},
5203         {0xa0, 0x0b, 0x0039},
5204         {0xa0, 0x00, 0x0038},
5205         {0xa0, 0x0b, 0x0039},
5206         {0xa0, 0x01, 0x0000},
5207         {0xa0, 0x03, 0x0008},
5208         {0xa0, 0x0a, 0x0010},
5209         {0xa0, 0x10, 0x0002},
5210         {0xa0, 0x02, 0x0003},
5211         {0xa0, 0x80, 0x0004},
5212         {0xa0, 0x01, 0x0005},
5213         {0xa0, 0xe0, 0x0006},
5214         {0xa0, 0xdc, 0x008b},
5215         {0xa0, 0x01, 0x0001},
5216         {0xa0, 0x07, 0x0012},
5217         {0xa0, 0x00, 0x0098},
5218         {0xa0, 0x00, 0x009a},
5219         {0xa0, 0x00, 0x011a},
5220         {0xa0, 0x00, 0x011c},
5221         {0xa0, 0xdc, 0x008b},
5222         {0xa0, 0x05, 0x0012},
5223         {0xa0, 0x01, 0x0092},
5224         {0xa0, 0x01, 0x0093},
5225         {0xa0, 0x00, 0x0094},
5226         {0xa0, 0x01, 0x0090},
5227         {0xa0, 0x06, 0x0092},
5228         {0xa0, 0x00, 0x0093},
5229         {0xa0, 0x00, 0x0094},
5230         {0xa0, 0x01, 0x0090},
5231         {0xa0, 0x08, 0x0092},
5232         {0xa0, 0x83, 0x0093},
5233         {0xa0, 0x04, 0x0094},
5234         {0xa0, 0x01, 0x0090},
5235         {0xa0, 0x01, 0x0092},
5236         {0xa0, 0x04, 0x0093},
5237         {0xa0, 0x00, 0x0094},
5238         {0xa0, 0x01, 0x0090},
5239         {0xa0, 0x08, 0x0092},
5240         {0xa0, 0x06, 0x0093},
5241         {0xa0, 0x00, 0x0094},
5242         {0xa0, 0x01, 0x0090},
5243         {0xa0, 0x02, 0x0092},
5244         {0xa0, 0x11, 0x0093},
5245         {0xa0, 0x00, 0x0094},
5246         {0xa0, 0x01, 0x0090},
5247         {0xa0, 0x03, 0x0092},
5248         {0xa0, 0xE7, 0x0093},
5249         {0xa0, 0x01, 0x0094},
5250         {0xa0, 0x01, 0x0090},
5251         {0xa0, 0x04, 0x0092},
5252         {0xa0, 0x87, 0x0093},
5253         {0xa0, 0x02, 0x0094},
5254         {0xa0, 0x01, 0x0090},
5255         {0xa0, 0x07, 0x0092},
5256         {0xa0, 0x02, 0x0093},
5257         {0xa0, 0x30, 0x0094},
5258         {0xa0, 0x01, 0x0090},
5259         {0xa0, 0x20, 0x0092},
5260         {0xa0, 0x00, 0x0093},
5261         {0xa0, 0x51, 0x0094},
5262         {0xa0, 0x01, 0x0090},
5263         {0xa0, 0x35, 0x0092},
5264         {0xa0, 0x7F, 0x0093},
5265         {0xa0, 0x00, 0x0094},
5266         {0xa0, 0x01, 0x0090},
5267         {0xa0, 0x30, 0x0092},
5268         {0xa0, 0x05, 0x0093},
5269         {0xa0, 0x00, 0x0094},
5270         {0xa0, 0x01, 0x0090},
5271         {0xa0, 0x31, 0x0092},
5272         {0xa0, 0x00, 0x0093},
5273         {0xa0, 0x00, 0x0094},
5274         {0xa0, 0x01, 0x0090},
5275         {0xa0, 0x58, 0x0092},
5276         {0xa0, 0x78, 0x0093},
5277         {0xa0, 0x00, 0x0094},
5278         {0xa0, 0x01, 0x0090},
5279         {0xa0, 0x62, 0x0092},
5280         {0xa0, 0x11, 0x0093},
5281         {0xa0, 0x04, 0x0094},
5282         {0xa0, 0x01, 0x0090},
5283         {0xa0, 0x2B, 0x0092},
5284         {0xa0, 0x7f, 0x0093},
5285         {0xa0, 0x00, 0x0094},
5286         {0xa0, 0x01, 0x0090},
5287         {0xa0, 0x2c, 0x0092},
5288         {0xa0, 0x7f, 0x0093},
5289         {0xa0, 0x00, 0x0094},
5290         {0xa0, 0x01, 0x0090},
5291         {0xa0, 0x2D, 0x0092},
5292         {0xa0, 0x7f, 0x0093},
5293         {0xa0, 0x00, 0x0094},
5294         {0xa0, 0x01, 0x0090},
5295         {0xa0, 0x2e, 0x0092},
5296         {0xa0, 0x7f, 0x0093},
5297         {0xa0, 0x00, 0x0094},
5298         {0xa0, 0x01, 0x0090},
5299         {0xa0, 0x10, 0x0087},
5300         {0xa0, 0xb7, 0x0101},
5301         {0xa0, 0x05, 0x0012},
5302         {0xa0, 0x0d, 0x0100},
5303         {0xa0, 0x06, 0x0189},
5304         {0xa0, 0x09, 0x01ad},
5305         {0xa0, 0x03, 0x01c5},
5306         {0xa0, 0x13, 0x01cb},
5307         {0xa0, 0x08, 0x0250},
5308         {0xa0, 0x08, 0x0301},
5309         {0xa0, 0x60, 0x01a8},
5310         {0xa0, 0x6c, 0x018d},
5311         {0xa0, 0x61, 0x0116},
5312         {0xa0, 0x65, 0x0118},
5313         {0xa0, 0x09, 0x01ad},
5314         {0xa0, 0x15, 0x01ae},
5315         {0xa0, 0x4c, 0x010a},   /* matrix */
5316         {0xa0, 0xf1, 0x010b},
5317         {0xa0, 0x03, 0x010c},
5318         {0xa0, 0xfe, 0x010d},
5319         {0xa0, 0x51, 0x010e},
5320         {0xa0, 0xf1, 0x010f},
5321         {0xa0, 0xec, 0x0110},
5322         {0xa0, 0x03, 0x0111},
5323         {0xa0, 0x51, 0x0112},
5324         {0xa0, 0x03, 0x0008},
5325         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
5326         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
5327         {0xa0, 0x38, 0x0120},   /* gamma > 5 */
5328         {0xa0, 0x51, 0x0121},
5329         {0xa0, 0x6e, 0x0122},
5330         {0xa0, 0x8c, 0x0123},
5331         {0xa0, 0xa2, 0x0124},
5332         {0xa0, 0xb6, 0x0125},
5333         {0xa0, 0xc8, 0x0126},
5334         {0xa0, 0xd6, 0x0127},
5335         {0xa0, 0xe2, 0x0128},
5336         {0xa0, 0xed, 0x0129},
5337         {0xa0, 0xf5, 0x012a},
5338         {0xa0, 0xfc, 0x012b},
5339         {0xa0, 0xff, 0x012c},
5340         {0xa0, 0xff, 0x012d},
5341         {0xa0, 0xff, 0x012e},
5342         {0xa0, 0xff, 0x012f},
5343         {0xa0, 0x12, 0x0130},
5344         {0xa0, 0x1b, 0x0131},
5345         {0xa0, 0x1d, 0x0132},
5346         {0xa0, 0x1a, 0x0133},
5347         {0xa0, 0x15, 0x0134},
5348         {0xa0, 0x12, 0x0135},
5349         {0xa0, 0x0f, 0x0136},
5350         {0xa0, 0x0d, 0x0137},
5351         {0xa0, 0x0b, 0x0138},
5352         {0xa0, 0x09, 0x0139},
5353         {0xa0, 0x07, 0x013a},
5354         {0xa0, 0x05, 0x013b},
5355         {0xa0, 0x00, 0x013c},
5356         {0xa0, 0x00, 0x013d},
5357         {0xa0, 0x00, 0x013e},
5358         {0xa0, 0x01, 0x013f},
5359         {0xa0, 0x4c, 0x010a},   /* matrix */
5360         {0xa0, 0xf1, 0x010b},
5361         {0xa0, 0x03, 0x010c},
5362         {0xa0, 0xfe, 0x010d},
5363         {0xa0, 0x51, 0x010e},
5364         {0xa0, 0xf1, 0x010f},
5365         {0xa0, 0xec, 0x0110},
5366         {0xa0, 0x03, 0x0111},
5367         {0xa0, 0x51, 0x0112},
5368         {0xa0, 0x10, 0x0180},
5369         {0xa0, 0x00, 0x0180},
5370         {0xa0, 0x00, 0x0019},
5371         {0xa0, 0x05, 0x0092},
5372         {0xa0, 0x09, 0x0093},
5373         {0xa0, 0x00, 0x0094},
5374         {0xa0, 0x01, 0x0090},
5375         {0xa0, 0x09, 0x0092},
5376         {0xa0, 0x34, 0x0093},
5377         {0xa0, 0x01, 0x0094},
5378         {0xa0, 0x01, 0x0090},
5379         {0xa0, 0x00, 0x0190},
5380         {0xa0, 0x07, 0x0191},
5381         {0xa0, 0xd2, 0x0192},
5382         {0xa0, 0x00, 0x0195},
5383         {0xa0, 0x00, 0x0196},
5384         {0xa0, 0x9a, 0x0197},
5385         {0xa0, 0x0e, 0x018c},
5386         {0xa0, 0x1c, 0x018f},
5387         {0xa0, 0x14, 0x01a9},
5388         {0xa0, 0x66, 0x01aa},
5389         {0xa0, 0xd7, 0x001d},
5390         {0xa0, 0xf4, 0x001e},
5391         {0xa0, 0xf9, 0x001f},
5392         {0xa0, 0xff, 0x0020},
5393         {0xa0, 0x42, 0x0180},
5394         {0xa0, 0x09, 0x01ad},
5395         {0xa0, 0x15, 0x01ae},
5396         {0xa0, 0x40, 0x0180},
5397         {0xa0, 0x42, 0x0180},
5398         {}
5399 };
5400
5401 static struct usb_action tas5130CK_InitialScale[] = {
5402         {0xa0, 0x01, 0x0000},
5403         {0xa0, 0x01, 0x003b},
5404         {0xa0, 0x0e, 0x003a},
5405         {0xa0, 0x01, 0x0038},
5406         {0xa0, 0x0b, 0x0039},
5407         {0xa0, 0x00, 0x0038},
5408         {0xa0, 0x0b, 0x0039},
5409         {0xa0, 0x01, 0x0000},
5410         {0xa0, 0x03, 0x0008},
5411         {0xa0, 0x0a, 0x0010},
5412         {0xa0, 0x00, 0x0002},
5413         {0xa0, 0x02, 0x0003},
5414         {0xa0, 0x80, 0x0004},
5415         {0xa0, 0x01, 0x0005},
5416         {0xa0, 0xe0, 0x0006},
5417         {0xa0, 0xdc, 0x008b},
5418         {0xa0, 0x01, 0x0001},
5419         {0xa0, 0x07, 0x0012},
5420         {0xa0, 0x00, 0x0098},
5421         {0xa0, 0x00, 0x009a},
5422         {0xa0, 0x00, 0x011a},
5423         {0xa0, 0x00, 0x011c},
5424         {0xa0, 0xdc, 0x008b},
5425         {0xa0, 0x05, 0x0012},
5426         {0xa0, 0x01, 0x0092},
5427         {0xa0, 0x01, 0x0093},
5428         {0xa0, 0x00, 0x0094},
5429         {0xa0, 0x01, 0x0090},
5430         {0xa0, 0x06, 0x0092},
5431         {0xa0, 0x00, 0x0093},
5432         {0xa0, 0x00, 0x0094},
5433         {0xa0, 0x01, 0x0090},
5434         {0xa0, 0x08, 0x0092},
5435         {0xa0, 0x83, 0x0093},
5436         {0xa0, 0x04, 0x0094},
5437         {0xa0, 0x01, 0x0090},
5438         {0xa0, 0x01, 0x0092},
5439         {0xa0, 0x04, 0x0093},
5440         {0xa0, 0x00, 0x0094},
5441         {0xa0, 0x01, 0x0090},
5442         {0xa0, 0x08, 0x0092},
5443         {0xa0, 0x06, 0x0093},
5444         {0xa0, 0x00, 0x0094},
5445         {0xa0, 0x01, 0x0090},
5446         {0xa0, 0x02, 0x0092},
5447         {0xa0, 0x11, 0x0093},
5448         {0xa0, 0x00, 0x0094},
5449         {0xa0, 0x01, 0x0090},
5450         {0xa0, 0x03, 0x0092},
5451         {0xa0, 0xe5, 0x0093},
5452         {0xa0, 0x01, 0x0094},
5453         {0xa0, 0x01, 0x0090},
5454         {0xa0, 0x04, 0x0092},
5455         {0xa0, 0x85, 0x0093},
5456         {0xa0, 0x02, 0x0094},
5457         {0xa0, 0x01, 0x0090},
5458         {0xa0, 0x07, 0x0092},
5459         {0xa0, 0x02, 0x0093},
5460         {0xa0, 0x30, 0x0094},
5461         {0xa0, 0x01, 0x0090},
5462         {0xa0, 0x20, 0x0092},
5463         {0xa0, 0x00, 0x0093},
5464         {0xa0, 0x51, 0x0094},
5465         {0xa0, 0x01, 0x0090},
5466         {0xa0, 0x35, 0x0092},
5467         {0xa0, 0x7F, 0x0093},
5468         {0xa0, 0x50, 0x0094},
5469         {0xa0, 0x01, 0x0090},
5470         {0xa0, 0x30, 0x0092},
5471         {0xa0, 0x05, 0x0093},
5472         {0xa0, 0x00, 0x0094},
5473         {0xa0, 0x01, 0x0090},
5474         {0xa0, 0x31, 0x0092},
5475         {0xa0, 0x00, 0x0093},
5476         {0xa0, 0x00, 0x0094},
5477         {0xa0, 0x01, 0x0090},
5478         {0xa0, 0x58, 0x0092},
5479         {0xa0, 0x78, 0x0093},
5480         {0xa0, 0x00, 0x0094},
5481         {0xa0, 0x01, 0x0090},
5482         {0xa0, 0x62, 0x0092},
5483         {0xa0, 0x11, 0x0093},
5484         {0xa0, 0x04, 0x0094},
5485         {0xa0, 0x01, 0x0090},
5486         {0xa0, 0x2B, 0x0092},
5487         {0xa0, 0x7f, 0x0093},
5488         {0xa0, 0x00, 0x0094},
5489         {0xa0, 0x01, 0x0090},
5490         {0xa0, 0x2C, 0x0092},
5491         {0xa0, 0x7F, 0x0093},
5492         {0xa0, 0x00, 0x0094},
5493         {0xa0, 0x01, 0x0090},
5494         {0xa0, 0x2D, 0x0092},
5495         {0xa0, 0x7f, 0x0093},
5496         {0xa0, 0x00, 0x0094},
5497         {0xa0, 0x01, 0x0090},
5498         {0xa0, 0x2e, 0x0092},
5499         {0xa0, 0x7f, 0x0093},
5500         {0xa0, 0x00, 0x0094},
5501         {0xa0, 0x01, 0x0090},
5502         {0xa0, 0x10, 0x0087},
5503         {0xa0, 0xb7, 0x0101},
5504         {0xa0, 0x05, 0x0012},
5505         {0xa0, 0x0d, 0x0100},
5506         {0xa0, 0x06, 0x0189},
5507         {0xa0, 0x09, 0x01ad},
5508         {0xa0, 0x03, 0x01c5},
5509         {0xa0, 0x13, 0x01cb},
5510         {0xa0, 0x08, 0x0250},
5511         {0xa0, 0x08, 0x0301},
5512         {0xa0, 0x60, 0x01a8},
5513         {0xa0, 0x6c, 0x018d},
5514         {0xa0, 0x61, 0x0116},
5515         {0xa0, 0x65, 0x0118},
5516         {0xa0, 0x09, 0x01ad},
5517         {0xa0, 0x15, 0x01ae},
5518         {0xa0, 0x4c, 0x010a},   /* matrix */
5519         {0xa0, 0xf1, 0x010b},
5520         {0xa0, 0x03, 0x010c},
5521         {0xa0, 0xfe, 0x010d},
5522         {0xa0, 0x51, 0x010e},
5523         {0xa0, 0xf1, 0x010f},
5524         {0xa0, 0xec, 0x0110},
5525         {0xa0, 0x03, 0x0111},
5526         {0xa0, 0x51, 0x0112},
5527         {0xa0, 0x03, 0x0008},
5528         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
5529         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
5530         {0xa0, 0x38, 0x0120},   /* gamma > 5 */
5531         {0xa0, 0x51, 0x0121},
5532         {0xa0, 0x6e, 0x0122},
5533         {0xa0, 0x8c, 0x0123},
5534         {0xa0, 0xa2, 0x0124},
5535         {0xa0, 0xb6, 0x0125},
5536         {0xa0, 0xc8, 0x0126},
5537         {0xa0, 0xd6, 0x0127},
5538         {0xa0, 0xe2, 0x0128},
5539         {0xa0, 0xed, 0x0129},
5540         {0xa0, 0xf5, 0x012a},
5541         {0xa0, 0xfc, 0x012b},
5542         {0xa0, 0xff, 0x012c},
5543         {0xa0, 0xff, 0x012d},
5544         {0xa0, 0xff, 0x012e},
5545         {0xa0, 0xff, 0x012f},
5546         {0xa0, 0x12, 0x0130},
5547         {0xa0, 0x1b, 0x0131},
5548         {0xa0, 0x1d, 0x0132},
5549         {0xa0, 0x1a, 0x0133},
5550         {0xa0, 0x15, 0x0134},
5551         {0xa0, 0x12, 0x0135},
5552         {0xa0, 0x0f, 0x0136},
5553         {0xa0, 0x0d, 0x0137},
5554         {0xa0, 0x0b, 0x0138},
5555         {0xa0, 0x09, 0x0139},
5556         {0xa0, 0x07, 0x013a},
5557         {0xa0, 0x05, 0x013b},
5558         {0xa0, 0x00, 0x013c},
5559         {0xa0, 0x00, 0x013d},
5560         {0xa0, 0x00, 0x013e},
5561         {0xa0, 0x01, 0x013f},
5562         {0xa0, 0x4c, 0x010a},   /* matrix */
5563         {0xa0, 0xf1, 0x010b},
5564         {0xa0, 0x03, 0x010c},
5565         {0xa0, 0xfe, 0x010d},
5566         {0xa0, 0x51, 0x010e},
5567         {0xa0, 0xf1, 0x010f},
5568         {0xa0, 0xec, 0x0110},
5569         {0xa0, 0x03, 0x0111},
5570         {0xa0, 0x51, 0x0112},
5571         {0xa0, 0x10, 0x0180},
5572         {0xa0, 0x00, 0x0180},
5573         {0xa0, 0x00, 0x0019},
5574         {0xa0, 0x05, 0x0092},
5575         {0xa0, 0x62, 0x0093},
5576         {0xa0, 0x00, 0x0094},
5577         {0xa0, 0x01, 0x0090},
5578         {0xa0, 0x09, 0x0092},
5579         {0xa0, 0xaa, 0x0093},
5580         {0xa0, 0x01, 0x0094},
5581         {0xa0, 0x01, 0x0090},
5582         {0xa0, 0x00, 0x0190},
5583         {0xa0, 0x03, 0x0191},
5584         {0xa0, 0x9b, 0x0192},
5585         {0xa0, 0x00, 0x0195},
5586         {0xa0, 0x00, 0x0196},
5587         {0xa0, 0x47, 0x0197},
5588         {0xa0, 0x0e, 0x018c},
5589         {0xa0, 0x1c, 0x018f},
5590         {0xa0, 0x14, 0x01a9},
5591         {0xa0, 0x66, 0x01aa},
5592         {0xa0, 0x62, 0x001d},
5593         {0xa0, 0x90, 0x001e},
5594         {0xa0, 0xc8, 0x001f},
5595         {0xa0, 0xff, 0x0020},
5596         {0xa0, 0x60, 0x011d},
5597         {0xa0, 0x42, 0x0180},
5598         {0xa0, 0x09, 0x01ad},
5599         {0xa0, 0x15, 0x01ae},
5600         {0xa0, 0x40, 0x0180},
5601         {0xa0, 0x42, 0x0180},
5602         {0xa0, 0x30, 0x0007},
5603         {0xa0, 0x02, 0x0008},
5604         {0xa0, 0x00, 0x0007},
5605         {0xa0, 0x03, 0x0008},
5606         {}
5607 };
5608
5609 static struct usb_action tas5130cxx_Initial[] = {
5610         {0xa0, 0x01, 0x0000},
5611         {0xa0, 0x50, 0x0002},
5612         {0xa0, 0x03, 0x0008},
5613         {0xa0, 0x02, 0x0010},
5614         {0xa0, 0x01, 0x0001},
5615         {0xa0, 0x00, 0x0001},
5616         {0xa0, 0x01, 0x0012},
5617         {0xa0, 0x01, 0x0001},
5618         {0xa0, 0x05, 0x0012},
5619         {0xa0, 0x07, 0x00a5},
5620         {0xa0, 0x02, 0x00a6},
5621
5622         {0xa0, 0x02, 0x0003},
5623         {0xa0, 0x80, 0x0004},
5624         {0xa0, 0x01, 0x0005},
5625         {0xa0, 0xe0, 0x0006},
5626
5627         {0xa0, 0x04, 0x0098},
5628         {0xa0, 0x0f, 0x009a},
5629         {0xa0, 0x04, 0x011a},
5630         {0xa0, 0x0f, 0x011c},
5631         {0xa0, 0xe8, 0x009c},
5632         {0xa0, 0x02, 0x009d},
5633         {0xa0, 0x88, 0x009e},
5634         {0xa0, 0x06, 0x008d},
5635         {0xa0, 0xf7, 0x0101},
5636         {0xa0, 0x0d, 0x0100},
5637         {0xa0, 0x06, 0x0189},
5638         {0xa0, 0x68, 0x018d},
5639         {0xa0, 0x60, 0x01a8},
5640         {0xa0, 0x00, 0x01ad},
5641         {0xa0, 0x03, 0x01c5},
5642         {0xa0, 0x13, 0x01cb},
5643         {0xa0, 0x08, 0x0250},
5644         {0xa0, 0x08, 0x0301},
5645         {0xa1, 0x01, 0x0002},
5646         {0xa1, 0x01, 0x0008},
5647         {0xa0, 0x03, 0x0008},   /* clock ? */
5648         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
5649         {0xa1, 0x01, 0x01c8},
5650         {0xa1, 0x01, 0x01c9},
5651         {0xa1, 0x01, 0x01ca},
5652         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
5653
5654         {0xa0, 0x68, 0x010a},   /* matrix */
5655         {0xa0, 0xec, 0x010b},
5656         {0xa0, 0xec, 0x010c},
5657         {0xa0, 0xec, 0x010d},
5658         {0xa0, 0x68, 0x010e},
5659         {0xa0, 0xec, 0x010f},
5660         {0xa0, 0xec, 0x0110},
5661         {0xa0, 0xec, 0x0111},
5662         {0xa0, 0x68, 0x0112},
5663
5664         {0xa1, 0x01, 0x018d},
5665         {0xa0, 0x90, 0x018d},   /* 90 */
5666         {0xa1, 0x01, 0x0180},
5667         {0xa0, 0x00, 0x0180},
5668         {0xa0, 0x00, 0x0019},
5669
5670         {0xaa, 0xa3, 0x0001},
5671         {0xaa, 0xa4, 0x0077},
5672         {0xa0, 0x01, 0x00a3},
5673         {0xa0, 0x77, 0x00a4},
5674
5675         {0xa0, 0x00, 0x0190},   /* 00 */
5676         {0xa0, 0x03, 0x0191},   /* 03 */
5677         {0xa0, 0xe8, 0x0192},   /* e8 */
5678         {0xa0, 0x00, 0x0195},   /* 0 */
5679         {0xa0, 0x00, 0x0196},   /* 0 */
5680         {0xa0, 0x7d, 0x0197},   /* 7d */
5681
5682         {0xa0, 0x0c, 0x018c},
5683         {0xa0, 0x18, 0x018f},
5684         {0xa0, 0x08, 0x01a9},   /* 08 */
5685         {0xa0, 0x24, 0x01aa},   /* 24 */
5686         {0xa0, 0xf0, 0x001d},
5687         {0xa0, 0xf4, 0x001e},
5688         {0xa0, 0xf8, 0x001f},
5689         {0xa0, 0xff, 0x0020},
5690         {0xa0, 0x03, 0x009f},
5691         {0xa0, 0xc0, 0x00a0},
5692         {0xa0, 0x50, 0x011d},   /* 50 */
5693         {0xa0, 0x40, 0x0180},
5694         {0xa1, 0x01, 0x0180},
5695         {0xa0, 0x42, 0x0180},
5696         {}
5697 };
5698 static struct usb_action tas5130cxx_InitialScale[] = {
5699         {0xa0, 0x01, 0x0000},
5700         {0xa0, 0x01, 0x0000},
5701         {0xa0, 0x40, 0x0002},
5702
5703         {0xa0, 0x03, 0x0008},
5704         {0xa1, 0x01, 0x0008},
5705
5706         {0xa0, 0x02, 0x0010},
5707         {0xa0, 0x01, 0x0001},
5708         {0xa0, 0x00, 0x0001},
5709         {0xa0, 0x01, 0x0012},
5710         {0xa0, 0x01, 0x0001},
5711         {0xa0, 0x05, 0x0012},
5712         {0xa0, 0x07, 0x00a5},
5713         {0xa0, 0x02, 0x00a6},
5714         {0xa0, 0x02, 0x0003},
5715         {0xa0, 0x80, 0x0004},
5716         {0xa0, 0x01, 0x0005},
5717         {0xa0, 0xe0, 0x0006},
5718         {0xa0, 0x05, 0x0098},
5719         {0xa0, 0x0f, 0x009a},
5720         {0xa0, 0x05, 0x011a},
5721         {0xa0, 0x0f, 0x011c},
5722         {0xa0, 0xe6, 0x009c},
5723         {0xa0, 0x02, 0x009d},
5724         {0xa0, 0x86, 0x009e},
5725         {0xa0, 0x06, 0x008d},
5726         {0xa0, 0x37, 0x0101},
5727         {0xa0, 0x0d, 0x0100},
5728         {0xa0, 0x06, 0x0189},
5729         {0xa0, 0x68, 0x018d},
5730         {0xa0, 0x60, 0x01a8},
5731         {0xa0, 0x00, 0x01ad},
5732         {0xa0, 0x03, 0x01c5},
5733         {0xa0, 0x13, 0x01cb},
5734         {0xa0, 0x08, 0x0250},
5735         {0xa0, 0x08, 0x0301},
5736         {0xa1, 0x01, 0x0002},
5737         {0xa1, 0x01, 0x0008},
5738
5739         {0xa0, 0x03, 0x0008},
5740         {0xa1, 0x01, 0x0008},   /* clock ? */
5741         {0xa0, 0x08, 0x01c6},   /* sharpness+ */
5742         {0xa1, 0x01, 0x01c8},
5743         {0xa1, 0x01, 0x01c9},
5744         {0xa1, 0x01, 0x01ca},
5745         {0xa0, 0x0f, 0x01cb},   /* sharpness- */
5746
5747         {0xa0, 0x68, 0x010a},   /* matrix */
5748         {0xa0, 0xec, 0x010b},
5749         {0xa0, 0xec, 0x010c},
5750         {0xa0, 0xec, 0x010d},
5751         {0xa0, 0x68, 0x010e},
5752         {0xa0, 0xec, 0x010f},
5753         {0xa0, 0xec, 0x0110},
5754         {0xa0, 0xec, 0x0111},
5755         {0xa0, 0x68, 0x0112},
5756
5757         {0xa1, 0x01, 0x018d},
5758         {0xa0, 0x90, 0x018d},
5759         {0xa1, 0x01, 0x0180},
5760         {0xa0, 0x00, 0x0180},
5761         {0xa0, 0x00, 0x0019},
5762         {0xaa, 0xa3, 0x0001},
5763         {0xaa, 0xa4, 0x0063},
5764         {0xa0, 0x01, 0x00a3},
5765         {0xa0, 0x63, 0x00a4},
5766         {0xa0, 0x00, 0x0190},
5767         {0xa0, 0x02, 0x0191},
5768         {0xa0, 0x38, 0x0192},
5769         {0xa0, 0x00, 0x0195},
5770         {0xa0, 0x00, 0x0196},
5771         {0xa0, 0x47, 0x0197},
5772         {0xa0, 0x0c, 0x018c},
5773         {0xa0, 0x18, 0x018f},
5774         {0xa0, 0x08, 0x01a9},
5775         {0xa0, 0x24, 0x01aa},
5776         {0xa0, 0xd3, 0x001d},
5777         {0xa0, 0xda, 0x001e},
5778         {0xa0, 0xea, 0x001f},
5779         {0xa0, 0xff, 0x0020},
5780         {0xa0, 0x03, 0x009f},
5781         {0xa0, 0x4c, 0x00a0},
5782         {0xa0, 0x50, 0x011d},
5783         {0xa0, 0x40, 0x0180},
5784         {0xa1, 0x01, 0x0180},
5785         {0xa0, 0x42, 0x0180},
5786         {}
5787 };
5788 static struct usb_action tas5130cxx_50HZ[] = {
5789         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
5790         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5791         {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
5792         {0xa0, 0x01, 0x00a3}, /* 00,a3,01,cc */
5793         {0xa0, 0x63, 0x00a4}, /* 00,a4,63,cc */
5794         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
5795         {0xa0, 0x02, 0x0191}, /* 01,91,02,cc */
5796         {0xa0, 0x38, 0x0192}, /* 01,92,38,cc */
5797         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
5798         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
5799         {0xa0, 0x47, 0x0197}, /* 01,97,47,cc */
5800         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
5801         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
5802         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
5803         {0xa0, 0x26, 0x01aa}, /* 01,aa,26,cc */
5804         {0xa0, 0xd3, 0x001d}, /* 00,1d,d3,cc */
5805         {0xa0, 0xda, 0x001e}, /* 00,1e,da,cc */
5806         {0xa0, 0xea, 0x001f}, /* 00,1f,ea,cc */
5807         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
5808         {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */
5809         {}
5810 };
5811 static struct usb_action tas5130cxx_50HZScale[] = {
5812         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
5813         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5814         {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5815         {0xa0, 0x01, 0x00a3}, /* 00,a3,01,cc */
5816         {0xa0, 0x77, 0x00a4}, /* 00,a4,77,cc */
5817         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
5818         {0xa0, 0x03, 0x0191}, /* 01,91,03,cc */
5819         {0xa0, 0xe8, 0x0192}, /* 01,92,e8,cc */
5820         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
5821         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
5822         {0xa0, 0x7d, 0x0197}, /* 01,97,7d,cc */
5823         {0xa0, 0x14, 0x018c}, /* 01,8c,14,cc */
5824         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
5825         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
5826         {0xa0, 0x26, 0x01aa}, /* 01,aa,26,cc */
5827         {0xa0, 0xf0, 0x001d}, /* 00,1d,f0,cc */
5828         {0xa0, 0xf4, 0x001e}, /* 00,1e,f4,cc */
5829         {0xa0, 0xf8, 0x001f}, /* 00,1f,f8,cc */
5830         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
5831         {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */
5832         {}
5833 };
5834 static struct usb_action tas5130cxx_60HZ[] = {
5835         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
5836         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5837         {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
5838         {0xa0, 0x01, 0x00a3}, /* 00,a3,01,cc */
5839         {0xa0, 0x36, 0x00a4}, /* 00,a4,36,cc */
5840         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
5841         {0xa0, 0x01, 0x0191}, /* 01,91,01,cc */
5842         {0xa0, 0xf0, 0x0192}, /* 01,92,f0,cc */
5843         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
5844         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
5845         {0xa0, 0x3e, 0x0197}, /* 01,97,3e,cc */
5846         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
5847         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
5848         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
5849         {0xa0, 0x26, 0x01aa}, /* 01,aa,26,cc */
5850         {0xa0, 0xca, 0x001d}, /* 00,1d,ca,cc */
5851         {0xa0, 0xd0, 0x001e}, /* 00,1e,d0,cc */
5852         {0xa0, 0xe0, 0x001f}, /* 00,1f,e0,cc */
5853         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
5854         {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */
5855         {}
5856 };
5857 static struct usb_action tas5130cxx_60HZScale[] = {
5858         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
5859         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5860         {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5861         {0xa0, 0x01, 0x00a3}, /* 00,a3,01,cc */
5862         {0xa0, 0x77, 0x00a4}, /* 00,a4,77,cc */
5863         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
5864         {0xa0, 0x03, 0x0191}, /* 01,91,03,cc */
5865         {0xa0, 0xe8, 0x0192}, /* 01,92,e8,cc */
5866         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
5867         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
5868         {0xa0, 0x7d, 0x0197}, /* 01,97,7d,cc */
5869         {0xa0, 0x14, 0x018c}, /* 01,8c,14,cc */
5870         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
5871         {0xa0, 0x0c, 0x01a9}, /* 01,a9,0c,cc */
5872         {0xa0, 0x26, 0x01aa}, /* 01,aa,26,cc */
5873         {0xa0, 0xc8, 0x001d}, /* 00,1d,c8,cc */
5874         {0xa0, 0xd0, 0x001e}, /* 00,1e,d0,cc */
5875         {0xa0, 0xe0, 0x001f}, /* 00,1f,e0,cc */
5876         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
5877         {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */
5878         {}
5879 };
5880 static struct usb_action tas5130cxx_NoFliker[] = {
5881         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
5882         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5883         {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
5884         {0xa0, 0x01, 0x00a3}, /* 00,a3,01,cc */
5885         {0xa0, 0x40, 0x00a4}, /* 00,a4,40,cc */
5886         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
5887         {0xa0, 0x01, 0x0191}, /* 01,91,01,cc */
5888         {0xa0, 0xf0, 0x0192}, /* 01,92,f0,cc */
5889         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
5890         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
5891         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
5892         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
5893         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
5894         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
5895         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
5896         {0xa0, 0xbc, 0x001d}, /* 00,1d,bc,cc */
5897         {0xa0, 0xd0, 0x001e}, /* 00,1e,d0,cc */
5898         {0xa0, 0xe0, 0x001f}, /* 00,1f,e0,cc */
5899         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
5900         {0xa0, 0x02, 0x009f}, /* 00,9f,02,cc */
5901         {}
5902 };
5903
5904 static struct usb_action tas5130cxx_NoFlikerScale[] = {
5905         {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */
5906         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5907         {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
5908         {0xa0, 0x01, 0x00a3}, /* 00,a3,01,cc */
5909         {0xa0, 0x90, 0x00a4}, /* 00,a4,90,cc */
5910         {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */
5911         {0xa0, 0x03, 0x0191}, /* 01,91,03,cc */
5912         {0xa0, 0xf0, 0x0192}, /* 01,92,f0,cc */
5913         {0xa0, 0x00, 0x0195}, /* 01,95,00,cc */
5914         {0xa0, 0x00, 0x0196}, /* 01,96,00,cc */
5915         {0xa0, 0x10, 0x0197}, /* 01,97,10,cc */
5916         {0xa0, 0x10, 0x018c}, /* 01,8c,10,cc */
5917         {0xa0, 0x20, 0x018f}, /* 01,8f,20,cc */
5918         {0xa0, 0x00, 0x01a9}, /* 01,a9,00,cc */
5919         {0xa0, 0x00, 0x01aa}, /* 01,aa,00,cc */
5920         {0xa0, 0xbc, 0x001d}, /* 00,1d,bc,cc */
5921         {0xa0, 0xd0, 0x001e}, /* 00,1e,d0,cc */
5922         {0xa0, 0xe0, 0x001f}, /* 00,1f,e0,cc */
5923         {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */
5924         {0xa0, 0x02, 0x009f}, /* 00,9f,02,cc */
5925         {}
5926 };
5927
5928 static struct usb_action tas5130c_vf0250_Initial[] = {
5929         {0xa0, 0x01, 0x0000},           /* 00,00,01,cc, */
5930         {0xa0, 0x02, 0x0008},           /* 00,08,02,cc, */
5931         {0xa0, 0x01, 0x0010},           /* 00,10,01,cc, */
5932         {0xa0, 0x10, 0x0002},           /* 00,02,00,cc,  0<->10 */
5933         {0xa0, 0x02, 0x0003},           /* 00,03,02,cc, */
5934         {0xa0, 0x80, 0x0004},           /* 00,04,80,cc, */
5935         {0xa0, 0x01, 0x0005},           /* 00,05,01,cc, */
5936         {0xa0, 0xe0, 0x0006},           /* 00,06,e0,cc, */
5937         {0xa0, 0x98, 0x008b},           /* 00,8b,98,cc, */
5938         {0xa0, 0x01, 0x0001},           /* 00,01,01,cc, */
5939         {0xa0, 0x03, 0x0012},           /* 00,12,03,cc, */
5940         {0xa0, 0x01, 0x0012},           /* 00,12,01,cc, */
5941         {0xa0, 0x00, 0x0098},           /* 00,98,00,cc, */
5942         {0xa0, 0x00, 0x009a},           /* 00,9a,00,cc, */
5943         {0xa0, 0x00, 0x011a},           /* 01,1a,00,cc, */
5944         {0xa0, 0x00, 0x011c},           /* 01,1c,00,cc, */
5945         {0xa0, 0xe8, 0x009c},           /* 00,9c,e6,cc,  6<->8 */
5946         {0xa0, 0x88, 0x009e},           /* 00,9e,86,cc,  6<->8 */
5947         {0xa0, 0x10, 0x0087},           /* 00,87,10,cc, */
5948         {0xa0, 0x98, 0x008b},           /* 00,8b,98,cc, */
5949         {0xaa, 0x1b, 0x0024},           /* 00,1b,24,aa, */
5950         {0xdd, 0x00, 0x0080},           /* 00,00,80,dd, */
5951         {0xaa, 0x1b, 0x0000},           /* 00,1b,00,aa, */
5952         {0xaa, 0x13, 0x0002},           /* 00,13,02,aa, */
5953         {0xaa, 0x15, 0x0004},           /* 00,15,04,aa */
5954         {0xaa, 0x01, 0x0000},
5955         {0xaa, 0x01, 0x0000},
5956         {0xaa, 0x1a, 0x0000},           /* 00,1a,00,aa, */
5957         {0xaa, 0x1c, 0x0017},           /* 00,1c,17,aa, */
5958         {0xa0, 0x82, 0x0086},           /* 00,86,82,cc, */
5959         {0xa0, 0x83, 0x0087},           /* 00,87,83,cc, */
5960         {0xa0, 0x84, 0x0088},           /* 00,88,84,cc, */
5961         {0xaa, 0x05, 0x0010},           /* 00,05,10,aa, */
5962         {0xaa, 0x0a, 0x0000},           /* 00,0a,00,aa, */
5963         {0xaa, 0x0b, 0x00a0},           /* 00,0b,a0,aa, */
5964         {0xaa, 0x0c, 0x0000},           /* 00,0c,00,aa, */
5965         {0xaa, 0x0d, 0x00a0},           /* 00,0d,a0,aa, */
5966         {0xaa, 0x0e, 0x0000},           /* 00,0e,00,aa, */
5967         {0xaa, 0x0f, 0x00a0},           /* 00,0f,a0,aa, */
5968         {0xaa, 0x10, 0x0000},           /* 00,10,00,aa, */
5969         {0xaa, 0x11, 0x00a0},           /* 00,11,a0,aa, */
5970         {0xa0, 0x00, 0x0039},
5971         {0xa1, 0x01, 0x0037},
5972         {0xaa, 0x16, 0x0001},           /* 00,16,01,aa, */
5973         {0xaa, 0x17, 0x00e8},           /* 00,17,e6,aa, (e6 -> e8) */
5974         {0xaa, 0x18, 0x0002},           /* 00,18,02,aa, */
5975         {0xaa, 0x19, 0x0088},           /* 00,19,86,aa, */
5976         {0xaa, 0x20, 0x0020},           /* 00,20,20,aa, */
5977         {0xa0, 0xb7, 0x0101},           /* 01,01,b7,cc, */
5978         {0xa0, 0x05, 0x0012},           /* 00,12,05,cc, */
5979         {0xa0, 0x0d, 0x0100},           /* 01,00,0d,cc, */
5980         {0xa0, 0x76, 0x0189},           /* 01,89,76,cc, */
5981         {0xa0, 0x09, 0x01ad},           /* 01,ad,09,cc, */
5982         {0xa0, 0x03, 0x01c5},           /* 01,c5,03,cc, */
5983         {0xa0, 0x13, 0x01cb},           /* 01,cb,13,cc, */
5984         {0xa0, 0x08, 0x0250},           /* 02,50,08,cc, */
5985         {0xa0, 0x08, 0x0301},           /* 03,01,08,cc, */
5986         {0xa0, 0x60, 0x01a8},           /* 01,a8,60,cc, */
5987         {0xa0, 0x61, 0x0116},           /* 01,16,61,cc, */
5988         {0xa0, 0x65, 0x0118},           /* 01,18,65,cc */
5989         {}
5990 };
5991
5992 static struct usb_action tas5130c_vf0250_InitialScale[] = {
5993         {0xa0, 0x01, 0x0000},           /* 00,00,01,cc, */
5994         {0xa0, 0x02, 0x0008},           /* 00,08,02,cc, */
5995         {0xa0, 0x01, 0x0010},           /* 00,10,01,cc, */
5996         {0xa0, 0x00, 0x0002},           /* 00,02,10,cc, */
5997         {0xa0, 0x02, 0x0003},           /* 00,03,02,cc, */
5998         {0xa0, 0x80, 0x0004},           /* 00,04,80,cc, */
5999         {0xa0, 0x01, 0x0005},           /* 00,05,01,cc, */
6000         {0xa0, 0xe0, 0x0006},           /* 00,06,e0,cc, */
6001         {0xa0, 0x98, 0x008b},           /* 00,8b,98,cc, */
6002         {0xa0, 0x01, 0x0001},           /* 00,01,01,cc, */
6003         {0xa0, 0x03, 0x0012},           /* 00,12,03,cc, */
6004         {0xa0, 0x01, 0x0012},           /* 00,12,01,cc, */
6005         {0xa0, 0x00, 0x0098},           /* 00,98,00,cc, */
6006         {0xa0, 0x00, 0x009a},           /* 00,9a,00,cc, */
6007         {0xa0, 0x00, 0x011a},           /* 01,1a,00,cc, */
6008         {0xa0, 0x00, 0x011c},           /* 01,1c,00,cc, */
6009         {0xa0, 0xe8, 0x009c},           /* 00,9c,e8,cc, 8<->6 */
6010         {0xa0, 0x88, 0x009e},           /* 00,9e,88,cc, 8<->6 */
6011         {0xa0, 0x10, 0x0087},           /* 00,87,10,cc, */
6012         {0xa0, 0x98, 0x008b},           /* 00,8b,98,cc, */
6013         {0xaa, 0x1b, 0x0024},           /* 00,1b,24,aa, */
6014         {0xdd, 0x00, 0x0080},           /* 00,00,80,dd, */
6015         {0xaa, 0x1b, 0x0000},           /* 00,1b,00,aa, */
6016         {0xaa, 0x13, 0x0002},           /* 00,13,02,aa, */
6017         {0xaa, 0x15, 0x0004},           /* 00,15,04,aa */
6018         {0xaa, 0x01, 0x0000},
6019         {0xaa, 0x01, 0x0000},
6020         {0xaa, 0x1a, 0x0000},           /* 00,1a,00,aa, */
6021         {0xaa, 0x1c, 0x0017},           /* 00,1c,17,aa, */
6022         {0xa0, 0x82, 0x0086},           /* 00,86,82,cc, */
6023         {0xa0, 0x83, 0x0087},           /* 00,87,83,cc, */
6024         {0xa0, 0x84, 0x0088},           /* 00,88,84,cc, */
6025         {0xaa, 0x05, 0x0010},           /* 00,05,10,aa, */
6026         {0xaa, 0x0a, 0x0000},           /* 00,0a,00,aa, */
6027         {0xaa, 0x0b, 0x00a0},           /* 00,0b,a0,aa, */
6028         {0xaa, 0x0c, 0x0000},           /* 00,0c,00,aa, */
6029         {0xaa, 0x0d, 0x00a0},           /* 00,0d,a0,aa, */
6030         {0xaa, 0x0e, 0x0000},           /* 00,0e,00,aa, */
6031         {0xaa, 0x0f, 0x00a0},           /* 00,0f,a0,aa, */
6032         {0xaa, 0x10, 0x0000},           /* 00,10,00,aa, */
6033         {0xaa, 0x11, 0x00a0},           /* 00,11,a0,aa, */
6034         {0xa0, 0x00, 0x0039},
6035         {0xa1, 0x01, 0x0037},
6036         {0xaa, 0x16, 0x0001},           /* 00,16,01,aa, */
6037         {0xaa, 0x17, 0x00e8},           /* 00,17,e6,aa (e6 -> e8) */
6038         {0xaa, 0x18, 0x0002},           /* 00,18,02,aa, */
6039         {0xaa, 0x19, 0x0088},           /* 00,19,88,aa, */
6040         {0xaa, 0x20, 0x0020},           /* 00,20,20,aa, */
6041         {0xa0, 0xb7, 0x0101},           /* 01,01,b7,cc, */
6042         {0xa0, 0x05, 0x0012},           /* 00,12,05,cc, */
6043         {0xa0, 0x0d, 0x0100},           /* 01,00,0d,cc, */
6044         {0xa0, 0x76, 0x0189},           /* 01,89,76,cc, */
6045         {0xa0, 0x09, 0x01ad},           /* 01,ad,09,cc, */
6046         {0xa0, 0x03, 0x01c5},           /* 01,c5,03,cc, */
6047         {0xa0, 0x13, 0x01cb},           /* 01,cb,13,cc, */
6048         {0xa0, 0x08, 0x0250},           /* 02,50,08,cc, */
6049         {0xa0, 0x08, 0x0301},           /* 03,01,08,cc, */
6050         {0xa0, 0x60, 0x01a8},           /* 01,a8,60,cc, */
6051         {0xa0, 0x61, 0x0116},           /* 01,16,61,cc, */
6052         {0xa0, 0x65, 0x0118},           /* 01,18,65,cc */
6053         {}
6054 };
6055 /* "50HZ" light frequency banding filter */
6056 static struct usb_action tas5130c_vf0250_50HZ[] = {
6057         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6058         {0xaa, 0x83, 0x0001},           /* 00,83,01,aa */
6059         {0xaa, 0x84, 0x00aa},           /* 00,84,aa,aa */
6060         {0xa0, 0x00, 0x0190},           /* 01,90,00,cc, */
6061         {0xa0, 0x06, 0x0191},           /* 01,91,0d,cc, */
6062         {0xa0, 0xa8, 0x0192},           /* 01,92,50,cc, */
6063         {0xa0, 0x00, 0x0195},           /* 01,95,00,cc, */
6064         {0xa0, 0x00, 0x0196},           /* 01,96,00,cc, */
6065         {0xa0, 0x8e, 0x0197},           /* 01,97,47,cc, */
6066         {0xa0, 0x0e, 0x018c},           /* 01,8c,0e,cc, */
6067         {0xa0, 0x15, 0x018f},           /* 01,8f,15,cc, */
6068         {0xa0, 0x10, 0x01a9},           /* 01,a9,10,cc, */
6069         {0xa0, 0x24, 0x01aa},           /* 01,aa,24,cc, */
6070         {0xa0, 0x62, 0x001d},           /* 00,1d,62,cc, */
6071         {0xa0, 0x90, 0x001e},           /* 00,1e,90,cc, */
6072         {0xa0, 0xc8, 0x001f},           /* 00,1f,c8,cc, */
6073         {0xa0, 0xff, 0x0020},           /* 00,20,ff,cc, */
6074         {0xa0, 0x58, 0x011d},           /* 01,1d,58,cc, */
6075         {0xa0, 0x42, 0x0180},           /* 01,80,42,cc, */
6076         {0xa0, 0x78, 0x018d},           /* 01,8d,78,cc */
6077         {}
6078 };
6079
6080 /* "50HZScale" light frequency banding filter */
6081 static struct usb_action tas5130c_vf0250_50HZScale[] = {
6082         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6083         {0xaa, 0x83, 0x0003},           /* 00,83,03,aa */
6084         {0xaa, 0x84, 0x0054},           /* 00,84,54,aa */
6085         {0xa0, 0x00, 0x0190},           /* 01,90,00,cc, */
6086         {0xa0, 0x0d, 0x0191},           /* 01,91,0d,cc, */
6087         {0xa0, 0x50, 0x0192},           /* 01,92,50,cc, */
6088         {0xa0, 0x00, 0x0195},           /* 01,95,00,cc, */
6089         {0xa0, 0x00, 0x0196},           /* 01,96,00,cc, */
6090         {0xa0, 0x8e, 0x0197},           /* 01,97,8e,cc, */
6091         {0xa0, 0x0e, 0x018c},           /* 01,8c,0e,cc, */
6092         {0xa0, 0x15, 0x018f},           /* 01,8f,15,cc, */
6093         {0xa0, 0x10, 0x01a9},           /* 01,a9,10,cc, */
6094         {0xa0, 0x24, 0x01aa},           /* 01,aa,24,cc, */
6095         {0xa0, 0x62, 0x001d},           /* 00,1d,62,cc, */
6096         {0xa0, 0x90, 0x001e},           /* 00,1e,90,cc, */
6097         {0xa0, 0xc8, 0x001f},           /* 00,1f,c8,cc, */
6098         {0xa0, 0xff, 0x0020},           /* 00,20,ff,cc, */
6099         {0xa0, 0x58, 0x011d},           /* 01,1d,58,cc, */
6100         {0xa0, 0x42, 0x0180},           /* 01,80,42,cc, */
6101         {0xa0, 0x78, 0x018d},           /* 01,8d,78,cc */
6102         {}
6103 };
6104
6105 /* "60HZ" light frequency banding filter */
6106 static struct usb_action tas5130c_vf0250_60HZ[] = {
6107         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6108         {0xaa, 0x83, 0x0001},           /* 00,83,01,aa */
6109         {0xaa, 0x84, 0x0062},           /* 00,84,62,aa */
6110         {0xa0, 0x00, 0x0190},           /* 01,90,00,cc, */
6111         {0xa0, 0x05, 0x0191},           /* 01,91,05,cc, */
6112         {0xa0, 0x88, 0x0192},           /* 01,92,88,cc, */
6113         {0xa0, 0x00, 0x0195},           /* 01,95,00,cc, */
6114         {0xa0, 0x00, 0x0196},           /* 01,96,00,cc, */
6115         {0xa0, 0x3b, 0x0197},           /* 01,97,3b,cc, */
6116         {0xa0, 0x0e, 0x018c},           /* 01,8c,0e,cc, */
6117         {0xa0, 0x15, 0x018f},           /* 01,8f,15,cc, */
6118         {0xa0, 0x10, 0x01a9},           /* 01,a9,10,cc, */
6119         {0xa0, 0x24, 0x01aa},           /* 01,aa,24,cc, */
6120         {0xa0, 0x62, 0x001d},           /* 00,1d,62,cc, */
6121         {0xa0, 0x90, 0x001e},           /* 00,1e,90,cc, */
6122         {0xa0, 0xc8, 0x001f},           /* 00,1f,c8,cc, */
6123         {0xa0, 0xff, 0x0020},           /* 00,20,ff,cc, */
6124         {0xa0, 0x58, 0x011d},           /* 01,1d,58,cc, */
6125         {0xa0, 0x42, 0x0180},           /* 01,80,42,cc, */
6126         {0xa0, 0x78, 0x018d},           /* 01,8d,78,cc */
6127         {}
6128 };
6129
6130 /* "60HZScale" light frequency banding ilter */
6131 static struct usb_action tas5130c_vf0250_60HZScale[] = {
6132         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6133         {0xaa, 0x83, 0x0002},           /* 00,83,02,aa */
6134         {0xaa, 0x84, 0x00c4},           /* 00,84,c4,aa */
6135         {0xa0, 0x00, 0x0190},           /* 01,90,00,cc, */
6136         {0xa0, 0x0b, 0x0191},           /* 01,1,0b,cc, */
6137         {0xa0, 0x10, 0x0192},           /* 01,2,10,cc, */
6138         {0xa0, 0x00, 0x0195},           /* 01,5,00,cc, */
6139         {0xa0, 0x00, 0x0196},           /* 01,6,00,cc, */
6140         {0xa0, 0x76, 0x0197},           /* 01,7,76,cc, */
6141         {0xa0, 0x0e, 0x018c},           /* 01,c,0e,cc, */
6142         {0xa0, 0x15, 0x018f},           /* 01,f,15,cc, */
6143         {0xa0, 0x10, 0x01a9},           /* 01,9,10,cc, */
6144         {0xa0, 0x24, 0x01aa},           /* 01,a,24,cc, */
6145         {0xa0, 0x62, 0x001d},           /* 00,d,62,cc, */
6146         {0xa0, 0x90, 0x001e},           /* 00,e,90,cc, */
6147         {0xa0, 0xc8, 0x001f},           /* 00,f,c8,cc, */
6148         {0xa0, 0xff, 0x0020},           /* 00,0,ff,cc, */
6149         {0xa0, 0x58, 0x011d},           /* 01,d,58,cc, */
6150         {0xa0, 0x42, 0x0180},           /* 01,80,42,cc, */
6151         {0xa0, 0x78, 0x018d},           /* 01,d,78,cc */
6152         {}
6153 };
6154
6155 /* "NoFliker" light frequency banding flter */
6156 static struct usb_action tas5130c_vf0250_NoFliker[] = {
6157         {0xa0, 0x0c, 0x0100},           /* 01,00,0c,cc, */
6158         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6159         {0xaa, 0x83, 0x0000},           /* 00,83,00,aa */
6160         {0xaa, 0x84, 0x0020},           /* 00,84,20,aa */
6161         {0xa0, 0x00, 0x0190},           /* 01,0,00,cc, */
6162         {0xa0, 0x05, 0x0191},           /* 01,91,05,cc, */
6163         {0xa0, 0x88, 0x0192},           /* 01,92,88,cc, */
6164         {0xa0, 0x00, 0x0195},           /* 01,95,00,cc, */
6165         {0xa0, 0x00, 0x0196},           /* 01,96,00,cc, */
6166         {0xa0, 0x10, 0x0197},           /* 01,97,10,cc, */
6167         {0xa0, 0x0e, 0x018c},           /* 01,8c,0e,cc, */
6168         {0xa0, 0x15, 0x018f},           /* 01,8f,15,cc, */
6169         {0xa0, 0x62, 0x001d},           /* 00,1d,62,cc, */
6170         {0xa0, 0x90, 0x001e},           /* 00,1e,90,cc, */
6171         {0xa0, 0xc8, 0x001f},           /* 00,1f,c8,cc, */
6172         {0xa0, 0xff, 0x0020},           /* 00,20,ff,cc, */
6173         {0xa0, 0x58, 0x011d},           /* 01,1d,58,cc, */
6174         {0xa0, 0x03, 0x0180},           /* 01,80,03,cc */
6175         {}
6176 };
6177
6178 /* "NoFlikerScale" light frequency banding filter */
6179 static struct usb_action tas5130c_vf0250_NoFlikerScale[] = {
6180         {0xa0, 0x0c, 0x0100},           /* 01,00,0c,cc, */
6181         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6182         {0xaa, 0x83, 0x0000},           /* 00,83,00,aa */
6183         {0xaa, 0x84, 0x0020},           /* 00,84,20,aa */
6184         {0xa0, 0x00, 0x0190},           /* 01,90,00,cc, */
6185         {0xa0, 0x0b, 0x0191},           /* 01,91,0b,cc, */
6186         {0xa0, 0x10, 0x0192},           /* 01,92,10,cc, */
6187         {0xa0, 0x00, 0x0195},           /* 01,95,00,cc, */
6188         {0xa0, 0x00, 0x0196},           /* 01,96,00,cc, */
6189         {0xa0, 0x10, 0x0197},           /* 01,97,10,cc, */
6190         {0xa0, 0x0e, 0x018c},           /* 01,8c,0e,cc, */
6191         {0xa0, 0x15, 0x018f},           /* 01,8f,15,cc, */
6192         {0xa0, 0x62, 0x001d},           /* 00,1d,62,cc, */
6193         {0xa0, 0x90, 0x001e},           /* 00,1e,90,cc, */
6194         {0xa0, 0xc8, 0x001f},           /* 00,1f,c8,cc, */
6195         {0xa0, 0xff, 0x0020},           /* 00,20,ff,cc, */
6196         {0xa0, 0x58, 0x011d},           /* 01,1d,58,cc, */
6197         {0xa0, 0x03, 0x0180},           /* 01,80,03,cc */
6198         {}
6199 };
6200
6201 static void reg_r_i(struct usb_device *dev,
6202                 __u16 index, __u8 *buffer)
6203 {
6204         usb_control_msg(dev,
6205                         usb_rcvctrlpipe(dev, 0),
6206                         0xa1,
6207                         USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6208                         0x01,                   /* value */
6209                         index, buffer, 1,
6210                         500);
6211 }
6212
6213 static void reg_r(struct usb_device *dev,
6214                 __u16 index, __u8 *buffer)
6215 {
6216         reg_r_i(dev, index, buffer);
6217         PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, *buffer);
6218 }
6219
6220 static void reg_w_i(struct usb_device *dev,
6221                         __u8 value,
6222                         __u16 index)
6223 {
6224         usb_control_msg(dev,
6225                         usb_sndctrlpipe(dev, 0),
6226                         0xa0,
6227                         USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6228                         value, index, NULL, 0,
6229                         500);
6230 }
6231
6232 static void reg_w(struct usb_device *dev,
6233                         __u8 value,
6234                         __u16 index)
6235 {
6236         PDEBUG(D_USBO, "reg w %02x -> [%04x]", value, index);
6237         reg_w_i(dev, value, index);
6238 }
6239
6240 static __u16 i2c_read(struct usb_device *dev, __u8 reg)
6241 {
6242         __u8 retbyte;
6243         __u8 retval[2];
6244
6245         reg_w_i(dev, reg, 0x92);
6246         reg_w_i(dev, 0x02, 0x90);               /* <- read command */
6247         msleep(25);
6248         reg_r_i(dev, 0x0091, &retbyte);         /* read status */
6249         reg_r_i(dev, 0x0095, &retval[0]);       /* read Lowbyte */
6250         reg_r_i(dev, 0x0096, &retval[1]);       /* read Hightbyte */
6251         PDEBUG(D_USBO, "i2c r [%02x] -> (%02x) %02x%02x",
6252                         reg, retbyte, retval[1], retval[0]);
6253         return (retval[1] << 8) | retval[0];
6254 }
6255
6256 static __u8 i2c_write(struct usb_device *dev,
6257                         __u8 reg,
6258                         __u8 valL,
6259                         __u8 valH)
6260 {
6261         __u8 retbyte;
6262
6263         reg_w_i(dev, reg, 0x92);
6264         reg_w_i(dev, valL, 0x93);
6265         reg_w_i(dev, valH, 0x94);
6266         reg_w_i(dev, 0x01, 0x90);               /* <- write command */
6267         msleep(5);
6268         reg_r_i(dev, 0x0091, &retbyte);         /* read status */
6269         PDEBUG(D_USBO, "i2c w [%02x] %02x%02x (%02x)",
6270                         reg, valH, valL, retbyte);
6271         return retbyte;
6272 }
6273
6274 static void usb_exchange(struct usb_device *dev,
6275                         struct usb_action *action)
6276 {
6277         __u8 buffread;
6278
6279         while (action->req) {
6280                 switch (action->req) {
6281                 case 0xa0:      /* write register */
6282                         reg_w(dev, action->val, action->idx);
6283                         break;
6284                 case 0xa1:      /* read status */
6285                         reg_r(dev, action->idx, &buffread);
6286                         break;
6287                 case 0xaa:
6288                         i2c_write(dev,
6289                                   action->val,                  /* reg */
6290                                   action->idx & 0xff,           /* valL */
6291                                   action->idx >> 8);            /* valH */
6292                         break;
6293                 default:
6294 /*              case 0xdd:       * delay */
6295                         msleep(action->val / 64 + 10);
6296                         break;
6297                 }
6298                 action++;
6299 /*              msleep(1); */
6300         }
6301 }
6302
6303 static void setmatrix(struct gspca_dev *gspca_dev)
6304 {
6305         struct sd *sd = (struct sd *) gspca_dev;
6306         int i;
6307         __u8 *matrix;
6308         static __u8 gc0305_matrix[9] =
6309                 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
6310         static __u8 ov7620_matrix[9] =
6311                 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
6312         static __u8 po2030_matrix[9] =
6313                 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
6314
6315         switch (sd->sensor) {
6316         case SENSOR_GC0305:
6317                 matrix = gc0305_matrix;
6318                 break;
6319         case SENSOR_MC501CB:
6320                 return;         /* no matrix? */
6321         case SENSOR_OV7620:
6322 /*      case SENSOR_OV7648: */
6323                 matrix = ov7620_matrix;
6324                 break;
6325         case SENSOR_PO2030:
6326                 matrix = po2030_matrix;
6327                 break;
6328         case SENSOR_TAS5130C_VF0250:    /* no matrix? */
6329                 return;
6330         default:                /* matrix already loaded */
6331                 return;
6332         }
6333         for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
6334                 reg_w(gspca_dev->dev, matrix[i], 0x010a + i);
6335 }
6336
6337 static void setbrightness(struct gspca_dev *gspca_dev)
6338 {
6339         struct sd *sd = (struct sd *) gspca_dev;
6340         __u8 brightness;
6341
6342         switch (sd->sensor) {
6343         case SENSOR_GC0305:
6344         case SENSOR_OV7620:
6345         case SENSOR_PO2030:
6346                 return;
6347         }
6348 /*fixme: is it really write to 011d and 018d for all other sensors? */
6349         brightness = sd->brightness;
6350         reg_w(gspca_dev->dev, brightness, 0x011d);
6351         if (brightness < 0x70)
6352                 brightness += 0x10;
6353         else
6354                 brightness = 0x80;
6355         reg_w(gspca_dev->dev, brightness, 0x018d);
6356 }
6357
6358 static void setsharpness(struct gspca_dev *gspca_dev)
6359 {
6360         struct sd *sd = (struct sd *) gspca_dev;
6361         struct usb_device *dev = gspca_dev->dev;
6362         int sharpness;
6363         __u8 retbyte;
6364         static __u8 sharpness_tb[][2] = {
6365                 {0x02, 0x03},
6366                 {0x04, 0x07},
6367                 {0x08, 0x0f},
6368                 {0x10, 0x1e}
6369         };
6370
6371         sharpness = sd->sharpness;
6372         reg_w(dev, sharpness_tb[sharpness][0], 0x01c6);
6373         reg_r(dev, 0x01c8, &retbyte);
6374         reg_r(dev, 0x01c9, &retbyte);
6375         reg_r(dev, 0x01ca, &retbyte);
6376         reg_w(dev, sharpness_tb[sharpness][1], 0x01cb);
6377 }
6378
6379 static void setcontrast(struct gspca_dev *gspca_dev)
6380 {
6381         struct sd *sd = (struct sd *) gspca_dev;
6382         struct usb_device *dev = gspca_dev->dev;
6383         __u8 *Tgamma, *Tgradient;
6384         int g, i, k;
6385         static __u8 kgamma_tb[16] =             /* delta for contrast */
6386                 {0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08,
6387                  0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
6388         static __u8 kgrad_tb[16] =
6389                 {0x1b, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00,
6390                  0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x04};
6391         static __u8 Tgamma_1[16] =
6392                 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
6393                  0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff};
6394         static __u8 Tgradient_1[16] =
6395                 {0x00, 0x01, 0x05, 0x0b, 0x10, 0x15, 0x18, 0x1a,
6396                  0x1a, 0x18, 0x16, 0x14, 0x12, 0x0f, 0x0d, 0x06};
6397         static __u8 Tgamma_2[16] =
6398                 {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
6399                  0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff};
6400         static __u8 Tgradient_2[16] =
6401                 {0x05, 0x0f, 0x16, 0x1a, 0x19, 0x19, 0x17, 0x15,
6402                  0x12, 0x10, 0x0e, 0x0b, 0x09, 0x08, 0x06, 0x03};
6403         static __u8 Tgamma_3[16] =
6404                 {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
6405                  0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff};
6406         static __u8 Tgradient_3[16] =
6407                 {0x0c, 0x16, 0x1b, 0x1c, 0x19, 0x18, 0x15, 0x12,
6408                  0x10, 0x0d, 0x0b, 0x09, 0x08, 0x06, 0x05, 0x03};
6409         static __u8 Tgamma_4[16] =
6410                 {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
6411                  0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff};
6412         static __u8 Tgradient_4[16] =
6413                 {0x26, 0x22, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0d,
6414                  0x0b, 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02};
6415         static __u8 Tgamma_5[16] =
6416                 {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
6417                  0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff};
6418         static __u8 Tgradient_5[16] =
6419                 {0x37, 0x26, 0x20, 0x1a, 0x14, 0x10, 0x0e, 0x0b,
6420                  0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x02};
6421         static __u8 Tgamma_6[16] =              /* ?? was gamma 5 */
6422                 {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
6423                  0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff};
6424         static __u8 Tgradient_6[16] =
6425                 {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
6426                  0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
6427         static __u8 *gamma_tb[] = {
6428                 0, Tgamma_1, Tgamma_2,
6429                 Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
6430         };
6431         static __u8 *gradient_tb[] = {
6432                 0, Tgradient_1, Tgradient_2,
6433                 Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
6434         };
6435 #ifdef CONFIG_VIDEO_ADV_DEBUG
6436         __u8 v[16];
6437 #endif
6438
6439         Tgamma = gamma_tb[sd->gamma];
6440         Tgradient = gradient_tb[sd->gamma];
6441
6442         k = (sd->contrast - 128)                /* -128 / 128 */
6443                         * Tgamma[0];
6444         PDEBUG(D_CONF, "gamma:%d contrast:%d gamma coeff: %d/128",
6445                 sd->gamma, sd->contrast, k);
6446         for (i = 0; i < 16; i++) {
6447                 g = Tgamma[i] + kgamma_tb[i] * k / 128;
6448                 if (g > 0xff)
6449                         g = 0xff;
6450                 else if (g <= 0)
6451                         g = 1;
6452                 reg_w(dev, g, 0x0120 + i);      /* gamma */
6453 #ifdef CONFIG_VIDEO_ADV_DEBUG
6454                 if (gspca_debug & D_CONF)
6455                         v[i] = g;
6456 #endif
6457         }
6458         PDEBUG(D_CONF, "tb: %02x %02x %02x %02x %02x %02x %02x %02x",
6459                 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6460         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6461                 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6462         for (i = 0; i < 16; i++) {
6463                 g = Tgradient[i] - kgrad_tb[i] * k / 128;
6464                 if (g > 0xff)
6465                         g = 0xff;
6466                 else if (g <= 0) {
6467                         if (i != 15)
6468                                 g = 0;
6469                         else
6470                                 g = 1;
6471                 }
6472                 reg_w(dev, g, 0x0130 + i);      /* gradient */
6473 #ifdef CONFIG_VIDEO_ADV_DEBUG
6474                 if (gspca_debug & D_CONF)
6475                         v[i] = g;
6476 #endif
6477         }
6478         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6479                 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6480         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6481                 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6482 }
6483
6484 static void setquality(struct gspca_dev *gspca_dev)
6485 {
6486         struct sd *sd = (struct sd *) gspca_dev;
6487         struct usb_device *dev = gspca_dev->dev;
6488         __u8 quality;
6489         __u8 frxt;
6490
6491         switch (sd->sensor) {
6492         case SENSOR_GC0305:
6493         case SENSOR_OV7620:
6494         case SENSOR_PO2030:
6495                 return;
6496         }
6497 /*fixme: is it really 0008 0007 0018 for all other sensors? */
6498         quality = sd->qindex;
6499         reg_w(dev, quality, 0x0008);
6500         frxt = 0x30;
6501         reg_w(dev, frxt, 0x0007);
6502         switch (quality) {
6503         case 0:
6504         case 1:
6505         case 2:
6506                 frxt = 0xff;
6507                 break;
6508         case 3:
6509                 frxt = 0xf0;
6510                 break;
6511         case 4:
6512                 frxt = 0xe0;
6513                 break;
6514         case 5:
6515                 frxt = 0x20;
6516                 break;
6517         }
6518         reg_w(dev, frxt, 0x0018);
6519 }
6520
6521 /* Matches the sensor's internal frame rate to the lighting frequency.
6522  * Valid frequencies are:
6523  *      50Hz, for European and Asian lighting (default)
6524  *      60Hz, for American lighting
6525  *      0 = No Fliker (for outdoore usage)
6526  * Returns: 0 for success
6527  */
6528 static int setlightfreq(struct gspca_dev *gspca_dev)
6529 {
6530         struct sd *sd = (struct sd *) gspca_dev;
6531         int i, mode;
6532         struct usb_action *zc3_freq;
6533         static struct usb_action *freq_tb[SENSOR_MAX][6] = {
6534 /* SENSOR_CS2102 0 */
6535                 {cs2102_NoFliker, cs2102_NoFlikerScale,
6536                  cs2102_50HZ, cs2102_50HZScale,
6537                  cs2102_60HZ, cs2102_60HZScale},
6538 /* SENSOR_CS2102K 1 */
6539                 {cs2102_NoFliker, cs2102_NoFlikerScale,
6540                  cs2102_50HZ, cs2102_50HZScale,
6541                  cs2102_60HZ, cs2102_60HZScale},
6542 /* SENSOR_GC0305 2 */
6543                 {gc0305_NoFliker, gc0305_NoFliker,
6544                  gc0305_50HZ, gc0305_50HZ,
6545                  gc0305_60HZ, gc0305_60HZ},
6546 /* SENSOR_HDCS2020 3 */
6547                 {0, 0,
6548                  0, 0,
6549                  0, 0},
6550 /* SENSOR_HDCS2020b 4 */
6551                 {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
6552                  hdcs2020b_50HZ, hdcs2020b_50HZ,
6553                  hdcs2020b_60HZ, hdcs2020b_60HZ},
6554 /* SENSOR_HV7131B 5 */
6555                 {0, 0,
6556                  0, 0,
6557                  0, 0},
6558 /* SENSOR_HV7131C 6 */
6559                 {0, 0,
6560                  0, 0,
6561                  0, 0},
6562 /* SENSOR_ICM105A 7 */
6563                 {icm105a_NoFliker, icm105a_NoFlikerScale,
6564                  icm105a_50HZ, icm105a_50HZScale,
6565                  icm105a_60HZ, icm105a_60HZScale},
6566 /* SENSOR_MC501CB 8 */
6567                 {MC501CB_NoFliker, MC501CB_NoFlikerScale,
6568                  MC501CB_50HZ, MC501CB_50HZScale,
6569                  MC501CB_60HZ, MC501CB_60HZScale},
6570 /* SENSOR_OV7620 9 */
6571                 {OV7620_NoFliker, OV7620_NoFliker,
6572                  OV7620_50HZ, OV7620_50HZ,
6573                  OV7620_60HZ, OV7620_60HZ},
6574 /* SENSOR_OV7630C 10 */
6575                 {0, 0,
6576                  0, 0,
6577                  0, 0},
6578 /* SENSOR_PAS106 11 */
6579                 {pas106b_NoFliker, pas106b_NoFliker,
6580                  pas106b_50HZ, pas106b_50HZ,
6581                  pas106b_60HZ, pas106b_60HZ},
6582 /* SENSOR_PB0330 12 */
6583                 {pb0330_NoFliker, pb0330_NoFlikerScale,
6584                  pb0330_50HZ, pb0330_50HZScale,
6585                  pb0330_60HZ, pb0330_60HZScale},
6586 /* SENSOR_PO2030 13 */
6587                 {PO2030_NoFliker, PO2030_NoFliker,
6588                  PO2030_50HZ, PO2030_50HZ,
6589                  PO2030_60HZ, PO2030_60HZ},
6590 /* SENSOR_TAS5130CK 14 */
6591                 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6592                  tas5130cxx_50HZ, tas5130cxx_50HZScale,
6593                  tas5130cxx_60HZ, tas5130cxx_60HZScale},
6594 /* SENSOR_TAS5130CXX 15 */
6595                 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6596                  tas5130cxx_50HZ, tas5130cxx_50HZScale,
6597                  tas5130cxx_60HZ, tas5130cxx_60HZScale},
6598 /* SENSOR_TAS5130C_VF0250 16 */
6599                 {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale,
6600                  tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale,
6601                  tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale},
6602         };
6603
6604         i = sd->lightfreq * 2;
6605         mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
6606         if (!mode)
6607                 i++;                    /* 640x480 */
6608         zc3_freq = freq_tb[(int) sd->sensor][i];
6609         if (zc3_freq != 0) {
6610                 usb_exchange(gspca_dev->dev, zc3_freq);
6611                 switch (sd->sensor) {
6612                 case SENSOR_GC0305:
6613                         if (mode                        /* if 320x240 */
6614                             && sd->lightfreq == 1)      /* and 50Hz */
6615                                 reg_w(gspca_dev->dev, 0x85, 0x018d);
6616                                                 /* win: 0x80, 0x018d */
6617                         break;
6618                 case SENSOR_OV7620:
6619                         if (!mode) {                    /* if 640x480 */
6620                                 if (sd->lightfreq != 0) /* and 50 or 60 Hz */
6621                                         reg_w(gspca_dev->dev, 0x40, 0x0002);
6622                                 else
6623                                         reg_w(gspca_dev->dev, 0x44, 0x0002);
6624                         }
6625                         break;
6626                 }
6627         }
6628         return 0;
6629 }
6630
6631 static void setautogain(struct gspca_dev *gspca_dev)
6632 {
6633         struct sd *sd = (struct sd *) gspca_dev;
6634         __u8 autoval;
6635
6636         if (sd->autogain)
6637                 autoval = 0x42;
6638         else
6639                 autoval = 0x02;
6640         reg_w(gspca_dev->dev, autoval, 0x0180);
6641 }
6642
6643 static void send_unknown(struct usb_device *dev, int sensor)
6644 {
6645         reg_w(dev, 0x01, 0x0000);               /* led off */
6646         switch (sensor) {
6647         case SENSOR_PAS106:
6648                 reg_w(dev, 0x03, 0x003a);
6649                 reg_w(dev, 0x0c, 0x003b);
6650                 reg_w(dev, 0x08, 0x0038);
6651                 break;
6652         case SENSOR_GC0305:
6653         case SENSOR_OV7620:
6654         case SENSOR_PB0330:
6655         case SENSOR_PO2030:
6656                 reg_w(dev, 0x0d, 0x003a);
6657                 reg_w(dev, 0x02, 0x003b);
6658                 reg_w(dev, 0x00, 0x0038);
6659                 break;
6660         }
6661 }
6662
6663 /* start probe 2 wires */
6664 static void start_2wr_probe(struct usb_device *dev, int sensor)
6665 {
6666         reg_w(dev, 0x01, 0x0000);
6667         reg_w(dev, sensor, 0x0010);
6668         reg_w(dev, 0x01, 0x0001);
6669         reg_w(dev, 0x03, 0x0012);
6670         reg_w(dev, 0x01, 0x0012);
6671 /*      msleep(2); */
6672 }
6673
6674 static int sif_probe(struct usb_device *dev)
6675 {
6676         __u16 checkword;
6677
6678         start_2wr_probe(dev, 0x0f);             /* PAS106 */
6679         reg_w(dev, 0x08, 0x008d);
6680         msleep(150);
6681         checkword = ((i2c_read(dev, 0x00) & 0x0f) << 4)
6682                         | ((i2c_read(dev, 0x01) & 0xf0) >> 4);
6683         PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
6684         if (checkword == 0x0007) {
6685                 send_unknown(dev, SENSOR_PAS106);
6686                 return 0x0f;                    /* PAS106 */
6687         }
6688         return -1;
6689 }
6690
6691 static int vga_2wr_probe(struct usb_device *dev)
6692 {
6693         __u8 retbyte;
6694         __u16 checkword;
6695
6696         start_2wr_probe(dev, 0x00);             /* HV7131B */
6697         i2c_write(dev, 0x01, 0xaa, 0x00);
6698         retbyte = i2c_read(dev, 0x01);
6699         if (retbyte != 0)
6700                 return 0x00;                    /* HV7131B */
6701
6702         start_2wr_probe(dev, 0x04);             /* CS2102 */
6703         i2c_write(dev, 0x01, 0xaa, 0x00);
6704         retbyte = i2c_read(dev, 0x01);
6705         if (retbyte != 0)
6706                 return 0x04;                    /* CS2102 */
6707
6708         start_2wr_probe(dev, 0x06);             /* OmniVision */
6709         reg_w(dev, 0x08, 0x8d);
6710         i2c_write(dev, 0x11, 0xaa, 0x00);
6711         retbyte = i2c_read(dev, 0x11);
6712         if (retbyte != 0) {
6713                 /* (should have returned 0xaa) --> Omnivision? */
6714                 /* reg_r 0x10 -> 0x06 -->  */
6715                 goto ov_check;
6716         }
6717
6718         start_2wr_probe(dev, 0x08);             /* HDCS2020 */
6719         i2c_write(dev, 0x15, 0xaa, 0x00);
6720         retbyte = i2c_read(dev, 0x15);
6721         if (retbyte != 0)
6722                 return 0x08;                    /* HDCS2020 */
6723
6724         start_2wr_probe(dev, 0x0a);             /* PB0330 */
6725         i2c_write(dev, 0x07, 0xaa, 0xaa);
6726         retbyte = i2c_read(dev, 0x07);
6727         if (retbyte != 0)
6728                 return 0x0a;                    /* PB0330 */
6729         retbyte = i2c_read(dev, 0x03);
6730         if (retbyte != 0)
6731                 return 0x0a;                    /* PB0330 ?? */
6732         retbyte = i2c_read(dev, 0x04);
6733         if (retbyte != 0)
6734                 return 0x0a;                    /* PB0330 ?? */
6735
6736         start_2wr_probe(dev, 0x0c);             /* ICM105A */
6737         i2c_write(dev, 0x01, 0x11, 0x00);
6738         retbyte = i2c_read(dev, 0x01);
6739         if (retbyte != 0)
6740                 return 0x0c;                    /* ICM105A */
6741
6742         start_2wr_probe(dev, 0x0e);             /* PAS202BCB */
6743         reg_w(dev, 0x08, 0x8d);
6744         i2c_write(dev, 0x03, 0xaa, 0x00);
6745         msleep(500);
6746         retbyte = i2c_read(dev, 0x03);
6747         if (retbyte != 0)
6748                 return 0x0e;                    /* PAS202BCB */
6749
6750         start_2wr_probe(dev, 0x02);             /* ?? */
6751         i2c_write(dev, 0x01, 0xaa, 0x00);
6752         retbyte = i2c_read(dev, 0x01);
6753         if (retbyte != 0)
6754                 return 0x02;                    /* ?? */
6755 ov_check:
6756         reg_r(dev, 0x0010, &retbyte);           /* ?? */
6757         reg_r(dev, 0x0010, &retbyte);
6758
6759         reg_w(dev, 0x01, 0x0000);
6760         reg_w(dev, 0x01, 0x0001);
6761         reg_w(dev, 0x06, 0x0010);               /* OmniVision */
6762         reg_w(dev, 0xa1, 0x008b);
6763         reg_w(dev, 0x08, 0x008d);
6764         msleep(500);
6765         reg_w(dev, 0x01, 0x0012);
6766         i2c_write(dev, 0x12, 0x80, 0x00);       /* sensor reset */
6767         retbyte = i2c_read(dev, 0x0a);
6768         checkword = retbyte << 8;
6769         retbyte = i2c_read(dev, 0x0b);
6770         checkword |= retbyte;
6771         PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", checkword);
6772         switch (checkword) {
6773         case 0x7631:                            /* OV7630C */
6774                 reg_w(dev, 0x06, 0x0010);
6775                 break;
6776         case 0x7620:                            /* OV7620 */
6777         case 0x7648:                            /* OV7648 */
6778                 break;
6779         default:
6780                 return -1;                      /* not OmniVision */
6781         }
6782         return checkword;
6783 }
6784
6785 struct sensor_by_chipset_revision {
6786         __u16 revision;
6787         __u8 internal_sensor_id;
6788 };
6789 static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
6790         {0xc001, 0x13},         /* MI0360 */
6791         {0xe001, 0x13},
6792         {0x8001, 0x13},
6793         {0x8000, 0x14},         /* CS2102K */
6794         {0x8400, 0x15},         /* TAS5130K */
6795         {0, 0}
6796 };
6797
6798 static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6799 {
6800         struct sd *sd = (struct sd *) gspca_dev;
6801         struct usb_device *dev = gspca_dev->dev;
6802         int i;
6803         __u8 retbyte;
6804         __u16 checkword;
6805
6806 /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
6807         reg_w(dev, 0x02, 0x0010);
6808         reg_r(dev, 0x10, &retbyte);
6809         reg_w(dev, 0x01, 0x0000);
6810         reg_w(dev, 0x00, 0x0010);
6811         reg_w(dev, 0x01, 0x0001);
6812         reg_w(dev, 0x91, 0x008b);
6813         reg_w(dev, 0x03, 0x0012);
6814         reg_w(dev, 0x01, 0x0012);
6815         reg_w(dev, 0x05, 0x0012);
6816         retbyte = i2c_read(dev, 0x14);
6817         if (retbyte != 0)
6818                 return 0x11;                    /* HV7131R */
6819         retbyte = i2c_read(dev, 0x15);
6820         if (retbyte != 0)
6821                 return 0x11;                    /* HV7131R */
6822         retbyte = i2c_read(dev, 0x16);
6823         if (retbyte != 0)
6824                 return 0x11;                    /* HV7131R */
6825
6826         reg_w(dev, 0x02, 0x0010);
6827         reg_r(dev, 0x000b, &retbyte);
6828         checkword = retbyte << 8;
6829         reg_r(dev, 0x000a, &retbyte);
6830         checkword |= retbyte;
6831         PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword);
6832         reg_r(dev, 0x0010, &retbyte);
6833         /* this is tested only once anyway */
6834         i = 0;
6835         while (chipset_revision_sensor[i].revision) {
6836                 if (chipset_revision_sensor[i].revision == checkword) {
6837                         sd->chip_revision = checkword;
6838                         send_unknown(dev, SENSOR_PB0330);
6839                         return chipset_revision_sensor[i].internal_sensor_id;
6840                 }
6841                 i++;
6842         }
6843
6844         reg_w(dev, 0x01, 0x0000);
6845         reg_w(dev, 0x01, 0x0001);
6846         reg_w(dev, 0xdd, 0x008b);
6847         reg_w(dev, 0x0a, 0x0010);
6848         reg_w(dev, 0x03, 0x0012);
6849         reg_w(dev, 0x01, 0x0012);
6850         retbyte = i2c_read(dev, 0x00);
6851         if (retbyte != 0) {
6852                 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6853                 return 0x0a;                    /* ?? */
6854         }
6855
6856         reg_w(dev, 0x01, 0x0000);
6857         reg_w(dev, 0x01, 0x0001);
6858         reg_w(dev, 0x98, 0x008b);
6859         reg_w(dev, 0x01, 0x0010);
6860         reg_w(dev, 0x03, 0x0012);
6861         msleep(2);
6862         reg_w(dev, 0x01, 0x0012);
6863         retbyte = i2c_read(dev, 0x00);
6864         if (retbyte != 0) {
6865                 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte);
6866                 send_unknown(dev, SENSOR_GC0305);
6867                 return retbyte;         /* 0x29 = gc0305 - should continue? */
6868         }
6869
6870         reg_w(dev, 0x01, 0x0000);       /* check OmniVision */
6871         reg_w(dev, 0x01, 0x0001);
6872         reg_w(dev, 0xa1, 0x008b);
6873         reg_w(dev, 0x08, 0x008d);
6874         reg_w(dev, 0x06, 0x0010);
6875         reg_w(dev, 0x01, 0x0012);
6876         reg_w(dev, 0x05, 0x0012);
6877         if (i2c_read(dev, 0x1c) == 0x7f /* OV7610 - manufacturer ID */
6878             && i2c_read(dev, 0x1d) == 0xa2) {
6879                 send_unknown(dev, SENSOR_OV7620);
6880                 return 0x06;            /* OmniVision confirm ? */
6881         }
6882
6883         reg_w(dev, 0x01, 0x00);
6884         reg_w(dev, 0x00, 0x02);
6885         reg_w(dev, 0x01, 0x10);
6886         reg_w(dev, 0x01, 0x01);
6887         reg_w(dev, 0xee, 0x8b);
6888         reg_w(dev, 0x03, 0x12);
6889 /*      msleep(150); */
6890         reg_w(dev, 0x01, 0x12);
6891         reg_w(dev, 0x05, 0x12);
6892         retbyte = i2c_read(dev, 0x00);          /* ID 0 */
6893         checkword = retbyte << 8;
6894         retbyte = i2c_read(dev, 0x01);          /* ID 1 */
6895         checkword |= retbyte;
6896         PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword);
6897         if (checkword == 0x2030) {
6898                 retbyte = i2c_read(dev, 0x02);  /* revision number */
6899                 PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
6900                 send_unknown(dev, SENSOR_PO2030);
6901                 return checkword;
6902         }
6903
6904         reg_w(dev, 0x01, 0x00);
6905         reg_w(dev, 0x0a, 0x10);
6906         reg_w(dev, 0xd3, 0x8b);
6907         reg_w(dev, 0x01, 0x01);
6908         reg_w(dev, 0x03, 0x12);
6909         reg_w(dev, 0x01, 0x12);
6910         reg_w(dev, 0x05, 0x01);
6911         reg_w(dev, 0xd3, 0x8b);
6912         retbyte = i2c_read(dev, 0x01);
6913         if (retbyte != 0) {
6914                 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6915                 return 0x0a;                    /* ?? */
6916         }
6917         return -1;
6918 }
6919
6920 static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6921 {
6922         struct sd *sd = (struct sd *) gspca_dev;
6923         struct usb_device *dev = gspca_dev->dev;
6924         int sensor, sensor2;
6925
6926         switch (sd->sensor) {
6927         case SENSOR_MC501CB:
6928         case SENSOR_TAS5130C_VF0250:
6929                 return -1;              /* don't probe */
6930         }
6931         sensor = vga_2wr_probe(dev);
6932         if (sensor >= 0) {
6933                 if (sensor < 0x7600)
6934                         return sensor;
6935                 /* next probe is needed for OmniVision ? */
6936         }
6937         sensor2 = vga_3wr_probe(gspca_dev);
6938         if (sensor2 >= 0) {
6939                 if (sensor >= 0)
6940                         return sensor;
6941                 return sensor2;
6942         }
6943         return sif_probe(dev);
6944 }
6945
6946 /* this function is called at probe time */
6947 static int sd_config(struct gspca_dev *gspca_dev,
6948                         const struct usb_device_id *id)
6949 {
6950         struct sd *sd = (struct sd *) gspca_dev;
6951         struct cam *cam;
6952         int sensor;
6953         __u8 bsensor;
6954         int vga = 1;            /* 1: vga, 0: sif */
6955         static __u8 gamma[SENSOR_MAX] = {
6956                 5,      /* SENSOR_CS2102 0 */
6957                 5,      /* SENSOR_CS2102K 1 */
6958                 4,      /* SENSOR_GC0305 2 */
6959                 4,      /* SENSOR_HDCS2020 3 */
6960                 4,      /* SENSOR_HDCS2020b 4 */
6961                 4,      /* SENSOR_HV7131B 5 */
6962                 4,      /* SENSOR_HV7131C 6 */
6963                 4,      /* SENSOR_ICM105A 7 */
6964                 4,      /* SENSOR_MC501CB 8 */
6965                 3,      /* SENSOR_OV7620 9 */
6966                 4,      /* SENSOR_OV7630C 10 */
6967                 4,      /* SENSOR_PAS106 11 */
6968                 4,      /* SENSOR_PB0330 12 */
6969                 4,      /* SENSOR_PO2030 13 */
6970                 4,      /* SENSOR_TAS5130CK 14 */
6971                 4,      /* SENSOR_TAS5130CXX 15 */
6972                 3,      /* SENSOR_TAS5130C_VF0250 16 */
6973         };
6974
6975         /* define some sensors from the vendor/product */
6976         sd->sharpness = 2;
6977         switch (id->idVendor) {
6978         case 0x041e:                            /* Creative */
6979                 switch (id->idProduct) {
6980                 case 0x4051:                    /* zc301 chips */
6981                 case 0x4053:
6982                         sd->sensor = SENSOR_TAS5130C_VF0250;
6983                         break;
6984                 }
6985                 break;
6986         case 0x046d:                            /* Logitech Labtec */
6987                 switch (id->idProduct) {
6988                 case 0x08dd:
6989                         sd->sensor = SENSOR_MC501CB;
6990                         break;
6991                 }
6992                 break;
6993         case 0x0ac8:                            /* Vimicro z-star */
6994                 switch (id->idProduct) {
6995                 case 0x305b:
6996                         sd->sensor = SENSOR_TAS5130C_VF0250;
6997                         break;
6998                 }
6999                 break;
7000         }
7001         sensor = zcxx_probeSensor(gspca_dev);
7002         if (sensor >= 0)
7003                 PDEBUG(D_PROBE, "probe sensor -> %02x", sensor);
7004         if ((unsigned) force_sensor < SENSOR_MAX) {
7005                 sd->sensor = force_sensor;
7006                 PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
7007         } else {
7008                 switch (sensor) {
7009                 case -1:
7010                         switch (sd->sensor) {
7011                         case SENSOR_MC501CB:
7012                                 PDEBUG(D_PROBE, "Sensor MC501CB");
7013                                 break;
7014                         case SENSOR_TAS5130C_VF0250:
7015                                 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7016                                 break;
7017                         default:
7018                                 PDEBUG(D_PROBE,
7019                                         "Sensor UNKNOW_0 force Tas5130");
7020                                 sd->sensor = SENSOR_TAS5130CXX;
7021                         }
7022                         break;
7023                 case 0:
7024                         PDEBUG(D_PROBE, "Find Sensor HV7131B");
7025                         sd->sensor = SENSOR_HV7131B;
7026                         break;
7027                 case 0x04:
7028                         PDEBUG(D_PROBE, "Find Sensor CS2102");
7029                         sd->sensor = SENSOR_CS2102;
7030                         break;
7031                 case 0x08:
7032                         PDEBUG(D_PROBE, "Find Sensor HDCS2020(b)");
7033                         sd->sensor = SENSOR_HDCS2020b;
7034                         break;
7035                 case 0x0a:
7036                         PDEBUG(D_PROBE,
7037                                 "Find Sensor PB0330. Chip revision %x",
7038                                 sd->chip_revision);
7039                         sd->sensor = SENSOR_PB0330;
7040                         break;
7041                 case 0x0c:
7042                         PDEBUG(D_PROBE, "Find Sensor ICM105A");
7043                         sd->sensor = SENSOR_ICM105A;
7044                         break;
7045                 case 0x0e:
7046                         PDEBUG(D_PROBE, "Find Sensor HDCS2020");
7047                         sd->sensor = SENSOR_HDCS2020;
7048                         sd->sharpness = 1;
7049                         break;
7050                 case 0x0f:
7051                         PDEBUG(D_PROBE, "Find Sensor PAS106");
7052                         sd->sensor = SENSOR_PAS106;
7053                         vga = 0;                /* SIF */
7054                         break;
7055                 case 0x10:
7056                 case 0x12:
7057                         PDEBUG(D_PROBE, "Find Sensor TAS5130");
7058                         sd->sensor = SENSOR_TAS5130CXX;
7059                         break;
7060                 case 0x11:
7061                         PDEBUG(D_PROBE, "Find Sensor HV7131R(c)");
7062                         sd->sensor = SENSOR_HV7131C;
7063                         break;
7064                 case 0x13:
7065                         PDEBUG(D_PROBE,
7066                                 "Find Sensor MI0360. Chip revision %x",
7067                                 sd->chip_revision);
7068                         sd->sensor = SENSOR_PB0330;
7069                         break;
7070                 case 0x14:
7071                         PDEBUG(D_PROBE,
7072                                 "Find Sensor CS2102K?. Chip revision %x",
7073                                 sd->chip_revision);
7074                         sd->sensor = SENSOR_CS2102K;
7075                         break;
7076                 case 0x15:
7077                         PDEBUG(D_PROBE,
7078                                 "Find Sensor TAS5130CK?. Chip revision %x",
7079                                 sd->chip_revision);
7080                         sd->sensor = SENSOR_TAS5130CK;
7081                         break;
7082                 case 0x29:
7083                         PDEBUG(D_PROBE, "Find Sensor GC0305");
7084                         sd->sensor = SENSOR_GC0305;
7085                         break;
7086                 case 0x2030:
7087                         PDEBUG(D_PROBE, "Find Sensor PO2030");
7088                         sd->sensor = SENSOR_PO2030;
7089                         sd->sharpness = 0;              /* from win traces */
7090                         break;
7091                 case 0x7620:
7092                         PDEBUG(D_PROBE, "Find Sensor OV7620");
7093                         sd->sensor = SENSOR_OV7620;
7094                         break;
7095                 case 0x7648:
7096                         PDEBUG(D_PROBE, "Find Sensor OV7648");
7097                         sd->sensor = SENSOR_OV7620;     /* same sensor (?) */
7098                         break;
7099                 default:
7100                         PDEBUG(D_ERR|D_PROBE, "Unknown sensor %02x", sensor);
7101                         return -EINVAL;
7102                 }
7103         }
7104         if (sensor < 0x20) {
7105                 if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
7106                         reg_w(gspca_dev->dev, 0x02, 0x0010);
7107                 else
7108                         reg_w(gspca_dev->dev, sensor & 0x0f, 0x0010);
7109                 reg_r(gspca_dev->dev, 0x0010, &bsensor);
7110         }
7111
7112         cam = &gspca_dev->cam;
7113         cam->dev_name = (char *) id->driver_info;
7114         cam->epaddr = 0x01;
7115 /*fixme:test*/
7116         gspca_dev->nbalt--;
7117         if (vga) {
7118                 cam->cam_mode = vga_mode;
7119                 cam->nmodes = sizeof vga_mode / sizeof vga_mode[0];
7120         } else {
7121                 cam->cam_mode = sif_mode;
7122                 cam->nmodes = sizeof sif_mode / sizeof sif_mode[0];
7123         }
7124         sd->qindex = 1;
7125         sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
7126         sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value;
7127         sd->gamma = gamma[(int) sd->sensor];
7128         sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value;
7129         sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value;
7130         sd->sharpness = sd_ctrls[SD_SHARPNESS].qctrl.default_value;
7131
7132         /* switch the led off */
7133         reg_w(gspca_dev->dev, 0x01, 0x0000);
7134         return 0;
7135 }
7136
7137 /* this function is called at open time */
7138 static int sd_open(struct gspca_dev *gspca_dev)
7139 {
7140         reg_w(gspca_dev->dev, 0x01, 0x0000);
7141         return 0;
7142 }
7143
7144 static void sd_start(struct gspca_dev *gspca_dev)
7145 {
7146         struct sd *sd = (struct sd *) gspca_dev;
7147         struct usb_device *dev = gspca_dev->dev;
7148         struct usb_action *zc3_init;
7149         int mode;
7150         __u8 retbyte;
7151         static struct usb_action *init_tb[SENSOR_MAX][2] = {
7152                 {cs2102_InitialScale, cs2102_Initial},          /* 0 */
7153                 {cs2102K_InitialScale, cs2102K_Initial},        /* 1 */
7154                 {gc0305_Initial, gc0305_InitialScale},          /* 2 */
7155                 {hdcs2020xx_InitialScale, hdcs2020xx_Initial},  /* 3 */
7156                 {hdcs2020xb_InitialScale, hdcs2020xb_Initial},  /* 4 */
7157                 {hv7131bxx_InitialScale, hv7131bxx_Initial},    /* 5 */
7158                 {hv7131cxx_InitialScale, hv7131cxx_Initial},    /* 6 */
7159                 {icm105axx_InitialScale, icm105axx_Initial},    /* 7 */
7160                 {MC501CB_InitialScale, MC501CB_Initial},        /* 9 */
7161                 {OV7620_mode0, OV7620_mode1},                   /* 9 */
7162                 {ov7630c_InitialScale, ov7630c_Initial},        /* 10 */
7163                 {pas106b_InitialScale, pas106b_Initial},        /* 11 */
7164                 {pb0330xx_InitialScale, pb0330xx_Initial},      /* 12 */
7165 /* or           {pb03303x_InitialScale, pb03303x_Initial}, */
7166                 {PO2030_mode0, PO2030_mode1},                   /* 13 */
7167                 {tas5130CK_InitialScale, tas5130CK_Initial},    /* 14 */
7168                 {tas5130cxx_InitialScale, tas5130cxx_Initial},  /* 15 */
7169                 {tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial},
7170                                                                 /* 16 */
7171         };
7172
7173         mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
7174         zc3_init = init_tb[(int) sd->sensor][mode];
7175         switch (sd->sensor) {
7176         case SENSOR_HV7131B:
7177         case SENSOR_HV7131C:
7178                 zcxx_probeSensor(gspca_dev);
7179                 break;
7180         case SENSOR_PAS106:
7181                 usb_exchange(dev, pas106b_Initial_com);
7182                 break;
7183         case SENSOR_PB0330:
7184                 if (mode) {
7185                         if (sd->chip_revision == 0xc001
7186                             || sd->chip_revision == 0xe001
7187                             || sd->chip_revision == 0x8001)
7188                                 zc3_init = pb03303x_Initial;
7189                 } else {
7190                         if (sd->chip_revision == 0xc001
7191                             || sd->chip_revision == 0xe001
7192                             || sd->chip_revision == 0x8001)
7193                                 zc3_init = pb03303x_InitialScale;
7194                 }
7195                 break;
7196         }
7197         usb_exchange(dev, zc3_init);
7198
7199         switch (sd->sensor) {
7200         case SENSOR_GC0305:
7201         case SENSOR_OV7620:
7202         case SENSOR_PO2030:
7203                 msleep(100);                    /* ?? */
7204                 reg_r(dev, 0x0002, &retbyte);   /* --> 0x40 */
7205                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7206                 reg_w(dev, 0x15, 0x01ae);
7207                 reg_w(dev, 0x0d, 0x003a);
7208                 reg_w(dev, 0x02, 0x003b);
7209                 reg_w(dev, 0x00, 0x0038);
7210                 break;
7211         }
7212
7213         setmatrix(gspca_dev);
7214         setbrightness(gspca_dev);
7215         switch (sd->sensor) {
7216         case SENSOR_OV7620:
7217                 reg_r(dev, 0x0008, &retbyte);
7218                 reg_w(dev, 0x00, 0x0008);
7219                 break;
7220         case SENSOR_GC0305:
7221                 reg_r(dev, 0x0008, &retbyte);
7222                 /* fall thru */
7223         case SENSOR_PO2030:
7224                 reg_w(dev, 0x03, 0x0008);
7225                 break;
7226         }
7227         setsharpness(gspca_dev);
7228
7229         /* set the gamma tables when not set */
7230         switch (sd->sensor) {
7231         case SENSOR_CS2102:             /* gamma set in xxx_Initial */
7232         case SENSOR_CS2102K:
7233         case SENSOR_HDCS2020:
7234         case SENSOR_HDCS2020b:
7235         case SENSOR_PB0330:             /* pb with chip_revision - see above */
7236         case SENSOR_OV7630C:
7237         case SENSOR_TAS5130CK:
7238                 break;
7239         default:
7240                 setcontrast(gspca_dev);
7241                 break;
7242         }
7243         setmatrix(gspca_dev);                   /* one more time? */
7244         switch (sd->sensor) {
7245         case SENSOR_OV7620:
7246                 reg_r(dev, 0x0180, &retbyte);   /* from win */
7247                 reg_w(dev, 0x00, 0x0180);
7248                 break;
7249         default:
7250                 setquality(gspca_dev);
7251                 break;
7252         }
7253         setlightfreq(gspca_dev);
7254
7255         switch (sd->sensor) {
7256         case SENSOR_GC0305:
7257         case SENSOR_OV7620:
7258                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7259                 reg_w(dev, 0x15, 0x01ae);
7260                 sd->autogain = 0;
7261                 break;
7262         case SENSOR_PO2030:
7263                 reg_w(dev, 0x40, 0x0117);       /* (from win traces) */
7264                 reg_r(dev, 0x0180, &retbyte);
7265                 break;
7266         }
7267
7268         setautogain(gspca_dev);
7269         switch (sd->sensor) {
7270         case SENSOR_GC0305:
7271 /*              setlightfreq(gspca_dev);        ?? (end: 80 -> [18d]) */
7272                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7273                 reg_w(dev, 0x15, 0x01ae);
7274                 reg_w(dev, 0x40, 0x0180);
7275                 reg_w(dev, 0x40, 0x0117);
7276                 reg_r(dev, 0x0180, &retbyte);
7277                 sd->autogain = 1;
7278                 setautogain(gspca_dev);
7279                 break;
7280         case SENSOR_OV7620:
7281                 i2c_read(dev, 0x13);            /*fixme: returns 0xa3 */
7282                 i2c_write(dev, 0x13, 0xa3, 0x00); /*fixme: same to send? */
7283                 reg_w(dev, 0x40, 0x0117);       /* (from win traces) */
7284                 reg_r(dev, 0x0180, &retbyte);
7285                 setautogain(gspca_dev);
7286                 msleep(500);
7287                 break;
7288         case SENSOR_PO2030:
7289                 msleep(500);
7290                 reg_r(dev, 0x0008, &retbyte);
7291                 reg_r(dev, 0x0007, &retbyte);
7292                 reg_w(dev, 0x00, 0x0007);       /* (from win traces) */
7293                 reg_w(dev, 0x02, 0x0008);
7294                 break;
7295         }
7296 }
7297
7298 static void sd_stopN(struct gspca_dev *gspca_dev)
7299 {
7300 }
7301
7302 static void sd_stop0(struct gspca_dev *gspca_dev)
7303 {
7304         struct sd *sd = (struct sd *) gspca_dev;
7305
7306         send_unknown(gspca_dev->dev, sd->sensor);
7307 }
7308
7309 /* this function is called at close time */
7310 static void sd_close(struct gspca_dev *gspca_dev)
7311 {
7312 }
7313
7314 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
7315                         struct gspca_frame *frame,
7316                         __u8 *data,
7317                         int len)
7318 {
7319
7320         if (data[0] == 0xff && data[1] == 0xd8) {       /* start of frame */
7321                 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
7322                                         data, 0);
7323                 /* put the JPEG header in the new frame */
7324                 jpeg_put_header(gspca_dev, frame,
7325                                 ((struct sd *) gspca_dev)->qindex,
7326                                 0x21);
7327                 /* remove the webcam's header:
7328                  * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
7329                  *      - 'ss ss' is the frame sequence number (BE)
7330                  *      - 'ww ww' and 'hh hh' are the window dimensions (BE)
7331                  *      - 'pp pp' is the packet sequence number (BE)
7332                  */
7333                 data += 18;
7334                 len -= 18;
7335         }
7336         gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
7337 }
7338
7339 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
7340 {
7341         struct sd *sd = (struct sd *) gspca_dev;
7342
7343         sd->brightness = val;
7344         if (gspca_dev->streaming)
7345                 setbrightness(gspca_dev);
7346         return 0;
7347 }
7348
7349 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
7350 {
7351         struct sd *sd = (struct sd *) gspca_dev;
7352
7353         *val = sd->brightness;
7354         return 0;
7355 }
7356
7357 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
7358 {
7359         struct sd *sd = (struct sd *) gspca_dev;
7360
7361         sd->contrast = val;
7362         if (gspca_dev->streaming)
7363                 setcontrast(gspca_dev);
7364         return 0;
7365 }
7366
7367 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
7368 {
7369         struct sd *sd = (struct sd *) gspca_dev;
7370
7371         *val = sd->contrast;
7372         return 0;
7373 }
7374
7375 static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
7376 {
7377         struct sd *sd = (struct sd *) gspca_dev;
7378
7379         sd->autogain = val;
7380         if (gspca_dev->streaming)
7381                 setautogain(gspca_dev);
7382         return 0;
7383 }
7384
7385 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val)
7386 {
7387         struct sd *sd = (struct sd *) gspca_dev;
7388
7389         *val = sd->autogain;
7390         return 0;
7391 }
7392
7393 static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val)
7394 {
7395         struct sd *sd = (struct sd *) gspca_dev;
7396
7397         sd->gamma = val;
7398         if (gspca_dev->streaming)
7399                 setcontrast(gspca_dev);
7400         return 0;
7401 }
7402
7403 static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val)
7404 {
7405         struct sd *sd = (struct sd *) gspca_dev;
7406
7407         *val = sd->gamma;
7408         return 0;
7409 }
7410
7411 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
7412 {
7413         struct sd *sd = (struct sd *) gspca_dev;
7414
7415         sd->lightfreq = val;
7416         if (gspca_dev->streaming)
7417                 setlightfreq(gspca_dev);
7418         return 0;
7419 }
7420
7421 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
7422 {
7423         struct sd *sd = (struct sd *) gspca_dev;
7424
7425         *val = sd->lightfreq;
7426         return 0;
7427 }
7428
7429 static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
7430 {
7431         struct sd *sd = (struct sd *) gspca_dev;
7432
7433         sd->sharpness = val;
7434         if (gspca_dev->streaming)
7435                 setsharpness(gspca_dev);
7436         return 0;
7437 }
7438
7439 static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
7440 {
7441         struct sd *sd = (struct sd *) gspca_dev;
7442
7443         *val = sd->sharpness;
7444         return 0;
7445 }
7446
7447 static int sd_querymenu(struct gspca_dev *gspca_dev,
7448                         struct v4l2_querymenu *menu)
7449 {
7450         switch (menu->id) {
7451         case V4L2_CID_POWER_LINE_FREQUENCY:
7452                 switch (menu->index) {
7453                 case 0:         /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
7454                         strcpy(menu->name, "NoFliker");
7455                         return 0;
7456                 case 1:         /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
7457                         strcpy(menu->name, "50 Hz");
7458                         return 0;
7459                 case 2:         /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
7460                         strcpy(menu->name, "60 Hz");
7461                         return 0;
7462                 }
7463                 break;
7464         }
7465         return -EINVAL;
7466 }
7467
7468 static struct sd_desc sd_desc = {
7469         .name = MODULE_NAME,
7470         .ctrls = sd_ctrls,
7471         .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
7472         .config = sd_config,
7473         .open = sd_open,
7474         .start = sd_start,
7475         .stopN = sd_stopN,
7476         .stop0 = sd_stop0,
7477         .close = sd_close,
7478         .pkt_scan = sd_pkt_scan,
7479         .querymenu = sd_querymenu,
7480 };
7481
7482 #define DVNM(name) .driver_info = (kernel_ulong_t) name
7483 static __devinitdata struct usb_device_id device_table[] = {
7484         {USB_DEVICE(0x041e, 0x041e), DVNM("Creative WebCam Live!")},
7485         {USB_DEVICE(0x041e, 0x4017), DVNM("Creative Webcam Mobile PD1090")},
7486         {USB_DEVICE(0x041e, 0x401c), DVNM("Creative NX")},
7487         {USB_DEVICE(0x041e, 0x401e), DVNM("Creative Nx Pro")},
7488         {USB_DEVICE(0x041e, 0x401f), DVNM("Creative Webcam Notebook PD1171")},
7489 /*0x041e, 0x4022*/
7490         {USB_DEVICE(0x041e, 0x4029), DVNM("Creative WebCam Vista Pro")},
7491         {USB_DEVICE(0x041e, 0x4034), DVNM("Creative Instant P0620")},
7492         {USB_DEVICE(0x041e, 0x4035), DVNM("Creative Instant P0620D")},
7493         {USB_DEVICE(0x041e, 0x4036), DVNM("Creative Live !")},
7494         {USB_DEVICE(0x041e, 0x403a), DVNM("Creative Nx Pro 2")},
7495         {USB_DEVICE(0x041e, 0x4051), DVNM("Creative Notebook Pro (VF0250)")},
7496         {USB_DEVICE(0x041e, 0x4053), DVNM("Creative Live!Cam Video IM")},
7497         {USB_DEVICE(0x0458, 0x7007), DVNM("Genius VideoCam V2")},
7498         {USB_DEVICE(0x0458, 0x700c), DVNM("Genius VideoCam V3")},
7499         {USB_DEVICE(0x0458, 0x700f), DVNM("Genius VideoCam Web V2")},
7500         {USB_DEVICE(0x0461, 0x0a00), DVNM("MicroInnovation WebCam320")},
7501         {USB_DEVICE(0x046d, 0x08a0), DVNM("Logitech QC IM")},
7502         {USB_DEVICE(0x046d, 0x08a1), DVNM("Logitech QC IM 0x08A1 +sound")},
7503         {USB_DEVICE(0x046d, 0x08a2), DVNM("Labtec Webcam Pro")},
7504         {USB_DEVICE(0x046d, 0x08a3), DVNM("Logitech QC Chat")},
7505         {USB_DEVICE(0x046d, 0x08a6), DVNM("Logitech QCim")},
7506         {USB_DEVICE(0x046d, 0x08a7), DVNM("Logitech QuickCam Image")},
7507         {USB_DEVICE(0x046d, 0x08a9), DVNM("Logitech Notebook Deluxe")},
7508         {USB_DEVICE(0x046d, 0x08aa), DVNM("Labtec Webcam  Notebook")},
7509         {USB_DEVICE(0x046d, 0x08ac), DVNM("Logitech QuickCam Cool")},
7510         {USB_DEVICE(0x046d, 0x08ad), DVNM("Logitech QCCommunicate STX")},
7511         {USB_DEVICE(0x046d, 0x08ae), DVNM("Logitech QuickCam for Notebooks")},
7512         {USB_DEVICE(0x046d, 0x08af), DVNM("Logitech QuickCam Cool")},
7513         {USB_DEVICE(0x046d, 0x08b9), DVNM("Logitech QC IM ???")},
7514         {USB_DEVICE(0x046d, 0x08d7), DVNM("Logitech QCam STX")},
7515         {USB_DEVICE(0x046d, 0x08d9), DVNM("Logitech QuickCam IM/Connect")},
7516         {USB_DEVICE(0x046d, 0x08d8), DVNM("Logitech Notebook Deluxe")},
7517         {USB_DEVICE(0x046d, 0x08da), DVNM("Logitech QuickCam Messenger")},
7518         {USB_DEVICE(0x046d, 0x08dd), DVNM("Logitech QuickCam for Notebooks")},
7519         {USB_DEVICE(0x0471, 0x0325), DVNM("Philips SPC 200 NC")},
7520         {USB_DEVICE(0x0471, 0x0326), DVNM("Philips SPC 300 NC")},
7521         {USB_DEVICE(0x0471, 0x032d), DVNM("Philips spc210nc")},
7522         {USB_DEVICE(0x0471, 0x032e), DVNM("Philips spc315nc")},
7523         {USB_DEVICE(0x055f, 0xc005), DVNM("Mustek Wcam300A")},
7524         {USB_DEVICE(0x055f, 0xd003), DVNM("Mustek WCam300A")},
7525         {USB_DEVICE(0x055f, 0xd004), DVNM("Mustek WCam300 AN")},
7526         {USB_DEVICE(0x0698, 0x2003), DVNM("CTX M730V built in")},
7527 /*0x0ac8, 0x0301*/
7528         {USB_DEVICE(0x0ac8, 0x0302), DVNM("Z-star Vimicro zc0302")},
7529         {USB_DEVICE(0x0ac8, 0x301b), DVNM("Z-Star zc301b")},
7530         {USB_DEVICE(0x0ac8, 0x303b), DVNM("Vimicro 0x303b")},
7531         {USB_DEVICE(0x0ac8, 0x305b), DVNM("Z-star Vimicro zc0305b")},
7532         {USB_DEVICE(0x0ac8, 0x307b), DVNM("Z-Star 307b")},
7533         {USB_DEVICE(0x10fd, 0x0128), DVNM("Typhoon Webshot II 300k 0x0128")},
7534 /*0x10fd, 0x804e*/
7535         {USB_DEVICE(0x10fd, 0x8050), DVNM("Typhoon Webshot II USB 300k")},
7536         {}                      /* end of entry */
7537 };
7538 #undef DVNAME
7539 MODULE_DEVICE_TABLE(usb, device_table);
7540
7541 /* -- device connect -- */
7542 static int sd_probe(struct usb_interface *intf,
7543                         const struct usb_device_id *id)
7544 {
7545         return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7546                                 THIS_MODULE);
7547 }
7548
7549 /* USB driver */
7550 static struct usb_driver sd_driver = {
7551         .name = MODULE_NAME,
7552         .id_table = device_table,
7553         .probe = sd_probe,
7554         .disconnect = gspca_disconnect,
7555 };
7556
7557 static int __init sd_mod_init(void)
7558 {
7559         if (usb_register(&sd_driver) < 0)
7560                 return -1;
7561         PDEBUG(D_PROBE, "v%s registered", version);
7562         return 0;
7563 }
7564
7565 static void __exit sd_mod_exit(void)
7566 {
7567         usb_deregister(&sd_driver);
7568         PDEBUG(D_PROBE, "deregistered");
7569 }
7570
7571 module_init(sd_mod_init);
7572 module_exit(sd_mod_exit);
7573
7574 module_param(force_sensor, int, 0644);
7575 MODULE_PARM_DESC(force_sensor,
7576         "Force sensor. Only for experts!!!");