Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[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, 7)
28 static const char version[] = "2.1.7";
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 #include "zc3xx-reg.h"
39
40 /* specific webcam descriptor */
41 struct sd {
42         struct gspca_dev gspca_dev;     /* !! must be the first item */
43
44         __u8 brightness;
45         __u8 contrast;
46         __u8 gamma;
47         __u8 autogain;
48         __u8 lightfreq;
49         __u8 sharpness;
50
51         char qindex;
52         char sensor;                    /* Type of image sensor chip */
53 /* !! values used in different tables */
54 #define SENSOR_CS2102 0
55 #define SENSOR_CS2102K 1
56 #define SENSOR_GC0305 2
57 #define SENSOR_HDCS2020 3
58 #define SENSOR_HDCS2020b 4
59 #define SENSOR_HV7131B 5
60 #define SENSOR_HV7131C 6
61 #define SENSOR_ICM105A 7
62 #define SENSOR_MC501CB 8
63 #define SENSOR_OV7620 9
64 /*#define SENSOR_OV7648 9 - same values */
65 #define SENSOR_OV7630C 10
66 #define SENSOR_PAS106 11
67 #define SENSOR_PB0330 12
68 #define SENSOR_PO2030 13
69 #define SENSOR_TAS5130CK 14
70 #define SENSOR_TAS5130CXX 15
71 #define SENSOR_TAS5130C_VF0250 16
72 #define SENSOR_MAX 17
73         unsigned short chip_revision;
74 };
75
76 /* V4L2 controls supported by the driver */
77 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
78 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
79 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
80 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
81 static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
82 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
83 static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val);
84 static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val);
85 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
86 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
87 static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
88 static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
89
90 static struct ctrl sd_ctrls[] = {
91 #define SD_BRIGHTNESS 0
92         {
93             {
94                 .id      = V4L2_CID_BRIGHTNESS,
95                 .type    = V4L2_CTRL_TYPE_INTEGER,
96                 .name    = "Brightness",
97                 .minimum = 0,
98                 .maximum = 255,
99                 .step    = 1,
100                 .default_value = 128,
101             },
102             .set = sd_setbrightness,
103             .get = sd_getbrightness,
104         },
105 #define SD_CONTRAST 1
106         {
107             {
108                 .id      = V4L2_CID_CONTRAST,
109                 .type    = V4L2_CTRL_TYPE_INTEGER,
110                 .name    = "Contrast",
111                 .minimum = 0,
112                 .maximum = 256,
113                 .step    = 1,
114                 .default_value = 128,
115             },
116             .set = sd_setcontrast,
117             .get = sd_getcontrast,
118         },
119 #define SD_GAMMA 2
120         {
121             {
122                 .id      = V4L2_CID_GAMMA,
123                 .type    = V4L2_CTRL_TYPE_INTEGER,
124                 .name    = "Gamma",
125                 .minimum = 1,
126                 .maximum = 6,
127                 .step    = 1,
128                 .default_value = 4,
129             },
130             .set = sd_setgamma,
131             .get = sd_getgamma,
132         },
133 #define SD_AUTOGAIN 3
134         {
135             {
136                 .id      = V4L2_CID_AUTOGAIN,
137                 .type    = V4L2_CTRL_TYPE_BOOLEAN,
138                 .name    = "Auto Gain",
139                 .minimum = 0,
140                 .maximum = 1,
141                 .step    = 1,
142                 .default_value = 1,
143             },
144             .set = sd_setautogain,
145             .get = sd_getautogain,
146         },
147 #define SD_FREQ 4
148         {
149             {
150                 .id      = V4L2_CID_POWER_LINE_FREQUENCY,
151                 .type    = V4L2_CTRL_TYPE_MENU,
152                 .name    = "Light frequency filter",
153                 .minimum = 0,
154                 .maximum = 2,   /* 0: 0, 1: 50Hz, 2:60Hz */
155                 .step    = 1,
156                 .default_value = 1,
157             },
158             .set = sd_setfreq,
159             .get = sd_getfreq,
160         },
161 #define SD_SHARPNESS 5
162         {
163             {
164                 .id      = V4L2_CID_SHARPNESS,
165                 .type    = V4L2_CTRL_TYPE_INTEGER,
166                 .name    = "Sharpness",
167                 .minimum = 0,
168                 .maximum = 3,
169                 .step    = 1,
170                 .default_value = 2,
171             },
172             .set = sd_setsharpness,
173             .get = sd_getsharpness,
174         },
175 };
176
177 static struct v4l2_pix_format vga_mode[] = {
178         {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
179                 .bytesperline = 320,
180                 .sizeimage = 320 * 240 * 3 / 8 + 590,
181                 .colorspace = V4L2_COLORSPACE_JPEG,
182                 .priv = 1},
183         {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
184                 .bytesperline = 640,
185                 .sizeimage = 640 * 480 * 3 / 8 + 590,
186                 .colorspace = V4L2_COLORSPACE_JPEG,
187                 .priv = 0},
188 };
189
190 static struct v4l2_pix_format sif_mode[] = {
191         {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
192                 .bytesperline = 176,
193                 .sizeimage = 176 * 144 * 3 / 8 + 590,
194                 .colorspace = V4L2_COLORSPACE_JPEG,
195                 .priv = 1},
196         {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
197                 .bytesperline = 352,
198                 .sizeimage = 352 * 288 * 3 / 8 + 590,
199                 .colorspace = V4L2_COLORSPACE_JPEG,
200                 .priv = 0},
201 };
202
203 /* usb exchanges */
204 struct usb_action {
205         __u8    req;
206         __u8    val;
207         __u16   idx;
208 };
209
210 static const struct usb_action cs2102_Initial[] = {
211         {0xa1, 0x01, 0x0008},
212         {0xa1, 0x01, 0x0008},
213         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
214         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
215         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
216         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
217         {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
218         {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
219         {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
220         {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
221         {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
222         {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
223         {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
224         {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
225         {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
226         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
227         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
228         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
229         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
230         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
231         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
232         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
233         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
234         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
235         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
236         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
237         {0xaa, 0x02, 0x0008},
238         {0xaa, 0x03, 0x0000},
239         {0xaa, 0x11, 0x0000},
240         {0xaa, 0x12, 0x0089},
241         {0xaa, 0x13, 0x0000},
242         {0xaa, 0x14, 0x00e9},
243         {0xaa, 0x20, 0x0000},
244         {0xaa, 0x22, 0x0000},
245         {0xaa, 0x0b, 0x0004},
246         {0xaa, 0x30, 0x0030},
247         {0xaa, 0x31, 0x0030},
248         {0xaa, 0x32, 0x0030},
249         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
250         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
251         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
252         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
253         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
254         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
255         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
256         {0xa0, 0x10, 0x01ae},
257         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
258         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
259         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
260         {0xa0, 0x00, 0x01ad},
261         {0xa1, 0x01, 0x0002},
262         {0xa1, 0x01, 0x0008},
263         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
264         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
265         {0xa1, 0x01, 0x01c8},
266         {0xa1, 0x01, 0x01c9},
267         {0xa1, 0x01, 0x01ca},
268         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
269         {0xa0, 0x24, ZC3XX_R120_GAMMA00},       /* gamma 5 */
270         {0xa0, 0x44, ZC3XX_R121_GAMMA01},
271         {0xa0, 0x64, ZC3XX_R122_GAMMA02},
272         {0xa0, 0x84, ZC3XX_R123_GAMMA03},
273         {0xa0, 0x9d, ZC3XX_R124_GAMMA04},
274         {0xa0, 0xb2, ZC3XX_R125_GAMMA05},
275         {0xa0, 0xc4, ZC3XX_R126_GAMMA06},
276         {0xa0, 0xd3, ZC3XX_R127_GAMMA07},
277         {0xa0, 0xe0, ZC3XX_R128_GAMMA08},
278         {0xa0, 0xeb, ZC3XX_R129_GAMMA09},
279         {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
280         {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
281         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
282         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
283         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
284         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
285         {0xa0, 0x18, ZC3XX_R130_GAMMA10},
286         {0xa0, 0x20, ZC3XX_R131_GAMMA11},
287         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
288         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
289         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
290         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
291         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
292         {0xa0, 0x0e, ZC3XX_R137_GAMMA17},
293         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
294         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
295         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
296         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
297         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
298         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
299         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
300         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
301         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
302         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
303         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
304         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
305         {0xa0, 0x58, ZC3XX_R10E_RGB11},
306         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
307         {0xa0, 0xf4, ZC3XX_R110_RGB20},
308         {0xa0, 0xf4, ZC3XX_R111_RGB21},
309         {0xa0, 0x58, ZC3XX_R112_RGB22},
310         {0xa1, 0x01, 0x0180},
311         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
312         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
313         {0xaa, 0x23, 0x0001},
314         {0xaa, 0x24, 0x0055},
315         {0xaa, 0x25, 0x00cc},
316         {0xaa, 0x21, 0x003f},
317         {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
318         {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
319         {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
320         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
321         {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
322         {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
323         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
324         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
325         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
326         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
327         {0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
328         {0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
329         {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
330         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
331         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
332         {0xa1, 0x01, 0x0180},
333         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
334         {0xa0, 0x40, ZC3XX_R116_RGAIN},
335         {0xa0, 0x40, ZC3XX_R117_GGAIN},
336         {0xa0, 0x40, ZC3XX_R118_BGAIN},
337         {}
338 };
339
340 static const struct usb_action cs2102_InitialScale[] = {
341         {0xa1, 0x01, 0x0008},
342         {0xa1, 0x01, 0x0008},
343         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
344         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
345         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
346         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
347         {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
348         {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
349         {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
350         {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
351         {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
352         {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
353         {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
354         {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
355         {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
356         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
357         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
358         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
359         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
360         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
361         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
362         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
363         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
364         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
365         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
366         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
367         {0xaa, 0x02, 0x0008},
368         {0xaa, 0x03, 0x0000},
369         {0xaa, 0x11, 0x0001},
370         {0xaa, 0x12, 0x0087},
371         {0xaa, 0x13, 0x0001},
372         {0xaa, 0x14, 0x00e7},
373         {0xaa, 0x20, 0x0000},
374         {0xaa, 0x22, 0x0000},
375         {0xaa, 0x0b, 0x0004},
376         {0xaa, 0x30, 0x0030},
377         {0xaa, 0x31, 0x0030},
378         {0xaa, 0x32, 0x0030},
379         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
380         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
381         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
382         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
383         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
384         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
385         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
386         {0xa0, 0x15, 0x01ae},
387         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
388         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
389         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
390         {0xa0, 0x00, 0x01ad},
391         {0xa1, 0x01, 0x0002},
392         {0xa1, 0x01, 0x0008},
393         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
394         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
395         {0xa1, 0x01, 0x01c8},
396         {0xa1, 0x01, 0x01c9},
397         {0xa1, 0x01, 0x01ca},
398         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
399         {0xa0, 0x24, ZC3XX_R120_GAMMA00},       /* gamma 5 */
400         {0xa0, 0x44, ZC3XX_R121_GAMMA01},
401         {0xa0, 0x64, ZC3XX_R122_GAMMA02},
402         {0xa0, 0x84, ZC3XX_R123_GAMMA03},
403         {0xa0, 0x9d, ZC3XX_R124_GAMMA04},
404         {0xa0, 0xb2, ZC3XX_R125_GAMMA05},
405         {0xa0, 0xc4, ZC3XX_R126_GAMMA06},
406         {0xa0, 0xd3, ZC3XX_R127_GAMMA07},
407         {0xa0, 0xe0, ZC3XX_R128_GAMMA08},
408         {0xa0, 0xeb, ZC3XX_R129_GAMMA09},
409         {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
410         {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
411         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
412         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
413         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
414         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
415         {0xa0, 0x18, ZC3XX_R130_GAMMA10},
416         {0xa0, 0x20, ZC3XX_R131_GAMMA11},
417         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
418         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
419         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
420         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
421         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
422         {0xa0, 0x0e, ZC3XX_R137_GAMMA17},
423         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
424         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
425         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
426         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
427         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
428         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
429         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
430         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
431         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
432         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
433         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
434         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
435         {0xa0, 0x58, ZC3XX_R10E_RGB11},
436         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
437         {0xa0, 0xf4, ZC3XX_R110_RGB20},
438         {0xa0, 0xf4, ZC3XX_R111_RGB21},
439         {0xa0, 0x58, ZC3XX_R112_RGB22},
440         {0xa1, 0x01, 0x0180},
441         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
442         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
443         {0xaa, 0x23, 0x0000},
444         {0xaa, 0x24, 0x00aa},
445         {0xaa, 0x25, 0x00e6},
446         {0xaa, 0x21, 0x003f},
447         {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
448         {0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
449         {0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
450         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
451         {0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
452         {0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
453         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
454         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
455         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
456         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
457         {0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
458         {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
459         {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
460         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
461         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
462         {0xa1, 0x01, 0x0180},
463         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
464         {0xa0, 0x40, ZC3XX_R116_RGAIN},
465         {0xa0, 0x40, ZC3XX_R117_GGAIN},
466         {0xa0, 0x40, ZC3XX_R118_BGAIN},
467         {}
468 };
469 static const struct usb_action cs2102_50HZ[] = {
470         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
471         {0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */
472         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
473         {0xaa, 0x04, 0x00ac}, /* 00,04,ac,aa */
474         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
475         {0xaa, 0x11, 0x00ac}, /* 00,11,ac,aa */
476         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
477         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
478         {0xaa, 0x1d, 0x00ac}, /* 00,1d,ac,aa */
479         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
480         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
481         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
482         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
483         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
484         {0xa0, 0x42, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,42,cc */
485         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
486         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
487         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
488         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
489         {0xa0, 0x8c, ZC3XX_R01D_HSYNC_0}, /* 00,1d,8c,cc */
490         {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
491         {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
492         {}
493 };
494 static const struct usb_action cs2102_50HZScale[] = {
495         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
496         {0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */
497         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
498         {0xaa, 0x04, 0x00a1}, /* 00,04,a1,aa */
499         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
500         {0xaa, 0x11, 0x00a1}, /* 00,11,a1,aa */
501         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
502         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
503         {0xaa, 0x1d, 0x00a1}, /* 00,1d,a1,aa */
504         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
505         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
506         {0xa0, 0xf7, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f7,cc */
507         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
508         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
509         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
510         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
511         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
512         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
513         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
514         {0xa0, 0x93, ZC3XX_R01D_HSYNC_0}, /* 00,1d,93,cc */
515         {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
516         {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
517         {}
518 };
519 static const struct usb_action cs2102_60HZ[] = {
520         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
521         {0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */
522         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
523         {0xaa, 0x04, 0x00aa}, /* 00,04,aa,aa */
524         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
525         {0xaa, 0x11, 0x00aa}, /* 00,11,aa,aa */
526         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
527         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
528         {0xaa, 0x1d, 0x00aa}, /* 00,1d,aa,aa */
529         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
530         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
531         {0xa0, 0xe4, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e4,cc */
532         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
533         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
534         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3a,cc */
535         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
536         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
537         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
538         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
539         {0xa0, 0x5d, ZC3XX_R01D_HSYNC_0}, /* 00,1d,5d,cc */
540         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
541         {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */
542         {}
543 };
544 static const struct usb_action cs2102_60HZScale[] = {
545         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
546         {0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */
547         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
548         {0xaa, 0x04, 0x00be}, /* 00,04,be,aa */
549         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
550         {0xaa, 0x11, 0x00be}, /* 00,11,be,aa */
551         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
552         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
553         {0xaa, 0x1d, 0x00be}, /* 00,1d,be,aa */
554         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
555         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
556         {0xa0, 0xfc, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,fc,cc */
557         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
558         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
559         {0xa0, 0x69, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,69,cc */
560         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
561         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
562         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
563         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
564         {0xa0, 0xb7, ZC3XX_R01D_HSYNC_0}, /* 00,1d,b7,cc */
565         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
566         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
567         {}
568 };
569 static const struct usb_action cs2102_NoFliker[] = {
570         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
571         {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
572         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
573         {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
574         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
575         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
576         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
577         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
578         {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
579         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
580         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
581         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
582         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
583         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
584         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
585         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
586         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
587         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
588         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
589         {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
590         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
591         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
592         {}
593 };
594 static const struct usb_action cs2102_NoFlikerScale[] = {
595         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
596         {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
597         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
598         {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
599         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
600         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
601         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
602         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
603         {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
604         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
605         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
606         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
607         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
608         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
609         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
610         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
611         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
612         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
613         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
614         {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
615         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
616         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
617         {}
618 };
619
620 /* CS2102_KOCOM */
621 static const struct usb_action cs2102K_Initial[] = {
622         {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
623         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
624         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
625         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
626         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
627         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
628         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
629         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
630         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
631         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
632         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
633         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
634         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
635         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
636         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
637         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
638         {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
639         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
640         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
641         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
642         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
643         {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
644         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
645         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
646         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
647         {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
648         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
649         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
650         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
651         {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
652         {0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
653         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
654         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
655         {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
656         {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
657         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
658         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
659         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
660         {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
661         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
662         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
663         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
664         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
665         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
666         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
667         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
668         {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
669         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
670         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
671         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
672         {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
673         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
674         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
675         {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
676         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
677         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
678         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
679         {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
680         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
681         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
682         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
683         {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
684         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
685         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
686         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
687         {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
688         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
689         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
690         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
691         {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
692         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
693         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
694         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
695         {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
696         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
697         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
698         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
699         {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
700         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
701         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
702         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
703         {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
704         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
705         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
706         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
707         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
708         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
709         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
710         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
711         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
712         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
713         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
714         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
715         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
716         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
717         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
718         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
719         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
720         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
721         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
722         {0xa0, 0x00, 0x01ad},
723         {0xa0, 0x01, 0x01b1},
724         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
725         {0xa0, 0x60, ZC3XX_R116_RGAIN},
726         {0xa0, 0x40, ZC3XX_R117_GGAIN},
727         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
728         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
729         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
730         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
731         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
732         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
733         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
734         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
735         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
736         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
737         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
738         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
739         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
740         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
741         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
742         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
743         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
744         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
745         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
746         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
747         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
748         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
749         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
750         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
751         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
752         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
753         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
754         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
755         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
756         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
757         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
758         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
759         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
760         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
761         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
762         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
763         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
764         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
765         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
766         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
767         {0xa0, 0x58, ZC3XX_R10E_RGB11},
768         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
769         {0xa0, 0xf4, ZC3XX_R110_RGB20},
770         {0xa0, 0xf4, ZC3XX_R111_RGB21},
771         {0xa0, 0x58, ZC3XX_R112_RGB22},
772         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
773         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
774         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
775         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
776         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
777         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
778         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
779         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
780         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
781         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
782         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
783         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
784         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
785         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
786         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
787         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
788         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
789         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
790         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
791         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
792         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
793         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
794         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
795         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
796         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
797         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
798         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
799         {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
800         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
801         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
802         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
803         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
804         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
805         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
806         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
807         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
808         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
809         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
810         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
811         {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
812         {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
813         {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
814         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
815         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
816         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
817         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
818         {0xa0, 0x60, ZC3XX_R116_RGAIN},
819         {0xa0, 0x40, ZC3XX_R117_GGAIN},
820         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
821         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
822         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
823         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
824         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
825         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
826         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
827         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
828         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
829         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
830         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
831         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
832         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
833         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
834         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
835         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
836         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
837         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
838         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
839         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
840         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
841         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
842         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
843         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
844         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
845         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
846         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
847         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
848         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
849         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
850         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
851         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
852         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
853         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
854         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
855         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
856         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
857         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
858         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
859         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
860         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
861         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
862         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
863         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
864         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
865         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
866         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
867         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
868         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
869         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
870         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
871         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
872         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
873         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
874         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
875         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
876         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
877         {}
878 };
879
880 static const struct usb_action cs2102K_InitialScale[] = {
881         {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
882         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
883         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
884         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
885         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
886         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
887         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
888         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
889         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
890         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
891         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
892         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
893         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
894         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
895         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
896         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
897         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
898         {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
899         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
900         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
901         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
902         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
903         {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
904         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
905         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
906         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
907         {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
908         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
909         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
910         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
911         {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
912         {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
913         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
914         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
915         {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
916         {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
917         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
918         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
919         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
920         {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
921         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
922         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
923         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
924         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
925         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
926         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
927         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
928         {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
929         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
930         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
931         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
932         {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
933         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
934         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
935         {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
936         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
937         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
938         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
939         {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
940         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
941         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
942         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
943         {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
944         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
945         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
946         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
947         {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
948         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
949         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
950         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
951         {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
952         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
953         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
954         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
955         {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
956         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
957         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
958         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
959         {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
960         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
961         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
962         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
963         {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
964         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
965         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
966         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
967         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
968         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
969         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
970         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
971         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
972         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
973         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
974         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
975         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
976         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
977         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
978         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
979         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
980         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
981         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
982         {0xa0, 0x00, 0x01ad},
983         {0xa0, 0x01, 0x01b1},
984         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
985         {0xa0, 0x60, ZC3XX_R116_RGAIN},
986         {0xa0, 0x40, ZC3XX_R117_GGAIN},
987         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
988         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
989         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
990         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
991         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
992         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
993         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
994         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
995         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
996         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
997         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
998         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
999         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1000         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1001         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1002         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1003         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1004         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1005         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1006         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1007         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1008         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1009         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1010         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1011         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1012         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1013         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1014         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1015         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1016         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1017         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1018         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1019         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1020         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1021         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1022         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1023         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1024         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1025         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1026         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1027         {0xa0, 0x58, ZC3XX_R10E_RGB11},
1028         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1029         {0xa0, 0xf4, ZC3XX_R110_RGB20},
1030         {0xa0, 0xf4, ZC3XX_R111_RGB21},
1031         {0xa0, 0x58, ZC3XX_R112_RGB22},
1032         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1033         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1034         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1035         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1036         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1037         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1038         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1039         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1040         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1041         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1042         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1043         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1044         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1045         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1046         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1047         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1048         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1049         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1050         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1051         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1052         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1053         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1054         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1055         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1056         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1057         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1058         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1059         {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1060         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1061         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1062         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1063         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1064         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1065         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1066         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1067         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1068         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1069         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1070         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1071         {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1072         {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1073         {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1074         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1075         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1076         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1077         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1078         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1079         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1080         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1081         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1082         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1083         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1084         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1085         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1086         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1087         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1088         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1089         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1090         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1091         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1092         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1093         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1094         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1095         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1096         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1097         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1098         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1099         {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
1100         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1101         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1102         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1103         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1104         {0xa0, 0x0A, ZC3XX_R092_I2CADDRESSSELECT},
1105         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1106         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1107         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1108         {0xa0, 0x0B, ZC3XX_R092_I2CADDRESSSELECT},
1109         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1110         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1111         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1112         {0xa0, 0x0C, ZC3XX_R092_I2CADDRESSSELECT},
1113         {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
1114         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1115         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1116         {0xa0, 0x0D, ZC3XX_R092_I2CADDRESSSELECT},
1117         {0xa0, 0xA3, ZC3XX_R093_I2CSETVALUE},
1118         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1119         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1120         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
1121         {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
1122         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1123         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1124         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
1125         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1126         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1127         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1128         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
1129         {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
1130         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1131         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1132         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
1133         {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
1134         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1135         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1136         {0xa0, 0x0E, ZC3XX_R092_I2CADDRESSSELECT},
1137         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1138         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1139         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1140         {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
1141         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1142         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1143         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1144         {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
1145         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1146         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1147         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1148         {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
1149         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1150         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1151         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1152         {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
1153         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1154         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1155         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1156         {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
1157         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1158         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1159         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1160         {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
1161         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1162         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1163         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1164         {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
1165         {0xa0, 0x0C, ZC3XX_R093_I2CSETVALUE},
1166         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1167         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1168         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1169         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1170         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1171         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1172         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1173         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1174         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
1175         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1176         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1177         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1178         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1179         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1180         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1181         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1182         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1183         {0xa0, 0x00, 0x01ad},
1184         {0xa0, 0x01, 0x01b1},
1185         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1186         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1187         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1188         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1189         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1190         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1191         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1192         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
1193         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1194         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1195         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1196         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1197         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1198         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1199         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1200         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1201         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1202         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1203         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1204         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1205         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1206         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1207         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1208         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1209         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1210         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1211         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1212         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1213         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1214         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1215         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1216         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1217         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1218         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1219         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1220         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1221         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1222         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1223         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1224         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1225         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1226         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1227         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1228         {0xa0, 0x58, ZC3XX_R10E_RGB11},
1229         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1230         {0xa0, 0xf4, ZC3XX_R110_RGB20},
1231         {0xa0, 0xf4, ZC3XX_R111_RGB21},
1232         {0xa0, 0x58, ZC3XX_R112_RGB22},
1233         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1234         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1235         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1236         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1237         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1238         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1239         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1240         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1241         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1242         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1243         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1244         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1245         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1246         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1247         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1248         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1249         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1250         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1251         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1252         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1253         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1254         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1255         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1256         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1257         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1258         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1259         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1260         {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1261         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1262         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1263         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1264         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1265         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1266         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1267         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1268         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1269         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1270         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1271         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1272         {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1273         {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1274         {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1275         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1276         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1277         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1278         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1279         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1280         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1281         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1282         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1283         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1284         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1285         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1286         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1287         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1288         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1289         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1290         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1291         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1292         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1293         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1294         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1295         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1296         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1297         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1298         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1299         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1300         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1301         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1302         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1303         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1304         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1305         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1306         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1307         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1308         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1309         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1310         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1311         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1312         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1313         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1314         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1315         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1316         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1317         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1318         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1319         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1320         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1321         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1322         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1323         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1324         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1325         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1326         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1327         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1328         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1329         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1330         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1331         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1332         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1333         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1334         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1335         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1336         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1337         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1338         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1339         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1340         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1341         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1342         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1343         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1344         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1345         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1346         {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1347         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1348         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1349         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1350         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1351         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1352         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1353         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1354         {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1355         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1356         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1357         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1358         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1359         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1360         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1361         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1362         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1363         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1364         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1365         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1366         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
1367         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1368         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1369         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1370         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1371         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1372         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1373         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1374         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1375         {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1376         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1377         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1378         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1379         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1380         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1381         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1382         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1383         {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1384         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1385         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1386         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1387         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1388         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1389         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1390         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1391         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1392         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1393         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1394         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1395         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1396         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1397         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1398         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1399         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1400         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1401         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1402         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1403         {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1404         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1405         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1406         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1407         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1408         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1409         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1410         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1411         {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1412         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1413         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1414         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1415         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1416         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1417         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1418         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1419         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1420         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1421         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1422         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1423         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1424         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1425         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1426         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1427         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1428         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1429         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1430         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1431         {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1432         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1433         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1434         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1435         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1436         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1437         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1438         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1439         {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1440         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1441         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1442         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1443         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1444         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1445         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1446         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1447         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1448         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1449         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1450         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1451         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1452         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1453         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1454         {}
1455 };
1456
1457 static const struct usb_action gc0305_Initial[] = {     /* 640x480 */
1458         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1459         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,03,cc */
1460         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
1461         {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},   /* 00,02,04,cc */
1462         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
1463         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1464         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
1465         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc */
1466         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
1467         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
1468         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
1469         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
1470         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
1471         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
1472         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
1473         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e6,cc */
1474         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,86,cc */
1475         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
1476         {0xaa, 0x13, 0x0002},   /* 00,13,02,aa */
1477         {0xaa, 0x15, 0x0003},   /* 00,15,03,aa */
1478         {0xaa, 0x01, 0x0000},   /* 00,01,00,aa */
1479         {0xaa, 0x02, 0x0000},   /* 00,02,00,aa */
1480         {0xaa, 0x1a, 0x0000},   /* 00,1a,00,aa */
1481         {0xaa, 0x1c, 0x0017},   /* 00,1c,17,aa */
1482         {0xaa, 0x1d, 0x0080},   /* 00,1d,80,aa */
1483         {0xaa, 0x1f, 0x0008},   /* 00,1f,08,aa */
1484         {0xaa, 0x21, 0x0012},   /* 00,21,12,aa */
1485         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc */
1486         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc */
1487         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc */
1488         {0xaa, 0x05, 0x0000},   /* 00,05,00,aa */
1489         {0xaa, 0x0a, 0x0000},   /* 00,0a,00,aa */
1490         {0xaa, 0x0b, 0x00b0},   /* 00,0b,b0,aa */
1491         {0xaa, 0x0c, 0x0000},   /* 00,0c,00,aa */
1492         {0xaa, 0x0d, 0x00b0},   /* 00,0d,b0,aa */
1493         {0xaa, 0x0e, 0x0000},   /* 00,0e,00,aa */
1494         {0xaa, 0x0f, 0x00b0},   /* 00,0f,b0,aa */
1495         {0xaa, 0x10, 0x0000},   /* 00,10,00,aa */
1496         {0xaa, 0x11, 0x00b0},   /* 00,11,b0,aa */
1497         {0xaa, 0x16, 0x0001},   /* 00,16,01,aa */
1498         {0xaa, 0x17, 0x00e6},   /* 00,17,e6,aa */
1499         {0xaa, 0x18, 0x0002},   /* 00,18,02,aa */
1500         {0xaa, 0x19, 0x0086},   /* 00,19,86,aa */
1501         {0xaa, 0x20, 0x0000},   /* 00,20,00,aa */
1502         {0xaa, 0x1b, 0x0020},   /* 00,1b,20,aa */
1503         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc */
1504         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc */
1505         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1506         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},     /* 01,89,76,cc */
1507         {0xa0, 0x09, 0x01ad},   /* 01,ad,09,cc */
1508         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1509         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
1510         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
1511         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
1512         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,60,cc */
1513         {0xa0, 0x85, ZC3XX_R18D_YTARGET},       /* 01,8d,85,cc */
1514         {0xa0, 0x00, 0x011e},   /* 01,1e,00,cc */
1515         {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1516         {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1517         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1518         {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
1519         {}
1520 };
1521 static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
1522         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1523         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,03,cc */
1524         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
1525         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},   /* 00,02,10,cc */
1526         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
1527         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1528         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
1529         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc */
1530         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
1531         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
1532         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
1533         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
1534         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
1535         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
1536         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
1537         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e8,cc */
1538         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,88,cc */
1539         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
1540         {0xaa, 0x13, 0x0000},   /* 00,13,00,aa */
1541         {0xaa, 0x15, 0x0001},   /* 00,15,01,aa */
1542         {0xaa, 0x01, 0x0000},   /* 00,01,00,aa */
1543         {0xaa, 0x02, 0x0000},   /* 00,02,00,aa */
1544         {0xaa, 0x1a, 0x0000},   /* 00,1a,00,aa */
1545         {0xaa, 0x1c, 0x0017},   /* 00,1c,17,aa */
1546         {0xaa, 0x1d, 0x0080},   /* 00,1d,80,aa */
1547         {0xaa, 0x1f, 0x0008},   /* 00,1f,08,aa */
1548         {0xaa, 0x21, 0x0012},   /* 00,21,12,aa */
1549         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc */
1550         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc */
1551         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc */
1552         {0xaa, 0x05, 0x0000},   /* 00,05,00,aa */
1553         {0xaa, 0x0a, 0x0000},   /* 00,0a,00,aa */
1554         {0xaa, 0x0b, 0x00b0},   /* 00,0b,b0,aa */
1555         {0xaa, 0x0c, 0x0000},   /* 00,0c,00,aa */
1556         {0xaa, 0x0d, 0x00b0},   /* 00,0d,b0,aa */
1557         {0xaa, 0x0e, 0x0000},   /* 00,0e,00,aa */
1558         {0xaa, 0x0f, 0x00b0},   /* 00,0f,b0,aa */
1559         {0xaa, 0x10, 0x0000},   /* 00,10,00,aa */
1560         {0xaa, 0x11, 0x00b0},   /* 00,11,b0,aa */
1561         {0xaa, 0x16, 0x0001},   /* 00,16,01,aa */
1562         {0xaa, 0x17, 0x00e8},   /* 00,17,e8,aa */
1563         {0xaa, 0x18, 0x0002},   /* 00,18,02,aa */
1564         {0xaa, 0x19, 0x0088},   /* 00,19,88,aa */
1565         {0xaa, 0x20, 0x0000},   /* 00,20,00,aa */
1566         {0xaa, 0x1b, 0x0020},   /* 00,1b,20,aa */
1567         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc */
1568         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc */
1569         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1570         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},     /* 01,89,76,cc */
1571         {0xa0, 0x09, 0x01ad},   /* 01,ad,09,cc */
1572         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1573         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
1574         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
1575         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
1576         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,60,cc */
1577         {0xa0, 0x00, 0x011e},   /* 01,1e,00,cc */
1578         {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1579         {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1580         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1581         {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
1582         {}
1583 };
1584 static const struct usb_action gc0305_50HZ[] = {
1585         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1586         {0xaa, 0x83, 0x0002},   /* 00,83,02,aa */
1587         {0xaa, 0x84, 0x0038},   /* 00,84,38,aa */       /* win: 00,84,ec */
1588         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1589         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc */
1590         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,18,cc */
1591                                                         /* win: 01,92,10 */
1592         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1593         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1594         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,8e,cc */
1595                                                         /* win: 01,97,ec */
1596         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1597         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1598         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc */
1599         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
1600         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1601         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1602         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1603         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1604         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1605         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
1606 /*      {0xa0, 0x85, ZC3XX_R18D_YTARGET},        * 01,8d,85,cc *
1607                                                  * if 640x480 */
1608         {}
1609 };
1610 static const struct usb_action gc0305_60HZ[] = {
1611         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1612         {0xaa, 0x83, 0x0000},   /* 00,83,00,aa */
1613         {0xaa, 0x84, 0x00ec},   /* 00,84,ec,aa */
1614         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1615         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc */
1616         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,10,cc */
1617         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1618         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1619         {0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,ec,cc */
1620         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1621         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1622         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc */
1623         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
1624         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1625         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1626         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1627         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1628         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1629         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
1630         {0xa0, 0x80, ZC3XX_R18D_YTARGET},       /* 01,8d,80,cc */
1631         {}
1632 };
1633
1634 static const struct usb_action gc0305_NoFliker[] = {
1635         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
1636         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1637         {0xaa, 0x83, 0x0000},   /* 00,83,00,aa */
1638         {0xaa, 0x84, 0x0020},   /* 00,84,20,aa */
1639         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1640         {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,00,cc */
1641         {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,48,cc */
1642         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1643         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1644         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc */
1645         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1646         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1647         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1648         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1649         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1650         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1651         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1652         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
1653         {0xa0, 0x80, ZC3XX_R18D_YTARGET},       /* 01,8d,80,cc */
1654         {}
1655 };
1656
1657 /* play poker with registers at your own risk !! */
1658 static const struct usb_action hdcs2020xx_Initial[] = {
1659         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1660         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1661         {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},
1662         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1663         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1664         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1665         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1666         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},
1667                                                 /* D0 ?? E0 did not start */
1668         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1669         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1670         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1671         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
1672         {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW},
1673         {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
1674         {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW},
1675         {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
1676         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
1677         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
1678         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
1679         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1680         {0xaa, 0x02, 0x0002},
1681         {0xaa, 0x07, 0x0006},
1682         {0xaa, 0x08, 0x0002},
1683         {0xaa, 0x09, 0x0006},
1684         {0xaa, 0x0a, 0x0001},
1685         {0xaa, 0x0b, 0x0001},
1686         {0xaa, 0x0c, 0x0008},
1687         {0xaa, 0x0d, 0x0000},
1688         {0xaa, 0x10, 0x0000},
1689         {0xaa, 0x12, 0x0005},
1690         {0xaa, 0x13, 0x0063},
1691         {0xaa, 0x15, 0x0070},
1692         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
1693         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1694         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1695         {0xa0, 0x00, 0x01ad},
1696         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1697         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1698         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1699         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1700         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1701         {0xa1, 0x01, 0x0002},
1702         {0xa1, 0x01, 0x0008},
1703         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1704         {0xa0, 0x04, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1705         {0xa1, 0x01, 0x01c8},
1706         {0xa1, 0x01, 0x01c9},
1707         {0xa1, 0x01, 0x01ca},
1708         {0xa0, 0x07, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1709         {0xa0, 0x11, ZC3XX_R120_GAMMA00},       /* gamma ~4 */
1710         {0xa0, 0x37, ZC3XX_R121_GAMMA01},
1711         {0xa0, 0x58, ZC3XX_R122_GAMMA02},
1712         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1713         {0xa0, 0x91, ZC3XX_R124_GAMMA04},
1714         {0xa0, 0xa6, ZC3XX_R125_GAMMA05},
1715         {0xa0, 0xb8, ZC3XX_R126_GAMMA06},
1716         {0xa0, 0xc7, ZC3XX_R127_GAMMA07},
1717         {0xa0, 0xd3, ZC3XX_R128_GAMMA08},
1718         {0xa0, 0xde, ZC3XX_R129_GAMMA09},
1719         {0xa0, 0xe6, ZC3XX_R12A_GAMMA0A},
1720         {0xa0, 0xed, ZC3XX_R12B_GAMMA0B},
1721         {0xa0, 0xf3, ZC3XX_R12C_GAMMA0C},
1722         {0xa0, 0xf8, ZC3XX_R12D_GAMMA0D},
1723         {0xa0, 0xfb, ZC3XX_R12E_GAMMA0E},
1724         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1725         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1726         {0xa0, 0x23, ZC3XX_R131_GAMMA11},
1727         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1728         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1729         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1730         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1731         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1732         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1733         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1734         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1735         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1736         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1737         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1738         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1739         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1740         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1741
1742         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
1743         {0xa0, 0xf5, ZC3XX_R10B_RGB01},
1744         {0xa0, 0xff, ZC3XX_R10C_RGB02},
1745         {0xa0, 0xf9, ZC3XX_R10D_RGB10},
1746         {0xa0, 0x51, ZC3XX_R10E_RGB11},
1747         {0xa0, 0xf5, ZC3XX_R10F_RGB12},
1748         {0xa0, 0xfb, ZC3XX_R110_RGB20},
1749         {0xa0, 0xed, ZC3XX_R111_RGB21},
1750         {0xa0, 0x5f, ZC3XX_R112_RGB22},
1751
1752         {0xa1, 0x01, 0x0180},
1753         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1754         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1755         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1756         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1757         {0xaa, 0x20, 0x0004},
1758         {0xaa, 0x21, 0x003d},
1759         {0xaa, 0x03, 0x0041},
1760         {0xaa, 0x04, 0x0010},
1761         {0xaa, 0x05, 0x003d},
1762         {0xaa, 0x0e, 0x0001},
1763         {0xaa, 0x0f, 0x0000},
1764         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
1765         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
1766         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1767         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
1768         {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
1769         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1770         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1771         {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW},
1772         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1773         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1774         {0xa0, 0x41, ZC3XX_R01D_HSYNC_0},
1775         {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},
1776         {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},
1777         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
1778         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},
1779         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},
1780         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
1781         {0xa1, 0x01, 0x0195},
1782         {0xa1, 0x01, 0x0196},
1783         {0xa1, 0x01, 0x0197},
1784         {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
1785         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
1786         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1787         {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1788         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1789         {0xa0, 0x85, ZC3XX_R118_BGAIN},
1790         {0xa1, 0x01, 0x0116},
1791         {0xa1, 0x01, 0x0118},
1792         {0xa1, 0x01, 0x0180},
1793         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1794         {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1795         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1796         {0xa0, 0x85, ZC3XX_R118_BGAIN},
1797         {0xa1, 0x01, 0x0116},
1798         {0xa1, 0x01, 0x0118},
1799 /*      {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, */
1800         {0xa0, 0x00, 0x0007},
1801         {}
1802 };
1803
1804 static const struct usb_action hdcs2020xx_InitialScale[] = {
1805         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1806         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1807         {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},
1808         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1809         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1810         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1811         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1812         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1813         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1814         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1815         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1816         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
1817         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1818         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
1819         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1820         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
1821         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
1822         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
1823         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
1824         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
1825         {0xaa, 0x02, 0x0002},
1826         {0xaa, 0x07, 0x0006},
1827         {0xaa, 0x08, 0x0002},
1828         {0xaa, 0x09, 0x0006},
1829         {0xaa, 0x0a, 0x0001},
1830         {0xaa, 0x0b, 0x0001},
1831         {0xaa, 0x0c, 0x0008},
1832         {0xaa, 0x0d, 0x0000},
1833         {0xaa, 0x10, 0x0000},
1834         {0xaa, 0x12, 0x0005},
1835         {0xaa, 0x13, 0x0063},
1836         {0xaa, 0x15, 0x0070},
1837         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1838         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1839         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1840         {0xa0, 0x00, 0x01ad},
1841         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1842         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1843         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1844         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1845         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1846         {0xa1, 0x01, 0x0002},
1847         {0xa1, 0x01, 0x0008},
1848         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1849         {0xa0, 0x04, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1850         {0xa1, 0x01, 0x01c8},
1851         {0xa1, 0x01, 0x01c9},
1852         {0xa1, 0x01, 0x01ca},
1853         {0xa0, 0x07, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1854         {0xa0, 0x11, ZC3XX_R120_GAMMA00},       /* gamma ~4*/
1855         {0xa0, 0x37, ZC3XX_R121_GAMMA01},
1856         {0xa0, 0x58, ZC3XX_R122_GAMMA02},
1857         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1858         {0xa0, 0x91, ZC3XX_R124_GAMMA04},
1859         {0xa0, 0xa6, ZC3XX_R125_GAMMA05},
1860         {0xa0, 0xb8, ZC3XX_R126_GAMMA06},
1861         {0xa0, 0xc7, ZC3XX_R127_GAMMA07},
1862         {0xa0, 0xd3, ZC3XX_R128_GAMMA08},
1863         {0xa0, 0xde, ZC3XX_R129_GAMMA09},
1864         {0xa0, 0xe6, ZC3XX_R12A_GAMMA0A},
1865         {0xa0, 0xed, ZC3XX_R12B_GAMMA0B},
1866         {0xa0, 0xf3, ZC3XX_R12C_GAMMA0C},
1867         {0xa0, 0xf8, ZC3XX_R12D_GAMMA0D},
1868         {0xa0, 0xfb, ZC3XX_R12E_GAMMA0E},
1869         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1870         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1871         {0xa0, 0x23, ZC3XX_R131_GAMMA11},
1872         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1873         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1874         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1875         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1876         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1877         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1878         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1879         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1880         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1881         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1882         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1883         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1884         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1885         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1886         {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
1887         {0xa0, 0xff, ZC3XX_R10B_RGB01},
1888         {0xa0, 0xff, ZC3XX_R10C_RGB02},
1889         {0xa0, 0xff, ZC3XX_R10D_RGB10},
1890         {0xa0, 0x60, ZC3XX_R10E_RGB11},
1891         {0xa0, 0xff, ZC3XX_R10F_RGB12},
1892         {0xa0, 0xff, ZC3XX_R110_RGB20},
1893         {0xa0, 0xff, ZC3XX_R111_RGB21},
1894         {0xa0, 0x60, ZC3XX_R112_RGB22},
1895
1896         {0xa1, 0x01, 0x0180},
1897         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1898         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1899         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1900         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1901         {0xaa, 0x20, 0x0002},
1902         {0xaa, 0x21, 0x001b},
1903         {0xaa, 0x03, 0x0044},
1904         {0xaa, 0x04, 0x0008},
1905         {0xaa, 0x05, 0x001b},
1906         {0xaa, 0x0e, 0x0001},
1907         {0xaa, 0x0f, 0x0000},
1908         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
1909         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
1910         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1911         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1912         {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
1913         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1914         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1915         {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW},
1916         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1917         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1918         {0xa0, 0x44, ZC3XX_R01D_HSYNC_0},
1919         {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},
1920         {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},
1921         {0xa0, 0xeb, ZC3XX_R020_HSYNC_3},
1922         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},
1923         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},
1924         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
1925         {0xa1, 0x01, 0x0195},
1926         {0xa1, 0x01, 0x0196},
1927         {0xa1, 0x01, 0x0197},
1928         {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
1929         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1930         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1931         {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1932         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1933         {0xa0, 0x99, ZC3XX_R118_BGAIN},
1934         {0xa1, 0x01, 0x0116},
1935         {0xa1, 0x01, 0x0118},
1936         {0xa1, 0x01, 0x0180},
1937         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1938         {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1939         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1940         {0xa0, 0x99, ZC3XX_R118_BGAIN},
1941 /*      {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, */
1942         {0xa0, 0x00, 0x0007},
1943 /*      {0xa0, 0x18, 0x00fe}, */
1944         {}
1945 };
1946 static const struct usb_action hdcs2020xb_Initial[] = {
1947         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1948         {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1949         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* qtable 0x05 */
1950         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1951         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1952         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1953         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1954         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1955         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1956         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1957         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1958         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1959         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1960         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1961         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1962         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1963         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1964         {0xaa, 0x1c, 0x0000},
1965         {0xaa, 0x0a, 0x0001},
1966         {0xaa, 0x0b, 0x0006},
1967         {0xaa, 0x0c, 0x007b},
1968         {0xaa, 0x0d, 0x00a7},
1969         {0xaa, 0x03, 0x00fb},
1970         {0xaa, 0x05, 0x0000},
1971         {0xaa, 0x06, 0x0003},
1972         {0xaa, 0x09, 0x0008},
1973
1974         {0xaa, 0x0f, 0x0018},   /* set sensor gain */
1975         {0xaa, 0x10, 0x0018},
1976         {0xaa, 0x11, 0x0018},
1977         {0xaa, 0x12, 0x0018},
1978
1979         {0xaa, 0x15, 0x004e},
1980         {0xaa, 0x1c, 0x0004},
1981         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1982         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1983         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1984         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1985         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1986         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1987         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1988         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1989         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1990         {0xa1, 0x01, 0x0002},
1991         {0xa1, 0x01, 0x0008},
1992         {0xa1, 0x01, 0x0180},
1993         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1994         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1995         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1996         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1997         {0xa1, 0x01, 0x0008},
1998         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1999         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2000         {0xa1, 0x01, 0x01c8},
2001         {0xa1, 0x01, 0x01c9},
2002         {0xa1, 0x01, 0x01ca},
2003         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2004         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
2005         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
2006         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
2007         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
2008         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
2009         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
2010         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
2011         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
2012         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
2013         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
2014         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
2015         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
2016         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
2017         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
2018         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
2019         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
2020         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
2021         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
2022         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
2023         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
2024         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
2025         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
2026         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
2027         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
2028         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
2029         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
2030         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
2031         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
2032         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
2033         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
2034         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
2035         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
2036
2037         {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
2038         {0xa0, 0xed, ZC3XX_R10B_RGB01},
2039         {0xa0, 0xed, ZC3XX_R10C_RGB02},
2040         {0xa0, 0xed, ZC3XX_R10D_RGB10},
2041         {0xa0, 0x66, ZC3XX_R10E_RGB11},
2042         {0xa0, 0xed, ZC3XX_R10F_RGB12},
2043         {0xa0, 0xed, ZC3XX_R110_RGB20},
2044         {0xa0, 0xed, ZC3XX_R111_RGB21},
2045         {0xa0, 0x66, ZC3XX_R112_RGB22},
2046
2047         {0xa1, 0x01, 0x0180},
2048         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2049         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2050         {0xaa, 0x13, 0x0031},
2051         {0xaa, 0x14, 0x0001},
2052         {0xaa, 0x0e, 0x0004},
2053         {0xaa, 0x19, 0x00cd},
2054         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2055         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
2056         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
2057         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2058         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2059         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
2060         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2061         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2062
2063         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 0x14 */
2064         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
2065         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
2066         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
2067         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
2068         {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
2069         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
2070         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2071         {0xa1, 0x01, 0x0180},
2072         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2073         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2074         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2075         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2076         {}
2077 };
2078 static const struct usb_action hdcs2020xb_InitialScale[] = {
2079         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2080         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2081         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2082         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
2083         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2084         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2085         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2086         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2087         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2088         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2089         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2090         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2091         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2092         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2093         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2094         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2095         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2096         {0xaa, 0x1c, 0x0000},
2097         {0xaa, 0x0a, 0x0001},
2098         {0xaa, 0x0b, 0x0006},
2099         {0xaa, 0x0c, 0x007a},
2100         {0xaa, 0x0d, 0x00a7},
2101         {0xaa, 0x03, 0x00fb},
2102         {0xaa, 0x05, 0x0000},
2103         {0xaa, 0x06, 0x0003},
2104         {0xaa, 0x09, 0x0008},
2105         {0xaa, 0x0f, 0x0018},   /* original setting */
2106         {0xaa, 0x10, 0x0018},
2107         {0xaa, 0x11, 0x0018},
2108         {0xaa, 0x12, 0x0018},
2109         {0xaa, 0x15, 0x004e},
2110         {0xaa, 0x1c, 0x0004},
2111         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
2112         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2113         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
2114         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2115         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2116         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2117         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2118         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2119         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2120         {0xa1, 0x01, 0x0002},
2121         {0xa1, 0x01, 0x0008},
2122         {0xa1, 0x01, 0x0180},
2123         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2124         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2125         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2126         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2127         {0xa1, 0x01, 0x0008},
2128         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2129         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2130         {0xa1, 0x01, 0x01c8},
2131         {0xa1, 0x01, 0x01c9},
2132         {0xa1, 0x01, 0x01ca},
2133         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2134         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
2135         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
2136         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
2137         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
2138         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
2139         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
2140         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
2141         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
2142         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
2143         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
2144         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
2145         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
2146         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
2147         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
2148         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
2149         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
2150         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
2151         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
2152         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
2153         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
2154         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
2155         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
2156         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
2157         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
2158         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
2159         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
2160         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
2161         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
2162         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
2163         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
2164         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
2165         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
2166         {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
2167         {0xa0, 0xed, ZC3XX_R10B_RGB01},
2168         {0xa0, 0xed, ZC3XX_R10C_RGB02},
2169         {0xa0, 0xed, ZC3XX_R10D_RGB10},
2170         {0xa0, 0x66, ZC3XX_R10E_RGB11},
2171         {0xa0, 0xed, ZC3XX_R10F_RGB12},
2172         {0xa0, 0xed, ZC3XX_R110_RGB20},
2173         {0xa0, 0xed, ZC3XX_R111_RGB21},
2174         {0xa0, 0x66, ZC3XX_R112_RGB22},
2175         {0xa1, 0x01, 0x0180},
2176         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2177         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2178  /**** set exposure ***/
2179         {0xaa, 0x13, 0x0031},
2180         {0xaa, 0x14, 0x0001},
2181         {0xaa, 0x0e, 0x0004},
2182         {0xaa, 0x19, 0x00cd},
2183         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2184         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
2185         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
2186         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2187         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2188         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
2189         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2190         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2191         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
2192         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
2193         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
2194         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
2195         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
2196         {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
2197         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
2198         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2199         {0xa1, 0x01, 0x0180},
2200         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2201         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2202         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2203         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2204         {}
2205 };
2206 static const struct usb_action hdcs2020b_50HZ[] = {
2207         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2208         {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
2209         {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2210         {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */
2211         {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */
2212         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2213         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2214         {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
2215         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2216         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2217         {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
2218         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2219         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2220         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
2221         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
2222         {0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
2223         {0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
2224         {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
2225         {}
2226 };
2227 static const struct usb_action hdcs2020b_60HZ[] = {
2228         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2229         {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
2230         {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2231         {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
2232         {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */
2233         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2234         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2235         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
2236         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2237         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2238         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
2239         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2240         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2241         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
2242         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
2243         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
2244         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
2245         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
2246         {}
2247 };
2248 static const struct usb_action hdcs2020b_NoFliker[] = {
2249         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2250         {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
2251         {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2252         {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
2253         {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */
2254         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2255         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2256         {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
2257         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2258         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2259         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2260         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2261         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2262         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2263         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2264         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
2265         {0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
2266         {0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
2267         {}
2268 };
2269
2270 static const struct usb_action hv7131bxx_Initial[] = {
2271         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2272         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2273         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
2274         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2275         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2276         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
2277         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2278         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2279         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2280         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2281         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2282         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2283         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2284         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2285         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2286         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2287         {0xaa, 0x30, 0x002d},
2288         {0xaa, 0x01, 0x0005},
2289         {0xaa, 0x11, 0x0000},
2290         {0xaa, 0x13, 0x0001},   /* {0xaa, 0x13, 0x0000}, */
2291         {0xaa, 0x14, 0x0001},
2292         {0xaa, 0x15, 0x00e8},
2293         {0xaa, 0x16, 0x0002},
2294         {0xaa, 0x17, 0x0086},
2295         {0xaa, 0x31, 0x0038},
2296         {0xaa, 0x32, 0x0038},
2297         {0xaa, 0x33, 0x0038},
2298         {0xaa, 0x5b, 0x0001},
2299         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2300         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2301         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2302         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
2303         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2304         {0xa0, 0x00, 0x01ad},
2305         {0xa0, 0xc0, 0x019b},
2306         {0xa0, 0xa0, 0x019c},
2307         {0xa0, 0x02, ZC3XX_R188_MINGAIN},
2308         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2309         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2310         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2311         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2312         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2313         {0xaa, 0x02, 0x0080},   /* {0xaa, 0x02, 0x0090}; */
2314         {0xa1, 0x01, 0x0002},
2315         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2316         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2317         {0xa1, 0x01, 0x0091},
2318         {0xa1, 0x01, 0x0095},
2319         {0xa1, 0x01, 0x0096},
2320
2321         {0xa1, 0x01, 0x0008},
2322         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2323         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2324         {0xa1, 0x01, 0x01c8},
2325         {0xa1, 0x01, 0x01c9},
2326         {0xa1, 0x01, 0x01ca},
2327         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2328
2329         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
2330         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
2331         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
2332         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
2333         {0xa0, 0x50, ZC3XX_R10E_RGB11},
2334         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
2335         {0xa0, 0xf8, ZC3XX_R110_RGB20},
2336         {0xa0, 0xf8, ZC3XX_R111_RGB21},
2337         {0xa0, 0x50, ZC3XX_R112_RGB22},
2338         {0xa1, 0x01, 0x0180},
2339         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2340         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2341         {0xaa, 0x25, 0x0007},
2342         {0xaa, 0x26, 0x00a1},
2343         {0xaa, 0x27, 0x0020},
2344         {0xaa, 0x20, 0x0000},
2345         {0xaa, 0x21, 0x00a0},
2346         {0xaa, 0x22, 0x0016},
2347         {0xaa, 0x23, 0x0040},
2348
2349         {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 2F */
2350         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 4d */
2351         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},
2352         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2353         {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},
2354         {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},
2355         {0xa0, 0x07, ZC3XX_R18C_AEFREEZE},
2356         {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},
2357         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},
2358         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
2359         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2360         {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},
2361         {0xa0, 0x16, ZC3XX_R01F_HSYNC_2},
2362         {0xa0, 0x40, ZC3XX_R020_HSYNC_3},
2363         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
2364         {0xa1, 0x01, 0x001d},
2365         {0xa1, 0x01, 0x001e},
2366         {0xa1, 0x01, 0x001f},
2367         {0xa1, 0x01, 0x0020},
2368         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2369         {0xa1, 0x01, 0x0180},
2370         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2371         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2372         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2373         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2374 /*      {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, */
2375         {}
2376 };
2377
2378 static const struct usb_action hv7131bxx_InitialScale[] = {
2379         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2380         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2381         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
2382         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2383         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2384         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
2385         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2386         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2387         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2388         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2389         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2390         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2391         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2392         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2393         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2394         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2395         {0xaa, 0x30, 0x002d},
2396         {0xaa, 0x01, 0x0005},
2397         {0xaa, 0x11, 0x0001},
2398         {0xaa, 0x13, 0x0000},   /* {0xaa, 0x13, 0x0001}; */
2399         {0xaa, 0x14, 0x0001},
2400         {0xaa, 0x15, 0x00e6},
2401         {0xaa, 0x16, 0x0002},
2402         {0xaa, 0x17, 0x0086},
2403         {0xaa, 0x31, 0x0038},
2404         {0xaa, 0x32, 0x0038},
2405         {0xaa, 0x33, 0x0038},
2406         {0xaa, 0x5b, 0x0001},
2407         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2408         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2409         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2410         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
2411         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2412         {0xa0, 0x00, 0x01ad},
2413         {0xa0, 0xc0, 0x019b},
2414         {0xa0, 0xa0, 0x019c},
2415         {0xa0, 0x02, ZC3XX_R188_MINGAIN},
2416         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2417         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2418         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2419         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2420         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2421         {0xaa, 0x02, 0x0090},   /* {0xaa, 0x02, 0x0080}, */
2422         {0xa1, 0x01, 0x0002},
2423         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2424         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2425         {0xa1, 0x01, 0x0091},
2426         {0xa1, 0x01, 0x0095},
2427         {0xa1, 0x01, 0x0096},
2428         {0xa1, 0x01, 0x0008},
2429         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2430         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2431         {0xa1, 0x01, 0x01c8},
2432         {0xa1, 0x01, 0x01c9},
2433         {0xa1, 0x01, 0x01ca},
2434         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2435
2436         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
2437         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
2438         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
2439         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
2440         {0xa0, 0x50, ZC3XX_R10E_RGB11},
2441         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
2442         {0xa0, 0xf8, ZC3XX_R110_RGB20},
2443         {0xa0, 0xf8, ZC3XX_R111_RGB21},
2444         {0xa0, 0x50, ZC3XX_R112_RGB22},
2445         {0xa1, 0x01, 0x0180},
2446         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2447         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2448         {0xaa, 0x25, 0x0007},
2449         {0xaa, 0x26, 0x00a1},
2450         {0xaa, 0x27, 0x0020},
2451         {0xaa, 0x20, 0x0000},
2452         {0xaa, 0x21, 0x0040},
2453         {0xaa, 0x22, 0x0013},
2454         {0xaa, 0x23, 0x004c},
2455         {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 2f */
2456         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 4d */
2457         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 60 */
2458         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2459         {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},
2460         {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},
2461         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2462         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2463         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},
2464         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
2465         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2466         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
2467         {0xa0, 0x13, ZC3XX_R01F_HSYNC_2},
2468         {0xa0, 0x4c, ZC3XX_R020_HSYNC_3},
2469         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
2470         {0xa1, 0x01, 0x001d},
2471         {0xa1, 0x01, 0x001e},
2472         {0xa1, 0x01, 0x001f},
2473         {0xa1, 0x01, 0x0020},
2474         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2475         {0xa1, 0x01, 0x0180},
2476         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2477         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2478         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2479         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2480 /*      {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, */
2481         {}
2482 };
2483
2484 static const struct usb_action hv7131cxx_Initial[] = {
2485         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2486         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2487         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2488         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2489         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2490         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2491         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2492         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2493         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2494         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2495         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2496         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2497         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2498         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2499         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2500         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2501         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2502         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2503         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2504         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2505         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2506         {0xaa, 0x01, 0x000c},
2507         {0xaa, 0x11, 0x0000},
2508         {0xaa, 0x13, 0x0000},
2509         {0xaa, 0x14, 0x0001},
2510         {0xaa, 0x15, 0x00e8},
2511         {0xaa, 0x16, 0x0002},
2512         {0xaa, 0x17, 0x0088},
2513
2514         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2515         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2516         {0xa0, 0x89, ZC3XX_R18D_YTARGET},
2517         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2518         {0xa0, 0x00, 0x01ad},
2519         {0xa0, 0xc0, 0x019b},
2520         {0xa0, 0xa0, 0x019c},
2521         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2522         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2523         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2524         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2525         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2526         {0xa1, 0x01, 0x0002},
2527         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2528         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2529         {0xa1, 0x01, 0x0091},
2530         {0xa1, 0x01, 0x0095},
2531         {0xa1, 0x01, 0x0096},
2532
2533         {0xa1, 0x01, 0x0008},
2534         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2535         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2536         {0xa1, 0x01, 0x01c8},
2537         {0xa1, 0x01, 0x01c9},
2538         {0xa1, 0x01, 0x01ca},
2539         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2540
2541         {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
2542         {0xa0, 0xf0, ZC3XX_R10B_RGB01},
2543         {0xa0, 0xf0, ZC3XX_R10C_RGB02},
2544         {0xa0, 0xf0, ZC3XX_R10D_RGB10},
2545         {0xa0, 0x60, ZC3XX_R10E_RGB11},
2546         {0xa0, 0xf0, ZC3XX_R10F_RGB12},
2547         {0xa0, 0xf0, ZC3XX_R110_RGB20},
2548         {0xa0, 0xf0, ZC3XX_R111_RGB21},
2549         {0xa0, 0x60, ZC3XX_R112_RGB22},
2550         {0xa1, 0x01, 0x0180},
2551         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2552         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2553         {0xaa, 0x25, 0x0007},
2554         {0xaa, 0x26, 0x0053},
2555         {0xaa, 0x27, 0x0000},
2556
2557         {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 2f */
2558         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 9b */
2559         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 80 */
2560         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2561         {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2562         {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2563         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2564         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2565         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2566         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2567         {0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
2568         {0xa1, 0x01, 0x001d},
2569         {0xa1, 0x01, 0x001e},
2570         {0xa1, 0x01, 0x001f},
2571         {0xa1, 0x01, 0x0020},
2572         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2573         {0xa1, 0x01, 0x0180},
2574         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2575         {}
2576 };
2577
2578 static const struct usb_action hv7131cxx_InitialScale[] = {
2579         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2580
2581         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* diff */
2582         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2583         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2584         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2585         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2586
2587         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2588         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2589
2590         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2591         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2592         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2593         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 1e0 */
2594
2595         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2596         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2597         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2598         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2599         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2600         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2601         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2602         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2603         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2604         {0xaa, 0x01, 0x000c},
2605         {0xaa, 0x11, 0x0000},
2606         {0xaa, 0x13, 0x0000},
2607         {0xaa, 0x14, 0x0001},
2608         {0xaa, 0x15, 0x00e8},
2609         {0xaa, 0x16, 0x0002},
2610         {0xaa, 0x17, 0x0088},
2611
2612         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00 */
2613
2614         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2615         {0xa0, 0x89, ZC3XX_R18D_YTARGET},
2616         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2617         {0xa0, 0x00, 0x01ad},
2618         {0xa0, 0xc0, 0x019b},
2619         {0xa0, 0xa0, 0x019c},
2620         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2621         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2622         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2623         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2624         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2625         {0xa1, 0x01, 0x0002},
2626         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2627                                                 /* read the i2c chips ident */
2628         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2629         {0xa1, 0x01, 0x0091},
2630         {0xa1, 0x01, 0x0095},
2631         {0xa1, 0x01, 0x0096},
2632
2633         {0xa1, 0x01, 0x0008},
2634         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2635         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2636         {0xa1, 0x01, 0x01c8},
2637         {0xa1, 0x01, 0x01c9},
2638         {0xa1, 0x01, 0x01ca},
2639         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2640
2641         {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
2642         {0xa0, 0xf0, ZC3XX_R10B_RGB01},
2643         {0xa0, 0xf0, ZC3XX_R10C_RGB02},
2644         {0xa0, 0xf0, ZC3XX_R10D_RGB10},
2645         {0xa0, 0x60, ZC3XX_R10E_RGB11},
2646         {0xa0, 0xf0, ZC3XX_R10F_RGB12},
2647         {0xa0, 0xf0, ZC3XX_R110_RGB20},
2648         {0xa0, 0xf0, ZC3XX_R111_RGB21},
2649         {0xa0, 0x60, ZC3XX_R112_RGB22},
2650         {0xa1, 0x01, 0x0180},
2651         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2652         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2653         {0xaa, 0x25, 0x0007},
2654         {0xaa, 0x26, 0x0053},
2655         {0xaa, 0x27, 0x0000},
2656
2657         {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 2f */
2658         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 9b */
2659         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 80 */
2660
2661         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2662         {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2663         {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2664
2665         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2666         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2667         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2668         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2669         {0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
2670         {0xa1, 0x01, 0x001d},
2671         {0xa1, 0x01, 0x001e},
2672         {0xa1, 0x01, 0x001f},
2673         {0xa1, 0x01, 0x0020},
2674         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2675         {0xa1, 0x01, 0x0180},
2676         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2677         {}
2678 };
2679
2680 static const struct usb_action icm105axx_Initial[] = {
2681         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2682         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2683         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2684         {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2685         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2686         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2687         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2688         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2689         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2690         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2691         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2692         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2693         {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2694         {0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
2695         {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2696         {0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
2697         {0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
2698         {0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
2699         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2700         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2701         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2702         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2703         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2704         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2705         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2706         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2707         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2708         {0xaa, 0x01, 0x0010},
2709         {0xaa, 0x03, 0x0000},
2710         {0xaa, 0x04, 0x0001},
2711         {0xaa, 0x05, 0x0020},
2712         {0xaa, 0x06, 0x0001},
2713         {0xaa, 0x08, 0x0000},
2714         {0xaa, 0x03, 0x0001},
2715         {0xaa, 0x04, 0x0011},
2716         {0xaa, 0x05, 0x00a0},
2717         {0xaa, 0x06, 0x0001},
2718         {0xaa, 0x08, 0x0000},
2719         {0xaa, 0x03, 0x0002},
2720         {0xaa, 0x04, 0x0013},
2721         {0xaa, 0x05, 0x0020},
2722         {0xaa, 0x06, 0x0001},
2723         {0xaa, 0x08, 0x0000},
2724         {0xaa, 0x03, 0x0003},
2725         {0xaa, 0x04, 0x0015},
2726         {0xaa, 0x05, 0x0020},
2727         {0xaa, 0x06, 0x0005},
2728         {0xaa, 0x08, 0x0000},
2729         {0xaa, 0x03, 0x0004},
2730         {0xaa, 0x04, 0x0017},
2731         {0xaa, 0x05, 0x0020},
2732         {0xaa, 0x06, 0x000d},
2733         {0xaa, 0x08, 0x0000},
2734         {0xaa, 0x03, 0x0005},
2735         {0xaa, 0x04, 0x0019},
2736         {0xaa, 0x05, 0x0020},
2737         {0xaa, 0x06, 0x0005},
2738         {0xaa, 0x08, 0x0000},
2739         {0xaa, 0x03, 0x0006},
2740         {0xaa, 0x04, 0x0017},
2741         {0xaa, 0x05, 0x0026},
2742         {0xaa, 0x06, 0x0005},
2743         {0xaa, 0x08, 0x0000},
2744         {0xaa, 0x03, 0x0007},
2745         {0xaa, 0x04, 0x0019},
2746         {0xaa, 0x05, 0x0022},
2747         {0xaa, 0x06, 0x0005},
2748         {0xaa, 0x08, 0x0000},
2749         {0xaa, 0x03, 0x0008},
2750         {0xaa, 0x04, 0x0021},
2751         {0xaa, 0x05, 0x00aa},
2752         {0xaa, 0x06, 0x0005},
2753         {0xaa, 0x08, 0x0000},
2754         {0xaa, 0x03, 0x0009},
2755         {0xaa, 0x04, 0x0023},
2756         {0xaa, 0x05, 0x00aa},
2757         {0xaa, 0x06, 0x000d},
2758         {0xaa, 0x08, 0x0000},
2759         {0xaa, 0x03, 0x000a},
2760         {0xaa, 0x04, 0x0025},
2761         {0xaa, 0x05, 0x00aa},
2762         {0xaa, 0x06, 0x0005},
2763         {0xaa, 0x08, 0x0000},
2764         {0xaa, 0x03, 0x000b},
2765         {0xaa, 0x04, 0x00ec},
2766         {0xaa, 0x05, 0x002e},
2767         {0xaa, 0x06, 0x0005},
2768         {0xaa, 0x08, 0x0000},
2769         {0xaa, 0x03, 0x000c},
2770         {0xaa, 0x04, 0x00fa},
2771         {0xaa, 0x05, 0x002a},
2772         {0xaa, 0x06, 0x0005},
2773         {0xaa, 0x08, 0x0000},
2774         {0xaa, 0x07, 0x000d},
2775         {0xaa, 0x01, 0x0005},
2776         {0xaa, 0x94, 0x0002},
2777         {0xaa, 0x90, 0x0000},
2778         {0xaa, 0x91, 0x001f},
2779         {0xaa, 0x10, 0x0064},
2780         {0xaa, 0x9b, 0x00f0},
2781         {0xaa, 0x9c, 0x0002},
2782         {0xaa, 0x14, 0x001a},
2783         {0xaa, 0x20, 0x0080},
2784         {0xaa, 0x22, 0x0080},
2785         {0xaa, 0x24, 0x0080},
2786         {0xaa, 0x26, 0x0080},
2787         {0xaa, 0x00, 0x0084},
2788         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2789         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2790         {0xaa, 0xa8, 0x00c0},
2791         {0xa1, 0x01, 0x0002},
2792         {0xa1, 0x01, 0x0008},
2793         {0xa1, 0x01, 0x0180},
2794         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2795         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2796         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2797         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2798         {0xa1, 0x01, 0x0008},
2799
2800         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2801         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2802         {0xa1, 0x01, 0x01c8},
2803         {0xa1, 0x01, 0x01c9},
2804         {0xa1, 0x01, 0x01ca},
2805         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2806         {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2807         {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2808         {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2809         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2810         {0xa0, 0x52, ZC3XX_R10E_RGB11},
2811         {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2812         {0xa0, 0xf7, ZC3XX_R110_RGB20},
2813         {0xa0, 0xf7, ZC3XX_R111_RGB21},
2814         {0xa0, 0x52, ZC3XX_R112_RGB22},
2815         {0xa1, 0x01, 0x0180},
2816         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2817         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2818         {0xaa, 0x0d, 0x0003},
2819         {0xaa, 0x0c, 0x008c},
2820         {0xaa, 0x0e, 0x0095},
2821         {0xaa, 0x0f, 0x0002},
2822         {0xaa, 0x1c, 0x0094},
2823         {0xaa, 0x1d, 0x0002},
2824         {0xaa, 0x20, 0x0080},
2825         {0xaa, 0x22, 0x0080},
2826         {0xaa, 0x24, 0x0080},
2827         {0xaa, 0x26, 0x0080},
2828         {0xaa, 0x00, 0x0084},
2829         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2830         {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
2831         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2832         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2833         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
2834         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2835         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2836         {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
2837         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2838         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2839         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2840         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2841         {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
2842         {0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
2843         {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
2844         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2845         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2846         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
2847         {0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
2848         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2849         {0xa1, 0x01, 0x0180},
2850         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2851         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2852         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2853         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2854         {}
2855 };
2856
2857 static const struct usb_action icm105axx_InitialScale[] = {
2858         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2859         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2860         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2861         {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2862         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2863         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2864         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2865         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2866         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2867         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2868         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2869         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2870         {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2871         {0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
2872         {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2873         {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
2874         {0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
2875         {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
2876         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2877         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2878         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2879         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2880         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2881         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2882         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2883         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2884         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2885         {0xaa, 0x01, 0x0010},
2886         {0xaa, 0x03, 0x0000},
2887         {0xaa, 0x04, 0x0001},
2888         {0xaa, 0x05, 0x0020},
2889         {0xaa, 0x06, 0x0001},
2890         {0xaa, 0x08, 0x0000},
2891         {0xaa, 0x03, 0x0001},
2892         {0xaa, 0x04, 0x0011},
2893         {0xaa, 0x05, 0x00a0},
2894         {0xaa, 0x06, 0x0001},
2895         {0xaa, 0x08, 0x0000},
2896         {0xaa, 0x03, 0x0002},
2897         {0xaa, 0x04, 0x0013},
2898         {0xaa, 0x05, 0x0020},
2899         {0xaa, 0x06, 0x0001},
2900         {0xaa, 0x08, 0x0000},
2901         {0xaa, 0x03, 0x0003},
2902         {0xaa, 0x04, 0x0015},
2903         {0xaa, 0x05, 0x0020},
2904         {0xaa, 0x06, 0x0005},
2905         {0xaa, 0x08, 0x0000},
2906         {0xaa, 0x03, 0x0004},
2907         {0xaa, 0x04, 0x0017},
2908         {0xaa, 0x05, 0x0020},
2909         {0xaa, 0x06, 0x000d},
2910         {0xaa, 0x08, 0x0000},
2911         {0xaa, 0x03, 0x0005},
2912         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
2913         {0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
2914         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
2915         {0xa1, 0x01, 0x0091},
2916         {0xaa, 0x05, 0x0020},
2917         {0xaa, 0x06, 0x0005},
2918         {0xaa, 0x08, 0x0000},
2919         {0xaa, 0x03, 0x0006},
2920         {0xaa, 0x04, 0x0017},
2921         {0xaa, 0x05, 0x0026},
2922         {0xaa, 0x06, 0x0005},
2923         {0xaa, 0x08, 0x0000},
2924         {0xaa, 0x03, 0x0007},
2925         {0xaa, 0x04, 0x0019},
2926         {0xaa, 0x05, 0x0022},
2927         {0xaa, 0x06, 0x0005},
2928         {0xaa, 0x08, 0x0000},
2929         {0xaa, 0x03, 0x0008},
2930         {0xaa, 0x04, 0x0021},
2931         {0xaa, 0x05, 0x00aa},
2932         {0xaa, 0x06, 0x0005},
2933         {0xaa, 0x08, 0x0000},
2934         {0xaa, 0x03, 0x0009},
2935         {0xaa, 0x04, 0x0023},
2936         {0xaa, 0x05, 0x00aa},
2937         {0xaa, 0x06, 0x000d},
2938         {0xaa, 0x08, 0x0000},
2939         {0xaa, 0x03, 0x000a},
2940         {0xaa, 0x04, 0x0025},
2941         {0xaa, 0x05, 0x00aa},
2942         {0xaa, 0x06, 0x0005},
2943         {0xaa, 0x08, 0x0000},
2944         {0xaa, 0x03, 0x000b},
2945         {0xaa, 0x04, 0x00ec},
2946         {0xaa, 0x05, 0x002e},
2947         {0xaa, 0x06, 0x0005},
2948         {0xaa, 0x08, 0x0000},
2949         {0xaa, 0x03, 0x000c},
2950         {0xaa, 0x04, 0x00fa},
2951         {0xaa, 0x05, 0x002a},
2952         {0xaa, 0x06, 0x0005},
2953         {0xaa, 0x08, 0x0000},
2954         {0xaa, 0x07, 0x000d},
2955         {0xaa, 0x01, 0x0005},
2956         {0xaa, 0x94, 0x0002},
2957         {0xaa, 0x90, 0x0000},
2958         {0xaa, 0x91, 0x0010},
2959         {0xaa, 0x10, 0x0064},
2960         {0xaa, 0x9b, 0x00f0},
2961         {0xaa, 0x9c, 0x0002},
2962         {0xaa, 0x14, 0x001a},
2963         {0xaa, 0x20, 0x0080},
2964         {0xaa, 0x22, 0x0080},
2965         {0xaa, 0x24, 0x0080},
2966         {0xaa, 0x26, 0x0080},
2967         {0xaa, 0x00, 0x0084},
2968         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2969         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2970         {0xaa, 0xa8, 0x0080},
2971         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
2972         {0xa1, 0x01, 0x0002},
2973         {0xa1, 0x01, 0x0008},
2974         {0xa1, 0x01, 0x0180},
2975         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2976         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2977         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2978         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2979         {0xa1, 0x01, 0x0008},
2980
2981         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2982         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2983         {0xa1, 0x01, 0x01c8},
2984         {0xa1, 0x01, 0x01c9},
2985         {0xa1, 0x01, 0x01ca},
2986         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2987
2988         {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2989         {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2990         {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2991         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2992         {0xa0, 0x52, ZC3XX_R10E_RGB11},
2993         {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2994         {0xa0, 0xf7, ZC3XX_R110_RGB20},
2995         {0xa0, 0xf7, ZC3XX_R111_RGB21},
2996         {0xa0, 0x52, ZC3XX_R112_RGB22},
2997         {0xa1, 0x01, 0x0180},
2998         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2999         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
3000         {0xaa, 0x0d, 0x0003},
3001         {0xaa, 0x0c, 0x0020},
3002         {0xaa, 0x0e, 0x000e},
3003         {0xaa, 0x0f, 0x0002},
3004         {0xaa, 0x1c, 0x000d},
3005         {0xaa, 0x1d, 0x0002},
3006         {0xaa, 0x20, 0x0080},
3007         {0xaa, 0x22, 0x0080},
3008         {0xaa, 0x24, 0x0080},
3009         {0xaa, 0x26, 0x0080},
3010         {0xaa, 0x00, 0x0084},
3011         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
3012         {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
3013         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3014         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
3015         {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
3016         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3017         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3018         {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
3019         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3020         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3021         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3022         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
3023         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
3024         {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
3025         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
3026         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
3027         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
3028         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3029         {0xa1, 0x01, 0x0180},
3030         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3031         {0xa0, 0x40, ZC3XX_R116_RGAIN},
3032         {0xa0, 0x40, ZC3XX_R117_GGAIN},
3033         {0xa0, 0x40, ZC3XX_R118_BGAIN},
3034         {}
3035 };
3036 static const struct usb_action icm105a_50HZ[] = {
3037         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3038         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3039         {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
3040         {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
3041         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3042         {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
3043         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3044         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3045         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3046         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3047         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3048         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3049         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3050         {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
3051         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3052         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3053         {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
3054         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3055         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3056         {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
3057         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3058         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3059         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
3060         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
3061         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
3062         {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
3063         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
3064         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3065         {}
3066 };
3067 static const struct usb_action icm105a_50HZScale[] = {
3068         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3069         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3070         {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
3071         {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
3072         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3073         {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
3074         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3075         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3076         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3077         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3078         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3079         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3080         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3081         {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
3082         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3083         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3084         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
3085         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3086         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3087         {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
3088         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3089         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3090         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
3091         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
3092         {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
3093         {0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
3094         {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
3095         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3096         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
3097         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
3098         {}
3099 };
3100 static const struct usb_action icm105a_60HZ[] = {
3101         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3102         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3103         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3104         {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
3105         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3106         {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
3107         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3108         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3109         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3110         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3111         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3112         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3113         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3114         {0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
3115         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3116         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3117         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
3118         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3119         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3120         {0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
3121         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3122         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3123         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
3124         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
3125         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
3126         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
3127         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
3128         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3129         {}
3130 };
3131 static const struct usb_action icm105a_60HZScale[] = {
3132         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3133         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3134         {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
3135         {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
3136         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3137         {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
3138         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3139         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3140         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3141         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3142         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3143         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3144         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3145         {0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
3146         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3147         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3148         {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
3149         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3150         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3151         {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
3152         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3153         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3154         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
3155         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
3156         {0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
3157         {0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
3158         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
3159         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3160         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
3161         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
3162         {}
3163 };
3164 static const struct usb_action icm105a_NoFliker[] = {
3165         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3166         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3167         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3168         {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
3169         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3170         {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
3171         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3172         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3173         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3174         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3175         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3176         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3177         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3178         {0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
3179         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3180         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3181         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
3182         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3183         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3184         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
3185         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3186         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3187         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
3188         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
3189         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
3190         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
3191         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
3192         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3193         {}
3194 };
3195 static const struct usb_action icm105a_NoFlikerScale[] = {
3196         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3197         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3198         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3199         {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
3200         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3201         {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
3202         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3203         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3204         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3205         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3206         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3207         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
3208         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3209         {0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
3210         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3211         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3212         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
3213         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3214         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3215         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
3216         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3217         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3218         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
3219         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
3220         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
3221         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
3222         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
3223         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3224         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
3225         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
3226         {}
3227 };
3228
3229 static const struct usb_action MC501CB_InitialScale[] = {
3230         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3231         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
3232         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
3233         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3234         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
3235         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3236         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3237         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3238         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3239         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3240         {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3241         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3242         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3243         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3244         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3245         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3246         {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3247         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3248         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3249         {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
3250         {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
3251         {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
3252         {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
3253         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3254         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3255         {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3256         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3257         {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3258         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3259         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3260         {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3261         {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3262         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3263         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3264         {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3265         {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3266         {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
3267         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3268         {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
3269         {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3270         {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3271         {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3272         {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3273         {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3274         {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3275         {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3276         {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3277         {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3278         {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3279         {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3280         {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3281         {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3282         {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3283         {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3284         {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3285         {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3286         {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3287         {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3288         {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3289         {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
3290         {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3291         {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3292         {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3293         {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3294         {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3295         {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3296         {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3297         {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3298         {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3299         {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3300         {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3301         {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3302         {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3303         {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3304         {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3305         {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3306         {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3307         {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3308         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3309         {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3310         {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3311         {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3312         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3313         {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
3314         {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3315         {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
3316         {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
3317         {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
3318         {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
3319         {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3320         {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3321         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3322         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3323         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3324         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3325         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3326         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3327         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3328         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3329         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3330         {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3331         {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
3332         {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
3333         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3334         {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3335         {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3336         {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3337         {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3338         {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3339         {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3340
3341         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3342         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3343         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3344         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3345         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3346         {}
3347 };
3348
3349 static const struct usb_action MC501CB_Initial[] = {     /* 320x240 */
3350         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3351         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
3352         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
3353         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3354         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
3355         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3356         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3357         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3358         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3359         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3360         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3361         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3362         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3363         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3364         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3365         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3366         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
3367         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3368         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
3369         {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
3370         {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
3371         {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
3372         {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
3373         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3374         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3375         {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3376         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3377         {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3378         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3379         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3380         {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3381         {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3382         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3383         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3384         {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3385         {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3386         {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
3387         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3388         {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
3389         {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3390         {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3391         {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3392         {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3393         {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3394         {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3395         {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3396         {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3397         {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3398         {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3399         {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3400         {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3401         {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3402         {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3403         {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3404         {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3405         {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3406         {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3407         {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3408         {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3409         {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
3410         {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3411         {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3412         {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3413         {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3414         {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3415         {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3416         {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3417         {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3418         {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3419         {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3420         {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3421         {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3422         {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3423         {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3424         {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3425         {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3426         {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3427         {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3428         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3429         {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3430         {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3431         {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3432         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3433         {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
3434         {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3435         {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
3436         {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
3437         {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
3438         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3439         {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3440         {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3441         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3442         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3443         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3444         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3445         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3446         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3447         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3448         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3449         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3450         {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3451         {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
3452         {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
3453         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3454         {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3455         {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3456         {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3457         {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3458         {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3459         {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3460         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3461         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3462         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3463         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3464         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3465         {}
3466 };
3467
3468 static const struct usb_action MC501CB_50HZ[] = {
3469         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3470         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3471         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3472         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3473         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3474         {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
3475         {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
3476         {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
3477         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3478         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3479         {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3480         {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3481         {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3482         {}
3483 };
3484
3485 static const struct usb_action MC501CB_50HZScale[] = {
3486         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3487         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3488         {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3489         {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3490         {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3491         {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
3492         {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
3493         {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
3494         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3495         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3496         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3497         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3498         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3499         {}
3500 };
3501
3502 static const struct usb_action MC501CB_60HZ[] = {
3503         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3504         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3505         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3506         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3507         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3508         {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3509         {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3510         {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3511         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3512         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3513         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3514         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3515         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3516         {}
3517 };
3518
3519 static const struct usb_action MC501CB_60HZScale[] = {
3520         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3521         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3522         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3523         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3524         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3525         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3526         {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3527         {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3528         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3529         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3530         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3531         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3532         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3533         {}
3534 };
3535
3536 static const struct usb_action MC501CB_NoFliker[] = {
3537         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3538         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3539         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3540         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3541         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3542         {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3543         {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3544         {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3545         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3546         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3547         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3548         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3549         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3550         {}
3551 };
3552
3553 static const struct usb_action MC501CB_NoFlikerScale[] = {
3554         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3555         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3556         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3557         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3558         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3559         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3560         {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3561         {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3562         {}
3563 };
3564
3565 /* from zs211.inf - HKR,%OV7620%,Initial - 640x480 */
3566 static const struct usb_action OV7620_mode0[] = {
3567         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3568         {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
3569         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3570         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3571         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3572         {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3573         {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3574         {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3575         {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3576         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3577         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3578         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3579         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3580         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3581         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3582         {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3583         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3584         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3585         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3586         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3587         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3588         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3589         {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3590         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3591         {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3592         {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3593         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3594         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3595         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3596         {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3597         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3598         {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3599         {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3600         {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3601         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3602         {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3603         {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3604         {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3605         {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3606         {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3607         {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3608         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3609         {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3610         {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3611         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3612         {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3613         {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3614         {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3615         {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3616         {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3617         {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3618         {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3619         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3620         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3621         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3622         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3623         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3624         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3625         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3626         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3627         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3628         {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3629         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3630         {0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
3631         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3632         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
3633         {}
3634 };
3635
3636 /* from zs211.inf - HKR,%OV7620%,InitialScale - 320x240 */
3637 static const struct usb_action OV7620_mode1[] = {
3638         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3639         {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},   /* 00,02,50,cc */
3640         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,00,cc */
3641                                                 /* mx change? */
3642         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3643         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3644         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},     /* 00,83,02,cc */
3645         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},     /* 00,85,01,cc */
3646         {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,80,cc */
3647         {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID},    /* 00,87,81,cc */
3648         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},    /* 00,88,10,cc */
3649         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3650         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3651         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3652         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3653         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3654         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3655         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3656         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3657         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
3658         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
3659         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
3660         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
3661         {0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,d6,cc */
3662                                                 /* OV7648 00,9c,d8,cc */
3663         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,88,cc */
3664         {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3665         {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3666         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3667         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3668         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3669         {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3670         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3671         {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3672         {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3673         {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3674         {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3675         {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3676         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3677         {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3678         {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3679         {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3680         {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3681         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3682         {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3683         {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3684         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3685         {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3686         {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3687         {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3688         {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3689         {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3690         {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3691         {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3692         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3693         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3694         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3695         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},     /* 01,89,06,cc */
3696         {0xa0, 0x00, 0x01ad},                   /* 01,ad,00,cc */
3697         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3698         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
3699         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3700         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
3701         {0xa0, 0x68, ZC3XX_R116_RGAIN},         /* 01,16,68,cc */
3702         {0xa0, 0x52, ZC3XX_R118_BGAIN},         /* 01,18,52,cc */
3703         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,50,cc */
3704         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3705         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,50,cc */
3706         {}
3707 };
3708
3709 /* from zs211.inf - HKR,%OV7620%\AE,50HZ */
3710 static const struct usb_action OV7620_50HZ[] = {
3711         {0xaa, 0x13, 0x00a3},   /* 00,13,a3,aa */
3712         {0xdd, 0x00, 0x0100},   /* 00,01,00,dd */
3713         {0xaa, 0x2b, 0x0096},   /* 00,2b,96,aa */
3714         {0xaa, 0x75, 0x008a},   /* 00,75,8a,aa */
3715         {0xaa, 0x2d, 0x0005},   /* 00,2d,05,aa */
3716         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
3717         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,04,cc */
3718         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,18,cc */
3719         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
3720         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
3721         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,83,cc */
3722         {0xaa, 0x10, 0x0082},                           /* 00,10,82,aa */
3723         {0xaa, 0x76, 0x0003},                           /* 00,76,03,aa */
3724 /*      {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},            * 00,02,40,cc
3725                                                          if mode0 (640x480) */
3726         {}
3727 };
3728
3729 /* from zs211.inf - HKR,%OV7620%\AE,60HZ */
3730 static const struct usb_action OV7620_60HZ[] = {
3731         {0xaa, 0x13, 0x00a3},                   /* 00,13,a3,aa */
3732                                                 /* (bug in zs211.inf) */
3733         {0xdd, 0x00, 0x0100},                   /* 00,01,00,dd */
3734         {0xaa, 0x2b, 0x0000},                   /* 00,2b,00,aa */
3735         {0xaa, 0x75, 0x008a},                   /* 00,75,8a,aa */
3736         {0xaa, 0x2d, 0x0005},                   /* 00,2d,05,aa */
3737         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3738         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3739         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3740         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3741         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3742         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3743         {0xaa, 0x10, 0x0020},                   /* 00,10,20,aa */
3744         {0xaa, 0x76, 0x0003},                   /* 00,76,03,aa */
3745 /*      {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},    * 00,02,40,cc
3746                                                  * if mode0 (640x480) */
3747 /* ?? in gspca v1, it was
3748         {0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3749         {0xa1, 0x01, 0x0037},           */
3750         {}
3751 };
3752
3753 /* from zs211.inf - HKR,%OV7620%\AE,NoFliker */
3754 static const struct usb_action OV7620_NoFliker[] = {
3755         {0xaa, 0x13, 0x00a3},                   /* 00,13,a3,aa */
3756                                                 /* (bug in zs211.inf) */
3757         {0xdd, 0x00, 0x0100},                   /* 00,01,00,dd */
3758         {0xaa, 0x2b, 0x0000},                   /* 00,2b,00,aa */
3759         {0xaa, 0x75, 0x008e},                   /* 00,75,8e,aa */
3760         {0xaa, 0x2d, 0x0001},                   /* 00,2d,01,aa */
3761         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3762         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3763         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3764         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3765         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3766         {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
3767 /*      {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT},    * 00,02,44,cc
3768                                                  - if mode1 (320x240) */
3769 /* ?? was
3770         {0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3771         {0xa1, 0x01, 0x0037},           */
3772         {}
3773 };
3774
3775 static const struct usb_action ov7630c_Initial[] = {
3776         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3777         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3778         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3779         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3780         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3781         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3782         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3783         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3784         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3785         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3786         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3787         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3788         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3789         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3790         {0xaa, 0x12, 0x0080},
3791         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3792         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3793         {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3794         {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3795         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3796         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3797         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3798         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3799         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3800         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
3801         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
3802         {0xaa, 0x12, 0x0069},
3803         {0xaa, 0x04, 0x0020},
3804         {0xaa, 0x06, 0x0050},
3805         {0xaa, 0x13, 0x0083},
3806         {0xaa, 0x14, 0x0000},
3807         {0xaa, 0x15, 0x0024},
3808         {0xaa, 0x17, 0x0018},
3809         {0xaa, 0x18, 0x00ba},
3810         {0xaa, 0x19, 0x0002},
3811         {0xaa, 0x1a, 0x00f6},
3812         {0xaa, 0x1b, 0x0002},
3813         {0xaa, 0x20, 0x00c2},
3814         {0xaa, 0x24, 0x0060},
3815         {0xaa, 0x25, 0x0040},
3816         {0xaa, 0x26, 0x0030},
3817         {0xaa, 0x27, 0x00ea},
3818         {0xaa, 0x28, 0x00a0},
3819         {0xaa, 0x21, 0x0000},
3820         {0xaa, 0x2a, 0x0081},
3821         {0xaa, 0x2b, 0x0096},
3822         {0xaa, 0x2d, 0x0094},
3823         {0xaa, 0x2f, 0x003d},
3824         {0xaa, 0x30, 0x0024},
3825         {0xaa, 0x60, 0x0000},
3826         {0xaa, 0x61, 0x0040},
3827         {0xaa, 0x68, 0x007c},
3828         {0xaa, 0x6f, 0x0015},
3829         {0xaa, 0x75, 0x0088},
3830         {0xaa, 0x77, 0x00b5},
3831         {0xaa, 0x01, 0x0060},
3832         {0xaa, 0x02, 0x0060},
3833         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3834         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3835         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3836         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3837         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3838         {0xa0, 0x00, 0x01ad},
3839         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3840         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3841         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3842         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3843         {0xa0, 0x60, ZC3XX_R116_RGAIN},
3844         {0xa0, 0x46, ZC3XX_R118_BGAIN},
3845         {0xa0, 0x04, ZC3XX_R113_RGB03},
3846 /* 0x10, */
3847         {0xa1, 0x01, 0x0002},
3848         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3849         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3850         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3851         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3852         {0xa0, 0x50, ZC3XX_R10E_RGB11},
3853         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3854         {0xa0, 0xf8, ZC3XX_R110_RGB20},
3855         {0xa0, 0xf8, ZC3XX_R111_RGB21},
3856         {0xa0, 0x50, ZC3XX_R112_RGB22},
3857 /* 0x03, */
3858         {0xa1, 0x01, 0x0008},
3859         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
3860         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
3861         {0xa1, 0x01, 0x01c8},
3862         {0xa1, 0x01, 0x01c9},
3863         {0xa1, 0x01, 0x01ca},
3864         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
3865         {0xa0, 0x01, ZC3XX_R120_GAMMA00},       /* gamma 2 ?*/
3866         {0xa0, 0x0c, ZC3XX_R121_GAMMA01},
3867         {0xa0, 0x1f, ZC3XX_R122_GAMMA02},
3868         {0xa0, 0x3a, ZC3XX_R123_GAMMA03},
3869         {0xa0, 0x53, ZC3XX_R124_GAMMA04},
3870         {0xa0, 0x6d, ZC3XX_R125_GAMMA05},
3871         {0xa0, 0x85, ZC3XX_R126_GAMMA06},
3872         {0xa0, 0x9c, ZC3XX_R127_GAMMA07},
3873         {0xa0, 0xb0, ZC3XX_R128_GAMMA08},
3874         {0xa0, 0xc2, ZC3XX_R129_GAMMA09},
3875         {0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
3876         {0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
3877         {0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
3878         {0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
3879         {0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
3880         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3881         {0xa0, 0x05, ZC3XX_R130_GAMMA10},
3882         {0xa0, 0x0f, ZC3XX_R131_GAMMA11},
3883         {0xa0, 0x16, ZC3XX_R132_GAMMA12},
3884         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
3885         {0xa0, 0x19, ZC3XX_R134_GAMMA14},
3886         {0xa0, 0x19, ZC3XX_R135_GAMMA15},
3887         {0xa0, 0x17, ZC3XX_R136_GAMMA16},
3888         {0xa0, 0x15, ZC3XX_R137_GAMMA17},
3889         {0xa0, 0x12, ZC3XX_R138_GAMMA18},
3890         {0xa0, 0x10, ZC3XX_R139_GAMMA19},
3891         {0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
3892         {0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
3893         {0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
3894         {0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
3895         {0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
3896         {0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
3897         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3898         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3899         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3900         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3901         {0xa0, 0x50, ZC3XX_R10E_RGB11},
3902         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3903         {0xa0, 0xf8, ZC3XX_R110_RGB20},
3904         {0xa0, 0xf8, ZC3XX_R111_RGB21},
3905         {0xa0, 0x50, ZC3XX_R112_RGB22},
3906
3907         {0xa1, 0x01, 0x0180},
3908         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3909         {0xaa, 0x10, 0x001b},
3910         {0xaa, 0x76, 0x0002},
3911         {0xaa, 0x2a, 0x0081},
3912         {0xaa, 0x2b, 0x0000},
3913         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3914         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
3915         {0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
3916         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3917         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3918         {0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
3919         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3920         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3921         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3922         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3923         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3924         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3925         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3926         {0xaa, 0x13, 0x0083},   /* 40 */
3927         {0xa1, 0x01, 0x0180},
3928         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3929         {}
3930 };
3931
3932 static const struct usb_action ov7630c_InitialScale[] = {
3933         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3934         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
3935         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3936         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3937         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3938         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3939         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3940         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3941         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3942         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3943         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3944         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3945
3946         {0xaa, 0x12, 0x0080},
3947         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3948         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3949         {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3950         {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3951         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3952         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3953         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3954         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3955         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3956         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
3957         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
3958         {0xaa, 0x12, 0x0069},   /* i2c */
3959         {0xaa, 0x04, 0x0020},
3960         {0xaa, 0x06, 0x0050},
3961         {0xaa, 0x13, 0x00c3},
3962         {0xaa, 0x14, 0x0000},
3963         {0xaa, 0x15, 0x0024},
3964         {0xaa, 0x19, 0x0003},
3965         {0xaa, 0x1a, 0x00f6},
3966         {0xaa, 0x1b, 0x0002},
3967         {0xaa, 0x20, 0x00c2},
3968         {0xaa, 0x24, 0x0060},
3969         {0xaa, 0x25, 0x0040},
3970         {0xaa, 0x26, 0x0030},
3971         {0xaa, 0x27, 0x00ea},
3972         {0xaa, 0x28, 0x00a0},
3973         {0xaa, 0x21, 0x0000},
3974         {0xaa, 0x2a, 0x0081},
3975         {0xaa, 0x2b, 0x0096},
3976         {0xaa, 0x2d, 0x0084},
3977         {0xaa, 0x2f, 0x003d},
3978         {0xaa, 0x30, 0x0024},
3979         {0xaa, 0x60, 0x0000},
3980         {0xaa, 0x61, 0x0040},
3981         {0xaa, 0x68, 0x007c},
3982         {0xaa, 0x6f, 0x0015},
3983         {0xaa, 0x75, 0x0088},
3984         {0xaa, 0x77, 0x00b5},
3985         {0xaa, 0x01, 0x0060},
3986         {0xaa, 0x02, 0x0060},
3987         {0xaa, 0x17, 0x0018},
3988         {0xaa, 0x18, 0x00ba},
3989         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3990         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3991         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3992         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3993         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3994         {0xa0, 0x00, 0x01ad},
3995         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3996         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3997         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3998         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3999         {0xa0, 0x60, ZC3XX_R116_RGAIN},
4000         {0xa0, 0x46, ZC3XX_R118_BGAIN},
4001         {0xa0, 0x04, ZC3XX_R113_RGB03},
4002
4003         {0xa1, 0x01, 0x0002},
4004         {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
4005         {0xa0, 0xfe, ZC3XX_R10B_RGB01},
4006         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4007         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
4008         {0xa0, 0x4d, ZC3XX_R10E_RGB11},
4009         {0xa0, 0xfc, ZC3XX_R10F_RGB12},
4010         {0xa0, 0x00, ZC3XX_R110_RGB20},
4011         {0xa0, 0xf6, ZC3XX_R111_RGB21},
4012         {0xa0, 0x4a, ZC3XX_R112_RGB22},
4013
4014         {0xa1, 0x01, 0x0008},
4015         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4016         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4017         {0xa1, 0x01, 0x01c8},
4018         {0xa1, 0x01, 0x01c9},
4019         {0xa1, 0x01, 0x01ca},
4020         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4021         {0xa0, 0x16, ZC3XX_R120_GAMMA00},       /* gamma ~4 */
4022         {0xa0, 0x3a, ZC3XX_R121_GAMMA01},
4023         {0xa0, 0x5b, ZC3XX_R122_GAMMA02},
4024         {0xa0, 0x7c, ZC3XX_R123_GAMMA03},
4025         {0xa0, 0x94, ZC3XX_R124_GAMMA04},
4026         {0xa0, 0xa9, ZC3XX_R125_GAMMA05},
4027         {0xa0, 0xbb, ZC3XX_R126_GAMMA06},
4028         {0xa0, 0xca, ZC3XX_R127_GAMMA07},
4029         {0xa0, 0xd7, ZC3XX_R128_GAMMA08},
4030         {0xa0, 0xe1, ZC3XX_R129_GAMMA09},
4031         {0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
4032         {0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
4033         {0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
4034         {0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
4035         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
4036         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4037         {0xa0, 0x20, ZC3XX_R130_GAMMA10},
4038         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4039         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4040         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4041         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4042         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4043         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4044         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4045         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4046         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4047         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4048         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4049         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4050         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4051         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
4052         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
4053         {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
4054         {0xa0, 0xfe, ZC3XX_R10B_RGB01},
4055         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4056         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
4057         {0xa0, 0x4d, ZC3XX_R10E_RGB11},
4058         {0xa0, 0xfc, ZC3XX_R10F_RGB12},
4059         {0xa0, 0x00, ZC3XX_R110_RGB20},
4060         {0xa0, 0xf6, ZC3XX_R111_RGB21},
4061         {0xa0, 0x4a, ZC3XX_R112_RGB22},
4062
4063         {0xa1, 0x01, 0x0180},
4064         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4065         {0xaa, 0x10, 0x000d},
4066         {0xaa, 0x76, 0x0002},
4067         {0xaa, 0x2a, 0x0081},
4068         {0xaa, 0x2b, 0x0000},
4069         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4070         {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
4071         {0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
4072         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4073         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4074         {0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
4075         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4076         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4077         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
4078         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
4079         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
4080         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
4081         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4082         {0xaa, 0x13, 0x00c3},
4083
4084         {0xa1, 0x01, 0x0180},
4085         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4086         {}
4087 };
4088
4089 static const struct usb_action pas106b_Initial_com[] = {
4090 /* Sream and Sensor specific */
4091         {0xa1, 0x01, 0x0010},   /* CMOSSensorSelect */
4092 /* System */
4093         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
4094         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
4095 /* Picture size */
4096         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* ClockSelect */
4097         {0xa0, 0x03, 0x003a},
4098         {0xa0, 0x0c, 0x003b},
4099         {0xa0, 0x04, 0x0038},
4100         {}
4101 };
4102
4103 static const struct usb_action pas106b_Initial[] = {    /* 176x144 */
4104 /* JPEG control */
4105         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},          /* ClockSetting */
4106 /* Sream and Sensor specific */
4107         {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},      /* CMOSSensorSelect */
4108 /* Picture size */
4109         {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},  /* FrameWidthHigh 00 */
4110         {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},   /* FrameWidthLow B0 */
4111         {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* FrameHeightHigh 00 */
4112         {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},  /* FrameHightLow 90 */
4113 /* System */
4114         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* SystemOperating */
4115 /* Sream and Sensor specific */
4116         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */
4117         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */
4118 /* Sensor Interface */
4119         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},  /* Compatibily Mode */
4120 /* Window inside sensor array */
4121         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},  /* WinXStartLow */
4122         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* FirstYLow */
4123         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},     /* FirstxLow */
4124         {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},  /* WinHeightLow */
4125         {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},   /* WinWidthLow */
4126 /* Init the sensor */
4127         {0xaa, 0x02, 0x0004},
4128         {0xaa, 0x08, 0x0000},
4129         {0xaa, 0x09, 0x0005},
4130         {0xaa, 0x0a, 0x0002},
4131         {0xaa, 0x0b, 0x0002},
4132         {0xaa, 0x0c, 0x0005},
4133         {0xaa, 0x0d, 0x0000},
4134         {0xaa, 0x0e, 0x0002},
4135         {0xaa, 0x14, 0x0081},
4136
4137 /* Other registors */
4138         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* SensorCorrection */
4139 /* Frame retreiving */
4140         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* AutoAdjustFPS */
4141 /* Gains */
4142         {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},   /* DigitalGain */
4143 /* Unknown */
4144         {0xa0, 0x00, 0x01ad},
4145 /* Sharpness */
4146         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* SharpnessMode */
4147         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* Sharpness05 */
4148 /* Other registors */
4149         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */
4150 /* Auto exposure and white balance */
4151         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},     /* AWBStatus */
4152 /*Dead pixels */
4153         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */
4154 /* EEPROM */
4155         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* EEPROMAccess */
4156 /* JPEG control */
4157         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* ClockSetting */
4158         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4159         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4160 /* Other registers */
4161         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */
4162 /* Auto exposure and white balance */
4163         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},     /* AWBStatus */
4164 /*Dead pixels */
4165         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */
4166 /* EEPROM */
4167         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* EEPROMAccess */
4168 /* JPEG control */
4169         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* ClockSetting */
4170         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4171         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4172
4173         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
4174         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
4175         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4176         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
4177         {0xa0, 0x58, ZC3XX_R10E_RGB11},
4178         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
4179         {0xa0, 0xf4, ZC3XX_R110_RGB20},
4180         {0xa0, 0xf4, ZC3XX_R111_RGB21},
4181         {0xa0, 0x58, ZC3XX_R112_RGB22},
4182 /* Auto correction */
4183         {0xa0, 0x03, ZC3XX_R181_WINXSTART},     /* WinXstart */
4184         {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},     /* WinXWidth */
4185         {0xa0, 0x16, ZC3XX_R183_WINXCENTER},    /* WinXCenter */
4186         {0xa0, 0x03, ZC3XX_R184_WINYSTART},     /* WinYStart */
4187         {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},     /* WinYWidth */
4188         {0xa0, 0x14, ZC3XX_R186_WINYCENTER},    /* WinYCenter */
4189         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */
4190
4191 /* Auto exposure and white balance */
4192         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* ExposureLimitHigh */
4193         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},      /* ExposureLimitMid */
4194         {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},      /* ExposureLimitLow */
4195         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* AntiFlickerHigh */
4196         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* AntiFlickerLow */
4197         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},        /* AntiFlickerLow */
4198         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},              /* AEBFreeze */
4199         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},            /* AEBUnfreeze */
4200 /* sensor on */
4201         {0xaa, 0x07, 0x00b1},
4202         {0xaa, 0x05, 0x0003},
4203         {0xaa, 0x04, 0x0001},
4204         {0xaa, 0x03, 0x003b},
4205 /* Gains */
4206         {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* DigitalLimitDiff */
4207         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},       /* DigitalGainStep */
4208         {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},            /* GlobalGain */
4209         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},            /* GlobalGain */
4210 /* Auto correction */
4211         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},     /* AutoCorrectEnable */
4212         {0xa1, 0x01, 0x0180},                           /* AutoCorrectEnable */
4213         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* AutoCorrectEnable */
4214 /* Gains */
4215         {0xa0, 0x40, ZC3XX_R116_RGAIN},                 /* RGain */
4216         {0xa0, 0x40, ZC3XX_R117_GGAIN},                 /* GGain */
4217         {0xa0, 0x40, ZC3XX_R118_BGAIN},                 /* BGain */
4218         {}
4219 };
4220
4221 static const struct usb_action pas106b_InitialScale[] = {       /* 352x288 */
4222 /* JPEG control */
4223         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},          /* ClockSetting */
4224 /* Sream and Sensor specific */
4225         {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},      /* CMOSSensorSelect */
4226 /* Picture size */
4227         {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},        /* FrameWidthHigh */
4228         {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},         /* FrameWidthLow */
4229         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* FrameHeightHigh */
4230         {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},        /* FrameHightLow */
4231 /* System */
4232         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* SystemOperating */
4233 /* Sream and Sensor specific */
4234         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */
4235         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */
4236 /* Sensor Interface */
4237         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},       /* Compatibily Mode */
4238 /* Window inside sensor array */
4239         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},  /* WinXStartLow */
4240         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* FirstYLow */
4241         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},     /* FirstxLow */
4242         {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},  /* WinHeightLow */
4243         {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},   /* WinWidthLow */
4244 /* Init the sensor */
4245         {0xaa, 0x02, 0x0004},
4246         {0xaa, 0x08, 0x0000},
4247         {0xaa, 0x09, 0x0005},
4248         {0xaa, 0x0a, 0x0002},
4249         {0xaa, 0x0b, 0x0002},
4250         {0xaa, 0x0c, 0x0005},
4251         {0xaa, 0x0d, 0x0000},
4252         {0xaa, 0x0e, 0x0002},
4253         {0xaa, 0x14, 0x0081},
4254
4255 /* Other registors */
4256         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* SensorCorrection */
4257 /* Frame retreiving */
4258         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* AutoAdjustFPS */
4259 /* Gains */
4260         {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},   /* DigitalGain */
4261 /* Unknown */
4262         {0xa0, 0x00, 0x01ad},
4263 /* Sharpness */
4264         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* SharpnessMode */
4265         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* Sharpness05 */
4266 /* Other registors */
4267         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */
4268 /* Auto exposure and white balance */
4269         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},     /* AWBStatus */
4270         {0xa0, 0x80, ZC3XX_R18D_YTARGET},       /* ????????? */
4271 /*Dead pixels */
4272         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */
4273 /* EEPROM */
4274         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* EEPROMAccess */
4275 /* JPEG control */
4276         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* ClockSetting */
4277         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4278         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4279 /* Other registers */
4280         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */
4281 /* Auto exposure and white balance */
4282         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},     /* AWBStatus */
4283 /*Dead pixels */
4284         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */
4285 /* EEPROM */
4286         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* EEPROMAccess */
4287 /* JPEG control */
4288         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* ClockSetting */
4289         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4290         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4291
4292         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
4293         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
4294         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4295         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
4296         {0xa0, 0x58, ZC3XX_R10E_RGB11},
4297         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
4298         {0xa0, 0xf4, ZC3XX_R110_RGB20},
4299         {0xa0, 0xf4, ZC3XX_R111_RGB21},
4300         {0xa0, 0x58, ZC3XX_R112_RGB22},
4301 /* Auto correction */
4302         {0xa0, 0x03, ZC3XX_R181_WINXSTART},     /* WinXstart */
4303         {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},     /* WinXWidth */
4304         {0xa0, 0x16, ZC3XX_R183_WINXCENTER},    /* WinXCenter */
4305         {0xa0, 0x03, ZC3XX_R184_WINYSTART},     /* WinYStart */
4306         {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},     /* WinYWidth */
4307         {0xa0, 0x14, ZC3XX_R186_WINYCENTER},    /* WinYCenter */
4308         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */
4309
4310 /* Auto exposure and white balance */
4311         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* ExposureLimitHigh 0 */
4312         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},  /* ExposureLimitMid */
4313         {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},  /* ExposureLimitLow 0xb1 */
4314
4315         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},   /* AntiFlickerHigh 0x00 */
4316         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},    /* AntiFlickerLow 0x00 */
4317         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},    /* AntiFlickerLow 0x87 */
4318
4319         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* AEBFreeze 0x10 0x0c */
4320         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* AEBUnfreeze 0x30 0x18 */
4321 /* sensor on */
4322         {0xaa, 0x07, 0x00b1},
4323         {0xaa, 0x05, 0x0003},
4324         {0xaa, 0x04, 0x0001},
4325         {0xaa, 0x03, 0x003b},
4326 /* Gains */
4327         {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* DigitalLimitDiff */
4328         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},       /* DigitalGainStep */
4329         {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},    /* GlobalGain */
4330         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* GlobalGain */
4331 /* Auto correction */
4332         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},     /* AutoCorrectEnable */
4333         {0xa1, 0x01, 0x0180},                           /* AutoCorrectEnable */
4334         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* AutoCorrectEnable */
4335 /* Gains */
4336         {0xa0, 0x40, ZC3XX_R116_RGAIN},         /* RGain */
4337         {0xa0, 0x40, ZC3XX_R117_GGAIN},         /* GGain */
4338         {0xa0, 0x40, ZC3XX_R118_BGAIN},         /* BGain */
4339
4340         {0xa0, 0x00, 0x0007},                   /* AutoCorrectEnable */
4341         {0xa0, 0xff, ZC3XX_R018_FRAMELOST},     /* Frame adjust */
4342         {}
4343 };
4344 static const struct usb_action pas106b_50HZ[] = {
4345         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4346         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4347         {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
4348         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4349         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4350         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
4351         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4352         {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,30,cc */
4353         {0xaa, 0x03, 0x0021},                   /* 00,03,21,aa */
4354         {0xaa, 0x04, 0x000c},                   /* 00,04,0c,aa */
4355         {0xaa, 0x05, 0x0002},                   /* 00,05,02,aa */
4356         {0xaa, 0x07, 0x001c},                   /* 00,07,1c,aa */
4357         {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
4358         {}
4359 };
4360 static const struct usb_action pas106b_60HZ[] = {
4361         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4362         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4363         {0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
4364         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4365         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4366         {0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
4367         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4368         {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,30,cc */
4369         {0xaa, 0x03, 0x001c},                   /* 00,03,1c,aa */
4370         {0xaa, 0x04, 0x0004},                   /* 00,04,04,aa */
4371         {0xaa, 0x05, 0x0001},                   /* 00,05,01,aa */
4372         {0xaa, 0x07, 0x00c4},                   /* 00,07,c4,aa */
4373         {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
4374         {}
4375 };
4376 static const struct usb_action pas106b_NoFliker[] = {
4377         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4378         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4379         {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
4380         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4381         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4382         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
4383         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4384         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
4385         {0xaa, 0x03, 0x0013},                   /* 00,03,13,aa */
4386         {0xaa, 0x04, 0x0000},                   /* 00,04,00,aa */
4387         {0xaa, 0x05, 0x0001},                   /* 00,05,01,aa */
4388         {0xaa, 0x07, 0x0030},                   /* 00,07,30,aa */
4389         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
4390         {}
4391 };
4392
4393 static const struct usb_action pb03303x_Initial[] = {
4394         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4395         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4396         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4397         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4398         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4399         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4400         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4401         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4402         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR}, /* 8b -> dc */
4403         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4404         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4405         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4406         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4407         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4408         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4409         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4410         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4411         {0xaa, 0x01, 0x0001},
4412         {0xaa, 0x06, 0x0000},
4413         {0xaa, 0x08, 0x0483},
4414         {0xaa, 0x01, 0x0004},
4415         {0xaa, 0x08, 0x0006},
4416         {0xaa, 0x02, 0x0011},
4417         {0xaa, 0x03, 0x01e7},
4418         {0xaa, 0x04, 0x0287},
4419         {0xaa, 0x07, 0x3002},
4420         {0xaa, 0x20, 0x1100},
4421         {0xaa, 0x35, 0x0050},
4422         {0xaa, 0x30, 0x0005},
4423         {0xaa, 0x31, 0x0000},
4424         {0xaa, 0x58, 0x0078},
4425         {0xaa, 0x62, 0x0411},
4426         {0xaa, 0x2b, 0x0028},
4427         {0xaa, 0x2c, 0x0030},
4428         {0xaa, 0x2d, 0x0030},
4429         {0xaa, 0x2e, 0x0028},
4430         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4431         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4432         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4433         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4434         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4435         {0xa0, 0x00, 0x01ad},
4436         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4437         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4438         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4439         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4440         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4441         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
4442         {0xa0, 0x61, ZC3XX_R116_RGAIN},
4443         {0xa0, 0x65, ZC3XX_R118_BGAIN},
4444
4445         {0xa1, 0x01, 0x0002},
4446         {0xa0, 0x09, 0x01ad},
4447         {0xa0, 0x15, 0x01ae},
4448         {0xa0, 0x0d, 0x003a},
4449         {0xa0, 0x02, 0x003b},
4450         {0xa0, 0x00, 0x0038},
4451         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4452         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4453         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4454         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4455         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4456         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4457         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4458         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4459         {0xa0, 0x50, ZC3XX_R112_RGB22},
4460
4461         {0xa1, 0x01, 0x0008},
4462         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4463         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4464         {0xa1, 0x01, 0x01c8},
4465         {0xa1, 0x01, 0x01c9},
4466         {0xa1, 0x01, 0x01ca},
4467         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4468         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
4469         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
4470         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
4471         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
4472         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
4473         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
4474         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
4475         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
4476         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
4477         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
4478         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
4479         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
4480         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
4481         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
4482         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
4483         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4484         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
4485         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4486         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4487         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4488         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4489         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4490         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4491         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4492         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4493         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4494         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4495         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4496         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4497         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4498         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
4499         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
4500         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4501         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4502         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4503         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4504         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4505         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4506         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4507         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4508         {0xa0, 0x50, ZC3XX_R112_RGB22},
4509
4510         {0xa1, 0x01, 0x0180},
4511         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4512         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4513         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4514         {0xaa, 0x05, 0x0009},
4515         {0xaa, 0x09, 0x0134},
4516         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4517         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4518         {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
4519         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4520         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4521         {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
4522         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4523         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4524         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4525         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4526         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4527         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4528         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4529         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4530         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4531         {0xa0, 0x09, 0x01ad},
4532         {0xa0, 0x15, 0x01ae},
4533         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4534         {0xa1, 0x01, 0x0180},
4535         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4536         {}
4537 };
4538
4539 static const struct usb_action pb03303x_InitialScale[] = {
4540         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4541         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4542         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4543         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4544         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4545         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4546         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4547         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4548         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR}, /* 8b -> dc */
4549         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4550         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4551         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4552         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4553         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4554         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4555         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4556         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4557         {0xaa, 0x01, 0x0001},
4558         {0xaa, 0x06, 0x0000},
4559         {0xaa, 0x08, 0x0483},
4560         {0xaa, 0x01, 0x0004},
4561         {0xaa, 0x08, 0x0006},
4562         {0xaa, 0x02, 0x0011},
4563         {0xaa, 0x03, 0x01e7},
4564         {0xaa, 0x04, 0x0287},
4565         {0xaa, 0x07, 0x3002},
4566         {0xaa, 0x20, 0x1100},
4567         {0xaa, 0x35, 0x0050},
4568         {0xaa, 0x30, 0x0005},
4569         {0xaa, 0x31, 0x0000},
4570         {0xaa, 0x58, 0x0078},
4571         {0xaa, 0x62, 0x0411},
4572         {0xaa, 0x2b, 0x0028},
4573         {0xaa, 0x2c, 0x0030},
4574         {0xaa, 0x2d, 0x0030},
4575         {0xaa, 0x2e, 0x0028},
4576         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4577         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4578         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4579         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4580         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4581         {0xa0, 0x00, 0x01ad},
4582         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4583         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4584         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4585         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4586         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4587         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
4588         {0xa0, 0x61, ZC3XX_R116_RGAIN},
4589         {0xa0, 0x65, ZC3XX_R118_BGAIN},
4590
4591         {0xa1, 0x01, 0x0002},
4592
4593         {0xa0, 0x09, 0x01ad},
4594         {0xa0, 0x15, 0x01ae},
4595
4596         {0xa0, 0x0d, 0x003a},
4597         {0xa0, 0x02, 0x003b},
4598         {0xa0, 0x00, 0x0038},
4599         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4600         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4601         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4602         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4603         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4604         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4605         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4606         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4607         {0xa0, 0x50, ZC3XX_R112_RGB22},
4608
4609         {0xa1, 0x01, 0x0008},
4610         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4611         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4612         {0xa1, 0x01, 0x01c8},
4613         {0xa1, 0x01, 0x01c9},
4614         {0xa1, 0x01, 0x01ca},
4615         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4616
4617         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
4618         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
4619         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
4620         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
4621         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
4622         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
4623         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
4624         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
4625         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
4626         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
4627         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
4628         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
4629         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
4630         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
4631         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
4632         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4633         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
4634         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4635         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4636         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4637         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4638         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4639         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4640         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4641         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4642         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4643         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4644         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4645         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4646         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4647         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
4648         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
4649         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4650         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4651         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4652         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4653         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4654         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4655         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4656         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4657         {0xa0, 0x50, ZC3XX_R112_RGB22},
4658
4659         {0xa1, 0x01, 0x0180},
4660         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4661         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4662         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4663         {0xaa, 0x05, 0x0009},
4664         {0xaa, 0x09, 0x0134},
4665         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4666         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4667         {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
4668         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4669         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4670         {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
4671         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4672         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4673         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4674         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4675         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4676         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4677         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4678         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4679         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4680         {0xa0, 0x09, 0x01ad},
4681         {0xa0, 0x15, 0x01ae},
4682         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4683         {0xa1, 0x01, 0x0180},
4684         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4685         {}
4686 };
4687 static const struct usb_action pb0330xx_Initial[] = {
4688         {0xa1, 0x01, 0x0008},
4689         {0xa1, 0x01, 0x0008},
4690         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4691         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
4692         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4693         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4694         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4695         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4696         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4697         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4698         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4699         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4700         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4701         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4702         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4703         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4704         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4705         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4706         {0xaa, 0x01, 0x0006},
4707         {0xaa, 0x02, 0x0011},
4708         {0xaa, 0x03, 0x01e7},
4709         {0xaa, 0x04, 0x0287},
4710         {0xaa, 0x06, 0x0003},
4711         {0xaa, 0x07, 0x3002},
4712         {0xaa, 0x20, 0x1100},
4713         {0xaa, 0x2f, 0xf7b0},
4714         {0xaa, 0x30, 0x0005},
4715         {0xaa, 0x31, 0x0000},
4716         {0xaa, 0x34, 0x0100},
4717         {0xaa, 0x35, 0x0060},
4718         {0xaa, 0x3d, 0x068f},
4719         {0xaa, 0x40, 0x01e0},
4720         {0xaa, 0x58, 0x0078},
4721         {0xaa, 0x62, 0x0411},
4722         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4723         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4724         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4725         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4726         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4727         {0xa0, 0x00, 0x01ad},
4728         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4729         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4730         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4731         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4732         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4733         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4734         {0xa1, 0x01, 0x0002},
4735         {0xa0, 0x09, 0x01ad},
4736         {0xa0, 0x15, 0x01ae},
4737         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
4738         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
4739         {0xa1, 0x01, 0x0091},
4740         {0xa1, 0x01, 0x0095},
4741         {0xa1, 0x01, 0x0096},
4742         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4743         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4744         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4745         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4746         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4747         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4748         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4749         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4750         {0xa0, 0x50, ZC3XX_R112_RGB22},
4751         {0xa1, 0x01, 0x0008},
4752         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4753         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4754         {0xa1, 0x01, 0x01c8},
4755         {0xa1, 0x01, 0x01c9},
4756         {0xa1, 0x01, 0x01ca},
4757         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4758
4759         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4760         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4761         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4762         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4763         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4764         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4765         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4766         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4767         {0xa0, 0x50, ZC3XX_R112_RGB22},
4768         {0xa1, 0x01, 0x0180},
4769         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4770         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4771         {0xaa, 0x05, 0x0066},
4772         {0xaa, 0x09, 0x02b2},
4773         {0xaa, 0x10, 0x0002},
4774
4775         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4776         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4777         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4778         {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4779         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4780         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4781         {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4782         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4783         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4784         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4785         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4786         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4787         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4788         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4789         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4790         {0xa0, 0x09, 0x01ad},
4791         {0xa0, 0x15, 0x01ae},
4792         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4793         {0xa1, 0x01, 0x0180},
4794         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4795         {0xa1, 0x01, 0x0008},
4796         {0xa1, 0x01, 0x0007},
4797 /*      {0xa0, 0x30, 0x0007}, */
4798 /*      {0xa0, 0x00, 0x0007}, */
4799         {}
4800 };
4801
4802 static const struct usb_action pb0330xx_InitialScale[] = {
4803         {0xa1, 0x01, 0x0008},
4804         {0xa1, 0x01, 0x0008},
4805         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4806         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
4807         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4808         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* 10 */
4809         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4810         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4811         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4812         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4813         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4814         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4815         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4816         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4817         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4818         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4819         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4820         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4821         {0xaa, 0x01, 0x0006},
4822         {0xaa, 0x02, 0x0011},
4823         {0xaa, 0x03, 0x01e7},
4824         {0xaa, 0x04, 0x0287},
4825         {0xaa, 0x06, 0x0003},
4826         {0xaa, 0x07, 0x3002},
4827         {0xaa, 0x20, 0x1100},
4828         {0xaa, 0x2f, 0xf7b0},
4829         {0xaa, 0x30, 0x0005},
4830         {0xaa, 0x31, 0x0000},
4831         {0xaa, 0x34, 0x0100},
4832         {0xaa, 0x35, 0x0060},
4833         {0xaa, 0x3d, 0x068f},
4834         {0xaa, 0x40, 0x01e0},
4835         {0xaa, 0x58, 0x0078},
4836         {0xaa, 0x62, 0x0411},
4837         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4838         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4839         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4840         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4841         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4842         {0xa0, 0x00, 0x01ad},
4843         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4844         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4845         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4846         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4847         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4848         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4849         {0xa1, 0x01, 0x0002},
4850         {0xa0, 0x09, 0x01ad},
4851         {0xa0, 0x15, 0x01ae},
4852         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
4853         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
4854         {0xa1, 0x01, 0x0091},
4855         {0xa1, 0x01, 0x0095},
4856         {0xa1, 0x01, 0x0096},
4857         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4858         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4859         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4860         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4861         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4862         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4863         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4864         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4865         {0xa0, 0x50, ZC3XX_R112_RGB22},
4866         {0xa1, 0x01, 0x0008},
4867         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4868         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4869         {0xa1, 0x01, 0x01c8},
4870         {0xa1, 0x01, 0x01c9},
4871         {0xa1, 0x01, 0x01ca},
4872         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4873
4874         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4875         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4876         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4877         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4878         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4879         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4880         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4881         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4882         {0xa0, 0x50, ZC3XX_R112_RGB22},
4883         {0xa1, 0x01, 0x0180},
4884         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4885         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4886         {0xaa, 0x05, 0x0066},
4887         {0xaa, 0x09, 0x02b2},
4888         {0xaa, 0x10, 0x0002},
4889         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4890         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4891         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4892         {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4893         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4894         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4895         {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4896         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4897         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4898         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4899         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4900         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4901         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4902         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4903         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4904         {0xa0, 0x09, 0x01ad},
4905         {0xa0, 0x15, 0x01ae},
4906         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4907         {0xa1, 0x01, 0x0180},
4908         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4909         {0xa1, 0x01, 0x0008},
4910         {0xa1, 0x01, 0x0007},
4911 /*      {0xa0, 0x30, 0x0007}, */
4912 /*      {0xa0, 0x00, 0x0007}, */
4913         {}
4914 };
4915 static const struct usb_action pb0330_50HZ[] = {
4916         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4917         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4918         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,ee,cc */
4919         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4920         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4921         {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
4922         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4923         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4924         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4925         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4926         {0xa0, 0x68, ZC3XX_R01D_HSYNC_0}, /* 00,1d,68,cc */
4927         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
4928         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
4929         {}
4930 };
4931 static const struct usb_action pb0330_50HZScale[] = {
4932         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4933         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4934         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4935         {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
4936         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4937         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4938         {0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
4939         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4940         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4941         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4942         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4943         {0xa0, 0xe5, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e5,cc */
4944         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f0,cc */
4945         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
4946         {}
4947 };
4948 static const struct usb_action pb0330_60HZ[] = {
4949         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4950         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4951         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4952         {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,dd,cc */
4953         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4954         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4955         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
4956         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4957         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4958         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4959         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4960         {0xa0, 0x43, ZC3XX_R01D_HSYNC_0}, /* 00,1d,43,cc */
4961         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
4962         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4963         {}
4964 };
4965 static const struct usb_action pb0330_60HZScale[] = {
4966         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4967         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4968         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4969         {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
4970         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4971         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4972         {0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
4973         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4974         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4975         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4976         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4977         {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
4978         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
4979         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4980         {}
4981 };
4982 static const struct usb_action pb0330_NoFliker[] = {
4983         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4984         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4985         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4986         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
4987         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4988         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4989         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
4990         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4991         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4992         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
4993         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
4994         {0xa0, 0x09, ZC3XX_R01D_HSYNC_0}, /* 00,1d,09,cc */
4995         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
4996         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4997         {}
4998 };
4999 static const struct usb_action pb0330_NoFlikerScale[] = {
5000         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5001         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5002         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
5003         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5004         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5005         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5006         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5007         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
5008         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
5009         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5010         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5011         {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},       /* 00,1d,09,cc */
5012         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},       /* 00,1e,40,cc */
5013         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},       /* 00,1f,90,cc */
5014         {}
5015 };
5016
5017 /* from oem9.inf - HKR,%PO2030%,Initial - 640x480 - (close to CS2102) */
5018 static const struct usb_action PO2030_mode0[] = {
5019         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5020         {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},   /* 00,02,04,cc */
5021         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5022         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5023         {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5024         {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5025         {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5026         {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5027         {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5028         {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5029         {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5030         {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5031         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5032         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5033         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5034         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5035         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5036         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5037         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5038         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5039         {0xaa, 0x8d, 0x0008},                   /* 00,8d,08,aa */
5040         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
5041         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
5042         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
5043         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
5044         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e6,cc */
5045         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,86,cc */
5046         {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
5047         {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5048         {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
5049         {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
5050         {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5051         {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5052         {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5053         {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5054         {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5055         {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5056         {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5057         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5058         {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5059         {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5060         {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5061         {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5062         {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5063         {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5064         {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5065         {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5066         {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5067         {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5068         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5069         {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5070         {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5071         {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5072         {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5073         {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5074         {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5075         {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5076         {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5077         {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5078         {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5079         {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5080         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5081         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5082         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5083         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
5084         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5085         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5086         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5087         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5088         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5089         {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5090         {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
5091         {}
5092 };
5093
5094 /* from oem9.inf - HKR,%PO2030%,InitialScale - 320x240 */
5095 static const struct usb_action PO2030_mode1[] = {
5096         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5097         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
5098         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5099         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5100         {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5101         {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5102         {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5103         {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5104         {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5105         {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5106         {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5107         {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5108         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5109         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5110         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5111         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5112         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5113         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5114         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5115         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5116         {0xaa, 0x8d, 0x0008},                   /* 00,8d,08,aa */
5117         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
5118         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
5119         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
5120         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
5121         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
5122         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
5123         {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
5124         {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5125         {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
5126         {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
5127         {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5128         {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5129         {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5130         {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5131         {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5132         {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5133         {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5134         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5135         {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5136         {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5137         {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5138         {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5139         {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5140         {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5141         {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5142         {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5143         {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5144         {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5145         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5146         {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5147         {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5148         {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5149         {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5150         {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5151         {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5152         {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5153         {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5154         {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5155         {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5156         {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5157         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5158         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5159         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5160         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
5161         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5162         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5163         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5164         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5165         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5166         {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5167         {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
5168         {}
5169 };
5170
5171 static const struct usb_action PO2030_50HZ[] = {
5172         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5173         {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
5174         {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
5175         {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
5176         {0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
5177         {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
5178         {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
5179         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5180         {0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
5181         {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
5182         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5183         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5184         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5185         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5186         {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5187         {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5188         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5189         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5190         {}
5191 };
5192
5193 static const struct usb_action PO2030_60HZ[] = {
5194         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5195         {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5196         {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
5197         {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
5198         {0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
5199         {0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
5200         {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
5201         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5202         {0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
5203         {0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
5204         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5205         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5206         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5207         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5208         {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,22,cc */
5209         {0xa0, 0x88, ZC3XX_R18D_YTARGET},               /* 01,8d,88,cc */
5210                                                         /* win: 01,8d,80 */
5211         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc */
5212         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
5213         {}
5214 };
5215
5216 static const struct usb_action PO2030_NoFliker[] = {
5217         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
5218         {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
5219         {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5220         {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
5221         {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
5222         {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
5223         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
5224         {}
5225 };
5226
5227 /* TEST */
5228 static const struct usb_action tas5130CK_Initial[] = {
5229         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5230         {0xa0, 0x01, 0x003b},
5231         {0xa0, 0x0e, 0x003a},
5232         {0xa0, 0x01, 0x0038},
5233         {0xa0, 0x0b, 0x0039},
5234         {0xa0, 0x00, 0x0038},
5235         {0xa0, 0x0b, 0x0039},
5236         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5237         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5238         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5239         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
5240         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5241         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5242         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5243         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5244         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5245         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5246         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5247         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5248         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5249         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5250         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5251         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5252         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5253         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5254         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5255         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5256         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5257         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5258         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5259         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5260         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5261         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5262         {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5263         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5264         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5265         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5266         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5267         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5268         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5269         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5270         {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5271         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5272         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5273         {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5274         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5275         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5276         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5277         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5278         {0xa0, 0xE7, ZC3XX_R093_I2CSETVALUE},
5279         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5280         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5281         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5282         {0xa0, 0x87, ZC3XX_R093_I2CSETVALUE},
5283         {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5284         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5285         {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5286         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5287         {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5288         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5289         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5290         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5291         {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5292         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5293         {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5294         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5295         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5296         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5297         {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5298         {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5299         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5300         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5301         {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5302         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5303         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5304         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5305         {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5306         {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5307         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5308         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5309         {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5310         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5311         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5312         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5313         {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5314         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5315         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5316         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5317         {0xa0, 0x2c, ZC3XX_R092_I2CADDRESSSELECT},
5318         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5319         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5320         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5321         {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5322         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5323         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5324         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5325         {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5326         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5327         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5328         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5329         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5330         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5331         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5332         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5333         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5334         {0xa0, 0x09, 0x01ad},
5335         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5336         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5337         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5338         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5339         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5340         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5341         {0xa0, 0x61, ZC3XX_R116_RGAIN},
5342         {0xa0, 0x65, ZC3XX_R118_BGAIN},
5343         {0xa0, 0x09, 0x01ad},
5344         {0xa0, 0x15, 0x01ae},
5345         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5346         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5347         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5348         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5349         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5350         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5351         {0xa0, 0xec, ZC3XX_R110_RGB20},
5352         {0xa0, 0x03, ZC3XX_R111_RGB21},
5353         {0xa0, 0x51, ZC3XX_R112_RGB22},
5354         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5355         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5356         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5357         {0xa0, 0x38, ZC3XX_R120_GAMMA00},       /* gamma > 5 */
5358         {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5359         {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5360         {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5361         {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5362         {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5363         {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5364         {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5365         {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5366         {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5367         {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5368         {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5369         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5370         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5371         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5372         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5373         {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5374         {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5375         {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5376         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5377         {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5378         {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5379         {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5380         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5381         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5382         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5383         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5384         {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5385         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5386         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5387         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5388         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5389         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5390         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5391         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5392         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5393         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5394         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5395         {0xa0, 0xec, ZC3XX_R110_RGB20},
5396         {0xa0, 0x03, ZC3XX_R111_RGB21},
5397         {0xa0, 0x51, ZC3XX_R112_RGB22},
5398         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5399         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5400         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5401         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5402         {0xa0, 0x09, ZC3XX_R093_I2CSETVALUE},
5403         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5404         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5405         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5406         {0xa0, 0x34, ZC3XX_R093_I2CSETVALUE},
5407         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5408         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5409         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5410         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5411         {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
5412         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5413         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5414         {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
5415         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5416         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5417         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5418         {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5419         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
5420         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5421         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
5422         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5423         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5424         {0xa0, 0x09, 0x01ad},
5425         {0xa0, 0x15, 0x01ae},
5426         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5427         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5428         {}
5429 };
5430
5431 static const struct usb_action tas5130CK_InitialScale[] = {
5432         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5433         {0xa0, 0x01, 0x003b},
5434         {0xa0, 0x0e, 0x003a},
5435         {0xa0, 0x01, 0x0038},
5436         {0xa0, 0x0b, 0x0039},
5437         {0xa0, 0x00, 0x0038},
5438         {0xa0, 0x0b, 0x0039},
5439         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5440         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5441         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5442         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
5443         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5444         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5445         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5446         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5447         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5448         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5449         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5450         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5451         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5452         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5453         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5454         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5455         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5456         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5457         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5458         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5459         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5460         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5461         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5462         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5463         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5464         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5465         {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5466         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5467         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5468         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5469         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5470         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5471         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5472         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5473         {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5474         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5475         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5476         {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5477         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5478         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5479         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5480         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5481         {0xa0, 0xe5, ZC3XX_R093_I2CSETVALUE},
5482         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5483         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5484         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5485         {0xa0, 0x85, ZC3XX_R093_I2CSETVALUE},
5486         {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5487         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5488         {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5489         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5490         {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5491         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5492         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5493         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5494         {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5495         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5496         {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5497         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5498         {0xa0, 0x50, ZC3XX_R094_I2CWRITEACK},
5499         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5500         {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5501         {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5502         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5503         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5504         {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5505         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5506         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5507         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5508         {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5509         {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5510         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5511         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5512         {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5513         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5514         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5515         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5516         {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5517         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5518         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5519         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5520         {0xa0, 0x2C, ZC3XX_R092_I2CADDRESSSELECT},
5521         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5522         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5523         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5524         {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5525         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5526         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5527         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5528         {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5529         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5530         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5531         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5532         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5533         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5534         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5535         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5536         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5537         {0xa0, 0x09, 0x01ad},
5538         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5539         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5540         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5541         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5542         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5543         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5544         {0xa0, 0x61, ZC3XX_R116_RGAIN},
5545         {0xa0, 0x65, ZC3XX_R118_BGAIN},
5546         {0xa0, 0x09, 0x01ad},
5547         {0xa0, 0x15, 0x01ae},
5548         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5549         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5550         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5551         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5552         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5553         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5554         {0xa0, 0xec, ZC3XX_R110_RGB20},
5555         {0xa0, 0x03, ZC3XX_R111_RGB21},
5556         {0xa0, 0x51, ZC3XX_R112_RGB22},
5557         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5558         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5559         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5560         {0xa0, 0x38, ZC3XX_R120_GAMMA00},       /* gamma > 5 */
5561         {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5562         {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5563         {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5564         {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5565         {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5566         {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5567         {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5568         {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5569         {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5570         {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5571         {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5572         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5573         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5574         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5575         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5576         {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5577         {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5578         {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5579         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5580         {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5581         {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5582         {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5583         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5584         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5585         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5586         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5587         {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5588         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5589         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5590         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5591         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5592         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5593         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5594         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5595         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5596         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5597         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5598         {0xa0, 0xec, ZC3XX_R110_RGB20},
5599         {0xa0, 0x03, ZC3XX_R111_RGB21},
5600         {0xa0, 0x51, ZC3XX_R112_RGB22},
5601         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5602         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5603         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5604         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5605         {0xa0, 0x62, ZC3XX_R093_I2CSETVALUE},
5606         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5607         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5608         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5609         {0xa0, 0xaa, ZC3XX_R093_I2CSETVALUE},
5610         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5611         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5612         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5613         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
5614         {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
5615         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5616         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5617         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5618         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5619         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5620         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5621         {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5622         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
5623         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
5624         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
5625         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5626         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
5627         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5628         {0xa0, 0x09, 0x01ad},
5629         {0xa0, 0x15, 0x01ae},
5630         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5631         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5632         {0xa0, 0x30, 0x0007},
5633         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
5634         {0xa0, 0x00, 0x0007},
5635         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5636         {}
5637 };
5638
5639 static const struct usb_action tas5130cxx_Initial[] = {
5640         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5641         {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
5642         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5643         {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5644         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5645         {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5646         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5647         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5648         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5649         {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5650         {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5651
5652         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5653         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5654         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5655         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5656
5657         {0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
5658         {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5659         {0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
5660         {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5661         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
5662         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5663         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
5664         {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5665         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5666         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5667         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5668         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
5669         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5670         {0xa0, 0x00, 0x01ad},
5671         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5672         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5673         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5674         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5675         {0xa1, 0x01, 0x0002},
5676         {0xa1, 0x01, 0x0008},
5677         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
5678         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5679         {0xa1, 0x01, 0x01c8},
5680         {0xa1, 0x01, 0x01c9},
5681         {0xa1, 0x01, 0x01ca},
5682         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5683
5684         {0xa0, 0x68, ZC3XX_R10A_RGB00}, /* matrix */
5685         {0xa0, 0xec, ZC3XX_R10B_RGB01},
5686         {0xa0, 0xec, ZC3XX_R10C_RGB02},
5687         {0xa0, 0xec, ZC3XX_R10D_RGB10},
5688         {0xa0, 0x68, ZC3XX_R10E_RGB11},
5689         {0xa0, 0xec, ZC3XX_R10F_RGB12},
5690         {0xa0, 0xec, ZC3XX_R110_RGB20},
5691         {0xa0, 0xec, ZC3XX_R111_RGB21},
5692         {0xa0, 0x68, ZC3XX_R112_RGB22},
5693
5694         {0xa1, 0x01, 0x018d},
5695         {0xa0, 0x90, ZC3XX_R18D_YTARGET},       /* 90 */
5696         {0xa1, 0x01, 0x0180},
5697         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5698         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5699
5700         {0xaa, 0xa3, 0x0001},
5701         {0xaa, 0xa4, 0x0077},
5702         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
5703         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW},
5704
5705         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 00 */
5706         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},      /* 03 */
5707         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW},      /* e8 */
5708         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 0 */
5709         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 0 */
5710         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW},        /* 7d */
5711
5712         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5713         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5714         {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 08 */
5715         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 24 */
5716         {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0},
5717         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5718         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
5719         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5720         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
5721         {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
5722         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},    /* 50 */
5723         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5724         {0xa1, 0x01, 0x0180},
5725         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5726         {}
5727 };
5728 static const struct usb_action tas5130cxx_InitialScale[] = {
5729         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5730         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5731         {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
5732
5733         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5734         {0xa1, 0x01, 0x0008},
5735
5736         {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5737         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5738         {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5739         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5740         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5741         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5742         {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5743         {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5744         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5745         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5746         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5747         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5748         {0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
5749         {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5750         {0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
5751         {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5752         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
5753         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5754         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
5755         {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5756         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5757         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5758         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5759         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
5760         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5761         {0xa0, 0x00, 0x01ad},
5762         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5763         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5764         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5765         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5766         {0xa1, 0x01, 0x0002},
5767         {0xa1, 0x01, 0x0008},
5768
5769         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5770         {0xa1, 0x01, 0x0008},   /* clock ? */
5771         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5772         {0xa1, 0x01, 0x01c8},
5773         {0xa1, 0x01, 0x01c9},
5774         {0xa1, 0x01, 0x01ca},
5775         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5776
5777         {0xa0, 0x68, ZC3XX_R10A_RGB00}, /* matrix */
5778         {0xa0, 0xec, ZC3XX_R10B_RGB01},
5779         {0xa0, 0xec, ZC3XX_R10C_RGB02},
5780         {0xa0, 0xec, ZC3XX_R10D_RGB10},
5781         {0xa0, 0x68, ZC3XX_R10E_RGB11},
5782         {0xa0, 0xec, ZC3XX_R10F_RGB12},
5783         {0xa0, 0xec, ZC3XX_R110_RGB20},
5784         {0xa0, 0xec, ZC3XX_R111_RGB21},
5785         {0xa0, 0x68, ZC3XX_R112_RGB22},
5786
5787         {0xa1, 0x01, 0x018d},
5788         {0xa0, 0x90, ZC3XX_R18D_YTARGET},
5789         {0xa1, 0x01, 0x0180},
5790         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5791         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5792         {0xaa, 0xa3, 0x0001},
5793         {0xaa, 0xa4, 0x0063},
5794         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
5795         {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW},
5796         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5797         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
5798         {0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW},
5799         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5800         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5801         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5802         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5803         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5804         {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5805         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
5806         {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0},
5807         {0xa0, 0xda, ZC3XX_R01E_HSYNC_1},
5808         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
5809         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5810         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
5811         {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
5812         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5813         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5814         {0xa1, 0x01, 0x0180},
5815         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5816         {}
5817 };
5818 static const struct usb_action tas5130cxx_50HZ[] = {
5819         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5820         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5821         {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
5822         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5823         {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
5824         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5825         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
5826         {0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,38,cc */
5827         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5828         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5829         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
5830         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5831         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5832         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5833         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5834         {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
5835         {0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
5836         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
5837         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5838         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5839         {}
5840 };
5841 static const struct usb_action tas5130cxx_50HZScale[] = {
5842         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5843         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5844         {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5845         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5846         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5847         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5848         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5849         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
5850         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5851         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5852         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5853         {0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
5854         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5855         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5856         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5857         {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
5858         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
5859         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
5860         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5861         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5862         {}
5863 };
5864 static const struct usb_action tas5130cxx_60HZ[] = {
5865         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5866         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5867         {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
5868         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5869         {0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
5870         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5871         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
5872         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5873         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5874         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5875         {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
5876         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5877         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5878         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5879         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5880         {0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
5881         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5882         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5883         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5884         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5885         {}
5886 };
5887 static const struct usb_action tas5130cxx_60HZScale[] = {
5888         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5889         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5890         {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5891         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5892         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5893         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5894         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5895         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
5896         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5897         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5898         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5899         {0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
5900         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5901         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5902         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5903         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
5904         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5905         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5906         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5907         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5908         {}
5909 };
5910 static const struct usb_action tas5130cxx_NoFliker[] = {
5911         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5912         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5913         {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
5914         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5915         {0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
5916         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5917         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
5918         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5919         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5920         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5921         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5922         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5923         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5924         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5925         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5926         {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5927         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5928         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5929         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5930         {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5931         {}
5932 };
5933
5934 static const struct usb_action tas5130cxx_NoFlikerScale[] = {
5935         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5936         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5937         {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
5938         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5939         {0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
5940         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5941         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5942         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5943         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5944         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5945         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5946         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5947         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5948         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5949         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5950         {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5951         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5952         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5953         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5954         {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5955         {}
5956 };
5957
5958 static const struct usb_action tas5130c_vf0250_Initial[] = {
5959         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc, */
5960         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},          /* 00,08,02,cc, */
5961         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc, */
5962         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},           /* 00,02,00,cc,
5963                                                          * 0<->10 */
5964         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc, */
5965         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc, */
5966         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc, */
5967         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc, */
5968         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
5969         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc, */
5970         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc, */
5971         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc, */
5972         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc, */
5973         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,00,cc, */
5974         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc, */
5975         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,00,cc, */
5976         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,e6,cc,
5977                                                          * 6<->8 */
5978         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,86,cc,
5979                                                          * 6<->8 */
5980         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},            /* 00,87,10,cc, */
5981         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
5982         {0xaa, 0x1b, 0x0024},           /* 00,1b,24,aa, */
5983         {0xdd, 0x00, 0x0080},           /* 00,00,80,dd, */
5984         {0xaa, 0x1b, 0x0000},           /* 00,1b,00,aa, */
5985         {0xaa, 0x13, 0x0002},           /* 00,13,02,aa, */
5986         {0xaa, 0x15, 0x0004},           /* 00,15,04,aa */
5987         {0xaa, 0x01, 0x0000},
5988         {0xaa, 0x01, 0x0000},
5989         {0xaa, 0x1a, 0x0000},           /* 00,1a,00,aa, */
5990         {0xaa, 0x1c, 0x0017},           /* 00,1c,17,aa, */
5991         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},           /* 00,86,82,cc, */
5992         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},            /* 00,87,83,cc, */
5993         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},            /* 00,88,84,cc, */
5994         {0xaa, 0x05, 0x0010},           /* 00,05,10,aa, */
5995         {0xaa, 0x0a, 0x0000},           /* 00,0a,00,aa, */
5996         {0xaa, 0x0b, 0x00a0},           /* 00,0b,a0,aa, */
5997         {0xaa, 0x0c, 0x0000},           /* 00,0c,00,aa, */
5998         {0xaa, 0x0d, 0x00a0},           /* 00,0d,a0,aa, */
5999         {0xaa, 0x0e, 0x0000},           /* 00,0e,00,aa, */
6000         {0xaa, 0x0f, 0x00a0},           /* 00,0f,a0,aa, */
6001         {0xaa, 0x10, 0x0000},           /* 00,10,00,aa, */
6002         {0xaa, 0x11, 0x00a0},           /* 00,11,a0,aa, */
6003         {0xa0, 0x00, 0x0039},
6004         {0xa1, 0x01, 0x0037},
6005         {0xaa, 0x16, 0x0001},           /* 00,16,01,aa, */
6006         {0xaa, 0x17, 0x00e8},           /* 00,17,e6,aa, (e6 -> e8) */
6007         {0xaa, 0x18, 0x0002},           /* 00,18,02,aa, */
6008         {0xaa, 0x19, 0x0088},           /* 00,19,86,aa, */
6009         {0xaa, 0x20, 0x0020},           /* 00,20,20,aa, */
6010         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc, */
6011         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc, */
6012         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc, */
6013         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},             /* 01,89,76,cc, */
6014         {0xa0, 0x09, 0x01ad},                           /* 01,ad,09,cc, */
6015         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc, */
6016         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc, */
6017         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc, */
6018         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc, */
6019         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},           /* 01,a8,60,cc, */
6020         {0xa0, 0x61, ZC3XX_R116_RGAIN},                 /* 01,16,61,cc, */
6021         {0xa0, 0x65, ZC3XX_R118_BGAIN},                 /* 01,18,65,cc */
6022         {}
6023 };
6024
6025 static const struct usb_action tas5130c_vf0250_InitialScale[] = {
6026         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc, */
6027         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},          /* 00,08,02,cc, */
6028         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc, */
6029         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},           /* 00,02,10,cc, */
6030         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc, */
6031         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc, */
6032         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc, */
6033         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc, */
6034         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
6035         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc, */
6036         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc, */
6037         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc, */
6038         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc, */
6039         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,00,cc, */
6040         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc, */
6041         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,00,cc, */
6042         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,e8,cc,
6043                                                          * 8<->6 */
6044         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,88,cc,
6045                                                          * 8<->6 */
6046         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},            /* 00,87,10,cc, */
6047         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
6048         {0xaa, 0x1b, 0x0024},           /* 00,1b,24,aa, */
6049         {0xdd, 0x00, 0x0080},           /* 00,00,80,dd, */
6050         {0xaa, 0x1b, 0x0000},           /* 00,1b,00,aa, */
6051         {0xaa, 0x13, 0x0002},           /* 00,13,02,aa, */
6052         {0xaa, 0x15, 0x0004},           /* 00,15,04,aa */
6053         {0xaa, 0x01, 0x0000},
6054         {0xaa, 0x01, 0x0000},
6055         {0xaa, 0x1a, 0x0000},           /* 00,1a,00,aa, */
6056         {0xaa, 0x1c, 0x0017},           /* 00,1c,17,aa, */
6057         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc, */
6058         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc, */
6059         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc, */
6060         {0xaa, 0x05, 0x0010},           /* 00,05,10,aa, */
6061         {0xaa, 0x0a, 0x0000},           /* 00,0a,00,aa, */
6062         {0xaa, 0x0b, 0x00a0},           /* 00,0b,a0,aa, */
6063         {0xaa, 0x0c, 0x0000},           /* 00,0c,00,aa, */
6064         {0xaa, 0x0d, 0x00a0},           /* 00,0d,a0,aa, */
6065         {0xaa, 0x0e, 0x0000},           /* 00,0e,00,aa, */
6066         {0xaa, 0x0f, 0x00a0},           /* 00,0f,a0,aa, */
6067         {0xaa, 0x10, 0x0000},           /* 00,10,00,aa, */
6068         {0xaa, 0x11, 0x00a0},           /* 00,11,a0,aa, */
6069         {0xa0, 0x00, 0x0039},
6070         {0xa1, 0x01, 0x0037},
6071         {0xaa, 0x16, 0x0001},           /* 00,16,01,aa, */
6072         {0xaa, 0x17, 0x00e8},           /* 00,17,e6,aa (e6 -> e8) */
6073         {0xaa, 0x18, 0x0002},           /* 00,18,02,aa, */
6074         {0xaa, 0x19, 0x0088},           /* 00,19,88,aa, */
6075         {0xaa, 0x20, 0x0020},           /* 00,20,20,aa, */
6076         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc, */
6077         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc, */
6078         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc, */
6079         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},             /* 01,89,76,cc, */
6080         {0xa0, 0x09, 0x01ad},                           /* 01,ad,09,cc, */
6081         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc, */
6082         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc, */
6083         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc, */
6084         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc, */
6085         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},           /* 01,a8,60,cc, */
6086         {0xa0, 0x61, ZC3XX_R116_RGAIN},         /* 01,16,61,cc, */
6087         {0xa0, 0x65, ZC3XX_R118_BGAIN},         /* 01,18,65,cc */
6088         {}
6089 };
6090 /* "50HZ" light frequency banding filter */
6091 static const struct usb_action tas5130c_vf0250_50HZ[] = {
6092         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6093         {0xaa, 0x83, 0x0001},           /* 00,83,01,aa */
6094         {0xaa, 0x84, 0x00aa},           /* 00,84,aa,aa */
6095         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6096         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0d,cc, */
6097         {0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,50,cc, */
6098         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6099         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6100         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,47,cc, */
6101         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6102         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6103         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6104         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6105         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6106         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6107         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6108         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6109         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6110         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6111         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6112         {}
6113 };
6114
6115 /* "50HZScale" light frequency banding filter */
6116 static const struct usb_action tas5130c_vf0250_50HZScale[] = {
6117         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6118         {0xaa, 0x83, 0x0003},           /* 00,83,03,aa */
6119         {0xaa, 0x84, 0x0054},           /* 00,84,54,aa */
6120         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6121         {0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0d,cc, */
6122         {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,50,cc, */
6123         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6124         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6125         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,8e,cc, */
6126         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6127         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6128         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6129         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6130         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6131         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6132         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6133         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6134         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6135         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6136         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6137         {}
6138 };
6139
6140 /* "60HZ" light frequency banding filter */
6141 static const struct usb_action tas5130c_vf0250_60HZ[] = {
6142         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6143         {0xaa, 0x83, 0x0001},           /* 00,83,01,aa */
6144         {0xaa, 0x84, 0x0062},           /* 00,84,62,aa */
6145         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6146         {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,05,cc, */
6147         {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,88,cc, */
6148         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6149         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6150         {0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,3b,cc, */
6151         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6152         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6153         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6154         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6155         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6156         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6157         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6158         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6159         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6160         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6161         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6162         {}
6163 };
6164
6165 /* "60HZScale" light frequency banding ilter */
6166 static const struct usb_action tas5130c_vf0250_60HZScale[] = {
6167         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6168         {0xaa, 0x83, 0x0002},           /* 00,83,02,aa */
6169         {0xaa, 0x84, 0x00c4},           /* 00,84,c4,aa */
6170         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6171         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,1,0b,cc, */
6172         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,2,10,cc, */
6173         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,5,00,cc, */
6174         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,6,00,cc, */
6175         {0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,7,76,cc, */
6176         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,c,0e,cc, */
6177         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,f,15,cc, */
6178         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,9,10,cc, */
6179         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,a,24,cc, */
6180         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,d,62,cc, */
6181         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,e,90,cc, */
6182         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,f,c8,cc, */
6183         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,0,ff,cc, */
6184         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,d,58,cc, */
6185         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6186         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,d,78,cc */
6187         {}
6188 };
6189
6190 /* "NoFliker" light frequency banding flter */
6191 static const struct usb_action tas5130c_vf0250_NoFliker[] = {
6192         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0c,cc, */
6193         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6194         {0xaa, 0x83, 0x0000},           /* 00,83,00,aa */
6195         {0xaa, 0x84, 0x0020},           /* 00,84,20,aa */
6196         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,0,00,cc, */
6197         {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,05,cc, */
6198         {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,88,cc, */
6199         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6200         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6201         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc, */
6202         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6203         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6204         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6205         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6206         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6207         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6208         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6209         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
6210         {}
6211 };
6212
6213 /* "NoFlikerScale" light frequency banding filter */
6214 static const struct usb_action tas5130c_vf0250_NoFlikerScale[] = {
6215         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0c,cc, */
6216         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6217         {0xaa, 0x83, 0x0000},           /* 00,83,00,aa */
6218         {0xaa, 0x84, 0x0020},           /* 00,84,20,aa */
6219         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6220         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc, */
6221         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,10,cc, */
6222         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6223         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6224         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc, */
6225         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6226         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6227         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6228         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6229         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6230         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6231         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6232         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
6233         {}
6234 };
6235
6236 static int reg_r_i(struct gspca_dev *gspca_dev,
6237                 __u16 index)
6238 {
6239         usb_control_msg(gspca_dev->dev,
6240                         usb_rcvctrlpipe(gspca_dev->dev, 0),
6241                         0xa1,
6242                         USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6243                         0x01,                   /* value */
6244                         index, gspca_dev->usb_buf, 1,
6245                         500);
6246         return gspca_dev->usb_buf[0];
6247 }
6248
6249 static int reg_r(struct gspca_dev *gspca_dev,
6250                 __u16 index)
6251 {
6252         int ret;
6253
6254         ret = reg_r_i(gspca_dev, index);
6255         PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
6256         return ret;
6257 }
6258
6259 static void reg_w_i(struct usb_device *dev,
6260                         __u8 value,
6261                         __u16 index)
6262 {
6263         usb_control_msg(dev,
6264                         usb_sndctrlpipe(dev, 0),
6265                         0xa0,
6266                         USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6267                         value, index, NULL, 0,
6268                         500);
6269 }
6270
6271 static void reg_w(struct usb_device *dev,
6272                         __u8 value,
6273                         __u16 index)
6274 {
6275         PDEBUG(D_USBO, "reg w %02x -> [%04x]", value, index);
6276         reg_w_i(dev, value, index);
6277 }
6278
6279 static __u16 i2c_read(struct gspca_dev *gspca_dev,
6280                         __u8 reg)
6281 {
6282         __u8 retbyte;
6283         __u8 retval[2];
6284
6285         reg_w_i(gspca_dev->dev, reg, 0x92);
6286         reg_w_i(gspca_dev->dev, 0x02, 0x90);            /* <- read command */
6287         msleep(25);
6288         retbyte = reg_r_i(gspca_dev, 0x0091);           /* read status */
6289         retval[0] = reg_r_i(gspca_dev, 0x0095);         /* read Lowbyte */
6290         retval[1] = reg_r_i(gspca_dev, 0x0096);         /* read Hightbyte */
6291         PDEBUG(D_USBO, "i2c r [%02x] -> (%02x) %02x%02x",
6292                         reg, retbyte, retval[1], retval[0]);
6293         return (retval[1] << 8) | retval[0];
6294 }
6295
6296 static __u8 i2c_write(struct gspca_dev *gspca_dev,
6297                         __u8 reg,
6298                         __u8 valL,
6299                         __u8 valH)
6300 {
6301         __u8 retbyte;
6302
6303         reg_w_i(gspca_dev->dev, reg, 0x92);
6304         reg_w_i(gspca_dev->dev, valL, 0x93);
6305         reg_w_i(gspca_dev->dev, valH, 0x94);
6306         reg_w_i(gspca_dev->dev, 0x01, 0x90);            /* <- write command */
6307         msleep(5);
6308         retbyte = reg_r_i(gspca_dev, 0x0091);           /* read status */
6309         PDEBUG(D_USBO, "i2c w [%02x] %02x%02x (%02x)",
6310                         reg, valH, valL, retbyte);
6311         return retbyte;
6312 }
6313
6314 static void usb_exchange(struct gspca_dev *gspca_dev,
6315                         const struct usb_action *action)
6316 {
6317         while (action->req) {
6318                 switch (action->req) {
6319                 case 0xa0:      /* write register */
6320                         reg_w(gspca_dev->dev, action->val, action->idx);
6321                         break;
6322                 case 0xa1:      /* read status */
6323                         reg_r(gspca_dev, action->idx);
6324                         break;
6325                 case 0xaa:
6326                         i2c_write(gspca_dev,
6327                                   action->val,                  /* reg */
6328                                   action->idx & 0xff,           /* valL */
6329                                   action->idx >> 8);            /* valH */
6330                         break;
6331                 default:
6332 /*              case 0xdd:       * delay */
6333                         msleep(action->val / 64 + 10);
6334                         break;
6335                 }
6336                 action++;
6337 /*              msleep(1); */
6338         }
6339 }
6340
6341 static void setmatrix(struct gspca_dev *gspca_dev)
6342 {
6343         struct sd *sd = (struct sd *) gspca_dev;
6344         int i;
6345         const __u8 *matrix;
6346         static const __u8 gc0305_matrix[9] =
6347                 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
6348         static const __u8 ov7620_matrix[9] =
6349                 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
6350         static const __u8 po2030_matrix[9] =
6351                 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
6352
6353         switch (sd->sensor) {
6354         case SENSOR_GC0305:
6355                 matrix = gc0305_matrix;
6356                 break;
6357         case SENSOR_MC501CB:
6358                 return;         /* no matrix? */
6359         case SENSOR_OV7620:
6360 /*      case SENSOR_OV7648: */
6361                 matrix = ov7620_matrix;
6362                 break;
6363         case SENSOR_PO2030:
6364                 matrix = po2030_matrix;
6365                 break;
6366         case SENSOR_TAS5130C_VF0250:    /* no matrix? */
6367                 return;
6368         default:                /* matrix already loaded */
6369                 return;
6370         }
6371         for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
6372                 reg_w(gspca_dev->dev, matrix[i], 0x010a + i);
6373 }
6374
6375 static void setbrightness(struct gspca_dev *gspca_dev)
6376 {
6377         struct sd *sd = (struct sd *) gspca_dev;
6378         __u8 brightness;
6379
6380         switch (sd->sensor) {
6381         case SENSOR_GC0305:
6382         case SENSOR_OV7620:
6383         case SENSOR_PO2030:
6384                 return;
6385         }
6386 /*fixme: is it really write to 011d and 018d for all other sensors? */
6387         brightness = sd->brightness;
6388         reg_w(gspca_dev->dev, brightness, 0x011d);
6389         if (brightness < 0x70)
6390                 brightness += 0x10;
6391         else
6392                 brightness = 0x80;
6393         reg_w(gspca_dev->dev, brightness, 0x018d);
6394 }
6395
6396 static void setsharpness(struct gspca_dev *gspca_dev)
6397 {
6398         struct sd *sd = (struct sd *) gspca_dev;
6399         struct usb_device *dev = gspca_dev->dev;
6400         int sharpness;
6401         static const __u8 sharpness_tb[][2] = {
6402                 {0x02, 0x03},
6403                 {0x04, 0x07},
6404                 {0x08, 0x0f},
6405                 {0x10, 0x1e}
6406         };
6407
6408         sharpness = sd->sharpness;
6409         reg_w(dev, sharpness_tb[sharpness][0], 0x01c6);
6410         reg_r(gspca_dev, 0x01c8);
6411         reg_r(gspca_dev, 0x01c9);
6412         reg_r(gspca_dev, 0x01ca);
6413         reg_w(dev, sharpness_tb[sharpness][1], 0x01cb);
6414 }
6415
6416 static void setcontrast(struct gspca_dev *gspca_dev)
6417 {
6418         struct sd *sd = (struct sd *) gspca_dev;
6419         struct usb_device *dev = gspca_dev->dev;
6420         const __u8 *Tgamma, *Tgradient;
6421         int g, i, k;
6422         static const __u8 kgamma_tb[16] =       /* delta for contrast */
6423                 {0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08,
6424                  0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
6425         static const __u8 kgrad_tb[16] =
6426                 {0x1b, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00,
6427                  0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x04};
6428         static const __u8 Tgamma_1[16] =
6429                 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
6430                  0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff};
6431         static const __u8 Tgradient_1[16] =
6432                 {0x00, 0x01, 0x05, 0x0b, 0x10, 0x15, 0x18, 0x1a,
6433                  0x1a, 0x18, 0x16, 0x14, 0x12, 0x0f, 0x0d, 0x06};
6434         static const __u8 Tgamma_2[16] =
6435                 {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
6436                  0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff};
6437         static const __u8 Tgradient_2[16] =
6438                 {0x05, 0x0f, 0x16, 0x1a, 0x19, 0x19, 0x17, 0x15,
6439                  0x12, 0x10, 0x0e, 0x0b, 0x09, 0x08, 0x06, 0x03};
6440         static const __u8 Tgamma_3[16] =
6441                 {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
6442                  0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff};
6443         static const __u8 Tgradient_3[16] =
6444                 {0x0c, 0x16, 0x1b, 0x1c, 0x19, 0x18, 0x15, 0x12,
6445                  0x10, 0x0d, 0x0b, 0x09, 0x08, 0x06, 0x05, 0x03};
6446         static const __u8 Tgamma_4[16] =
6447                 {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
6448                  0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff};
6449         static const __u8 Tgradient_4[16] =
6450                 {0x26, 0x22, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0d,
6451                  0x0b, 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02};
6452         static const __u8 Tgamma_5[16] =
6453                 {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
6454                  0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff};
6455         static const __u8 Tgradient_5[16] =
6456                 {0x37, 0x26, 0x20, 0x1a, 0x14, 0x10, 0x0e, 0x0b,
6457                  0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x02};
6458         static const __u8 Tgamma_6[16] =                /* ?? was gamma 5 */
6459                 {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
6460                  0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff};
6461         static const __u8 Tgradient_6[16] =
6462                 {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
6463                  0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
6464         static const __u8 *gamma_tb[] = {
6465                 NULL, Tgamma_1, Tgamma_2,
6466                 Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
6467         };
6468         static const __u8 *gradient_tb[] = {
6469                 NULL, Tgradient_1, Tgradient_2,
6470                 Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
6471         };
6472 #ifdef CONFIG_VIDEO_ADV_DEBUG
6473         __u8 v[16];
6474 #endif
6475
6476         Tgamma = gamma_tb[sd->gamma];
6477         Tgradient = gradient_tb[sd->gamma];
6478
6479         k = (sd->contrast - 128)                /* -128 / 128 */
6480                         * Tgamma[0];
6481         PDEBUG(D_CONF, "gamma:%d contrast:%d gamma coeff: %d/128",
6482                 sd->gamma, sd->contrast, k);
6483         for (i = 0; i < 16; i++) {
6484                 g = Tgamma[i] + kgamma_tb[i] * k / 128;
6485                 if (g > 0xff)
6486                         g = 0xff;
6487                 else if (g <= 0)
6488                         g = 1;
6489                 reg_w(dev, g, 0x0120 + i);      /* gamma */
6490 #ifdef CONFIG_VIDEO_ADV_DEBUG
6491                 if (gspca_debug & D_CONF)
6492                         v[i] = g;
6493 #endif
6494         }
6495         PDEBUG(D_CONF, "tb: %02x %02x %02x %02x %02x %02x %02x %02x",
6496                 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6497         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6498                 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6499         for (i = 0; i < 16; i++) {
6500                 g = Tgradient[i] - kgrad_tb[i] * k / 128;
6501                 if (g > 0xff)
6502                         g = 0xff;
6503                 else if (g <= 0) {
6504                         if (i != 15)
6505                                 g = 0;
6506                         else
6507                                 g = 1;
6508                 }
6509                 reg_w(dev, g, 0x0130 + i);      /* gradient */
6510 #ifdef CONFIG_VIDEO_ADV_DEBUG
6511                 if (gspca_debug & D_CONF)
6512                         v[i] = g;
6513 #endif
6514         }
6515         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6516                 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6517         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6518                 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6519 }
6520
6521 static void setquality(struct gspca_dev *gspca_dev)
6522 {
6523         struct sd *sd = (struct sd *) gspca_dev;
6524         struct usb_device *dev = gspca_dev->dev;
6525         __u8 quality;
6526         __u8 frxt;
6527
6528         switch (sd->sensor) {
6529         case SENSOR_GC0305:
6530         case SENSOR_OV7620:
6531         case SENSOR_PO2030:
6532                 return;
6533         }
6534 /*fixme: is it really 0008 0007 0018 for all other sensors? */
6535         quality = sd->qindex;
6536         reg_w(dev, quality, 0x0008);
6537         frxt = 0x30;
6538         reg_w(dev, frxt, 0x0007);
6539         switch (quality) {
6540         case 0:
6541         case 1:
6542         case 2:
6543                 frxt = 0xff;
6544                 break;
6545         case 3:
6546                 frxt = 0xf0;
6547                 break;
6548         case 4:
6549                 frxt = 0xe0;
6550                 break;
6551         case 5:
6552                 frxt = 0x20;
6553                 break;
6554         }
6555         reg_w(dev, frxt, 0x0018);
6556 }
6557
6558 /* Matches the sensor's internal frame rate to the lighting frequency.
6559  * Valid frequencies are:
6560  *      50Hz, for European and Asian lighting (default)
6561  *      60Hz, for American lighting
6562  *      0 = No Fliker (for outdoore usage)
6563  * Returns: 0 for success
6564  */
6565 static int setlightfreq(struct gspca_dev *gspca_dev)
6566 {
6567         struct sd *sd = (struct sd *) gspca_dev;
6568         int i, mode;
6569         const struct usb_action *zc3_freq;
6570         static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
6571 /* SENSOR_CS2102 0 */
6572                 {cs2102_NoFliker, cs2102_NoFlikerScale,
6573                  cs2102_50HZ, cs2102_50HZScale,
6574                  cs2102_60HZ, cs2102_60HZScale},
6575 /* SENSOR_CS2102K 1 */
6576                 {cs2102_NoFliker, cs2102_NoFlikerScale,
6577                  cs2102_50HZ, cs2102_50HZScale,
6578                  cs2102_60HZ, cs2102_60HZScale},
6579 /* SENSOR_GC0305 2 */
6580                 {gc0305_NoFliker, gc0305_NoFliker,
6581                  gc0305_50HZ, gc0305_50HZ,
6582                  gc0305_60HZ, gc0305_60HZ},
6583 /* SENSOR_HDCS2020 3 */
6584                 {NULL, NULL,
6585                  NULL, NULL,
6586                  NULL, NULL},
6587 /* SENSOR_HDCS2020b 4 */
6588                 {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
6589                  hdcs2020b_50HZ, hdcs2020b_50HZ,
6590                  hdcs2020b_60HZ, hdcs2020b_60HZ},
6591 /* SENSOR_HV7131B 5 */
6592                 {NULL, NULL,
6593                  NULL, NULL,
6594                  NULL, NULL},
6595 /* SENSOR_HV7131C 6 */
6596                 {NULL, NULL,
6597                  NULL, NULL,
6598                  NULL, NULL},
6599 /* SENSOR_ICM105A 7 */
6600                 {icm105a_NoFliker, icm105a_NoFlikerScale,
6601                  icm105a_50HZ, icm105a_50HZScale,
6602                  icm105a_60HZ, icm105a_60HZScale},
6603 /* SENSOR_MC501CB 8 */
6604                 {MC501CB_NoFliker, MC501CB_NoFlikerScale,
6605                  MC501CB_50HZ, MC501CB_50HZScale,
6606                  MC501CB_60HZ, MC501CB_60HZScale},
6607 /* SENSOR_OV7620 9 */
6608                 {OV7620_NoFliker, OV7620_NoFliker,
6609                  OV7620_50HZ, OV7620_50HZ,
6610                  OV7620_60HZ, OV7620_60HZ},
6611 /* SENSOR_OV7630C 10 */
6612                 {NULL, NULL,
6613                  NULL, NULL,
6614                  NULL, NULL},
6615 /* SENSOR_PAS106 11 */
6616                 {pas106b_NoFliker, pas106b_NoFliker,
6617                  pas106b_50HZ, pas106b_50HZ,
6618                  pas106b_60HZ, pas106b_60HZ},
6619 /* SENSOR_PB0330 12 */
6620                 {pb0330_NoFliker, pb0330_NoFlikerScale,
6621                  pb0330_50HZ, pb0330_50HZScale,
6622                  pb0330_60HZ, pb0330_60HZScale},
6623 /* SENSOR_PO2030 13 */
6624                 {PO2030_NoFliker, PO2030_NoFliker,
6625                  PO2030_50HZ, PO2030_50HZ,
6626                  PO2030_60HZ, PO2030_60HZ},
6627 /* SENSOR_TAS5130CK 14 */
6628                 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6629                  tas5130cxx_50HZ, tas5130cxx_50HZScale,
6630                  tas5130cxx_60HZ, tas5130cxx_60HZScale},
6631 /* SENSOR_TAS5130CXX 15 */
6632                 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6633                  tas5130cxx_50HZ, tas5130cxx_50HZScale,
6634                  tas5130cxx_60HZ, tas5130cxx_60HZScale},
6635 /* SENSOR_TAS5130C_VF0250 16 */
6636                 {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale,
6637                  tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale,
6638                  tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale},
6639         };
6640
6641         i = sd->lightfreq * 2;
6642         mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
6643         if (!mode)
6644                 i++;                    /* 640x480 */
6645         zc3_freq = freq_tb[(int) sd->sensor][i];
6646         if (zc3_freq != NULL) {
6647                 usb_exchange(gspca_dev, zc3_freq);
6648                 switch (sd->sensor) {
6649                 case SENSOR_GC0305:
6650                         if (mode                        /* if 320x240 */
6651                             && sd->lightfreq == 1)      /* and 50Hz */
6652                                 reg_w(gspca_dev->dev, 0x85, 0x018d);
6653                                                 /* win: 0x80, 0x018d */
6654                         break;
6655                 case SENSOR_OV7620:
6656                         if (!mode) {                    /* if 640x480 */
6657                                 if (sd->lightfreq != 0) /* and 50 or 60 Hz */
6658                                         reg_w(gspca_dev->dev, 0x40, 0x0002);
6659                                 else
6660                                         reg_w(gspca_dev->dev, 0x44, 0x0002);
6661                         }
6662                         break;
6663                 }
6664         }
6665         return 0;
6666 }
6667
6668 static void setautogain(struct gspca_dev *gspca_dev)
6669 {
6670         struct sd *sd = (struct sd *) gspca_dev;
6671         __u8 autoval;
6672
6673         if (sd->autogain)
6674                 autoval = 0x42;
6675         else
6676                 autoval = 0x02;
6677         reg_w(gspca_dev->dev, autoval, 0x0180);
6678 }
6679
6680 static void send_unknown(struct usb_device *dev, int sensor)
6681 {
6682         reg_w(dev, 0x01, 0x0000);               /* led off */
6683         switch (sensor) {
6684         case SENSOR_PAS106:
6685                 reg_w(dev, 0x03, 0x003a);
6686                 reg_w(dev, 0x0c, 0x003b);
6687                 reg_w(dev, 0x08, 0x0038);
6688                 break;
6689         case SENSOR_GC0305:
6690         case SENSOR_OV7620:
6691         case SENSOR_PB0330:
6692         case SENSOR_PO2030:
6693                 reg_w(dev, 0x0d, 0x003a);
6694                 reg_w(dev, 0x02, 0x003b);
6695                 reg_w(dev, 0x00, 0x0038);
6696                 break;
6697         }
6698 }
6699
6700 /* start probe 2 wires */
6701 static void start_2wr_probe(struct usb_device *dev, int sensor)
6702 {
6703         reg_w(dev, 0x01, 0x0000);
6704         reg_w(dev, sensor, 0x0010);
6705         reg_w(dev, 0x01, 0x0001);
6706         reg_w(dev, 0x03, 0x0012);
6707         reg_w(dev, 0x01, 0x0012);
6708 /*      msleep(2); */
6709 }
6710
6711 static int sif_probe(struct gspca_dev *gspca_dev)
6712 {
6713         __u16 checkword;
6714
6715         start_2wr_probe(gspca_dev->dev, 0x0f);          /* PAS106 */
6716         reg_w(gspca_dev->dev, 0x08, 0x008d);
6717         msleep(150);
6718         checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
6719                         | ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
6720         PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
6721         if (checkword == 0x0007) {
6722                 send_unknown(gspca_dev->dev, SENSOR_PAS106);
6723                 return 0x0f;                    /* PAS106 */
6724         }
6725         return -1;
6726 }
6727
6728 static int vga_2wr_probe(struct gspca_dev *gspca_dev)
6729 {
6730         struct usb_device *dev = gspca_dev->dev;
6731         __u8 retbyte;
6732         __u16 checkword;
6733
6734         start_2wr_probe(dev, 0x00);             /* HV7131B */
6735         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6736         retbyte = i2c_read(gspca_dev, 0x01);
6737         if (retbyte != 0)
6738                 return 0x00;                    /* HV7131B */
6739
6740         start_2wr_probe(dev, 0x04);             /* CS2102 */
6741         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6742         retbyte = i2c_read(gspca_dev, 0x01);
6743         if (retbyte != 0)
6744                 return 0x04;                    /* CS2102 */
6745
6746         start_2wr_probe(dev, 0x06);             /* OmniVision */
6747         reg_w(dev, 0x08, 0x8d);
6748         i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
6749         retbyte = i2c_read(gspca_dev, 0x11);
6750         if (retbyte != 0) {
6751                 /* (should have returned 0xaa) --> Omnivision? */
6752                 /* reg_r 0x10 -> 0x06 -->  */
6753                 goto ov_check;
6754         }
6755
6756         start_2wr_probe(dev, 0x08);             /* HDCS2020 */
6757         i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
6758         retbyte = i2c_read(gspca_dev, 0x15);
6759         if (retbyte != 0)
6760                 return 0x08;                    /* HDCS2020 */
6761
6762         start_2wr_probe(dev, 0x0a);             /* PB0330 */
6763         i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
6764         retbyte = i2c_read(gspca_dev, 0x07);
6765         if (retbyte != 0)
6766                 return 0x0a;                    /* PB0330 */
6767         retbyte = i2c_read(gspca_dev, 0x03);
6768         if (retbyte != 0)
6769                 return 0x0a;                    /* PB0330 ?? */
6770         retbyte = i2c_read(gspca_dev, 0x04);
6771         if (retbyte != 0)
6772                 return 0x0a;                    /* PB0330 ?? */
6773
6774         start_2wr_probe(dev, 0x0c);             /* ICM105A */
6775         i2c_write(gspca_dev, 0x01, 0x11, 0x00);
6776         retbyte = i2c_read(gspca_dev, 0x01);
6777         if (retbyte != 0)
6778                 return 0x0c;                    /* ICM105A */
6779
6780         start_2wr_probe(dev, 0x0e);             /* PAS202BCB */
6781         reg_w(dev, 0x08, 0x8d);
6782         i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
6783         msleep(500);
6784         retbyte = i2c_read(gspca_dev, 0x03);
6785         if (retbyte != 0)
6786                 return 0x0e;                    /* PAS202BCB */
6787
6788         start_2wr_probe(dev, 0x02);             /* ?? */
6789         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6790         retbyte = i2c_read(gspca_dev, 0x01);
6791         if (retbyte != 0)
6792                 return 0x02;                    /* ?? */
6793 ov_check:
6794         reg_r(gspca_dev, 0x0010);               /* ?? */
6795         reg_r(gspca_dev, 0x0010);
6796
6797         reg_w(dev, 0x01, 0x0000);
6798         reg_w(dev, 0x01, 0x0001);
6799         reg_w(dev, 0x06, 0x0010);               /* OmniVision */
6800         reg_w(dev, 0xa1, 0x008b);
6801         reg_w(dev, 0x08, 0x008d);
6802         msleep(500);
6803         reg_w(dev, 0x01, 0x0012);
6804         i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
6805         retbyte = i2c_read(gspca_dev, 0x0a);
6806         checkword = retbyte << 8;
6807         retbyte = i2c_read(gspca_dev, 0x0b);
6808         checkword |= retbyte;
6809         PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", checkword);
6810         switch (checkword) {
6811         case 0x7631:                            /* OV7630C */
6812                 reg_w(dev, 0x06, 0x0010);
6813                 break;
6814         case 0x7620:                            /* OV7620 */
6815         case 0x7648:                            /* OV7648 */
6816                 break;
6817         default:
6818                 return -1;                      /* not OmniVision */
6819         }
6820         return checkword;
6821 }
6822
6823 struct sensor_by_chipset_revision {
6824         __u16 revision;
6825         __u8 internal_sensor_id;
6826 };
6827 static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
6828         {0xc001, 0x13},         /* MI0360 */
6829         {0xe001, 0x13},
6830         {0x8001, 0x13},
6831         {0x8000, 0x14},         /* CS2102K */
6832         {0x8400, 0x15},         /* TAS5130K */
6833         {0, 0}
6834 };
6835
6836 static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6837 {
6838         struct sd *sd = (struct sd *) gspca_dev;
6839         struct usb_device *dev = gspca_dev->dev;
6840         int i;
6841         __u8 retbyte;
6842         __u16 checkword;
6843
6844 /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
6845         reg_w(dev, 0x02, 0x0010);
6846         reg_r(gspca_dev, 0x10);
6847         reg_w(dev, 0x01, 0x0000);
6848         reg_w(dev, 0x00, 0x0010);
6849         reg_w(dev, 0x01, 0x0001);
6850         reg_w(dev, 0x91, 0x008b);
6851         reg_w(dev, 0x03, 0x0012);
6852         reg_w(dev, 0x01, 0x0012);
6853         reg_w(dev, 0x05, 0x0012);
6854         retbyte = i2c_read(gspca_dev, 0x14);
6855         if (retbyte != 0)
6856                 return 0x11;                    /* HV7131R */
6857         retbyte = i2c_read(gspca_dev, 0x15);
6858         if (retbyte != 0)
6859                 return 0x11;                    /* HV7131R */
6860         retbyte = i2c_read(gspca_dev, 0x16);
6861         if (retbyte != 0)
6862                 return 0x11;                    /* HV7131R */
6863
6864         reg_w(dev, 0x02, 0x0010);
6865         retbyte = reg_r(gspca_dev, 0x000b);
6866         checkword = retbyte << 8;
6867         retbyte = reg_r(gspca_dev, 0x000a);
6868         checkword |= retbyte;
6869         PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword);
6870         reg_r(gspca_dev, 0x0010);
6871         /* this is tested only once anyway */
6872         i = 0;
6873         while (chipset_revision_sensor[i].revision) {
6874                 if (chipset_revision_sensor[i].revision == checkword) {
6875                         sd->chip_revision = checkword;
6876                         send_unknown(dev, SENSOR_PB0330);
6877                         return chipset_revision_sensor[i].internal_sensor_id;
6878                 }
6879                 i++;
6880         }
6881
6882         reg_w(dev, 0x01, 0x0000);
6883         reg_w(dev, 0x01, 0x0001);
6884         reg_w(dev, 0xdd, 0x008b);
6885         reg_w(dev, 0x0a, 0x0010);
6886         reg_w(dev, 0x03, 0x0012);
6887         reg_w(dev, 0x01, 0x0012);
6888         retbyte = i2c_read(gspca_dev, 0x00);
6889         if (retbyte != 0) {
6890                 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6891                 return 0x0a;                    /* ?? */
6892         }
6893
6894         reg_w(dev, 0x01, 0x0000);
6895         reg_w(dev, 0x01, 0x0001);
6896         reg_w(dev, 0x98, 0x008b);
6897         reg_w(dev, 0x01, 0x0010);
6898         reg_w(dev, 0x03, 0x0012);
6899         msleep(2);
6900         reg_w(dev, 0x01, 0x0012);
6901         retbyte = i2c_read(gspca_dev, 0x00);
6902         if (retbyte != 0) {
6903                 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte);
6904                 send_unknown(dev, SENSOR_GC0305);
6905                 return retbyte;         /* 0x29 = gc0305 - should continue? */
6906         }
6907
6908         reg_w(dev, 0x01, 0x0000);       /* check OmniVision */
6909         reg_w(dev, 0x01, 0x0001);
6910         reg_w(dev, 0xa1, 0x008b);
6911         reg_w(dev, 0x08, 0x008d);
6912         reg_w(dev, 0x06, 0x0010);
6913         reg_w(dev, 0x01, 0x0012);
6914         reg_w(dev, 0x05, 0x0012);
6915         if (i2c_read(gspca_dev, 0x1c) == 0x7f   /* OV7610 - manufacturer ID */
6916             && i2c_read(gspca_dev, 0x1d) == 0xa2) {
6917                 send_unknown(dev, SENSOR_OV7620);
6918                 return 0x06;            /* OmniVision confirm ? */
6919         }
6920
6921         reg_w(dev, 0x01, 0x00);
6922         reg_w(dev, 0x00, 0x02);
6923         reg_w(dev, 0x01, 0x10);
6924         reg_w(dev, 0x01, 0x01);
6925         reg_w(dev, 0xee, 0x8b);
6926         reg_w(dev, 0x03, 0x12);
6927 /*      msleep(150); */
6928         reg_w(dev, 0x01, 0x12);
6929         reg_w(dev, 0x05, 0x12);
6930         retbyte = i2c_read(gspca_dev, 0x00);            /* ID 0 */
6931         checkword = retbyte << 8;
6932         retbyte = i2c_read(gspca_dev, 0x01);            /* ID 1 */
6933         checkword |= retbyte;
6934         PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword);
6935         if (checkword == 0x2030) {
6936                 retbyte = i2c_read(gspca_dev, 0x02);    /* revision number */
6937                 PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
6938                 send_unknown(dev, SENSOR_PO2030);
6939                 return checkword;
6940         }
6941
6942         reg_w(dev, 0x01, 0x00);
6943         reg_w(dev, 0x0a, 0x10);
6944         reg_w(dev, 0xd3, 0x8b);
6945         reg_w(dev, 0x01, 0x01);
6946         reg_w(dev, 0x03, 0x12);
6947         reg_w(dev, 0x01, 0x12);
6948         reg_w(dev, 0x05, 0x01);
6949         reg_w(dev, 0xd3, 0x8b);
6950         retbyte = i2c_read(gspca_dev, 0x01);
6951         if (retbyte != 0) {
6952                 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6953                 return 0x0a;                    /* ?? */
6954         }
6955         return -1;
6956 }
6957
6958 static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6959 {
6960         struct sd *sd = (struct sd *) gspca_dev;
6961         int sensor, sensor2;
6962
6963         switch (sd->sensor) {
6964         case SENSOR_MC501CB:
6965         case SENSOR_TAS5130C_VF0250:
6966                 return -1;              /* don't probe */
6967         }
6968         sensor = vga_2wr_probe(gspca_dev);
6969         if (sensor >= 0) {
6970                 if (sensor < 0x7600)
6971                         return sensor;
6972                 /* next probe is needed for OmniVision ? */
6973         }
6974         sensor2 = vga_3wr_probe(gspca_dev);
6975         if (sensor2 >= 0) {
6976                 if (sensor >= 0)
6977                         return sensor;
6978                 return sensor2;
6979         }
6980         return sif_probe(gspca_dev);
6981 }
6982
6983 /* this function is called at probe time */
6984 static int sd_config(struct gspca_dev *gspca_dev,
6985                         const struct usb_device_id *id)
6986 {
6987         struct sd *sd = (struct sd *) gspca_dev;
6988         struct cam *cam;
6989         int sensor;
6990         int vga = 1;            /* 1: vga, 0: sif */
6991         static const __u8 gamma[SENSOR_MAX] = {
6992                 5,      /* SENSOR_CS2102 0 */
6993                 5,      /* SENSOR_CS2102K 1 */
6994                 4,      /* SENSOR_GC0305 2 */
6995                 4,      /* SENSOR_HDCS2020 3 */
6996                 4,      /* SENSOR_HDCS2020b 4 */
6997                 4,      /* SENSOR_HV7131B 5 */
6998                 4,      /* SENSOR_HV7131C 6 */
6999                 4,      /* SENSOR_ICM105A 7 */
7000                 4,      /* SENSOR_MC501CB 8 */
7001                 3,      /* SENSOR_OV7620 9 */
7002                 4,      /* SENSOR_OV7630C 10 */
7003                 4,      /* SENSOR_PAS106 11 */
7004                 4,      /* SENSOR_PB0330 12 */
7005                 4,      /* SENSOR_PO2030 13 */
7006                 4,      /* SENSOR_TAS5130CK 14 */
7007                 4,      /* SENSOR_TAS5130CXX 15 */
7008                 3,      /* SENSOR_TAS5130C_VF0250 16 */
7009         };
7010
7011         /* define some sensors from the vendor/product */
7012         sd->sharpness = 2;
7013         switch (id->idVendor) {
7014         case 0x041e:                            /* Creative */
7015                 switch (id->idProduct) {
7016                 case 0x4051:                    /* zc301 chips */
7017                 case 0x4053:
7018                         sd->sensor = SENSOR_TAS5130C_VF0250;
7019                         break;
7020                 }
7021                 break;
7022         case 0x046d:                            /* Logitech Labtec */
7023                 switch (id->idProduct) {
7024                 case 0x08dd:
7025                         sd->sensor = SENSOR_MC501CB;
7026                         break;
7027                 }
7028                 break;
7029         case 0x0ac8:                            /* Vimicro z-star */
7030                 switch (id->idProduct) {
7031                 case 0x305b:
7032                         sd->sensor = SENSOR_TAS5130C_VF0250;
7033                         break;
7034                 }
7035                 break;
7036         }
7037         sensor = zcxx_probeSensor(gspca_dev);
7038         if (sensor >= 0)
7039                 PDEBUG(D_PROBE, "probe sensor -> %02x", sensor);
7040         if ((unsigned) force_sensor < SENSOR_MAX) {
7041                 sd->sensor = force_sensor;
7042                 PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
7043         } else {
7044                 switch (sensor) {
7045                 case -1:
7046                         switch (sd->sensor) {
7047                         case SENSOR_MC501CB:
7048                                 PDEBUG(D_PROBE, "Sensor MC501CB");
7049                                 break;
7050                         case SENSOR_TAS5130C_VF0250:
7051                                 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7052                                 break;
7053                         default:
7054                                 PDEBUG(D_PROBE,
7055                                         "Sensor UNKNOW_0 force Tas5130");
7056                                 sd->sensor = SENSOR_TAS5130CXX;
7057                         }
7058                         break;
7059                 case 0:
7060                         PDEBUG(D_PROBE, "Find Sensor HV7131B");
7061                         sd->sensor = SENSOR_HV7131B;
7062                         break;
7063                 case 0x04:
7064                         PDEBUG(D_PROBE, "Find Sensor CS2102");
7065                         sd->sensor = SENSOR_CS2102;
7066                         break;
7067                 case 0x08:
7068                         PDEBUG(D_PROBE, "Find Sensor HDCS2020(b)");
7069                         sd->sensor = SENSOR_HDCS2020b;
7070                         break;
7071                 case 0x0a:
7072                         PDEBUG(D_PROBE,
7073                                 "Find Sensor PB0330. Chip revision %x",
7074                                 sd->chip_revision);
7075                         sd->sensor = SENSOR_PB0330;
7076                         break;
7077                 case 0x0c:
7078                         PDEBUG(D_PROBE, "Find Sensor ICM105A");
7079                         sd->sensor = SENSOR_ICM105A;
7080                         break;
7081                 case 0x0e:
7082                         PDEBUG(D_PROBE, "Find Sensor HDCS2020");
7083                         sd->sensor = SENSOR_HDCS2020;
7084                         sd->sharpness = 1;
7085                         break;
7086                 case 0x0f:
7087                         PDEBUG(D_PROBE, "Find Sensor PAS106");
7088                         sd->sensor = SENSOR_PAS106;
7089                         vga = 0;                /* SIF */
7090                         break;
7091                 case 0x10:
7092                 case 0x12:
7093                         PDEBUG(D_PROBE, "Find Sensor TAS5130");
7094                         sd->sensor = SENSOR_TAS5130CXX;
7095                         break;
7096                 case 0x11:
7097                         PDEBUG(D_PROBE, "Find Sensor HV7131R(c)");
7098                         sd->sensor = SENSOR_HV7131C;
7099                         break;
7100                 case 0x13:
7101                         PDEBUG(D_PROBE,
7102                                 "Find Sensor MI0360. Chip revision %x",
7103                                 sd->chip_revision);
7104                         sd->sensor = SENSOR_PB0330;
7105                         break;
7106                 case 0x14:
7107                         PDEBUG(D_PROBE,
7108                                 "Find Sensor CS2102K?. Chip revision %x",
7109                                 sd->chip_revision);
7110                         sd->sensor = SENSOR_CS2102K;
7111                         break;
7112                 case 0x15:
7113                         PDEBUG(D_PROBE,
7114                                 "Find Sensor TAS5130CK?. Chip revision %x",
7115                                 sd->chip_revision);
7116                         sd->sensor = SENSOR_TAS5130CK;
7117                         break;
7118                 case 0x29:
7119                         PDEBUG(D_PROBE, "Find Sensor GC0305");
7120                         sd->sensor = SENSOR_GC0305;
7121                         break;
7122                 case 0x2030:
7123                         PDEBUG(D_PROBE, "Find Sensor PO2030");
7124                         sd->sensor = SENSOR_PO2030;
7125                         sd->sharpness = 0;              /* from win traces */
7126                         break;
7127                 case 0x7620:
7128                         PDEBUG(D_PROBE, "Find Sensor OV7620");
7129                         sd->sensor = SENSOR_OV7620;
7130                         break;
7131                 case 0x7648:
7132                         PDEBUG(D_PROBE, "Find Sensor OV7648");
7133                         sd->sensor = SENSOR_OV7620;     /* same sensor (?) */
7134                         break;
7135                 default:
7136                         PDEBUG(D_ERR|D_PROBE, "Unknown sensor %02x", sensor);
7137                         return -EINVAL;
7138                 }
7139         }
7140         if (sensor < 0x20) {
7141                 if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
7142                         reg_w(gspca_dev->dev, 0x02, 0x0010);
7143                 else
7144                         reg_w(gspca_dev->dev, sensor & 0x0f, 0x0010);
7145                 reg_r(gspca_dev, 0x0010);
7146         }
7147
7148         cam = &gspca_dev->cam;
7149         cam->dev_name = (char *) id->driver_info;
7150         cam->epaddr = 0x01;
7151 /*fixme:test*/
7152         gspca_dev->nbalt--;
7153         if (vga) {
7154                 cam->cam_mode = vga_mode;
7155                 cam->nmodes = ARRAY_SIZE(vga_mode);
7156         } else {
7157                 cam->cam_mode = sif_mode;
7158                 cam->nmodes = ARRAY_SIZE(sif_mode);
7159         }
7160         sd->qindex = 1;
7161         sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
7162         sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value;
7163         sd->gamma = gamma[(int) sd->sensor];
7164         sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value;
7165         sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value;
7166         sd->sharpness = sd_ctrls[SD_SHARPNESS].qctrl.default_value;
7167
7168         /* switch the led off */
7169         reg_w(gspca_dev->dev, 0x01, 0x0000);
7170         return 0;
7171 }
7172
7173 /* this function is called at open time */
7174 static int sd_open(struct gspca_dev *gspca_dev)
7175 {
7176         reg_w(gspca_dev->dev, 0x01, 0x0000);
7177         return 0;
7178 }
7179
7180 static void sd_start(struct gspca_dev *gspca_dev)
7181 {
7182         struct sd *sd = (struct sd *) gspca_dev;
7183         struct usb_device *dev = gspca_dev->dev;
7184         const struct usb_action *zc3_init;
7185         int mode;
7186         static const struct usb_action *init_tb[SENSOR_MAX][2] = {
7187                 {cs2102_InitialScale, cs2102_Initial},          /* 0 */
7188                 {cs2102K_InitialScale, cs2102K_Initial},        /* 1 */
7189                 {gc0305_Initial, gc0305_InitialScale},          /* 2 */
7190                 {hdcs2020xx_InitialScale, hdcs2020xx_Initial},  /* 3 */
7191                 {hdcs2020xb_InitialScale, hdcs2020xb_Initial},  /* 4 */
7192                 {hv7131bxx_InitialScale, hv7131bxx_Initial},    /* 5 */
7193                 {hv7131cxx_InitialScale, hv7131cxx_Initial},    /* 6 */
7194                 {icm105axx_InitialScale, icm105axx_Initial},    /* 7 */
7195                 {MC501CB_InitialScale, MC501CB_Initial},        /* 9 */
7196                 {OV7620_mode0, OV7620_mode1},                   /* 9 */
7197                 {ov7630c_InitialScale, ov7630c_Initial},        /* 10 */
7198                 {pas106b_InitialScale, pas106b_Initial},        /* 11 */
7199                 {pb0330xx_InitialScale, pb0330xx_Initial},      /* 12 */
7200 /* or           {pb03303x_InitialScale, pb03303x_Initial}, */
7201                 {PO2030_mode0, PO2030_mode1},                   /* 13 */
7202                 {tas5130CK_InitialScale, tas5130CK_Initial},    /* 14 */
7203                 {tas5130cxx_InitialScale, tas5130cxx_Initial},  /* 15 */
7204                 {tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial},
7205                                                                 /* 16 */
7206         };
7207
7208         mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
7209         zc3_init = init_tb[(int) sd->sensor][mode];
7210         switch (sd->sensor) {
7211         case SENSOR_HV7131B:
7212         case SENSOR_HV7131C:
7213                 zcxx_probeSensor(gspca_dev);
7214                 break;
7215         case SENSOR_PAS106:
7216                 usb_exchange(gspca_dev, pas106b_Initial_com);
7217                 break;
7218         case SENSOR_PB0330:
7219                 if (mode) {
7220                         if (sd->chip_revision == 0xc001
7221                             || sd->chip_revision == 0xe001
7222                             || sd->chip_revision == 0x8001)
7223                                 zc3_init = pb03303x_Initial;
7224                 } else {
7225                         if (sd->chip_revision == 0xc001
7226                             || sd->chip_revision == 0xe001
7227                             || sd->chip_revision == 0x8001)
7228                                 zc3_init = pb03303x_InitialScale;
7229                 }
7230                 break;
7231         }
7232         usb_exchange(gspca_dev, zc3_init);
7233
7234         switch (sd->sensor) {
7235         case SENSOR_GC0305:
7236         case SENSOR_OV7620:
7237         case SENSOR_PO2030:
7238                 msleep(100);                    /* ?? */
7239                 reg_r(gspca_dev, 0x0002);       /* --> 0x40 */
7240                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7241                 reg_w(dev, 0x15, 0x01ae);
7242                 reg_w(dev, 0x0d, 0x003a);
7243                 reg_w(dev, 0x02, 0x003b);
7244                 reg_w(dev, 0x00, 0x0038);
7245                 break;
7246         }
7247
7248         setmatrix(gspca_dev);
7249         setbrightness(gspca_dev);
7250         switch (sd->sensor) {
7251         case SENSOR_OV7620:
7252                 reg_r(gspca_dev, 0x0008);
7253                 reg_w(dev, 0x00, 0x0008);
7254                 break;
7255         case SENSOR_GC0305:
7256                 reg_r(gspca_dev, 0x0008);
7257                 /* fall thru */
7258         case SENSOR_PO2030:
7259                 reg_w(dev, 0x03, 0x0008);
7260                 break;
7261         }
7262         setsharpness(gspca_dev);
7263
7264         /* set the gamma tables when not set */
7265         switch (sd->sensor) {
7266         case SENSOR_CS2102:             /* gamma set in xxx_Initial */
7267         case SENSOR_CS2102K:
7268         case SENSOR_HDCS2020:
7269         case SENSOR_HDCS2020b:
7270         case SENSOR_PB0330:             /* pb with chip_revision - see above */
7271         case SENSOR_OV7630C:
7272         case SENSOR_TAS5130CK:
7273                 break;
7274         default:
7275                 setcontrast(gspca_dev);
7276                 break;
7277         }
7278         setmatrix(gspca_dev);                   /* one more time? */
7279         switch (sd->sensor) {
7280         case SENSOR_OV7620:
7281                 reg_r(gspca_dev, 0x0180);       /* from win */
7282                 reg_w(dev, 0x00, 0x0180);
7283                 break;
7284         default:
7285                 setquality(gspca_dev);
7286                 break;
7287         }
7288         setlightfreq(gspca_dev);
7289
7290         switch (sd->sensor) {
7291         case SENSOR_GC0305:
7292         case SENSOR_OV7620:
7293                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7294                 reg_w(dev, 0x15, 0x01ae);
7295                 sd->autogain = 0;
7296                 break;
7297         case SENSOR_PO2030:
7298                 reg_w(dev, 0x40, 0x0117);       /* (from win traces) */
7299                 reg_r(gspca_dev, 0x0180);
7300                 break;
7301         }
7302
7303         setautogain(gspca_dev);
7304         switch (sd->sensor) {
7305         case SENSOR_GC0305:
7306 /*              setlightfreq(gspca_dev);        ?? (end: 80 -> [18d]) */
7307                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7308                 reg_w(dev, 0x15, 0x01ae);
7309                 reg_w(dev, 0x40, 0x0180);
7310                 reg_w(dev, 0x40, 0x0117);
7311                 reg_r(gspca_dev, 0x0180);
7312                 sd->autogain = 1;
7313                 setautogain(gspca_dev);
7314                 break;
7315         case SENSOR_OV7620:
7316                 i2c_read(gspca_dev, 0x13);      /*fixme: returns 0xa3 */
7317                 i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
7318                                          /*fixme: returned value to send? */
7319                 reg_w(dev, 0x40, 0x0117);       /* (from win traces) */
7320                 reg_r(gspca_dev, 0x0180);
7321                 setautogain(gspca_dev);
7322                 msleep(500);
7323                 break;
7324         case SENSOR_PO2030:
7325                 msleep(500);
7326                 reg_r(gspca_dev, 0x0008);
7327                 reg_r(gspca_dev, 0x0007);
7328                 reg_w(dev, 0x00, 0x0007);       /* (from win traces) */
7329                 reg_w(dev, 0x02, 0x0008);
7330                 break;
7331         }
7332 }
7333
7334 static void sd_stopN(struct gspca_dev *gspca_dev)
7335 {
7336 }
7337
7338 static void sd_stop0(struct gspca_dev *gspca_dev)
7339 {
7340         struct sd *sd = (struct sd *) gspca_dev;
7341
7342         send_unknown(gspca_dev->dev, sd->sensor);
7343 }
7344
7345 /* this function is called at close time */
7346 static void sd_close(struct gspca_dev *gspca_dev)
7347 {
7348 }
7349
7350 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
7351                         struct gspca_frame *frame,
7352                         __u8 *data,
7353                         int len)
7354 {
7355
7356         if (data[0] == 0xff && data[1] == 0xd8) {       /* start of frame */
7357                 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
7358                                         data, 0);
7359                 /* put the JPEG header in the new frame */
7360                 jpeg_put_header(gspca_dev, frame,
7361                                 ((struct sd *) gspca_dev)->qindex,
7362                                 0x21);
7363                 /* remove the webcam's header:
7364                  * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
7365                  *      - 'ss ss' is the frame sequence number (BE)
7366                  *      - 'ww ww' and 'hh hh' are the window dimensions (BE)
7367                  *      - 'pp pp' is the packet sequence number (BE)
7368                  */
7369                 data += 18;
7370                 len -= 18;
7371         }
7372         gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
7373 }
7374
7375 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
7376 {
7377         struct sd *sd = (struct sd *) gspca_dev;
7378
7379         sd->brightness = val;
7380         if (gspca_dev->streaming)
7381                 setbrightness(gspca_dev);
7382         return 0;
7383 }
7384
7385 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
7386 {
7387         struct sd *sd = (struct sd *) gspca_dev;
7388
7389         *val = sd->brightness;
7390         return 0;
7391 }
7392
7393 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
7394 {
7395         struct sd *sd = (struct sd *) gspca_dev;
7396
7397         sd->contrast = val;
7398         if (gspca_dev->streaming)
7399                 setcontrast(gspca_dev);
7400         return 0;
7401 }
7402
7403 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
7404 {
7405         struct sd *sd = (struct sd *) gspca_dev;
7406
7407         *val = sd->contrast;
7408         return 0;
7409 }
7410
7411 static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
7412 {
7413         struct sd *sd = (struct sd *) gspca_dev;
7414
7415         sd->autogain = val;
7416         if (gspca_dev->streaming)
7417                 setautogain(gspca_dev);
7418         return 0;
7419 }
7420
7421 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val)
7422 {
7423         struct sd *sd = (struct sd *) gspca_dev;
7424
7425         *val = sd->autogain;
7426         return 0;
7427 }
7428
7429 static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val)
7430 {
7431         struct sd *sd = (struct sd *) gspca_dev;
7432
7433         sd->gamma = val;
7434         if (gspca_dev->streaming)
7435                 setcontrast(gspca_dev);
7436         return 0;
7437 }
7438
7439 static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val)
7440 {
7441         struct sd *sd = (struct sd *) gspca_dev;
7442
7443         *val = sd->gamma;
7444         return 0;
7445 }
7446
7447 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
7448 {
7449         struct sd *sd = (struct sd *) gspca_dev;
7450
7451         sd->lightfreq = val;
7452         if (gspca_dev->streaming)
7453                 setlightfreq(gspca_dev);
7454         return 0;
7455 }
7456
7457 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
7458 {
7459         struct sd *sd = (struct sd *) gspca_dev;
7460
7461         *val = sd->lightfreq;
7462         return 0;
7463 }
7464
7465 static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
7466 {
7467         struct sd *sd = (struct sd *) gspca_dev;
7468
7469         sd->sharpness = val;
7470         if (gspca_dev->streaming)
7471                 setsharpness(gspca_dev);
7472         return 0;
7473 }
7474
7475 static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
7476 {
7477         struct sd *sd = (struct sd *) gspca_dev;
7478
7479         *val = sd->sharpness;
7480         return 0;
7481 }
7482
7483 static int sd_querymenu(struct gspca_dev *gspca_dev,
7484                         struct v4l2_querymenu *menu)
7485 {
7486         switch (menu->id) {
7487         case V4L2_CID_POWER_LINE_FREQUENCY:
7488                 switch (menu->index) {
7489                 case 0:         /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
7490                         strcpy((char *) menu->name, "NoFliker");
7491                         return 0;
7492                 case 1:         /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
7493                         strcpy((char *) menu->name, "50 Hz");
7494                         return 0;
7495                 case 2:         /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
7496                         strcpy((char *) menu->name, "60 Hz");
7497                         return 0;
7498                 }
7499                 break;
7500         }
7501         return -EINVAL;
7502 }
7503
7504 static const struct sd_desc sd_desc = {
7505         .name = MODULE_NAME,
7506         .ctrls = sd_ctrls,
7507         .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
7508         .config = sd_config,
7509         .open = sd_open,
7510         .start = sd_start,
7511         .stopN = sd_stopN,
7512         .stop0 = sd_stop0,
7513         .close = sd_close,
7514         .pkt_scan = sd_pkt_scan,
7515         .querymenu = sd_querymenu,
7516 };
7517
7518 #define DVNM(name) .driver_info = (kernel_ulong_t) name
7519 static const __devinitdata struct usb_device_id device_table[] = {
7520         {USB_DEVICE(0x041e, 0x041e), DVNM("Creative WebCam Live!")},
7521 #ifndef CONFIG_USB_ZC0301
7522         {USB_DEVICE(0x041e, 0x4017), DVNM("Creative Webcam Mobile PD1090")},
7523         {USB_DEVICE(0x041e, 0x401c), DVNM("Creative NX")},
7524         {USB_DEVICE(0x041e, 0x401e), DVNM("Creative Nx Pro")},
7525         {USB_DEVICE(0x041e, 0x401f), DVNM("Creative Webcam Notebook PD1171")},
7526 #endif
7527         {USB_DEVICE(0x041e, 0x4029), DVNM("Creative WebCam Vista Pro")},
7528 #ifndef CONFIG_USB_ZC0301
7529         {USB_DEVICE(0x041e, 0x4034), DVNM("Creative Instant P0620")},
7530         {USB_DEVICE(0x041e, 0x4035), DVNM("Creative Instant P0620D")},
7531         {USB_DEVICE(0x041e, 0x4036), DVNM("Creative Live !")},
7532         {USB_DEVICE(0x041e, 0x403a), DVNM("Creative Nx Pro 2")},
7533 #endif
7534         {USB_DEVICE(0x041e, 0x4051), DVNM("Creative Notebook Pro (VF0250)")},
7535         {USB_DEVICE(0x041e, 0x4053), DVNM("Creative Live!Cam Video IM")},
7536 #ifndef CONFIG_USB_ZC0301
7537         {USB_DEVICE(0x0458, 0x7007), DVNM("Genius VideoCam V2")},
7538         {USB_DEVICE(0x0458, 0x700c), DVNM("Genius VideoCam V3")},
7539         {USB_DEVICE(0x0458, 0x700f), DVNM("Genius VideoCam Web V2")},
7540 #endif
7541         {USB_DEVICE(0x0461, 0x0a00), DVNM("MicroInnovation WebCam320")},
7542         {USB_DEVICE(0x046d, 0x08a0), DVNM("Logitech QC IM")},
7543         {USB_DEVICE(0x046d, 0x08a1), DVNM("Logitech QC IM 0x08A1 +sound")},
7544         {USB_DEVICE(0x046d, 0x08a2), DVNM("Labtec Webcam Pro")},
7545         {USB_DEVICE(0x046d, 0x08a3), DVNM("Logitech QC Chat")},
7546         {USB_DEVICE(0x046d, 0x08a6), DVNM("Logitech QCim")},
7547         {USB_DEVICE(0x046d, 0x08a7), DVNM("Logitech QuickCam Image")},
7548         {USB_DEVICE(0x046d, 0x08a9), DVNM("Logitech Notebook Deluxe")},
7549         {USB_DEVICE(0x046d, 0x08aa), DVNM("Labtec Webcam Notebook")},
7550         {USB_DEVICE(0x046d, 0x08ac), DVNM("Logitech QuickCam Cool")},
7551         {USB_DEVICE(0x046d, 0x08ad), DVNM("Logitech QCCommunicate STX")},
7552 #ifndef CONFIG_USB_ZC0301
7553         {USB_DEVICE(0x046d, 0x08ae), DVNM("Logitech QuickCam for Notebooks")},
7554 #endif
7555         {USB_DEVICE(0x046d, 0x08af), DVNM("Logitech QuickCam Cool")},
7556         {USB_DEVICE(0x046d, 0x08b9), DVNM("Logitech QC IM ???")},
7557         {USB_DEVICE(0x046d, 0x08d7), DVNM("Logitech QCam STX")},
7558         {USB_DEVICE(0x046d, 0x08d9), DVNM("Logitech QuickCam IM/Connect")},
7559         {USB_DEVICE(0x046d, 0x08d8), DVNM("Logitech Notebook Deluxe")},
7560         {USB_DEVICE(0x046d, 0x08da), DVNM("Logitech QuickCam Messenger")},
7561         {USB_DEVICE(0x046d, 0x08dd), DVNM("Logitech QuickCam for Notebooks")},
7562         {USB_DEVICE(0x0471, 0x0325), DVNM("Philips SPC 200 NC")},
7563         {USB_DEVICE(0x0471, 0x0326), DVNM("Philips SPC 300 NC")},
7564         {USB_DEVICE(0x0471, 0x032d), DVNM("Philips spc210nc")},
7565         {USB_DEVICE(0x0471, 0x032e), DVNM("Philips spc315nc")},
7566         {USB_DEVICE(0x055f, 0xc005), DVNM("Mustek Wcam300A")},
7567 #ifndef CONFIG_USB_ZC0301
7568         {USB_DEVICE(0x055f, 0xd003), DVNM("Mustek WCam300A")},
7569         {USB_DEVICE(0x055f, 0xd004), DVNM("Mustek WCam300 AN")},
7570 #endif
7571         {USB_DEVICE(0x0698, 0x2003), DVNM("CTX M730V built in")},
7572         {USB_DEVICE(0x0ac8, 0x0302), DVNM("Z-star Vimicro zc0302")},
7573 #ifndef CONFIG_USB_ZC0301
7574         {USB_DEVICE(0x0ac8, 0x301b), DVNM("Z-Star zc301b")},
7575         {USB_DEVICE(0x0ac8, 0x303b), DVNM("Vimicro 0x303b")},
7576 #endif
7577         {USB_DEVICE(0x0ac8, 0x305b), DVNM("Z-star Vimicro zc0305b")},
7578 #ifndef CONFIG_USB_ZC0301
7579         {USB_DEVICE(0x0ac8, 0x307b), DVNM("Z-Star 307b")},
7580         {USB_DEVICE(0x10fd, 0x0128), DVNM("Typhoon Webshot II 300k 0x0128")},
7581         {USB_DEVICE(0x10fd, 0x8050), DVNM("Typhoon Webshot II USB 300k")},
7582 #endif
7583         {}                      /* end of entry */
7584 };
7585 #undef DVNAME
7586 MODULE_DEVICE_TABLE(usb, device_table);
7587
7588 /* -- device connect -- */
7589 static int sd_probe(struct usb_interface *intf,
7590                         const struct usb_device_id *id)
7591 {
7592         return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7593                                 THIS_MODULE);
7594 }
7595
7596 /* USB driver */
7597 static struct usb_driver sd_driver = {
7598         .name = MODULE_NAME,
7599         .id_table = device_table,
7600         .probe = sd_probe,
7601         .disconnect = gspca_disconnect,
7602 };
7603
7604 static int __init sd_mod_init(void)
7605 {
7606         if (usb_register(&sd_driver) < 0)
7607                 return -1;
7608         PDEBUG(D_PROBE, "v%s registered", version);
7609         return 0;
7610 }
7611
7612 static void __exit sd_mod_exit(void)
7613 {
7614         usb_deregister(&sd_driver);
7615         PDEBUG(D_PROBE, "deregistered");
7616 }
7617
7618 module_init(sd_mod_init);
7619 module_exit(sd_mod_exit);
7620
7621 module_param(force_sensor, int, 0644);
7622 MODULE_PARM_DESC(force_sensor,
7623         "Force sensor. Only for experts!!!");