Merge branch 'core/iommu' into core/urgent
[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 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, "
28                 "Serge A. Suchkov <Serge.A.S@tochka.ru>");
29 MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
30 MODULE_LICENSE("GPL");
31
32 static int force_sensor = -1;
33
34 #include "jpeg.h"
35 #include "zc3xx-reg.h"
36
37 /* specific webcam descriptor */
38 struct sd {
39         struct gspca_dev gspca_dev;     /* !! must be the first item */
40
41         __u8 brightness;
42         __u8 contrast;
43         __u8 gamma;
44         __u8 autogain;
45         __u8 lightfreq;
46         __u8 sharpness;
47
48         char qindex;
49         signed char sensor;             /* Type of image sensor chip */
50 /* !! values used in different tables */
51 #define SENSOR_CS2102 0
52 #define SENSOR_CS2102K 1
53 #define SENSOR_GC0305 2
54 #define SENSOR_HDCS2020b 3
55 #define SENSOR_HV7131B 4
56 #define SENSOR_HV7131C 5
57 #define SENSOR_ICM105A 6
58 #define SENSOR_MC501CB 7
59 #define SENSOR_OV7620 8
60 /*#define SENSOR_OV7648 8 - same values */
61 #define SENSOR_OV7630C 9
62 #define SENSOR_PAS106 10
63 #define SENSOR_PAS202B 11
64 #define SENSOR_PB0330 12
65 #define SENSOR_PO2030 13
66 #define SENSOR_TAS5130CK 14
67 #define SENSOR_TAS5130CXX 15
68 #define SENSOR_TAS5130C_VF0250 16
69 #define SENSOR_MAX 17
70         unsigned short chip_revision;
71 };
72
73 /* V4L2 controls supported by the driver */
74 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
75 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
76 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
77 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
78 static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
79 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
80 static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val);
81 static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val);
82 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
83 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
84 static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
85 static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
86
87 static struct ctrl sd_ctrls[] = {
88 #define BRIGHTNESS_IDX 0
89 #define SD_BRIGHTNESS 0
90         {
91             {
92                 .id      = V4L2_CID_BRIGHTNESS,
93                 .type    = V4L2_CTRL_TYPE_INTEGER,
94                 .name    = "Brightness",
95                 .minimum = 0,
96                 .maximum = 255,
97                 .step    = 1,
98                 .default_value = 128,
99             },
100             .set = sd_setbrightness,
101             .get = sd_getbrightness,
102         },
103 #define SD_CONTRAST 1
104         {
105             {
106                 .id      = V4L2_CID_CONTRAST,
107                 .type    = V4L2_CTRL_TYPE_INTEGER,
108                 .name    = "Contrast",
109                 .minimum = 0,
110                 .maximum = 256,
111                 .step    = 1,
112                 .default_value = 128,
113             },
114             .set = sd_setcontrast,
115             .get = sd_getcontrast,
116         },
117 #define SD_GAMMA 2
118         {
119             {
120                 .id      = V4L2_CID_GAMMA,
121                 .type    = V4L2_CTRL_TYPE_INTEGER,
122                 .name    = "Gamma",
123                 .minimum = 1,
124                 .maximum = 6,
125                 .step    = 1,
126                 .default_value = 4,
127             },
128             .set = sd_setgamma,
129             .get = sd_getgamma,
130         },
131 #define SD_AUTOGAIN 3
132         {
133             {
134                 .id      = V4L2_CID_AUTOGAIN,
135                 .type    = V4L2_CTRL_TYPE_BOOLEAN,
136                 .name    = "Auto Gain",
137                 .minimum = 0,
138                 .maximum = 1,
139                 .step    = 1,
140                 .default_value = 1,
141             },
142             .set = sd_setautogain,
143             .get = sd_getautogain,
144         },
145 #define LIGHTFREQ_IDX 4
146 #define SD_FREQ 4
147         {
148             {
149                 .id      = V4L2_CID_POWER_LINE_FREQUENCY,
150                 .type    = V4L2_CTRL_TYPE_MENU,
151                 .name    = "Light frequency filter",
152                 .minimum = 0,
153                 .maximum = 2,   /* 0: 0, 1: 50Hz, 2:60Hz */
154                 .step    = 1,
155                 .default_value = 1,
156             },
157             .set = sd_setfreq,
158             .get = sd_getfreq,
159         },
160 #define SD_SHARPNESS 5
161         {
162             {
163                 .id      = V4L2_CID_SHARPNESS,
164                 .type    = V4L2_CTRL_TYPE_INTEGER,
165                 .name    = "Sharpness",
166                 .minimum = 0,
167                 .maximum = 3,
168                 .step    = 1,
169                 .default_value = 2,
170             },
171             .set = sd_setsharpness,
172             .get = sd_getsharpness,
173         },
174 };
175
176 static const struct v4l2_pix_format vga_mode[] = {
177         {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
178                 .bytesperline = 320,
179                 .sizeimage = 320 * 240 * 3 / 8 + 590,
180                 .colorspace = V4L2_COLORSPACE_JPEG,
181                 .priv = 1},
182         {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
183                 .bytesperline = 640,
184                 .sizeimage = 640 * 480 * 3 / 8 + 590,
185                 .colorspace = V4L2_COLORSPACE_JPEG,
186                 .priv = 0},
187 };
188
189 static const struct v4l2_pix_format sif_mode[] = {
190         {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
191                 .bytesperline = 176,
192                 .sizeimage = 176 * 144 * 3 / 8 + 590,
193                 .colorspace = V4L2_COLORSPACE_JPEG,
194                 .priv = 1},
195         {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
196                 .bytesperline = 352,
197                 .sizeimage = 352 * 288 * 3 / 8 + 590,
198                 .colorspace = V4L2_COLORSPACE_JPEG,
199                 .priv = 0},
200 };
201
202 /* usb exchanges */
203 struct usb_action {
204         __u8    req;
205         __u8    val;
206         __u16   idx;
207 };
208
209 static const struct usb_action cs2102_Initial[] = {
210         {0xa1, 0x01, 0x0008},
211         {0xa1, 0x01, 0x0008},
212         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
213         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
214         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
215         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
216         {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
217         {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
218         {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
219         {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
220         {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
221         {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
222         {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
223         {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
224         {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
225         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
226         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
227         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
228         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
229         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
230         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
231         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
232         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
233         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
234         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
235         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
236         {0xaa, 0x02, 0x0008},
237         {0xaa, 0x03, 0x0000},
238         {0xaa, 0x11, 0x0000},
239         {0xaa, 0x12, 0x0089},
240         {0xaa, 0x13, 0x0000},
241         {0xaa, 0x14, 0x00e9},
242         {0xaa, 0x20, 0x0000},
243         {0xaa, 0x22, 0x0000},
244         {0xaa, 0x0b, 0x0004},
245         {0xaa, 0x30, 0x0030},
246         {0xaa, 0x31, 0x0030},
247         {0xaa, 0x32, 0x0030},
248         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
249         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
250         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
251         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
252         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
253         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
254         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
255         {0xa0, 0x10, 0x01ae},
256         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
257         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
258         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
259         {0xa0, 0x00, 0x01ad},
260         {0xa1, 0x01, 0x0002},
261         {0xa1, 0x01, 0x0008},
262         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
263         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
264         {0xa1, 0x01, 0x01c8},
265         {0xa1, 0x01, 0x01c9},
266         {0xa1, 0x01, 0x01ca},
267         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
268         {0xa0, 0x24, ZC3XX_R120_GAMMA00},       /* gamma 5 */
269         {0xa0, 0x44, ZC3XX_R121_GAMMA01},
270         {0xa0, 0x64, ZC3XX_R122_GAMMA02},
271         {0xa0, 0x84, ZC3XX_R123_GAMMA03},
272         {0xa0, 0x9d, ZC3XX_R124_GAMMA04},
273         {0xa0, 0xb2, ZC3XX_R125_GAMMA05},
274         {0xa0, 0xc4, ZC3XX_R126_GAMMA06},
275         {0xa0, 0xd3, ZC3XX_R127_GAMMA07},
276         {0xa0, 0xe0, ZC3XX_R128_GAMMA08},
277         {0xa0, 0xeb, ZC3XX_R129_GAMMA09},
278         {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
279         {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
280         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
281         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
282         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
283         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
284         {0xa0, 0x18, ZC3XX_R130_GAMMA10},
285         {0xa0, 0x20, ZC3XX_R131_GAMMA11},
286         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
287         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
288         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
289         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
290         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
291         {0xa0, 0x0e, ZC3XX_R137_GAMMA17},
292         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
293         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
294         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
295         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
296         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
297         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
298         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
299         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
300         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
301         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
302         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
303         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
304         {0xa0, 0x58, ZC3XX_R10E_RGB11},
305         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
306         {0xa0, 0xf4, ZC3XX_R110_RGB20},
307         {0xa0, 0xf4, ZC3XX_R111_RGB21},
308         {0xa0, 0x58, ZC3XX_R112_RGB22},
309         {0xa1, 0x01, 0x0180},
310         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
311         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
312         {0xaa, 0x23, 0x0001},
313         {0xaa, 0x24, 0x0055},
314         {0xaa, 0x25, 0x00cc},
315         {0xaa, 0x21, 0x003f},
316         {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
317         {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
318         {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
319         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
320         {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
321         {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
322         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
323         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
324         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
325         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
326         {0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
327         {0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
328         {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
329         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
330         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
331         {0xa1, 0x01, 0x0180},
332         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
333         {0xa0, 0x40, ZC3XX_R116_RGAIN},
334         {0xa0, 0x40, ZC3XX_R117_GGAIN},
335         {0xa0, 0x40, ZC3XX_R118_BGAIN},
336         {}
337 };
338
339 static const struct usb_action cs2102_InitialScale[] = {
340         {0xa1, 0x01, 0x0008},
341         {0xa1, 0x01, 0x0008},
342         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
343         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
344         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
345         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
346         {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
347         {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
348         {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
349         {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
350         {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
351         {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
352         {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
353         {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
354         {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
355         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
356         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
357         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
358         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
359         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
360         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
361         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
362         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
363         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
364         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
365         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
366         {0xaa, 0x02, 0x0008},
367         {0xaa, 0x03, 0x0000},
368         {0xaa, 0x11, 0x0001},
369         {0xaa, 0x12, 0x0087},
370         {0xaa, 0x13, 0x0001},
371         {0xaa, 0x14, 0x00e7},
372         {0xaa, 0x20, 0x0000},
373         {0xaa, 0x22, 0x0000},
374         {0xaa, 0x0b, 0x0004},
375         {0xaa, 0x30, 0x0030},
376         {0xaa, 0x31, 0x0030},
377         {0xaa, 0x32, 0x0030},
378         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
379         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
380         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
381         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
382         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
383         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
384         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
385         {0xa0, 0x15, 0x01ae},
386         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
387         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
388         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
389         {0xa0, 0x00, 0x01ad},
390         {0xa1, 0x01, 0x0002},
391         {0xa1, 0x01, 0x0008},
392         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
393         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
394         {0xa1, 0x01, 0x01c8},
395         {0xa1, 0x01, 0x01c9},
396         {0xa1, 0x01, 0x01ca},
397         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
398         {0xa0, 0x24, ZC3XX_R120_GAMMA00},       /* gamma 5 */
399         {0xa0, 0x44, ZC3XX_R121_GAMMA01},
400         {0xa0, 0x64, ZC3XX_R122_GAMMA02},
401         {0xa0, 0x84, ZC3XX_R123_GAMMA03},
402         {0xa0, 0x9d, ZC3XX_R124_GAMMA04},
403         {0xa0, 0xb2, ZC3XX_R125_GAMMA05},
404         {0xa0, 0xc4, ZC3XX_R126_GAMMA06},
405         {0xa0, 0xd3, ZC3XX_R127_GAMMA07},
406         {0xa0, 0xe0, ZC3XX_R128_GAMMA08},
407         {0xa0, 0xeb, ZC3XX_R129_GAMMA09},
408         {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
409         {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
410         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
411         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
412         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
413         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
414         {0xa0, 0x18, ZC3XX_R130_GAMMA10},
415         {0xa0, 0x20, ZC3XX_R131_GAMMA11},
416         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
417         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
418         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
419         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
420         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
421         {0xa0, 0x0e, ZC3XX_R137_GAMMA17},
422         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
423         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
424         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
425         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
426         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
427         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
428         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
429         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
430         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
431         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
432         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
433         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
434         {0xa0, 0x58, ZC3XX_R10E_RGB11},
435         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
436         {0xa0, 0xf4, ZC3XX_R110_RGB20},
437         {0xa0, 0xf4, ZC3XX_R111_RGB21},
438         {0xa0, 0x58, ZC3XX_R112_RGB22},
439         {0xa1, 0x01, 0x0180},
440         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
441         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
442         {0xaa, 0x23, 0x0000},
443         {0xaa, 0x24, 0x00aa},
444         {0xaa, 0x25, 0x00e6},
445         {0xaa, 0x21, 0x003f},
446         {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
447         {0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
448         {0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
449         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
450         {0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
451         {0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
452         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
453         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
454         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
455         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
456         {0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
457         {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
458         {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
459         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
460         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
461         {0xa1, 0x01, 0x0180},
462         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
463         {0xa0, 0x40, ZC3XX_R116_RGAIN},
464         {0xa0, 0x40, ZC3XX_R117_GGAIN},
465         {0xa0, 0x40, ZC3XX_R118_BGAIN},
466         {}
467 };
468 static const struct usb_action cs2102_50HZ[] = {
469         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
470         {0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */
471         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
472         {0xaa, 0x04, 0x00ac}, /* 00,04,ac,aa */
473         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
474         {0xaa, 0x11, 0x00ac}, /* 00,11,ac,aa */
475         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
476         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
477         {0xaa, 0x1d, 0x00ac}, /* 00,1d,ac,aa */
478         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
479         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
480         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
481         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
482         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
483         {0xa0, 0x42, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,42,cc */
484         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
485         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
486         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
487         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
488         {0xa0, 0x8c, ZC3XX_R01D_HSYNC_0}, /* 00,1d,8c,cc */
489         {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
490         {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
491         {}
492 };
493 static const struct usb_action cs2102_50HZScale[] = {
494         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
495         {0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */
496         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
497         {0xaa, 0x04, 0x00a1}, /* 00,04,a1,aa */
498         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
499         {0xaa, 0x11, 0x00a1}, /* 00,11,a1,aa */
500         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
501         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
502         {0xaa, 0x1d, 0x00a1}, /* 00,1d,a1,aa */
503         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
504         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
505         {0xa0, 0xf7, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f7,cc */
506         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
507         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
508         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
509         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
510         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
511         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
512         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
513         {0xa0, 0x93, ZC3XX_R01D_HSYNC_0}, /* 00,1d,93,cc */
514         {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
515         {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
516         {}
517 };
518 static const struct usb_action cs2102_60HZ[] = {
519         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
520         {0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */
521         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
522         {0xaa, 0x04, 0x00aa}, /* 00,04,aa,aa */
523         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
524         {0xaa, 0x11, 0x00aa}, /* 00,11,aa,aa */
525         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
526         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
527         {0xaa, 0x1d, 0x00aa}, /* 00,1d,aa,aa */
528         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
529         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
530         {0xa0, 0xe4, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e4,cc */
531         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
532         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
533         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3a,cc */
534         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
535         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
536         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
537         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
538         {0xa0, 0x5d, ZC3XX_R01D_HSYNC_0}, /* 00,1d,5d,cc */
539         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
540         {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */
541         {}
542 };
543 static const struct usb_action cs2102_60HZScale[] = {
544         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
545         {0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */
546         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
547         {0xaa, 0x04, 0x00be}, /* 00,04,be,aa */
548         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
549         {0xaa, 0x11, 0x00be}, /* 00,11,be,aa */
550         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
551         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
552         {0xaa, 0x1d, 0x00be}, /* 00,1d,be,aa */
553         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
554         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
555         {0xa0, 0xfc, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,fc,cc */
556         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
557         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
558         {0xa0, 0x69, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,69,cc */
559         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
560         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
561         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
562         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
563         {0xa0, 0xb7, ZC3XX_R01D_HSYNC_0}, /* 00,1d,b7,cc */
564         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
565         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
566         {}
567 };
568 static const struct usb_action cs2102_NoFliker[] = {
569         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
570         {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
571         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
572         {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
573         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
574         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
575         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
576         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
577         {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
578         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
579         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
580         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
581         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
582         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
583         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
584         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
585         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
586         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
587         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
588         {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
589         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
590         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
591         {}
592 };
593 static const struct usb_action cs2102_NoFlikerScale[] = {
594         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
595         {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
596         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
597         {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
598         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
599         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
600         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
601         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
602         {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
603         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
604         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
605         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
606         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
607         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
608         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
609         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
610         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
611         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
612         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
613         {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
614         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
615         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
616         {}
617 };
618
619 /* CS2102_KOCOM */
620 static const struct usb_action cs2102K_Initial[] = {
621         {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
622         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
623         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
624         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
625         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
626         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
627         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
628         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
629         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
630         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
631         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
632         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
633         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
634         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
635         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
636         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
637         {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
638         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
639         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
640         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
641         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
642         {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
643         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
644         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
645         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
646         {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
647         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
648         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
649         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
650         {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
651         {0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
652         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
653         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
654         {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
655         {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
656         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
657         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
658         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
659         {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
660         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
661         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
662         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
663         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
664         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
665         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
666         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
667         {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
668         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
669         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
670         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
671         {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
672         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
673         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
674         {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
675         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
676         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
677         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
678         {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
679         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
680         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
681         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
682         {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
683         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
684         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
685         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
686         {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
687         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
688         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
689         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
690         {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
691         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
692         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
693         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
694         {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
695         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
696         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
697         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
698         {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
699         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
700         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
701         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
702         {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
703         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
704         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
705         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
706         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
707         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
708         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
709         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
710         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
711         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
712         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
713         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
714         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
715         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
716         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
717         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
718         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
719         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
720         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
721         {0xa0, 0x00, 0x01ad},
722         {0xa0, 0x01, 0x01b1},
723         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
724         {0xa0, 0x60, ZC3XX_R116_RGAIN},
725         {0xa0, 0x40, ZC3XX_R117_GGAIN},
726         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
727         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
728         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
729         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
730         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
731         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
732         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
733         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
734         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
735         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
736         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
737         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
738         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
739         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
740         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
741         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
742         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
743         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
744         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
745         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
746         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
747         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
748         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
749         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
750         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
751         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
752         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
753         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
754         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
755         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
756         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
757         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
758         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
759         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
760         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
761         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
762         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
763         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
764         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
765         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
766         {0xa0, 0x58, ZC3XX_R10E_RGB11},
767         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
768         {0xa0, 0xf4, ZC3XX_R110_RGB20},
769         {0xa0, 0xf4, ZC3XX_R111_RGB21},
770         {0xa0, 0x58, ZC3XX_R112_RGB22},
771         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
772         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
773         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
774         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
775         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
776         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
777         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
778         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
779         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
780         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
781         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
782         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
783         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
784         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
785         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
786         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
787         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
788         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
789         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
790         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
791         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
792         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
793         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
794         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
795         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
796         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
797         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
798         {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
799         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
800         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
801         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
802         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
803         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
804         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
805         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
806         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
807         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
808         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
809         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
810         {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
811         {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
812         {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
813         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
814         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
815         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
816         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
817         {0xa0, 0x60, ZC3XX_R116_RGAIN},
818         {0xa0, 0x40, ZC3XX_R117_GGAIN},
819         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
820         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
821         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
822         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
823         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
824         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
825         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
826         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
827         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
828         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
829         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
830         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
831         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
832         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
833         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
834         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
835         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
836         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
837         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
838         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
839         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
840         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
841         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
842         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
843         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
844         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
845         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
846         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
847         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
848         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
849         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
850         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
851         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
852         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
853         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
854         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
855         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
856         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
857         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
858         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
859         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
860         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
861         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
862         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
863         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
864         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
865         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
866         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
867         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
868         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
869         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
870         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
871         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
872         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
873         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
874         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
875         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
876         {}
877 };
878
879 static const struct usb_action cs2102K_InitialScale[] = {
880         {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
881         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
882         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
883         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
884         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
885         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
886         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
887         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
888         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
889         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
890         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
891         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
892         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
893         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
894         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
895         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
896         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
897         {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
898         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
899         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
900         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
901         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
902         {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
903         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
904         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
905         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
906         {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
907         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
908         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
909         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
910         {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
911         {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
912         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
913         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
914         {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
915         {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
916         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
917         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
918         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
919         {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
920         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
921         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
922         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
923         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
924         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
925         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
926         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
927         {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
928         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
929         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
930         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
931         {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
932         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
933         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
934         {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
935         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
936         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
937         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
938         {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
939         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
940         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
941         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
942         {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
943         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
944         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
945         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
946         {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
947         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
948         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
949         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
950         {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
951         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
952         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
953         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
954         {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
955         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
956         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
957         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
958         {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
959         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
960         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
961         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
962         {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
963         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
964         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
965         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
966         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
967         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
968         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
969         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
970         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
971         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
972         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
973         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
974         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
975         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
976         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
977         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
978         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
979         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
980         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
981         {0xa0, 0x00, 0x01ad},
982         {0xa0, 0x01, 0x01b1},
983         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
984         {0xa0, 0x60, ZC3XX_R116_RGAIN},
985         {0xa0, 0x40, ZC3XX_R117_GGAIN},
986         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
987         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
988         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
989         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
990         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
991         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
992         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
993         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
994         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
995         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
996         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
997         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
998         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
999         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1000         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1001         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1002         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1003         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1004         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1005         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1006         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1007         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1008         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1009         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1010         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1011         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1012         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1013         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1014         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1015         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1016         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1017         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1018         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1019         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1020         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1021         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1022         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1023         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1024         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1025         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1026         {0xa0, 0x58, ZC3XX_R10E_RGB11},
1027         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1028         {0xa0, 0xf4, ZC3XX_R110_RGB20},
1029         {0xa0, 0xf4, ZC3XX_R111_RGB21},
1030         {0xa0, 0x58, ZC3XX_R112_RGB22},
1031         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1032         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1033         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1034         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1035         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1036         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1037         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1038         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1039         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1040         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1041         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1042         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1043         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1044         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1045         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1046         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1047         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1048         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1049         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1050         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1051         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1052         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1053         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1054         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1055         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1056         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1057         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1058         {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1059         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1060         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1061         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1062         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1063         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1064         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1065         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1066         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1067         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1068         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1069         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1070         {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1071         {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1072         {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1073         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1074         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1075         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1076         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1077         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1078         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1079         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1080         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1081         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1082         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1083         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1084         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1085         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1086         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1087         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1088         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1089         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1090         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1091         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1092         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1093         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1094         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1095         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1096         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1097         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1098         {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
1099         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1100         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1101         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1102         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1103         {0xa0, 0x0A, ZC3XX_R092_I2CADDRESSSELECT},
1104         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1105         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1106         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1107         {0xa0, 0x0B, ZC3XX_R092_I2CADDRESSSELECT},
1108         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1109         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1110         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1111         {0xa0, 0x0C, ZC3XX_R092_I2CADDRESSSELECT},
1112         {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
1113         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1114         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1115         {0xa0, 0x0D, ZC3XX_R092_I2CADDRESSSELECT},
1116         {0xa0, 0xA3, ZC3XX_R093_I2CSETVALUE},
1117         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1118         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1119         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
1120         {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
1121         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1122         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1123         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
1124         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1125         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1126         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1127         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
1128         {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
1129         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1130         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1131         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
1132         {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
1133         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1134         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1135         {0xa0, 0x0E, ZC3XX_R092_I2CADDRESSSELECT},
1136         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1137         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1138         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1139         {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
1140         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1141         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1142         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1143         {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
1144         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1145         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1146         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1147         {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
1148         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1149         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1150         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1151         {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
1152         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1153         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1154         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1155         {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
1156         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1157         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1158         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1159         {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
1160         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1161         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1162         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1163         {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
1164         {0xa0, 0x0C, ZC3XX_R093_I2CSETVALUE},
1165         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1166         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1167         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1168         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1169         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1170         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1171         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1172         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1173         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
1174         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1175         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1176         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1177         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1178         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1179         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1180         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1181         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1182         {0xa0, 0x00, 0x01ad},
1183         {0xa0, 0x01, 0x01b1},
1184         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1185         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1186         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1187         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1188         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1189         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1190         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1191         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
1192         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1193         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1194         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1195         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1196         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1197         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1198         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1199         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1200         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1201         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1202         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1203         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1204         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1205         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1206         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1207         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1208         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1209         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1210         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1211         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1212         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1213         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1214         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1215         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1216         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1217         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1218         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1219         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1220         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1221         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1222         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1223         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1224         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1225         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1226         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1227         {0xa0, 0x58, ZC3XX_R10E_RGB11},
1228         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1229         {0xa0, 0xf4, ZC3XX_R110_RGB20},
1230         {0xa0, 0xf4, ZC3XX_R111_RGB21},
1231         {0xa0, 0x58, ZC3XX_R112_RGB22},
1232         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1233         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1234         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1235         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1236         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1237         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1238         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1239         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1240         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1241         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1242         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1243         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1244         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1245         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1246         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1247         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1248         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1249         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1250         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1251         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1252         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1253         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1254         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1255         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1256         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1257         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1258         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1259         {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1260         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1261         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1262         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1263         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1264         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1265         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1266         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1267         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1268         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1269         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1270         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1271         {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1272         {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1273         {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1274         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1275         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1276         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1277         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1278         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1279         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1280         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1281         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1282         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1283         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1284         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1285         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1286         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1287         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1288         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1289         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1290         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1291         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1292         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1293         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1294         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1295         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1296         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1297         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1298         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1299         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1300         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1301         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1302         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1303         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1304         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1305         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1306         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1307         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1308         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1309         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1310         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1311         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1312         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1313         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1314         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1315         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1316         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1317         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1318         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1319         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1320         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1321         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1322         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1323         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1324         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1325         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1326         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1327         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1328         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1329         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1330         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1331         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1332         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1333         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1334         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1335         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1336         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1337         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1338         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1339         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1340         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1341         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1342         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1343         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1344         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1345         {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1346         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1347         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1348         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1349         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1350         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1351         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1352         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1353         {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1354         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1355         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1356         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1357         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1358         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1359         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1360         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1361         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1362         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1363         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1364         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1365         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
1366         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1367         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1368         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1369         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1370         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1371         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1372         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1373         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1374         {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1375         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1376         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1377         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1378         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1379         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1380         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1381         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1382         {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1383         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1384         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1385         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1386         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1387         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1388         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1389         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1390         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1391         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1392         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1393         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1394         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1395         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1396         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1397         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1398         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1399         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1400         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1401         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1402         {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1403         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1404         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1405         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1406         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1407         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1408         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1409         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1410         {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1411         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1412         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1413         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1414         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1415         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1416         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1417         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1418         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1419         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1420         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1421         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1422         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1423         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1424         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1425         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1426         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1427         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1428         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1429         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1430         {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1431         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1432         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1433         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1434         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1435         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1436         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1437         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1438         {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1439         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1440         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1441         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1442         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1443         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1444         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1445         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1446         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1447         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1448         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1449         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1450         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1451         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1452         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1453         {}
1454 };
1455
1456 static const struct usb_action gc0305_Initial[] = {     /* 640x480 */
1457         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1458         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,03,cc */
1459         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
1460         {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},   /* 00,02,04,cc */
1461         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
1462         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1463         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
1464         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc */
1465         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
1466         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
1467         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
1468         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
1469         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
1470         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
1471         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
1472         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e6,cc */
1473         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,86,cc */
1474         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
1475         {0xaa, 0x13, 0x0002},   /* 00,13,02,aa */
1476         {0xaa, 0x15, 0x0003},   /* 00,15,03,aa */
1477         {0xaa, 0x01, 0x0000},   /* 00,01,00,aa */
1478         {0xaa, 0x02, 0x0000},   /* 00,02,00,aa */
1479         {0xaa, 0x1a, 0x0000},   /* 00,1a,00,aa */
1480         {0xaa, 0x1c, 0x0017},   /* 00,1c,17,aa */
1481         {0xaa, 0x1d, 0x0080},   /* 00,1d,80,aa */
1482         {0xaa, 0x1f, 0x0008},   /* 00,1f,08,aa */
1483         {0xaa, 0x21, 0x0012},   /* 00,21,12,aa */
1484         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc */
1485         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc */
1486         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc */
1487         {0xaa, 0x05, 0x0000},   /* 00,05,00,aa */
1488         {0xaa, 0x0a, 0x0000},   /* 00,0a,00,aa */
1489         {0xaa, 0x0b, 0x00b0},   /* 00,0b,b0,aa */
1490         {0xaa, 0x0c, 0x0000},   /* 00,0c,00,aa */
1491         {0xaa, 0x0d, 0x00b0},   /* 00,0d,b0,aa */
1492         {0xaa, 0x0e, 0x0000},   /* 00,0e,00,aa */
1493         {0xaa, 0x0f, 0x00b0},   /* 00,0f,b0,aa */
1494         {0xaa, 0x10, 0x0000},   /* 00,10,00,aa */
1495         {0xaa, 0x11, 0x00b0},   /* 00,11,b0,aa */
1496         {0xaa, 0x16, 0x0001},   /* 00,16,01,aa */
1497         {0xaa, 0x17, 0x00e6},   /* 00,17,e6,aa */
1498         {0xaa, 0x18, 0x0002},   /* 00,18,02,aa */
1499         {0xaa, 0x19, 0x0086},   /* 00,19,86,aa */
1500         {0xaa, 0x20, 0x0000},   /* 00,20,00,aa */
1501         {0xaa, 0x1b, 0x0020},   /* 00,1b,20,aa */
1502         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc */
1503         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc */
1504         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1505         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},     /* 01,89,76,cc */
1506         {0xa0, 0x09, 0x01ad},   /* 01,ad,09,cc */
1507         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1508         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
1509         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
1510         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
1511         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,60,cc */
1512         {0xa0, 0x85, ZC3XX_R18D_YTARGET},       /* 01,8d,85,cc */
1513         {0xa0, 0x00, 0x011e},   /* 01,1e,00,cc */
1514         {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1515         {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1516         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1517         {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
1518         {}
1519 };
1520 static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
1521         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1522         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,03,cc */
1523         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
1524         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},   /* 00,02,10,cc */
1525         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
1526         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1527         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
1528         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc */
1529         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
1530         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
1531         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
1532         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
1533         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
1534         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
1535         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
1536         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e8,cc */
1537         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,88,cc */
1538         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
1539         {0xaa, 0x13, 0x0000},   /* 00,13,00,aa */
1540         {0xaa, 0x15, 0x0001},   /* 00,15,01,aa */
1541         {0xaa, 0x01, 0x0000},   /* 00,01,00,aa */
1542         {0xaa, 0x02, 0x0000},   /* 00,02,00,aa */
1543         {0xaa, 0x1a, 0x0000},   /* 00,1a,00,aa */
1544         {0xaa, 0x1c, 0x0017},   /* 00,1c,17,aa */
1545         {0xaa, 0x1d, 0x0080},   /* 00,1d,80,aa */
1546         {0xaa, 0x1f, 0x0008},   /* 00,1f,08,aa */
1547         {0xaa, 0x21, 0x0012},   /* 00,21,12,aa */
1548         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc */
1549         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc */
1550         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc */
1551         {0xaa, 0x05, 0x0000},   /* 00,05,00,aa */
1552         {0xaa, 0x0a, 0x0000},   /* 00,0a,00,aa */
1553         {0xaa, 0x0b, 0x00b0},   /* 00,0b,b0,aa */
1554         {0xaa, 0x0c, 0x0000},   /* 00,0c,00,aa */
1555         {0xaa, 0x0d, 0x00b0},   /* 00,0d,b0,aa */
1556         {0xaa, 0x0e, 0x0000},   /* 00,0e,00,aa */
1557         {0xaa, 0x0f, 0x00b0},   /* 00,0f,b0,aa */
1558         {0xaa, 0x10, 0x0000},   /* 00,10,00,aa */
1559         {0xaa, 0x11, 0x00b0},   /* 00,11,b0,aa */
1560         {0xaa, 0x16, 0x0001},   /* 00,16,01,aa */
1561         {0xaa, 0x17, 0x00e8},   /* 00,17,e8,aa */
1562         {0xaa, 0x18, 0x0002},   /* 00,18,02,aa */
1563         {0xaa, 0x19, 0x0088},   /* 00,19,88,aa */
1564         {0xaa, 0x20, 0x0000},   /* 00,20,00,aa */
1565         {0xaa, 0x1b, 0x0020},   /* 00,1b,20,aa */
1566         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc */
1567         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc */
1568         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1569         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},     /* 01,89,76,cc */
1570         {0xa0, 0x09, 0x01ad},   /* 01,ad,09,cc */
1571         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1572         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
1573         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
1574         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
1575         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,60,cc */
1576         {0xa0, 0x00, 0x011e},   /* 01,1e,00,cc */
1577         {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1578         {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1579         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1580         {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
1581         {}
1582 };
1583 static const struct usb_action gc0305_50HZ[] = {
1584         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1585         {0xaa, 0x83, 0x0002},   /* 00,83,02,aa */
1586         {0xaa, 0x84, 0x0038},   /* 00,84,38,aa */       /* win: 00,84,ec */
1587         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1588         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc */
1589         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,18,cc */
1590                                                         /* win: 01,92,10 */
1591         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1592         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1593         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,8e,cc */
1594                                                         /* win: 01,97,ec */
1595         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1596         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1597         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc */
1598         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
1599         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1600         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1601         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1602         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1603         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1604         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
1605 /*      {0xa0, 0x85, ZC3XX_R18D_YTARGET},        * 01,8d,85,cc *
1606                                                  * if 640x480 */
1607         {}
1608 };
1609 static const struct usb_action gc0305_60HZ[] = {
1610         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1611         {0xaa, 0x83, 0x0000},   /* 00,83,00,aa */
1612         {0xaa, 0x84, 0x00ec},   /* 00,84,ec,aa */
1613         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1614         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc */
1615         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,10,cc */
1616         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1617         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1618         {0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,ec,cc */
1619         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1620         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1621         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc */
1622         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
1623         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1624         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1625         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1626         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1627         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1628         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
1629         {0xa0, 0x80, ZC3XX_R18D_YTARGET},       /* 01,8d,80,cc */
1630         {}
1631 };
1632
1633 static const struct usb_action gc0305_NoFliker[] = {
1634         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
1635         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1636         {0xaa, 0x83, 0x0000},   /* 00,83,00,aa */
1637         {0xaa, 0x84, 0x0020},   /* 00,84,20,aa */
1638         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1639         {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,00,cc */
1640         {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,48,cc */
1641         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1642         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1643         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc */
1644         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1645         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1646         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1647         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1648         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1649         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1650         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1651         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
1652         {0xa0, 0x80, ZC3XX_R18D_YTARGET},       /* 01,8d,80,cc */
1653         {}
1654 };
1655
1656 static const struct usb_action hdcs2020xb_Initial[] = {
1657         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1658         {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1659         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* qtable 0x05 */
1660         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1661         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1662         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1663         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1664         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1665         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1666         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1667         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1668         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1669         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1670         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1671         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1672         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1673         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1674         {0xaa, 0x1c, 0x0000},
1675         {0xaa, 0x0a, 0x0001},
1676         {0xaa, 0x0b, 0x0006},
1677         {0xaa, 0x0c, 0x007b},
1678         {0xaa, 0x0d, 0x00a7},
1679         {0xaa, 0x03, 0x00fb},
1680         {0xaa, 0x05, 0x0000},
1681         {0xaa, 0x06, 0x0003},
1682         {0xaa, 0x09, 0x0008},
1683
1684         {0xaa, 0x0f, 0x0018},   /* set sensor gain */
1685         {0xaa, 0x10, 0x0018},
1686         {0xaa, 0x11, 0x0018},
1687         {0xaa, 0x12, 0x0018},
1688
1689         {0xaa, 0x15, 0x004e},
1690         {0xaa, 0x1c, 0x0004},
1691         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1692         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1693         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1694         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1695         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
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         {0xa1, 0x01, 0x0002},
1701         {0xa1, 0x01, 0x0008},
1702         {0xa1, 0x01, 0x0180},
1703         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1704         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1705         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1706         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1707         {0xa1, 0x01, 0x0008},
1708         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1709         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1710         {0xa1, 0x01, 0x01c8},
1711         {0xa1, 0x01, 0x01c9},
1712         {0xa1, 0x01, 0x01ca},
1713         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1714         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
1715         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1716         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1717         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1718         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1719         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1720         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1721         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1722         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1723         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1724         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1725         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1726         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1727         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1728         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1729         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1730         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1731         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1732         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1733         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1734         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1735         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1736         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1737         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1738         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1739         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1740         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1741         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1742         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1743         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1744         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1745         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1746
1747         {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1748         {0xa0, 0xed, ZC3XX_R10B_RGB01},
1749         {0xa0, 0xed, ZC3XX_R10C_RGB02},
1750         {0xa0, 0xed, ZC3XX_R10D_RGB10},
1751         {0xa0, 0x66, ZC3XX_R10E_RGB11},
1752         {0xa0, 0xed, ZC3XX_R10F_RGB12},
1753         {0xa0, 0xed, ZC3XX_R110_RGB20},
1754         {0xa0, 0xed, ZC3XX_R111_RGB21},
1755         {0xa0, 0x66, ZC3XX_R112_RGB22},
1756
1757         {0xa1, 0x01, 0x0180},
1758         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1759         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1760         {0xaa, 0x13, 0x0031},
1761         {0xaa, 0x14, 0x0001},
1762         {0xaa, 0x0e, 0x0004},
1763         {0xaa, 0x19, 0x00cd},
1764         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1765         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1766         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1767         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1768         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1769         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1770         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1771         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1772
1773         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 0x14 */
1774         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1775         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1776         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1777         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1778         {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1779         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1780         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1781         {0xa1, 0x01, 0x0180},
1782         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1783         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1784         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1785         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1786         {}
1787 };
1788 static const struct usb_action hdcs2020xb_InitialScale[] = {
1789         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1790         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1791         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1792         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1793         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1794         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1795         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1796         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1797         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1798         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1799         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1800         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1801         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1802         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1803         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1804         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1805         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1806         {0xaa, 0x1c, 0x0000},
1807         {0xaa, 0x0a, 0x0001},
1808         {0xaa, 0x0b, 0x0006},
1809         {0xaa, 0x0c, 0x007a},
1810         {0xaa, 0x0d, 0x00a7},
1811         {0xaa, 0x03, 0x00fb},
1812         {0xaa, 0x05, 0x0000},
1813         {0xaa, 0x06, 0x0003},
1814         {0xaa, 0x09, 0x0008},
1815         {0xaa, 0x0f, 0x0018},   /* original setting */
1816         {0xaa, 0x10, 0x0018},
1817         {0xaa, 0x11, 0x0018},
1818         {0xaa, 0x12, 0x0018},
1819         {0xaa, 0x15, 0x004e},
1820         {0xaa, 0x1c, 0x0004},
1821         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1822         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1823         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1824         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1825         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1826         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1827         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1828         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1829         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1830         {0xa1, 0x01, 0x0002},
1831         {0xa1, 0x01, 0x0008},
1832         {0xa1, 0x01, 0x0180},
1833         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1834         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1835         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1836         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1837         {0xa1, 0x01, 0x0008},
1838         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1839         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1840         {0xa1, 0x01, 0x01c8},
1841         {0xa1, 0x01, 0x01c9},
1842         {0xa1, 0x01, 0x01ca},
1843         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1844         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
1845         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1846         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1847         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1848         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1849         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1850         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1851         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1852         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1853         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1854         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1855         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1856         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1857         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1858         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1859         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1860         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1861         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1862         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1863         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1864         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1865         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1866         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1867         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1868         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1869         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1870         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1871         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1872         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1873         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1874         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1875         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1876         {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1877         {0xa0, 0xed, ZC3XX_R10B_RGB01},
1878         {0xa0, 0xed, ZC3XX_R10C_RGB02},
1879         {0xa0, 0xed, ZC3XX_R10D_RGB10},
1880         {0xa0, 0x66, ZC3XX_R10E_RGB11},
1881         {0xa0, 0xed, ZC3XX_R10F_RGB12},
1882         {0xa0, 0xed, ZC3XX_R110_RGB20},
1883         {0xa0, 0xed, ZC3XX_R111_RGB21},
1884         {0xa0, 0x66, ZC3XX_R112_RGB22},
1885         {0xa1, 0x01, 0x0180},
1886         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1887         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1888  /**** set exposure ***/
1889         {0xaa, 0x13, 0x0031},
1890         {0xaa, 0x14, 0x0001},
1891         {0xaa, 0x0e, 0x0004},
1892         {0xaa, 0x19, 0x00cd},
1893         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1894         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1895         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1896         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1897         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1898         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1899         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1900         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1901         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1902         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1903         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1904         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1905         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1906         {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1907         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1908         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1909         {0xa1, 0x01, 0x0180},
1910         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1911         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1912         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1913         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1914         {}
1915 };
1916 static const struct usb_action hdcs2020b_50HZ[] = {
1917         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1918         {0xaa, 0x13, 0x0018},                   /* 00,13,18,aa */
1919         {0xaa, 0x14, 0x0001},                   /* 00,14,01,aa */
1920         {0xaa, 0x0e, 0x0005},                   /* 00,0e,05,aa */
1921         {0xaa, 0x19, 0x001f},                   /* 00,19,1f,aa */
1922         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1923         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1924         {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
1925         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1926         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1927         {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
1928         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1929         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1930         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1931         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1932         {0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
1933         {0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
1934         {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
1935         {}
1936 };
1937 static const struct usb_action hdcs2020b_60HZ[] = {
1938         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1939         {0xaa, 0x13, 0x0031},                   /* 00,13,31,aa */
1940         {0xaa, 0x14, 0x0001},                   /* 00,14,01,aa */
1941         {0xaa, 0x0e, 0x0004},                   /* 00,0e,04,aa */
1942         {0xaa, 0x19, 0x00cd},                   /* 00,19,cd,aa */
1943         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1944         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1945         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
1946         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1947         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1948         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
1949         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1950         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1951         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1952         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1953         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1954         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
1955         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
1956         {}
1957 };
1958 static const struct usb_action hdcs2020b_NoFliker[] = {
1959         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1960         {0xaa, 0x13, 0x0010},                   /* 00,13,10,aa */
1961         {0xaa, 0x14, 0x0001},                   /* 00,14,01,aa */
1962         {0xaa, 0x0e, 0x0004},                   /* 00,0e,04,aa */
1963         {0xaa, 0x19, 0x0000},                   /* 00,19,00,aa */
1964         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1965         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1966         {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
1967         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1968         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1969         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1970         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1971         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1972         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
1973         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
1974         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1975         {0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
1976         {0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
1977         {}
1978 };
1979
1980 static const struct usb_action hv7131bxx_Initial[] = {          /* 320x240 */
1981         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1982         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1983         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1984         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1985         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
1986         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
1987         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1988         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1989         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1990         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1991         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1992         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1993         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1994         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1995         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1996         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1997         {0xaa, 0x30, 0x002d},
1998         {0xaa, 0x01, 0x0005},
1999         {0xaa, 0x11, 0x0000},
2000         {0xaa, 0x13, 0x0001},   /* {0xaa, 0x13, 0x0000}, */
2001         {0xaa, 0x14, 0x0001},
2002         {0xaa, 0x15, 0x00e8},
2003         {0xaa, 0x16, 0x0002},
2004         {0xaa, 0x17, 0x0086},           /* 00,17,88,aa */
2005         {0xaa, 0x31, 0x0038},
2006         {0xaa, 0x32, 0x0038},
2007         {0xaa, 0x33, 0x0038},
2008         {0xaa, 0x5b, 0x0001},
2009         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2010         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2011         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2012         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
2013         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2014         {0xa0, 0x00, 0x01ad},
2015         {0xa0, 0xc0, 0x019b},
2016         {0xa0, 0xa0, 0x019c},
2017         {0xa0, 0x02, ZC3XX_R188_MINGAIN},
2018         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2019         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2020         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2021         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2022         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2023         {0xaa, 0x02, 0x0090},                   /* 00,02,80,aa */
2024         {}
2025 };
2026
2027 static const struct usb_action hv7131bxx_InitialScale[] = {     /* 640x480*/
2028         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2029         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2030         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
2031         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2032         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2033         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
2034         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2035         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2036         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2037         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2038         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2039         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2040         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2041         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2042         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2043         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2044         {0xaa, 0x30, 0x002d},
2045         {0xaa, 0x01, 0x0005},
2046         {0xaa, 0x11, 0x0001},
2047         {0xaa, 0x13, 0x0000},   /* {0xaa, 0x13, 0x0001}; */
2048         {0xaa, 0x14, 0x0001},
2049         {0xaa, 0x15, 0x00e6},
2050         {0xaa, 0x16, 0x0002},
2051         {0xaa, 0x17, 0x0086},
2052         {0xaa, 0x31, 0x0038},
2053         {0xaa, 0x32, 0x0038},
2054         {0xaa, 0x33, 0x0038},
2055         {0xaa, 0x5b, 0x0001},
2056         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2057         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2058         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2059         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
2060         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2061         {0xa0, 0x00, 0x01ad},
2062         {0xa0, 0xc0, 0x019b},
2063         {0xa0, 0xa0, 0x019c},
2064         {0xa0, 0x02, ZC3XX_R188_MINGAIN},
2065         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2066         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2067         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2068         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2069         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2070         {0xaa, 0x02, 0x0090},   /* {0xaa, 0x02, 0x0080}, */
2071         {}
2072 };
2073 static const struct usb_action hv7131b_50HZ[] = {       /* 640x480*/
2074         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2075         {0xaa, 0x25, 0x0007},                   /* 00,25,07,aa */
2076         {0xaa, 0x26, 0x0053},                   /* 00,26,53,aa */
2077         {0xaa, 0x27, 0x0000},                   /* 00,27,00,aa */
2078         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2079         {0xaa, 0x21, 0x0050},                   /* 00,21,50,aa */
2080         {0xaa, 0x22, 0x001b},                   /* 00,22,1b,aa */
2081         {0xaa, 0x23, 0x00fc},                   /* 00,23,fc,aa */
2082         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2083         {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,9b,cc */
2084         {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,80,cc */
2085         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
2086         {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,ea,cc */
2087         {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,60,cc */
2088         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0c,cc */
2089         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,18,cc */
2090         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,18,cc */
2091         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
2092         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2093         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},       /* 00,1e,50,cc */
2094         {0xa0, 0x1b, ZC3XX_R01F_HSYNC_2},       /* 00,1f,1b,cc */
2095         {0xa0, 0xfc, ZC3XX_R020_HSYNC_3},       /* 00,20,fc,cc */
2096         {}
2097 };
2098 static const struct usb_action hv7131b_50HZScale[] = {  /* 320x240 */
2099         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2100         {0xaa, 0x25, 0x0007},                   /* 00,25,07,aa */
2101         {0xaa, 0x26, 0x0053},                   /* 00,26,53,aa */
2102         {0xaa, 0x27, 0x0000},                   /* 00,27,00,aa */
2103         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2104         {0xaa, 0x21, 0x0050},                   /* 00,21,50,aa */
2105         {0xaa, 0x22, 0x0012},                   /* 00,22,12,aa */
2106         {0xaa, 0x23, 0x0080},                   /* 00,23,80,aa */
2107         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2108         {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,9b,cc */
2109         {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,80,cc */
2110         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,01,cc */
2111         {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,d4,cc */
2112         {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,c0,cc */
2113         {0xa0, 0x07, ZC3XX_R18C_AEFREEZE},      /* 01,8c,07,cc */
2114         {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,0f,cc */
2115         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,18,cc */
2116         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
2117         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2118         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},       /* 00,1e,50,cc */
2119         {0xa0, 0x12, ZC3XX_R01F_HSYNC_2},       /* 00,1f,12,cc */
2120         {0xa0, 0x80, ZC3XX_R020_HSYNC_3},       /* 00,20,80,cc */
2121         {}
2122 };
2123 static const struct usb_action hv7131b_60HZ[] = {       /* 640x480*/
2124         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2125         {0xaa, 0x25, 0x0007},                   /* 00,25,07,aa */
2126         {0xaa, 0x26, 0x00a1},                   /* 00,26,a1,aa */
2127         {0xaa, 0x27, 0x0020},                   /* 00,27,20,aa */
2128         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2129         {0xaa, 0x21, 0x0040},                   /* 00,21,40,aa */
2130         {0xaa, 0x22, 0x0013},                   /* 00,22,13,aa */
2131         {0xaa, 0x23, 0x004c},                   /* 00,23,4c,aa */
2132         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2133         {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,4d,cc */
2134         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,60,cc */
2135         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
2136         {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,c3,cc */
2137         {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,50,cc */
2138         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0c,cc */
2139         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,18,cc */
2140         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,18,cc */
2141         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
2142         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2143         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},       /* 00,1e,40,cc */
2144         {0xa0, 0x13, ZC3XX_R01F_HSYNC_2},       /* 00,1f,13,cc */
2145         {0xa0, 0x4c, ZC3XX_R020_HSYNC_3},       /* 00,20,4c,cc */
2146         {}
2147 };
2148 static const struct usb_action hv7131b_60HZScale[] = {  /* 320x240 */
2149         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2150         {0xaa, 0x25, 0x0007},                   /* 00,25,07,aa */
2151         {0xaa, 0x26, 0x00a1},                   /* 00,26,a1,aa */
2152         {0xaa, 0x27, 0x0020},                   /* 00,27,20,aa */
2153         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2154         {0xaa, 0x21, 0x00a0},                   /* 00,21,a0,aa */
2155         {0xaa, 0x22, 0x0016},                   /* 00,22,16,aa */
2156         {0xaa, 0x23, 0x0040},                   /* 00,23,40,aa */
2157         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2158         {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,4d,cc */
2159         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,60,cc */
2160         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,01,cc */
2161         {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,86,cc */
2162         {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,a0,cc */
2163         {0xa0, 0x07, ZC3XX_R18C_AEFREEZE},      /* 01,8c,07,cc */
2164         {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,0f,cc */
2165         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,18,cc */
2166         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
2167         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2168         {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},       /* 00,1e,a0,cc */
2169         {0xa0, 0x16, ZC3XX_R01F_HSYNC_2},       /* 00,1f,16,cc */
2170         {0xa0, 0x40, ZC3XX_R020_HSYNC_3},       /* 00,20,40,cc */
2171         {}
2172 };
2173 static const struct usb_action hv7131b_NoFliker[] = {   /* 640x480*/
2174         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2175         {0xaa, 0x25, 0x0003},                   /* 00,25,03,aa */
2176         {0xaa, 0x26, 0x0000},                   /* 00,26,00,aa */
2177         {0xaa, 0x27, 0x0000},                   /* 00,27,00,aa */
2178         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2179         {0xaa, 0x21, 0x0010},                   /* 00,21,10,aa */
2180         {0xaa, 0x22, 0x0000},                   /* 00,22,00,aa */
2181         {0xaa, 0x23, 0x0003},                   /* 00,23,03,aa */
2182         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2183         {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,f8,cc */
2184         {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,00,cc */
2185         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
2186         {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,02,cc */
2187         {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,00,cc */
2188         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
2189         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
2190         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,00,cc */
2191         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,00,cc */
2192         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2193         {0xa0, 0x10, ZC3XX_R01E_HSYNC_1},       /* 00,1e,10,cc */
2194         {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},       /* 00,1f,00,cc */
2195         {0xa0, 0x03, ZC3XX_R020_HSYNC_3},       /* 00,20,03,cc */
2196         {}
2197 };
2198 static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
2199         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2200         {0xaa, 0x25, 0x0003},                   /* 00,25,03,aa */
2201         {0xaa, 0x26, 0x0000},                   /* 00,26,00,aa */
2202         {0xaa, 0x27, 0x0000},                   /* 00,27,00,aa */
2203         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2204         {0xaa, 0x21, 0x00a0},                   /* 00,21,a0,aa */
2205         {0xaa, 0x22, 0x0016},                   /* 00,22,16,aa */
2206         {0xaa, 0x23, 0x0040},                   /* 00,23,40,aa */
2207         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2208         {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,f8,cc */
2209         {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,00,cc */
2210         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
2211         {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,02,cc */
2212         {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,00,cc */
2213         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
2214         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
2215         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,00,cc */
2216         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,00,cc */
2217         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2218         {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},       /* 00,1e,a0,cc */
2219         {0xa0, 0x16, ZC3XX_R01F_HSYNC_2},       /* 00,1f,16,cc */
2220         {0xa0, 0x40, ZC3XX_R020_HSYNC_3},       /* 00,20,40,cc */
2221         {}
2222 };
2223
2224 static const struct usb_action hv7131cxx_Initial[] = {
2225         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2226         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2227         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2228         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2229         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2230         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2231         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2232         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2233         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2234         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2235         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2236         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2237         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2238         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2239         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2240         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2241         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2242         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2243         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2244         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2245         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2246         {0xaa, 0x01, 0x000c},
2247         {0xaa, 0x11, 0x0000},
2248         {0xaa, 0x13, 0x0000},
2249         {0xaa, 0x14, 0x0001},
2250         {0xaa, 0x15, 0x00e8},
2251         {0xaa, 0x16, 0x0002},
2252         {0xaa, 0x17, 0x0088},
2253
2254         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2255         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2256         {0xa0, 0x89, ZC3XX_R18D_YTARGET},
2257         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2258         {0xa0, 0x00, 0x01ad},
2259         {0xa0, 0xc0, 0x019b},
2260         {0xa0, 0xa0, 0x019c},
2261         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2262         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2263         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2264         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2265         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2266         {0xa1, 0x01, 0x0002},
2267         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2268         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2269         {0xa1, 0x01, 0x0091},
2270         {0xa1, 0x01, 0x0095},
2271         {0xa1, 0x01, 0x0096},
2272
2273         {0xa1, 0x01, 0x0008},
2274         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2275         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2276         {0xa1, 0x01, 0x01c8},
2277         {0xa1, 0x01, 0x01c9},
2278         {0xa1, 0x01, 0x01ca},
2279         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2280
2281         {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
2282         {0xa0, 0xf0, ZC3XX_R10B_RGB01},
2283         {0xa0, 0xf0, ZC3XX_R10C_RGB02},
2284         {0xa0, 0xf0, ZC3XX_R10D_RGB10},
2285         {0xa0, 0x60, ZC3XX_R10E_RGB11},
2286         {0xa0, 0xf0, ZC3XX_R10F_RGB12},
2287         {0xa0, 0xf0, ZC3XX_R110_RGB20},
2288         {0xa0, 0xf0, ZC3XX_R111_RGB21},
2289         {0xa0, 0x60, ZC3XX_R112_RGB22},
2290         {0xa1, 0x01, 0x0180},
2291         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2292         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2293         {0xaa, 0x25, 0x0007},
2294         {0xaa, 0x26, 0x0053},
2295         {0xaa, 0x27, 0x0000},
2296
2297         {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 2f */
2298         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 9b */
2299         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 80 */
2300         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2301         {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2302         {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2303         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2304         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2305         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2306         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2307         {0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
2308         {0xa1, 0x01, 0x001d},
2309         {0xa1, 0x01, 0x001e},
2310         {0xa1, 0x01, 0x001f},
2311         {0xa1, 0x01, 0x0020},
2312         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2313         {0xa1, 0x01, 0x0180},
2314         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2315         {}
2316 };
2317
2318 static const struct usb_action hv7131cxx_InitialScale[] = {
2319         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2320
2321         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* diff */
2322         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2323         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2324         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2325         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2326
2327         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2328         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2329
2330         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2331         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2332         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2333         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 1e0 */
2334
2335         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2336         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2337         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2338         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2339         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2340         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2341         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2342         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2343         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2344         {0xaa, 0x01, 0x000c},
2345         {0xaa, 0x11, 0x0000},
2346         {0xaa, 0x13, 0x0000},
2347         {0xaa, 0x14, 0x0001},
2348         {0xaa, 0x15, 0x00e8},
2349         {0xaa, 0x16, 0x0002},
2350         {0xaa, 0x17, 0x0088},
2351
2352         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00 */
2353
2354         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2355         {0xa0, 0x89, ZC3XX_R18D_YTARGET},
2356         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2357         {0xa0, 0x00, 0x01ad},
2358         {0xa0, 0xc0, 0x019b},
2359         {0xa0, 0xa0, 0x019c},
2360         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2361         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2362         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2363         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2364         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2365         {0xa1, 0x01, 0x0002},
2366         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2367                                                 /* read the i2c chips ident */
2368         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2369         {0xa1, 0x01, 0x0091},
2370         {0xa1, 0x01, 0x0095},
2371         {0xa1, 0x01, 0x0096},
2372
2373         {0xa1, 0x01, 0x0008},
2374         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2375         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2376         {0xa1, 0x01, 0x01c8},
2377         {0xa1, 0x01, 0x01c9},
2378         {0xa1, 0x01, 0x01ca},
2379         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2380
2381         {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
2382         {0xa0, 0xf0, ZC3XX_R10B_RGB01},
2383         {0xa0, 0xf0, ZC3XX_R10C_RGB02},
2384         {0xa0, 0xf0, ZC3XX_R10D_RGB10},
2385         {0xa0, 0x60, ZC3XX_R10E_RGB11},
2386         {0xa0, 0xf0, ZC3XX_R10F_RGB12},
2387         {0xa0, 0xf0, ZC3XX_R110_RGB20},
2388         {0xa0, 0xf0, ZC3XX_R111_RGB21},
2389         {0xa0, 0x60, ZC3XX_R112_RGB22},
2390         {0xa1, 0x01, 0x0180},
2391         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2392         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2393         {0xaa, 0x25, 0x0007},
2394         {0xaa, 0x26, 0x0053},
2395         {0xaa, 0x27, 0x0000},
2396
2397         {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 2f */
2398         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 9b */
2399         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 80 */
2400
2401         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2402         {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2403         {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2404
2405         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2406         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2407         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2408         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2409         {0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
2410         {0xa1, 0x01, 0x001d},
2411         {0xa1, 0x01, 0x001e},
2412         {0xa1, 0x01, 0x001f},
2413         {0xa1, 0x01, 0x0020},
2414         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2415         {0xa1, 0x01, 0x0180},
2416         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2417         {}
2418 };
2419
2420 static const struct usb_action icm105axx_Initial[] = {
2421         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2422         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2423         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2424         {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2425         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2426         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2427         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2428         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2429         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2430         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2431         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2432         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2433         {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2434         {0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
2435         {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2436         {0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
2437         {0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
2438         {0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
2439         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2440         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2441         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2442         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2443         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2444         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2445         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2446         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2447         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2448         {0xaa, 0x01, 0x0010},
2449         {0xaa, 0x03, 0x0000},
2450         {0xaa, 0x04, 0x0001},
2451         {0xaa, 0x05, 0x0020},
2452         {0xaa, 0x06, 0x0001},
2453         {0xaa, 0x08, 0x0000},
2454         {0xaa, 0x03, 0x0001},
2455         {0xaa, 0x04, 0x0011},
2456         {0xaa, 0x05, 0x00a0},
2457         {0xaa, 0x06, 0x0001},
2458         {0xaa, 0x08, 0x0000},
2459         {0xaa, 0x03, 0x0002},
2460         {0xaa, 0x04, 0x0013},
2461         {0xaa, 0x05, 0x0020},
2462         {0xaa, 0x06, 0x0001},
2463         {0xaa, 0x08, 0x0000},
2464         {0xaa, 0x03, 0x0003},
2465         {0xaa, 0x04, 0x0015},
2466         {0xaa, 0x05, 0x0020},
2467         {0xaa, 0x06, 0x0005},
2468         {0xaa, 0x08, 0x0000},
2469         {0xaa, 0x03, 0x0004},
2470         {0xaa, 0x04, 0x0017},
2471         {0xaa, 0x05, 0x0020},
2472         {0xaa, 0x06, 0x000d},
2473         {0xaa, 0x08, 0x0000},
2474         {0xaa, 0x03, 0x0005},
2475         {0xaa, 0x04, 0x0019},
2476         {0xaa, 0x05, 0x0020},
2477         {0xaa, 0x06, 0x0005},
2478         {0xaa, 0x08, 0x0000},
2479         {0xaa, 0x03, 0x0006},
2480         {0xaa, 0x04, 0x0017},
2481         {0xaa, 0x05, 0x0026},
2482         {0xaa, 0x06, 0x0005},
2483         {0xaa, 0x08, 0x0000},
2484         {0xaa, 0x03, 0x0007},
2485         {0xaa, 0x04, 0x0019},
2486         {0xaa, 0x05, 0x0022},
2487         {0xaa, 0x06, 0x0005},
2488         {0xaa, 0x08, 0x0000},
2489         {0xaa, 0x03, 0x0008},
2490         {0xaa, 0x04, 0x0021},
2491         {0xaa, 0x05, 0x00aa},
2492         {0xaa, 0x06, 0x0005},
2493         {0xaa, 0x08, 0x0000},
2494         {0xaa, 0x03, 0x0009},
2495         {0xaa, 0x04, 0x0023},
2496         {0xaa, 0x05, 0x00aa},
2497         {0xaa, 0x06, 0x000d},
2498         {0xaa, 0x08, 0x0000},
2499         {0xaa, 0x03, 0x000a},
2500         {0xaa, 0x04, 0x0025},
2501         {0xaa, 0x05, 0x00aa},
2502         {0xaa, 0x06, 0x0005},
2503         {0xaa, 0x08, 0x0000},
2504         {0xaa, 0x03, 0x000b},
2505         {0xaa, 0x04, 0x00ec},
2506         {0xaa, 0x05, 0x002e},
2507         {0xaa, 0x06, 0x0005},
2508         {0xaa, 0x08, 0x0000},
2509         {0xaa, 0x03, 0x000c},
2510         {0xaa, 0x04, 0x00fa},
2511         {0xaa, 0x05, 0x002a},
2512         {0xaa, 0x06, 0x0005},
2513         {0xaa, 0x08, 0x0000},
2514         {0xaa, 0x07, 0x000d},
2515         {0xaa, 0x01, 0x0005},
2516         {0xaa, 0x94, 0x0002},
2517         {0xaa, 0x90, 0x0000},
2518         {0xaa, 0x91, 0x001f},
2519         {0xaa, 0x10, 0x0064},
2520         {0xaa, 0x9b, 0x00f0},
2521         {0xaa, 0x9c, 0x0002},
2522         {0xaa, 0x14, 0x001a},
2523         {0xaa, 0x20, 0x0080},
2524         {0xaa, 0x22, 0x0080},
2525         {0xaa, 0x24, 0x0080},
2526         {0xaa, 0x26, 0x0080},
2527         {0xaa, 0x00, 0x0084},
2528         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2529         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2530         {0xaa, 0xa8, 0x00c0},
2531         {0xa1, 0x01, 0x0002},
2532         {0xa1, 0x01, 0x0008},
2533         {0xa1, 0x01, 0x0180},
2534         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2535         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2536         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2537         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2538         {0xa1, 0x01, 0x0008},
2539
2540         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2541         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2542         {0xa1, 0x01, 0x01c8},
2543         {0xa1, 0x01, 0x01c9},
2544         {0xa1, 0x01, 0x01ca},
2545         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2546         {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2547         {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2548         {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2549         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2550         {0xa0, 0x52, ZC3XX_R10E_RGB11},
2551         {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2552         {0xa0, 0xf7, ZC3XX_R110_RGB20},
2553         {0xa0, 0xf7, ZC3XX_R111_RGB21},
2554         {0xa0, 0x52, ZC3XX_R112_RGB22},
2555         {0xa1, 0x01, 0x0180},
2556         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2557         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2558         {0xaa, 0x0d, 0x0003},
2559         {0xaa, 0x0c, 0x008c},
2560         {0xaa, 0x0e, 0x0095},
2561         {0xaa, 0x0f, 0x0002},
2562         {0xaa, 0x1c, 0x0094},
2563         {0xaa, 0x1d, 0x0002},
2564         {0xaa, 0x20, 0x0080},
2565         {0xaa, 0x22, 0x0080},
2566         {0xaa, 0x24, 0x0080},
2567         {0xaa, 0x26, 0x0080},
2568         {0xaa, 0x00, 0x0084},
2569         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2570         {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
2571         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2572         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2573         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
2574         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2575         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2576         {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
2577         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2578         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2579         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2580         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2581         {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
2582         {0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
2583         {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
2584         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2585         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2586         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
2587         {0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
2588         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2589         {0xa1, 0x01, 0x0180},
2590         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2591         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2592         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2593         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2594         {}
2595 };
2596
2597 static const struct usb_action icm105axx_InitialScale[] = {
2598         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2599         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2600         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2601         {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2602         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2603         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2604         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2605         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2606         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2607         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2608         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2609         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2610         {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2611         {0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
2612         {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2613         {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
2614         {0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
2615         {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
2616         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2617         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2618         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2619         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2620         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2621         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2622         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2623         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2624         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2625         {0xaa, 0x01, 0x0010},
2626         {0xaa, 0x03, 0x0000},
2627         {0xaa, 0x04, 0x0001},
2628         {0xaa, 0x05, 0x0020},
2629         {0xaa, 0x06, 0x0001},
2630         {0xaa, 0x08, 0x0000},
2631         {0xaa, 0x03, 0x0001},
2632         {0xaa, 0x04, 0x0011},
2633         {0xaa, 0x05, 0x00a0},
2634         {0xaa, 0x06, 0x0001},
2635         {0xaa, 0x08, 0x0000},
2636         {0xaa, 0x03, 0x0002},
2637         {0xaa, 0x04, 0x0013},
2638         {0xaa, 0x05, 0x0020},
2639         {0xaa, 0x06, 0x0001},
2640         {0xaa, 0x08, 0x0000},
2641         {0xaa, 0x03, 0x0003},
2642         {0xaa, 0x04, 0x0015},
2643         {0xaa, 0x05, 0x0020},
2644         {0xaa, 0x06, 0x0005},
2645         {0xaa, 0x08, 0x0000},
2646         {0xaa, 0x03, 0x0004},
2647         {0xaa, 0x04, 0x0017},
2648         {0xaa, 0x05, 0x0020},
2649         {0xaa, 0x06, 0x000d},
2650         {0xaa, 0x08, 0x0000},
2651         {0xaa, 0x03, 0x0005},
2652         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
2653         {0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
2654         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
2655         {0xa1, 0x01, 0x0091},
2656         {0xaa, 0x05, 0x0020},
2657         {0xaa, 0x06, 0x0005},
2658         {0xaa, 0x08, 0x0000},
2659         {0xaa, 0x03, 0x0006},
2660         {0xaa, 0x04, 0x0017},
2661         {0xaa, 0x05, 0x0026},
2662         {0xaa, 0x06, 0x0005},
2663         {0xaa, 0x08, 0x0000},
2664         {0xaa, 0x03, 0x0007},
2665         {0xaa, 0x04, 0x0019},
2666         {0xaa, 0x05, 0x0022},
2667         {0xaa, 0x06, 0x0005},
2668         {0xaa, 0x08, 0x0000},
2669         {0xaa, 0x03, 0x0008},
2670         {0xaa, 0x04, 0x0021},
2671         {0xaa, 0x05, 0x00aa},
2672         {0xaa, 0x06, 0x0005},
2673         {0xaa, 0x08, 0x0000},
2674         {0xaa, 0x03, 0x0009},
2675         {0xaa, 0x04, 0x0023},
2676         {0xaa, 0x05, 0x00aa},
2677         {0xaa, 0x06, 0x000d},
2678         {0xaa, 0x08, 0x0000},
2679         {0xaa, 0x03, 0x000a},
2680         {0xaa, 0x04, 0x0025},
2681         {0xaa, 0x05, 0x00aa},
2682         {0xaa, 0x06, 0x0005},
2683         {0xaa, 0x08, 0x0000},
2684         {0xaa, 0x03, 0x000b},
2685         {0xaa, 0x04, 0x00ec},
2686         {0xaa, 0x05, 0x002e},
2687         {0xaa, 0x06, 0x0005},
2688         {0xaa, 0x08, 0x0000},
2689         {0xaa, 0x03, 0x000c},
2690         {0xaa, 0x04, 0x00fa},
2691         {0xaa, 0x05, 0x002a},
2692         {0xaa, 0x06, 0x0005},
2693         {0xaa, 0x08, 0x0000},
2694         {0xaa, 0x07, 0x000d},
2695         {0xaa, 0x01, 0x0005},
2696         {0xaa, 0x94, 0x0002},
2697         {0xaa, 0x90, 0x0000},
2698         {0xaa, 0x91, 0x0010},
2699         {0xaa, 0x10, 0x0064},
2700         {0xaa, 0x9b, 0x00f0},
2701         {0xaa, 0x9c, 0x0002},
2702         {0xaa, 0x14, 0x001a},
2703         {0xaa, 0x20, 0x0080},
2704         {0xaa, 0x22, 0x0080},
2705         {0xaa, 0x24, 0x0080},
2706         {0xaa, 0x26, 0x0080},
2707         {0xaa, 0x00, 0x0084},
2708         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2709         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2710         {0xaa, 0xa8, 0x0080},
2711         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
2712         {0xa1, 0x01, 0x0002},
2713         {0xa1, 0x01, 0x0008},
2714         {0xa1, 0x01, 0x0180},
2715         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2716         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2717         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2718         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2719         {0xa1, 0x01, 0x0008},
2720
2721         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2722         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2723         {0xa1, 0x01, 0x01c8},
2724         {0xa1, 0x01, 0x01c9},
2725         {0xa1, 0x01, 0x01ca},
2726         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2727
2728         {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2729         {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2730         {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2731         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2732         {0xa0, 0x52, ZC3XX_R10E_RGB11},
2733         {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2734         {0xa0, 0xf7, ZC3XX_R110_RGB20},
2735         {0xa0, 0xf7, ZC3XX_R111_RGB21},
2736         {0xa0, 0x52, ZC3XX_R112_RGB22},
2737         {0xa1, 0x01, 0x0180},
2738         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2739         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2740         {0xaa, 0x0d, 0x0003},
2741         {0xaa, 0x0c, 0x0020},
2742         {0xaa, 0x0e, 0x000e},
2743         {0xaa, 0x0f, 0x0002},
2744         {0xaa, 0x1c, 0x000d},
2745         {0xaa, 0x1d, 0x0002},
2746         {0xaa, 0x20, 0x0080},
2747         {0xaa, 0x22, 0x0080},
2748         {0xaa, 0x24, 0x0080},
2749         {0xaa, 0x26, 0x0080},
2750         {0xaa, 0x00, 0x0084},
2751         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2752         {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
2753         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2754         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2755         {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
2756         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2757         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2758         {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
2759         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2760         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2761         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2762         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2763         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
2764         {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
2765         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
2766         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2767         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2768         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2769         {0xa1, 0x01, 0x0180},
2770         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2771         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2772         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2773         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2774         {}
2775 };
2776 static const struct usb_action icm105a_50HZ[] = {
2777         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2778         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2779         {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
2780         {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
2781         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2782         {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
2783         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2784         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2785         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2786         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2787         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2788         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2789         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2790         {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
2791         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2792         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2793         {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
2794         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2795         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2796         {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
2797         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2798         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2799         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2800         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2801         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
2802         {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
2803         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2804         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2805         {}
2806 };
2807 static const struct usb_action icm105a_50HZScale[] = {
2808         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2809         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2810         {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
2811         {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
2812         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2813         {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
2814         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2815         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2816         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2817         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2818         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2819         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2820         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2821         {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
2822         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2823         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2824         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2825         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2826         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2827         {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
2828         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2829         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2830         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2831         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2832         {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
2833         {0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
2834         {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
2835         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2836         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2837         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2838         {}
2839 };
2840 static const struct usb_action icm105a_60HZ[] = {
2841         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2842         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2843         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2844         {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2845         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2846         {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
2847         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2848         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2849         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2850         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2851         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2852         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2853         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2854         {0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
2855         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2856         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2857         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
2858         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2859         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2860         {0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
2861         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2862         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2863         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2864         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2865         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2866         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2867         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2868         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2869         {}
2870 };
2871 static const struct usb_action icm105a_60HZScale[] = {
2872         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2873         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2874         {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
2875         {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
2876         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2877         {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
2878         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2879         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2880         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2881         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2882         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2883         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2884         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2885         {0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
2886         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2887         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2888         {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
2889         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2890         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2891         {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
2892         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2893         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2894         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2895         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2896         {0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
2897         {0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
2898         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2899         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2900         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2901         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2902         {}
2903 };
2904 static const struct usb_action icm105a_NoFliker[] = {
2905         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2906         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2907         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2908         {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2909         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2910         {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
2911         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2912         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2913         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2914         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2915         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2916         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2917         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2918         {0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
2919         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2920         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2921         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2922         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2923         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2924         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2925         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2926         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2927         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2928         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2929         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2930         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2931         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2932         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2933         {}
2934 };
2935 static const struct usb_action icm105a_NoFlikerScale[] = {
2936         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2937         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2938         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2939         {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
2940         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2941         {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
2942         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2943         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2944         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2945         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2946         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2947         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2948         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2949         {0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
2950         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2951         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2952         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2953         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2954         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2955         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2956         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2957         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2958         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2959         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2960         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2961         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2962         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2963         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2964         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2965         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2966         {}
2967 };
2968
2969 static const struct usb_action MC501CB_InitialScale[] = {
2970         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2971         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
2972         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2973         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2974         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2975         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2976         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2977         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2978         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2979         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2980         {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
2981         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2982         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2983         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2984         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2985         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2986         {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
2987         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2988         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
2989         {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2990         {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2991         {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2992         {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2993         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2994         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2995         {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2996         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2997         {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2998         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2999         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3000         {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3001         {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3002         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3003         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3004         {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3005         {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3006         {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
3007         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3008         {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
3009         {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3010         {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3011         {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3012         {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3013         {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3014         {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3015         {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3016         {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3017         {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3018         {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3019         {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3020         {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3021         {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3022         {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3023         {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3024         {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3025         {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3026         {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3027         {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3028         {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3029         {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
3030         {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3031         {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3032         {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3033         {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3034         {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3035         {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3036         {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3037         {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3038         {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3039         {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3040         {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3041         {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3042         {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3043         {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3044         {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3045         {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3046         {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3047         {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3048         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3049         {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3050         {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3051         {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3052         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3053         {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
3054         {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3055         {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
3056         {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
3057         {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
3058         {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
3059         {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3060         {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3061         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3062         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3063         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3064         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3065         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3066         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3067         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3068         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3069         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3070         {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3071         {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
3072         {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
3073         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3074         {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3075         {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3076         {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3077         {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3078         {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3079         {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3080
3081         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3082         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3083         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3084         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3085         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3086         {}
3087 };
3088
3089 static const struct usb_action MC501CB_Initial[] = {     /* 320x240 */
3090         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3091         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
3092         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
3093         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3094         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
3095         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3096         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3097         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3098         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3099         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3100         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3101         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3102         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3103         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3104         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3105         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3106         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
3107         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3108         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
3109         {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
3110         {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
3111         {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
3112         {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
3113         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3114         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3115         {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3116         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3117         {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3118         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3119         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3120         {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3121         {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3122         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3123         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3124         {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3125         {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3126         {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
3127         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3128         {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
3129         {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3130         {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3131         {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3132         {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3133         {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3134         {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3135         {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3136         {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3137         {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3138         {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3139         {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3140         {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3141         {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3142         {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3143         {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3144         {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3145         {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3146         {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3147         {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3148         {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3149         {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
3150         {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3151         {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3152         {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3153         {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3154         {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3155         {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3156         {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3157         {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3158         {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3159         {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3160         {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3161         {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3162         {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3163         {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3164         {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3165         {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3166         {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3167         {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3168         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3169         {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3170         {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3171         {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3172         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3173         {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
3174         {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3175         {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
3176         {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
3177         {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
3178         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3179         {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3180         {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3181         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3182         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3183         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3184         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3185         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3186         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3187         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3188         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3189         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3190         {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3191         {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
3192         {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
3193         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3194         {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3195         {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3196         {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3197         {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3198         {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3199         {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3200         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3201         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3202         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3203         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3204         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3205         {}
3206 };
3207
3208 static const struct usb_action MC501CB_50HZ[] = {
3209         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3210         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3211         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3212         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3213         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3214         {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
3215         {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
3216         {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
3217         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3218         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3219         {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3220         {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3221         {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3222         {}
3223 };
3224
3225 static const struct usb_action MC501CB_50HZScale[] = {
3226         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3227         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3228         {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3229         {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3230         {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3231         {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
3232         {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
3233         {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
3234         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3235         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3236         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3237         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3238         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3239         {}
3240 };
3241
3242 static const struct usb_action MC501CB_60HZ[] = {
3243         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3244         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3245         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3246         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3247         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3248         {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3249         {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3250         {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3251         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3252         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3253         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3254         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3255         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3256         {}
3257 };
3258
3259 static const struct usb_action MC501CB_60HZScale[] = {
3260         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3261         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3262         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3263         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3264         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3265         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3266         {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3267         {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3268         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3269         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3270         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3271         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3272         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3273         {}
3274 };
3275
3276 static const struct usb_action MC501CB_NoFliker[] = {
3277         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3278         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3279         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3280         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3281         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3282         {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3283         {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3284         {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3285         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3286         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3287         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3288         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3289         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3290         {}
3291 };
3292
3293 static const struct usb_action MC501CB_NoFlikerScale[] = {
3294         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3295         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3296         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3297         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3298         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3299         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3300         {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3301         {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3302         {}
3303 };
3304
3305 /* from zs211.inf - HKR,%OV7620%,Initial - 640x480 */
3306 static const struct usb_action OV7620_mode0[] = {
3307         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3308         {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
3309         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3310         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3311         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3312         {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3313         {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3314         {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3315         {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3316         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3317         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3318         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3319         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3320         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3321         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3322         {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3323         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3324         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3325         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3326         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3327         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3328         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3329         {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3330         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3331         {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3332         {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3333         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3334         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3335         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3336         {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3337         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3338         {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3339         {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3340         {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3341         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3342         {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3343         {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3344         {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3345         {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3346         {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3347         {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3348         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3349         {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3350         {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3351         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3352         {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3353         {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3354         {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3355         {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3356         {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3357         {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3358         {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3359         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3360         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3361         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3362         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3363         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3364         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3365         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3366         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3367         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3368         {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3369         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3370         {0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
3371         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3372         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
3373         {}
3374 };
3375
3376 /* from zs211.inf - HKR,%OV7620%,InitialScale - 320x240 */
3377 static const struct usb_action OV7620_mode1[] = {
3378         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3379         {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},   /* 00,02,50,cc */
3380         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,00,cc */
3381                                                 /* mx change? */
3382         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3383         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3384         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},     /* 00,83,02,cc */
3385         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},     /* 00,85,01,cc */
3386         {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,80,cc */
3387         {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID},    /* 00,87,81,cc */
3388         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},    /* 00,88,10,cc */
3389         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3390         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3391         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3392         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3393         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3394         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3395         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3396         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3397         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
3398         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
3399         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
3400         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
3401         {0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,d6,cc */
3402                                                 /* OV7648 00,9c,d8,cc */
3403         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,88,cc */
3404         {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3405         {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3406         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3407         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3408         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3409         {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3410         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3411         {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3412         {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3413         {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3414         {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3415         {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3416         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3417         {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3418         {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3419         {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3420         {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3421         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3422         {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3423         {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3424         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3425         {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3426         {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3427         {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3428         {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3429         {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3430         {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3431         {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3432         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3433         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3434         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3435         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},     /* 01,89,06,cc */
3436         {0xa0, 0x00, 0x01ad},                   /* 01,ad,00,cc */
3437         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3438         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
3439         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3440         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
3441         {0xa0, 0x68, ZC3XX_R116_RGAIN},         /* 01,16,68,cc */
3442         {0xa0, 0x52, ZC3XX_R118_BGAIN},         /* 01,18,52,cc */
3443         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,50,cc */
3444         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3445         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,50,cc */
3446         {}
3447 };
3448
3449 /* from zs211.inf - HKR,%OV7620%\AE,50HZ */
3450 static const struct usb_action OV7620_50HZ[] = {
3451         {0xaa, 0x13, 0x00a3},   /* 00,13,a3,aa */
3452         {0xdd, 0x00, 0x0100},   /* 00,01,00,dd */
3453         {0xaa, 0x2b, 0x0096},   /* 00,2b,96,aa */
3454         {0xaa, 0x75, 0x008a},   /* 00,75,8a,aa */
3455         {0xaa, 0x2d, 0x0005},   /* 00,2d,05,aa */
3456         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
3457         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,04,cc */
3458         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,18,cc */
3459         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
3460         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
3461         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,83,cc */
3462         {0xaa, 0x10, 0x0082},                           /* 00,10,82,aa */
3463         {0xaa, 0x76, 0x0003},                           /* 00,76,03,aa */
3464 /*      {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},            * 00,02,40,cc
3465                                                          if mode0 (640x480) */
3466         {}
3467 };
3468
3469 /* from zs211.inf - HKR,%OV7620%\AE,60HZ */
3470 static const struct usb_action OV7620_60HZ[] = {
3471         {0xaa, 0x13, 0x00a3},                   /* 00,13,a3,aa */
3472                                                 /* (bug in zs211.inf) */
3473         {0xdd, 0x00, 0x0100},                   /* 00,01,00,dd */
3474         {0xaa, 0x2b, 0x0000},                   /* 00,2b,00,aa */
3475         {0xaa, 0x75, 0x008a},                   /* 00,75,8a,aa */
3476         {0xaa, 0x2d, 0x0005},                   /* 00,2d,05,aa */
3477         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3478         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3479         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3480         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3481         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3482         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3483         {0xaa, 0x10, 0x0020},                   /* 00,10,20,aa */
3484         {0xaa, 0x76, 0x0003},                   /* 00,76,03,aa */
3485 /*      {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},    * 00,02,40,cc
3486                                                  * if mode0 (640x480) */
3487 /* ?? in gspca v1, it was
3488         {0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3489         {0xa1, 0x01, 0x0037},           */
3490         {}
3491 };
3492
3493 /* from zs211.inf - HKR,%OV7620%\AE,NoFliker */
3494 static const struct usb_action OV7620_NoFliker[] = {
3495         {0xaa, 0x13, 0x00a3},                   /* 00,13,a3,aa */
3496                                                 /* (bug in zs211.inf) */
3497         {0xdd, 0x00, 0x0100},                   /* 00,01,00,dd */
3498         {0xaa, 0x2b, 0x0000},                   /* 00,2b,00,aa */
3499         {0xaa, 0x75, 0x008e},                   /* 00,75,8e,aa */
3500         {0xaa, 0x2d, 0x0001},                   /* 00,2d,01,aa */
3501         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3502         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3503         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3504         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3505         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3506         {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
3507 /*      {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT},    * 00,02,44,cc
3508                                                  - if mode1 (320x240) */
3509 /* ?? was
3510         {0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3511         {0xa1, 0x01, 0x0037},           */
3512         {}
3513 };
3514
3515 static const struct usb_action ov7630c_Initial[] = {
3516         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3517         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3518         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3519         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3520         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3521         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3522         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3523         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3524         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3525         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3526         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3527         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3528         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3529         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3530         {0xaa, 0x12, 0x0080},
3531         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3532         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3533         {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3534         {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3535         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3536         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3537         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3538         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3539         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3540         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
3541         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
3542         {0xaa, 0x12, 0x0069},
3543         {0xaa, 0x04, 0x0020},
3544         {0xaa, 0x06, 0x0050},
3545         {0xaa, 0x13, 0x0083},
3546         {0xaa, 0x14, 0x0000},
3547         {0xaa, 0x15, 0x0024},
3548         {0xaa, 0x17, 0x0018},
3549         {0xaa, 0x18, 0x00ba},
3550         {0xaa, 0x19, 0x0002},
3551         {0xaa, 0x1a, 0x00f6},
3552         {0xaa, 0x1b, 0x0002},
3553         {0xaa, 0x20, 0x00c2},
3554         {0xaa, 0x24, 0x0060},
3555         {0xaa, 0x25, 0x0040},
3556         {0xaa, 0x26, 0x0030},
3557         {0xaa, 0x27, 0x00ea},
3558         {0xaa, 0x28, 0x00a0},
3559         {0xaa, 0x21, 0x0000},
3560         {0xaa, 0x2a, 0x0081},
3561         {0xaa, 0x2b, 0x0096},
3562         {0xaa, 0x2d, 0x0094},
3563         {0xaa, 0x2f, 0x003d},
3564         {0xaa, 0x30, 0x0024},
3565         {0xaa, 0x60, 0x0000},
3566         {0xaa, 0x61, 0x0040},
3567         {0xaa, 0x68, 0x007c},
3568         {0xaa, 0x6f, 0x0015},
3569         {0xaa, 0x75, 0x0088},
3570         {0xaa, 0x77, 0x00b5},
3571         {0xaa, 0x01, 0x0060},
3572         {0xaa, 0x02, 0x0060},
3573         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3574         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3575         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3576         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3577         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3578         {0xa0, 0x00, 0x01ad},
3579         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3580         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3581         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3582         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3583         {0xa0, 0x60, ZC3XX_R116_RGAIN},
3584         {0xa0, 0x46, ZC3XX_R118_BGAIN},
3585         {0xa0, 0x04, ZC3XX_R113_RGB03},
3586 /* 0x10, */
3587         {0xa1, 0x01, 0x0002},
3588         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3589         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3590         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3591         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3592         {0xa0, 0x50, ZC3XX_R10E_RGB11},
3593         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3594         {0xa0, 0xf8, ZC3XX_R110_RGB20},
3595         {0xa0, 0xf8, ZC3XX_R111_RGB21},
3596         {0xa0, 0x50, ZC3XX_R112_RGB22},
3597 /* 0x03, */
3598         {0xa1, 0x01, 0x0008},
3599         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
3600         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
3601         {0xa1, 0x01, 0x01c8},
3602         {0xa1, 0x01, 0x01c9},
3603         {0xa1, 0x01, 0x01ca},
3604         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
3605         {0xa0, 0x01, ZC3XX_R120_GAMMA00},       /* gamma 2 ?*/
3606         {0xa0, 0x0c, ZC3XX_R121_GAMMA01},
3607         {0xa0, 0x1f, ZC3XX_R122_GAMMA02},
3608         {0xa0, 0x3a, ZC3XX_R123_GAMMA03},
3609         {0xa0, 0x53, ZC3XX_R124_GAMMA04},
3610         {0xa0, 0x6d, ZC3XX_R125_GAMMA05},
3611         {0xa0, 0x85, ZC3XX_R126_GAMMA06},
3612         {0xa0, 0x9c, ZC3XX_R127_GAMMA07},
3613         {0xa0, 0xb0, ZC3XX_R128_GAMMA08},
3614         {0xa0, 0xc2, ZC3XX_R129_GAMMA09},
3615         {0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
3616         {0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
3617         {0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
3618         {0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
3619         {0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
3620         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3621         {0xa0, 0x05, ZC3XX_R130_GAMMA10},
3622         {0xa0, 0x0f, ZC3XX_R131_GAMMA11},
3623         {0xa0, 0x16, ZC3XX_R132_GAMMA12},
3624         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
3625         {0xa0, 0x19, ZC3XX_R134_GAMMA14},
3626         {0xa0, 0x19, ZC3XX_R135_GAMMA15},
3627         {0xa0, 0x17, ZC3XX_R136_GAMMA16},
3628         {0xa0, 0x15, ZC3XX_R137_GAMMA17},
3629         {0xa0, 0x12, ZC3XX_R138_GAMMA18},
3630         {0xa0, 0x10, ZC3XX_R139_GAMMA19},
3631         {0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
3632         {0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
3633         {0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
3634         {0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
3635         {0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
3636         {0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
3637         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3638         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3639         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3640         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3641         {0xa0, 0x50, ZC3XX_R10E_RGB11},
3642         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3643         {0xa0, 0xf8, ZC3XX_R110_RGB20},
3644         {0xa0, 0xf8, ZC3XX_R111_RGB21},
3645         {0xa0, 0x50, ZC3XX_R112_RGB22},
3646
3647         {0xa1, 0x01, 0x0180},
3648         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3649         {0xaa, 0x10, 0x001b},
3650         {0xaa, 0x76, 0x0002},
3651         {0xaa, 0x2a, 0x0081},
3652         {0xaa, 0x2b, 0x0000},
3653         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3654         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
3655         {0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
3656         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3657         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3658         {0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
3659         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3660         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3661         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3662         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3663         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3664         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3665         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3666         {0xaa, 0x13, 0x0083},   /* 40 */
3667         {0xa1, 0x01, 0x0180},
3668         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3669         {}
3670 };
3671
3672 static const struct usb_action ov7630c_InitialScale[] = {
3673         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3674         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
3675         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3676         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3677         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3678         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3679         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3680         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3681         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3682         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3683         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3684         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3685
3686         {0xaa, 0x12, 0x0080},
3687         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3688         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3689         {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3690         {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3691         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3692         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3693         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3694         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3695         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3696         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
3697         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
3698         {0xaa, 0x12, 0x0069},   /* i2c */
3699         {0xaa, 0x04, 0x0020},
3700         {0xaa, 0x06, 0x0050},
3701         {0xaa, 0x13, 0x00c3},
3702         {0xaa, 0x14, 0x0000},
3703         {0xaa, 0x15, 0x0024},
3704         {0xaa, 0x19, 0x0003},
3705         {0xaa, 0x1a, 0x00f6},
3706         {0xaa, 0x1b, 0x0002},
3707         {0xaa, 0x20, 0x00c2},
3708         {0xaa, 0x24, 0x0060},
3709         {0xaa, 0x25, 0x0040},
3710         {0xaa, 0x26, 0x0030},
3711         {0xaa, 0x27, 0x00ea},
3712         {0xaa, 0x28, 0x00a0},
3713         {0xaa, 0x21, 0x0000},
3714         {0xaa, 0x2a, 0x0081},
3715         {0xaa, 0x2b, 0x0096},
3716         {0xaa, 0x2d, 0x0084},
3717         {0xaa, 0x2f, 0x003d},
3718         {0xaa, 0x30, 0x0024},
3719         {0xaa, 0x60, 0x0000},
3720         {0xaa, 0x61, 0x0040},
3721         {0xaa, 0x68, 0x007c},
3722         {0xaa, 0x6f, 0x0015},
3723         {0xaa, 0x75, 0x0088},
3724         {0xaa, 0x77, 0x00b5},
3725         {0xaa, 0x01, 0x0060},
3726         {0xaa, 0x02, 0x0060},
3727         {0xaa, 0x17, 0x0018},
3728         {0xaa, 0x18, 0x00ba},
3729         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3730         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3731         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3732         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3733         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3734         {0xa0, 0x00, 0x01ad},
3735         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3736         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3737         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3738         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3739         {0xa0, 0x60, ZC3XX_R116_RGAIN},
3740         {0xa0, 0x46, ZC3XX_R118_BGAIN},
3741         {0xa0, 0x04, ZC3XX_R113_RGB03},
3742
3743         {0xa1, 0x01, 0x0002},
3744         {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3745         {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3746         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3747         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3748         {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3749         {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3750         {0xa0, 0x00, ZC3XX_R110_RGB20},
3751         {0xa0, 0xf6, ZC3XX_R111_RGB21},
3752         {0xa0, 0x4a, ZC3XX_R112_RGB22},
3753
3754         {0xa1, 0x01, 0x0008},
3755         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
3756         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
3757         {0xa1, 0x01, 0x01c8},
3758         {0xa1, 0x01, 0x01c9},
3759         {0xa1, 0x01, 0x01ca},
3760         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
3761         {0xa0, 0x16, ZC3XX_R120_GAMMA00},       /* gamma ~4 */
3762         {0xa0, 0x3a, ZC3XX_R121_GAMMA01},
3763         {0xa0, 0x5b, ZC3XX_R122_GAMMA02},
3764         {0xa0, 0x7c, ZC3XX_R123_GAMMA03},
3765         {0xa0, 0x94, ZC3XX_R124_GAMMA04},
3766         {0xa0, 0xa9, ZC3XX_R125_GAMMA05},
3767         {0xa0, 0xbb, ZC3XX_R126_GAMMA06},
3768         {0xa0, 0xca, ZC3XX_R127_GAMMA07},
3769         {0xa0, 0xd7, ZC3XX_R128_GAMMA08},
3770         {0xa0, 0xe1, ZC3XX_R129_GAMMA09},
3771         {0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
3772         {0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
3773         {0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
3774         {0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
3775         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
3776         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3777         {0xa0, 0x20, ZC3XX_R130_GAMMA10},
3778         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
3779         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
3780         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
3781         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
3782         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
3783         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
3784         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
3785         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
3786         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
3787         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
3788         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
3789         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
3790         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
3791         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
3792         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
3793         {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3794         {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3795         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3796         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3797         {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3798         {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3799         {0xa0, 0x00, ZC3XX_R110_RGB20},
3800         {0xa0, 0xf6, ZC3XX_R111_RGB21},
3801         {0xa0, 0x4a, ZC3XX_R112_RGB22},
3802
3803         {0xa1, 0x01, 0x0180},
3804         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3805         {0xaa, 0x10, 0x000d},
3806         {0xaa, 0x76, 0x0002},
3807         {0xaa, 0x2a, 0x0081},
3808         {0xaa, 0x2b, 0x0000},
3809         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3810         {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
3811         {0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
3812         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3813         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3814         {0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
3815         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3816         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3817         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3818         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3819         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3820         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3821         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3822         {0xaa, 0x13, 0x00c3},
3823
3824         {0xa1, 0x01, 0x0180},
3825         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3826         {}
3827 };
3828
3829 static const struct usb_action pas106b_Initial_com[] = {
3830 /* Sream and Sensor specific */
3831         {0xa1, 0x01, 0x0010},   /* CMOSSensorSelect */
3832 /* System */
3833         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
3834         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
3835 /* Picture size */
3836         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* ClockSelect */
3837         {0xa0, 0x03, 0x003a},
3838         {0xa0, 0x0c, 0x003b},
3839         {0xa0, 0x04, 0x0038},
3840         {}
3841 };
3842
3843 static const struct usb_action pas106b_Initial[] = {    /* 176x144 */
3844 /* JPEG control */
3845         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3846 /* Sream and Sensor specific */
3847         {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
3848 /* Picture size */
3849         {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
3850         {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
3851         {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
3852         {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
3853 /* System */
3854         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3855 /* Sream and Sensor specific */
3856         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3857         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3858 /* Sensor Interface */
3859         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3860 /* Window inside sensor array */
3861         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3862         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3863         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3864         {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3865         {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
3866 /* Init the sensor */
3867         {0xaa, 0x02, 0x0004},
3868         {0xaa, 0x08, 0x0000},
3869         {0xaa, 0x09, 0x0005},
3870         {0xaa, 0x0a, 0x0002},
3871         {0xaa, 0x0b, 0x0002},
3872         {0xaa, 0x0c, 0x0005},
3873         {0xaa, 0x0d, 0x0000},
3874         {0xaa, 0x0e, 0x0002},
3875         {0xaa, 0x14, 0x0081},
3876
3877 /* Other registors */
3878         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
3879 /* Frame retreiving */
3880         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
3881 /* Gains */
3882         {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
3883 /* Unknown */
3884         {0xa0, 0x00, 0x01ad},
3885 /* Sharpness */
3886         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3887         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3888 /* Other registors */
3889         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3890 /* Auto exposure and white balance */
3891         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3892 /*Dead pixels */
3893         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3894 /* EEPROM */
3895         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3896 /* JPEG control */
3897         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3898         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3899         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3900 /* Other registers */
3901         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3902 /* Auto exposure and white balance */
3903         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3904 /*Dead pixels */
3905         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3906 /* EEPROM */
3907         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3908 /* JPEG control */
3909         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3910         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3911         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3912
3913         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
3914         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
3915         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3916         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
3917         {0xa0, 0x58, ZC3XX_R10E_RGB11},
3918         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
3919         {0xa0, 0xf4, ZC3XX_R110_RGB20},
3920         {0xa0, 0xf4, ZC3XX_R111_RGB21},
3921         {0xa0, 0x58, ZC3XX_R112_RGB22},
3922 /* Auto correction */
3923         {0xa0, 0x03, ZC3XX_R181_WINXSTART},
3924         {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3925         {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3926         {0xa0, 0x03, ZC3XX_R184_WINYSTART},
3927         {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3928         {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3929         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3930
3931 /* Auto exposure and white balance */
3932         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3933         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3934         {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
3935         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3936         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3937         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
3938         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
3939         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
3940 /* sensor on */
3941         {0xaa, 0x07, 0x00b1},
3942         {0xaa, 0x05, 0x0003},
3943         {0xaa, 0x04, 0x0001},
3944         {0xaa, 0x03, 0x003b},
3945 /* Gains */
3946         {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3947         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3948         {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
3949         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
3950 /* Auto correction */
3951         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3952         {0xa1, 0x01, 0x0180},                           /* AutoCorrectEnable */
3953         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3954 /* Gains */
3955         {0xa0, 0x40, ZC3XX_R116_RGAIN},
3956         {0xa0, 0x40, ZC3XX_R117_GGAIN},
3957         {0xa0, 0x40, ZC3XX_R118_BGAIN},
3958         {}
3959 };
3960
3961 static const struct usb_action pas106b_InitialScale[] = {       /* 352x288 */
3962 /* JPEG control */
3963         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3964 /* Sream and Sensor specific */
3965         {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
3966 /* Picture size */
3967         {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
3968         {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
3969         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3970         {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
3971 /* System */
3972         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3973 /* Sream and Sensor specific */
3974         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3975         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3976 /* Sensor Interface */
3977         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3978 /* Window inside sensor array */
3979         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3980         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3981         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3982         {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3983         {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
3984 /* Init the sensor */
3985         {0xaa, 0x02, 0x0004},
3986         {0xaa, 0x08, 0x0000},
3987         {0xaa, 0x09, 0x0005},
3988         {0xaa, 0x0a, 0x0002},
3989         {0xaa, 0x0b, 0x0002},
3990         {0xaa, 0x0c, 0x0005},
3991         {0xaa, 0x0d, 0x0000},
3992         {0xaa, 0x0e, 0x0002},
3993         {0xaa, 0x14, 0x0081},
3994
3995 /* Other registors */
3996         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
3997 /* Frame retreiving */
3998         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
3999 /* Gains */
4000         {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
4001 /* Unknown */
4002         {0xa0, 0x00, 0x01ad},
4003 /* Sharpness */
4004         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4005         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4006 /* Other registors */
4007         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4008 /* Auto exposure and white balance */
4009         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4010         {0xa0, 0x80, ZC3XX_R18D_YTARGET},
4011 /*Dead pixels */
4012         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4013 /* EEPROM */
4014         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4015 /* JPEG control */
4016         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4017         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4018         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4019 /* Other registers */
4020         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4021 /* Auto exposure and white balance */
4022         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4023 /*Dead pixels */
4024         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4025 /* EEPROM */
4026         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4027 /* JPEG control */
4028         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4029         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4030         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4031
4032         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
4033         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
4034         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4035         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
4036         {0xa0, 0x58, ZC3XX_R10E_RGB11},
4037         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
4038         {0xa0, 0xf4, ZC3XX_R110_RGB20},
4039         {0xa0, 0xf4, ZC3XX_R111_RGB21},
4040         {0xa0, 0x58, ZC3XX_R112_RGB22},
4041 /* Auto correction */
4042         {0xa0, 0x03, ZC3XX_R181_WINXSTART},
4043         {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
4044         {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
4045         {0xa0, 0x03, ZC3XX_R184_WINYSTART},
4046         {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
4047         {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
4048         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4049
4050 /* Auto exposure and white balance */
4051         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4052         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4053         {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
4054
4055         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4056         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4057         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
4058
4059         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4060         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4061 /* sensor on */
4062         {0xaa, 0x07, 0x00b1},
4063         {0xaa, 0x05, 0x0003},
4064         {0xaa, 0x04, 0x0001},
4065         {0xaa, 0x03, 0x003b},
4066 /* Gains */
4067         {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
4068         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
4069         {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
4070         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4071 /* Auto correction */
4072         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4073         {0xa1, 0x01, 0x0180},                           /* AutoCorrectEnable */
4074         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4075 /* Gains */
4076         {0xa0, 0x40, ZC3XX_R116_RGAIN},
4077         {0xa0, 0x40, ZC3XX_R117_GGAIN},
4078         {0xa0, 0x40, ZC3XX_R118_BGAIN},
4079
4080         {0xa0, 0x00, 0x0007},                   /* AutoCorrectEnable */
4081         {0xa0, 0xff, ZC3XX_R018_FRAMELOST},     /* Frame adjust */
4082         {}
4083 };
4084 static const struct usb_action pas106b_50HZ[] = {
4085         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4086         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4087         {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
4088         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4089         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4090         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
4091         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4092         {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,30,cc */
4093         {0xaa, 0x03, 0x0021},                   /* 00,03,21,aa */
4094         {0xaa, 0x04, 0x000c},                   /* 00,04,0c,aa */
4095         {0xaa, 0x05, 0x0002},                   /* 00,05,02,aa */
4096         {0xaa, 0x07, 0x001c},                   /* 00,07,1c,aa */
4097         {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
4098         {}
4099 };
4100 static const struct usb_action pas106b_60HZ[] = {
4101         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4102         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4103         {0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
4104         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4105         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4106         {0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
4107         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4108         {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,30,cc */
4109         {0xaa, 0x03, 0x001c},                   /* 00,03,1c,aa */
4110         {0xaa, 0x04, 0x0004},                   /* 00,04,04,aa */
4111         {0xaa, 0x05, 0x0001},                   /* 00,05,01,aa */
4112         {0xaa, 0x07, 0x00c4},                   /* 00,07,c4,aa */
4113         {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
4114         {}
4115 };
4116 static const struct usb_action pas106b_NoFliker[] = {
4117         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4118         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4119         {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
4120         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4121         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4122         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
4123         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4124         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
4125         {0xaa, 0x03, 0x0013},                   /* 00,03,13,aa */
4126         {0xaa, 0x04, 0x0000},                   /* 00,04,00,aa */
4127         {0xaa, 0x05, 0x0001},                   /* 00,05,01,aa */
4128         {0xaa, 0x07, 0x0030},                   /* 00,07,30,aa */
4129         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
4130         {}
4131 };
4132
4133 /* from usbvm31b.inf */
4134 static const struct usb_action pas202b_Initial[] = {    /* 640x480 */
4135         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc */
4136         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},          /* 00,08,00,cc */
4137         {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0e,cc */
4138         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},           /* 00,02,00,cc */
4139         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
4140         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc */
4141         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
4142         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc */
4143         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
4144         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
4145         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
4146         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},       /* 00,8d,08,cc */
4147         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc */
4148         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,03,cc */
4149         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc */
4150         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,03,cc */
4151         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},         /* 00,9b,01,cc */
4152         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,e6,cc */
4153         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},          /* 00,9d,02,cc */
4154         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,86,cc */
4155         {0xaa, 0x02, 0x0002},                   /* 00,02,04,aa --> 02 */
4156         {0xaa, 0x07, 0x0006},                           /* 00,07,06,aa */
4157         {0xaa, 0x08, 0x0002},                           /* 00,08,02,aa */
4158         {0xaa, 0x09, 0x0006},                           /* 00,09,06,aa */
4159         {0xaa, 0x0a, 0x0001},                           /* 00,0a,01,aa */
4160         {0xaa, 0x0b, 0x0001},                           /* 00,0b,01,aa */
4161         {0xaa, 0x0c, 0x0008},                           /* 00,0c,08,aa */
4162         {0xaa, 0x0d, 0x0000},                           /* 00,0d,00,aa */
4163         {0xaa, 0x10, 0x0000},                           /* 00,10,00,aa */
4164         {0xaa, 0x12, 0x0005},                           /* 00,12,05,aa */
4165         {0xaa, 0x13, 0x0063},                           /* 00,13,63,aa */
4166         {0xaa, 0x15, 0x0070},                           /* 00,15,70,aa */
4167         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc */
4168         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc */
4169         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},             /* 01,89,06,cc */
4170         {0xa0, 0x00, 0x01ad},                           /* 01,ad,00,cc */
4171         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc */
4172         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc */
4173         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
4174         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc */
4175         {0xa0, 0x70, ZC3XX_R18D_YTARGET},               /* 01,8d,70,cc */
4176         {}
4177 };
4178 static const struct usb_action pas202b_InitialScale[] = {       /* 320x240 */
4179         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc */
4180         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},          /* 00,08,00,cc */
4181         {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0e,cc */
4182         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},           /* 00,02,10,cc */
4183         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
4184         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc */
4185         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
4186         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,d0,cc */
4187         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
4188         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
4189         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
4190         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},       /* 00,8d,08,cc */
4191         {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,08,cc */
4192         {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,02,cc */
4193         {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,08,cc */
4194         {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,02,cc */
4195         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},         /* 00,9b,01,cc */
4196         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,d8,cc */
4197         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},          /* 00,9d,02,cc */
4198         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,88,cc */
4199         {0xaa, 0x02, 0x0002},                           /* 00,02,02,aa */
4200         {0xaa, 0x07, 0x0006},                           /* 00,07,06,aa */
4201         {0xaa, 0x08, 0x0002},                           /* 00,08,02,aa */
4202         {0xaa, 0x09, 0x0006},                           /* 00,09,06,aa */
4203         {0xaa, 0x0a, 0x0001},                           /* 00,0a,01,aa */
4204         {0xaa, 0x0b, 0x0001},                           /* 00,0b,01,aa */
4205         {0xaa, 0x0c, 0x0008},                           /* 00,0c,08,aa */
4206         {0xaa, 0x0d, 0x0000},                           /* 00,0d,00,aa */
4207         {0xaa, 0x10, 0x0000},                           /* 00,10,00,aa */
4208         {0xaa, 0x12, 0x0005},                           /* 00,12,05,aa */
4209         {0xaa, 0x13, 0x0063},                           /* 00,13,63,aa */
4210         {0xaa, 0x15, 0x0070},                           /* 00,15,70,aa */
4211         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,37,cc */
4212         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc */
4213         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},             /* 01,89,06,cc */
4214         {0xa0, 0x00, 0x01ad},                           /* 01,ad,00,cc */
4215         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc */
4216         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc */
4217         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
4218         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc */
4219         {0xa0, 0x70, ZC3XX_R18D_YTARGET},               /* 01,8d,70,cc */
4220         {}
4221 };
4222 static const struct usb_action pas202b_50HZ[] = {
4223         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4224         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4225         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4226         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4227         {0xaa, 0x21, 0x0068},                           /* 00,21,68,aa */
4228         {0xaa, 0x03, 0x0044},                           /* 00,03,44,aa */
4229         {0xaa, 0x04, 0x0009},                           /* 00,04,09,aa */
4230         {0xaa, 0x05, 0x0028},                           /* 00,05,28,aa */
4231         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4232         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4233         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,14,cc */
4234         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
4235         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4236         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,07,cc */
4237         {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,d2,cc */
4238         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4239         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4240         {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,4d,cc */
4241         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4242         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4243         {0xa0, 0x44, ZC3XX_R01D_HSYNC_0},               /* 00,1d,44,cc */
4244         {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},               /* 00,1e,6f,cc */
4245         {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},               /* 00,1f,ad,cc */
4246         {0xa0, 0xeb, ZC3XX_R020_HSYNC_3},               /* 00,20,eb,cc */
4247         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4248         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4249         {}
4250 };
4251 static const struct usb_action pas202b_50HZScale[] = {
4252         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4253         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4254         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4255         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4256         {0xaa, 0x21, 0x006c},                           /* 00,21,6c,aa */
4257         {0xaa, 0x03, 0x0041},                           /* 00,03,41,aa */
4258         {0xaa, 0x04, 0x0009},                           /* 00,04,09,aa */
4259         {0xaa, 0x05, 0x002c},                           /* 00,05,2c,aa */
4260         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4261         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4262         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,14,cc */
4263         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
4264         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4265         {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0f,cc */
4266         {0xa0, 0xbe, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,be,cc */
4267         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4268         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4269         {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,9b,cc */
4270         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4271         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4272         {0xa0, 0x41, ZC3XX_R01D_HSYNC_0},               /* 00,1d,41,cc */
4273         {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},               /* 00,1e,6f,cc */
4274         {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},               /* 00,1f,ad,cc */
4275         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc */
4276         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4277         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4278         {}
4279 };
4280 static const struct usb_action pas202b_60HZ[] = {
4281         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4282         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4283         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4284         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4285         {0xaa, 0x21, 0x0000},                           /* 00,21,00,aa */
4286         {0xaa, 0x03, 0x0045},                           /* 00,03,45,aa */
4287         {0xaa, 0x04, 0x0008},                           /* 00,04,08,aa */
4288         {0xaa, 0x05, 0x0000},                           /* 00,05,00,aa */
4289         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4290         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4291         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,14,cc */
4292         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
4293         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4294         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,07,cc */
4295         {0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,c0,cc */
4296         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4297         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4298         {0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,40,cc */
4299         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4300         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4301         {0xa0, 0x45, ZC3XX_R01D_HSYNC_0},               /* 00,1d,45,cc */
4302         {0xa0, 0x8e, ZC3XX_R01E_HSYNC_1},               /* 00,1e,8e,cc */
4303         {0xa0, 0xc1, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c1,cc */
4304         {0xa0, 0xf5, ZC3XX_R020_HSYNC_3},               /* 00,20,f5,cc */
4305         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4306         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4307         {}
4308 };
4309 static const struct usb_action pas202b_60HZScale[] = {
4310         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4311         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4312         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4313         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4314         {0xaa, 0x21, 0x0004},                           /* 00,21,04,aa */
4315         {0xaa, 0x03, 0x0042},                           /* 00,03,42,aa */
4316         {0xaa, 0x04, 0x0008},                           /* 00,04,08,aa */
4317         {0xaa, 0x05, 0x0004},                           /* 00,05,04,aa */
4318         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4319         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4320         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,14,cc */
4321         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
4322         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4323         {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0f,cc */
4324         {0xa0, 0x9f, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,9f,cc */
4325         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4326         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4327         {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,81,cc */
4328         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4329         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4330         {0xa0, 0x42, ZC3XX_R01D_HSYNC_0},               /* 00,1d,42,cc */
4331         {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},               /* 00,1e,6f,cc */
4332         {0xa0, 0xaf, ZC3XX_R01F_HSYNC_2},               /* 00,1f,af,cc */
4333         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc */
4334         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4335         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4336         {}
4337 };
4338 static const struct usb_action pas202b_NoFliker[] = {
4339         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4340         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4341         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4342         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4343         {0xaa, 0x21, 0x0020},                           /* 00,21,20,aa */
4344         {0xaa, 0x03, 0x0040},                           /* 00,03,40,aa */
4345         {0xaa, 0x04, 0x0008},                           /* 00,04,08,aa */
4346         {0xaa, 0x05, 0x0020},                           /* 00,05,20,aa */
4347         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4348         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4349         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4350         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,07,cc */
4351         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,f0,cc */
4352         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4353         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4354         {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,02,cc */
4355         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4356         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4357         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,00,cc */
4358         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,00,cc */
4359         {0xa0, 0x40, ZC3XX_R01D_HSYNC_0},               /* 00,1d,40,cc */
4360         {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},               /* 00,1e,60,cc */
4361         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},               /* 00,1f,90,cc */
4362         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc */
4363         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4364         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4365         {}
4366 };
4367 static const struct usb_action pas202b_NoFlikerScale[] = {
4368         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4369         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4370         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4371         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4372         {0xaa, 0x21, 0x0010},                           /* 00,21,10,aa */
4373         {0xaa, 0x03, 0x0040},                           /* 00,03,40,aa */
4374         {0xaa, 0x04, 0x0008},                           /* 00,04,08,aa */
4375         {0xaa, 0x05, 0x0010},                           /* 00,05,10,aa */
4376         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4377         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4378         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4379         {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0f,cc */
4380         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,f0,cc */
4381         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4382         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4383         {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,02,cc */
4384         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4385         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4386         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,00,cc */
4387         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,00,cc */
4388         {0xa0, 0x40, ZC3XX_R01D_HSYNC_0},               /* 00,1d,40,cc */
4389         {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},               /* 00,1e,60,cc */
4390         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},               /* 00,1f,90,cc */
4391         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc */
4392         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4393         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4394         {}
4395 };
4396
4397 static const struct usb_action pb03303x_Initial[] = {
4398         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4399         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4400         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4401         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4402         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4403         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4404         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4405         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4406         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR}, /* 8b -> dc */
4407         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4408         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4409         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4410         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4411         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4412         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4413         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4414         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4415         {0xaa, 0x01, 0x0001},
4416         {0xaa, 0x06, 0x0000},
4417         {0xaa, 0x08, 0x0483},
4418         {0xaa, 0x01, 0x0004},
4419         {0xaa, 0x08, 0x0006},
4420         {0xaa, 0x02, 0x0011},
4421         {0xaa, 0x03, 0x01e7},
4422         {0xaa, 0x04, 0x0287},
4423         {0xaa, 0x07, 0x3002},
4424         {0xaa, 0x20, 0x1100},
4425         {0xaa, 0x35, 0x0050},
4426         {0xaa, 0x30, 0x0005},
4427         {0xaa, 0x31, 0x0000},
4428         {0xaa, 0x58, 0x0078},
4429         {0xaa, 0x62, 0x0411},
4430         {0xaa, 0x2b, 0x0028},
4431         {0xaa, 0x2c, 0x0030},
4432         {0xaa, 0x2d, 0x0030},
4433         {0xaa, 0x2e, 0x0028},
4434         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4435         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4436         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4437         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4438         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4439         {0xa0, 0x00, 0x01ad},
4440         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4441         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4442         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4443         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4444         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4445         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
4446         {0xa0, 0x61, ZC3XX_R116_RGAIN},
4447         {0xa0, 0x65, ZC3XX_R118_BGAIN},
4448
4449         {0xa1, 0x01, 0x0002},
4450         {0xa0, 0x09, 0x01ad},
4451         {0xa0, 0x15, 0x01ae},
4452         {0xa0, 0x0d, 0x003a},
4453         {0xa0, 0x02, 0x003b},
4454         {0xa0, 0x00, 0x0038},
4455         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4456         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4457         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4458         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4459         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4460         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4461         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4462         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4463         {0xa0, 0x50, ZC3XX_R112_RGB22},
4464
4465         {0xa1, 0x01, 0x0008},
4466         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4467         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4468         {0xa1, 0x01, 0x01c8},
4469         {0xa1, 0x01, 0x01c9},
4470         {0xa1, 0x01, 0x01ca},
4471         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4472         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
4473         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
4474         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
4475         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
4476         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
4477         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
4478         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
4479         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
4480         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
4481         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
4482         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
4483         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
4484         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
4485         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
4486         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
4487         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4488         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
4489         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4490         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4491         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4492         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4493         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4494         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4495         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4496         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4497         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4498         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4499         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4500         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4501         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4502         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
4503         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
4504         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4505         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4506         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4507         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4508         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4509         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4510         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4511         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4512         {0xa0, 0x50, ZC3XX_R112_RGB22},
4513
4514         {0xa1, 0x01, 0x0180},
4515         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4516         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4517         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4518         {0xaa, 0x05, 0x0009},
4519         {0xaa, 0x09, 0x0134},
4520         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4521         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4522         {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
4523         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4524         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4525         {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
4526         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4527         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4528         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4529         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4530         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4531         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4532         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4533         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4534         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4535         {0xa0, 0x09, 0x01ad},
4536         {0xa0, 0x15, 0x01ae},
4537         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4538         {0xa1, 0x01, 0x0180},
4539         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4540         {}
4541 };
4542
4543 static const struct usb_action pb03303x_InitialScale[] = {
4544         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4545         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4546         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4547         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4548         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4549         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4550         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4551         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4552         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR}, /* 8b -> dc */
4553         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4554         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4555         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4556         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4557         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4558         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4559         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4560         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4561         {0xaa, 0x01, 0x0001},
4562         {0xaa, 0x06, 0x0000},
4563         {0xaa, 0x08, 0x0483},
4564         {0xaa, 0x01, 0x0004},
4565         {0xaa, 0x08, 0x0006},
4566         {0xaa, 0x02, 0x0011},
4567         {0xaa, 0x03, 0x01e7},
4568         {0xaa, 0x04, 0x0287},
4569         {0xaa, 0x07, 0x3002},
4570         {0xaa, 0x20, 0x1100},
4571         {0xaa, 0x35, 0x0050},
4572         {0xaa, 0x30, 0x0005},
4573         {0xaa, 0x31, 0x0000},
4574         {0xaa, 0x58, 0x0078},
4575         {0xaa, 0x62, 0x0411},
4576         {0xaa, 0x2b, 0x0028},
4577         {0xaa, 0x2c, 0x0030},
4578         {0xaa, 0x2d, 0x0030},
4579         {0xaa, 0x2e, 0x0028},
4580         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4581         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4582         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4583         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4584         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4585         {0xa0, 0x00, 0x01ad},
4586         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4587         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4588         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4589         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4590         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4591         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
4592         {0xa0, 0x61, ZC3XX_R116_RGAIN},
4593         {0xa0, 0x65, ZC3XX_R118_BGAIN},
4594
4595         {0xa1, 0x01, 0x0002},
4596
4597         {0xa0, 0x09, 0x01ad},
4598         {0xa0, 0x15, 0x01ae},
4599
4600         {0xa0, 0x0d, 0x003a},
4601         {0xa0, 0x02, 0x003b},
4602         {0xa0, 0x00, 0x0038},
4603         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4604         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4605         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4606         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4607         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4608         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4609         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4610         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4611         {0xa0, 0x50, ZC3XX_R112_RGB22},
4612
4613         {0xa1, 0x01, 0x0008},
4614         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4615         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4616         {0xa1, 0x01, 0x01c8},
4617         {0xa1, 0x01, 0x01c9},
4618         {0xa1, 0x01, 0x01ca},
4619         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4620
4621         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
4622         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
4623         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
4624         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
4625         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
4626         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
4627         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
4628         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
4629         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
4630         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
4631         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
4632         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
4633         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
4634         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
4635         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
4636         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4637         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
4638         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4639         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4640         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4641         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4642         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4643         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4644         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4645         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4646         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4647         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4648         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4649         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4650         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4651         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
4652         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
4653         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4654         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4655         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4656         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4657         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4658         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4659         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4660         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4661         {0xa0, 0x50, ZC3XX_R112_RGB22},
4662
4663         {0xa1, 0x01, 0x0180},
4664         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4665         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4666         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4667         {0xaa, 0x05, 0x0009},
4668         {0xaa, 0x09, 0x0134},
4669         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4670         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4671         {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
4672         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4673         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4674         {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
4675         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4676         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4677         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4678         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4679         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4680         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4681         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4682         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4683         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4684         {0xa0, 0x09, 0x01ad},
4685         {0xa0, 0x15, 0x01ae},
4686         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4687         {0xa1, 0x01, 0x0180},
4688         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4689         {}
4690 };
4691 static const struct usb_action pb0330xx_Initial[] = {
4692         {0xa1, 0x01, 0x0008},
4693         {0xa1, 0x01, 0x0008},
4694         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4695         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
4696         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4697         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4698         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4699         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4700         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4701         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4702         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4703         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4704         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4705         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4706         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4707         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4708         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4709         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4710         {0xaa, 0x01, 0x0006},
4711         {0xaa, 0x02, 0x0011},
4712         {0xaa, 0x03, 0x01e7},
4713         {0xaa, 0x04, 0x0287},
4714         {0xaa, 0x06, 0x0003},
4715         {0xaa, 0x07, 0x3002},
4716         {0xaa, 0x20, 0x1100},
4717         {0xaa, 0x2f, 0xf7b0},
4718         {0xaa, 0x30, 0x0005},
4719         {0xaa, 0x31, 0x0000},
4720         {0xaa, 0x34, 0x0100},
4721         {0xaa, 0x35, 0x0060},
4722         {0xaa, 0x3d, 0x068f},
4723         {0xaa, 0x40, 0x01e0},
4724         {0xaa, 0x58, 0x0078},
4725         {0xaa, 0x62, 0x0411},
4726         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4727         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4728         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4729         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4730         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4731         {0xa0, 0x00, 0x01ad},
4732         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4733         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4734         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4735         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4736         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4737         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4738         {0xa1, 0x01, 0x0002},
4739         {0xa0, 0x09, 0x01ad},
4740         {0xa0, 0x15, 0x01ae},
4741         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
4742         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
4743         {0xa1, 0x01, 0x0091},
4744         {0xa1, 0x01, 0x0095},
4745         {0xa1, 0x01, 0x0096},
4746         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4747         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4748         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4749         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4750         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4751         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4752         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4753         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4754         {0xa0, 0x50, ZC3XX_R112_RGB22},
4755         {0xa1, 0x01, 0x0008},
4756         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4757         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4758         {0xa1, 0x01, 0x01c8},
4759         {0xa1, 0x01, 0x01c9},
4760         {0xa1, 0x01, 0x01ca},
4761         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4762
4763         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4764         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4765         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4766         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4767         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4768         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4769         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4770         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4771         {0xa0, 0x50, ZC3XX_R112_RGB22},
4772         {0xa1, 0x01, 0x0180},
4773         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4774         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4775         {0xaa, 0x05, 0x0066},
4776         {0xaa, 0x09, 0x02b2},
4777         {0xaa, 0x10, 0x0002},
4778
4779         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4780         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4781         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4782         {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4783         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4784         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4785         {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4786         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4787         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4788         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4789         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4790         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4791         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4792         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4793         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4794         {0xa0, 0x09, 0x01ad},
4795         {0xa0, 0x15, 0x01ae},
4796         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4797         {0xa1, 0x01, 0x0180},
4798         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4799         {0xa1, 0x01, 0x0008},
4800         {0xa1, 0x01, 0x0007},
4801 /*      {0xa0, 0x30, 0x0007}, */
4802 /*      {0xa0, 0x00, 0x0007}, */
4803         {}
4804 };
4805
4806 static const struct usb_action pb0330xx_InitialScale[] = {
4807         {0xa1, 0x01, 0x0008},
4808         {0xa1, 0x01, 0x0008},
4809         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4810         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
4811         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4812         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* 10 */
4813         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4814         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4815         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4816         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4817         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4818         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4819         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4820         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4821         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4822         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4823         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4824         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4825         {0xaa, 0x01, 0x0006},
4826         {0xaa, 0x02, 0x0011},
4827         {0xaa, 0x03, 0x01e7},
4828         {0xaa, 0x04, 0x0287},
4829         {0xaa, 0x06, 0x0003},
4830         {0xaa, 0x07, 0x3002},
4831         {0xaa, 0x20, 0x1100},
4832         {0xaa, 0x2f, 0xf7b0},
4833         {0xaa, 0x30, 0x0005},
4834         {0xaa, 0x31, 0x0000},
4835         {0xaa, 0x34, 0x0100},
4836         {0xaa, 0x35, 0x0060},
4837         {0xaa, 0x3d, 0x068f},
4838         {0xaa, 0x40, 0x01e0},
4839         {0xaa, 0x58, 0x0078},
4840         {0xaa, 0x62, 0x0411},
4841         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4842         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4843         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4844         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4845         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4846         {0xa0, 0x00, 0x01ad},
4847         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4848         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4849         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4850         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4851         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4852         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4853         {0xa1, 0x01, 0x0002},
4854         {0xa0, 0x09, 0x01ad},
4855         {0xa0, 0x15, 0x01ae},
4856         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
4857         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
4858         {0xa1, 0x01, 0x0091},
4859         {0xa1, 0x01, 0x0095},
4860         {0xa1, 0x01, 0x0096},
4861         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4862         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4863         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4864         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4865         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4866         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4867         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4868         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4869         {0xa0, 0x50, ZC3XX_R112_RGB22},
4870         {0xa1, 0x01, 0x0008},
4871         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4872         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4873         {0xa1, 0x01, 0x01c8},
4874         {0xa1, 0x01, 0x01c9},
4875         {0xa1, 0x01, 0x01ca},
4876         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4877
4878         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4879         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4880         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4881         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4882         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4883         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4884         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4885         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4886         {0xa0, 0x50, ZC3XX_R112_RGB22},
4887         {0xa1, 0x01, 0x0180},
4888         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4889         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4890         {0xaa, 0x05, 0x0066},
4891         {0xaa, 0x09, 0x02b2},
4892         {0xaa, 0x10, 0x0002},
4893         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4894         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4895         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4896         {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4897         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4898         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4899         {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4900         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4901         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4902         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4903         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4904         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4905         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4906         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4907         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4908         {0xa0, 0x09, 0x01ad},
4909         {0xa0, 0x15, 0x01ae},
4910         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4911         {0xa1, 0x01, 0x0180},
4912         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4913         {0xa1, 0x01, 0x0008},
4914         {0xa1, 0x01, 0x0007},
4915 /*      {0xa0, 0x30, 0x0007}, */
4916 /*      {0xa0, 0x00, 0x0007}, */
4917         {}
4918 };
4919 static const struct usb_action pb0330_50HZ[] = {
4920         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4921         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4922         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,ee,cc */
4923         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4924         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4925         {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
4926         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4927         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4928         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4929         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4930         {0xa0, 0x68, ZC3XX_R01D_HSYNC_0}, /* 00,1d,68,cc */
4931         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
4932         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
4933         {}
4934 };
4935 static const struct usb_action pb0330_50HZScale[] = {
4936         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4937         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4938         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4939         {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
4940         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4941         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4942         {0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
4943         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4944         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4945         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4946         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4947         {0xa0, 0xe5, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e5,cc */
4948         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f0,cc */
4949         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
4950         {}
4951 };
4952 static const struct usb_action pb0330_60HZ[] = {
4953         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4954         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4955         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4956         {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,dd,cc */
4957         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4958         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4959         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
4960         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4961         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4962         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4963         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4964         {0xa0, 0x43, ZC3XX_R01D_HSYNC_0}, /* 00,1d,43,cc */
4965         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
4966         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4967         {}
4968 };
4969 static const struct usb_action pb0330_60HZScale[] = {
4970         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4971         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4972         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4973         {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
4974         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4975         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4976         {0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
4977         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4978         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4979         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4980         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4981         {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
4982         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
4983         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4984         {}
4985 };
4986 static const struct usb_action pb0330_NoFliker[] = {
4987         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4988         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4989         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4990         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
4991         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4992         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4993         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
4994         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4995         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4996         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
4997         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
4998         {0xa0, 0x09, ZC3XX_R01D_HSYNC_0}, /* 00,1d,09,cc */
4999         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
5000         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
5001         {}
5002 };
5003 static const struct usb_action pb0330_NoFlikerScale[] = {
5004         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5005         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5006         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
5007         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5008         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5009         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5010         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5011         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
5012         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
5013         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5014         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5015         {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},       /* 00,1d,09,cc */
5016         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},       /* 00,1e,40,cc */
5017         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},       /* 00,1f,90,cc */
5018         {}
5019 };
5020
5021 /* from oem9.inf - HKR,%PO2030%,Initial - 640x480 - (close to CS2102) */
5022 static const struct usb_action PO2030_mode0[] = {
5023         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5024         {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},   /* 00,02,04,cc */
5025         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5026         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5027         {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5028         {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5029         {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5030         {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5031         {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5032         {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5033         {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5034         {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5035         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5036         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5037         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5038         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5039         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5040         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5041         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5042         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5043         {0xaa, 0x8d, 0x0008},                   /* 00,8d,08,aa */
5044         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
5045         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
5046         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
5047         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
5048         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e6,cc */
5049         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,86,cc */
5050         {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
5051         {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5052         {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
5053         {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
5054         {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5055         {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5056         {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5057         {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5058         {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5059         {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5060         {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5061         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5062         {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5063         {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5064         {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5065         {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5066         {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5067         {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5068         {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5069         {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5070         {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5071         {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5072         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5073         {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5074         {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5075         {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5076         {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5077         {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5078         {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5079         {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5080         {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5081         {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5082         {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5083         {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5084         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5085         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5086         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5087         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
5088         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5089         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5090         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5091         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5092         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5093         {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5094         {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
5095         {}
5096 };
5097
5098 /* from oem9.inf - HKR,%PO2030%,InitialScale - 320x240 */
5099 static const struct usb_action PO2030_mode1[] = {
5100         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5101         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
5102         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5103         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5104         {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5105         {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5106         {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5107         {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5108         {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5109         {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5110         {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5111         {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5112         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5113         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5114         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5115         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5116         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5117         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5118         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5119         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5120         {0xaa, 0x8d, 0x0008},                   /* 00,8d,08,aa */
5121         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
5122         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
5123         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
5124         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
5125         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
5126         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
5127         {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
5128         {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5129         {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
5130         {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
5131         {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5132         {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5133         {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5134         {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5135         {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5136         {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5137         {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5138         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5139         {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5140         {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5141         {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5142         {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5143         {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5144         {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5145         {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5146         {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5147         {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5148         {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5149         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5150         {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5151         {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5152         {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5153         {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5154         {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5155         {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5156         {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5157         {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5158         {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5159         {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5160         {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5161         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5162         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5163         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5164         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
5165         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5166         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5167         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5168         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5169         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5170         {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5171         {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
5172         {}
5173 };
5174
5175 static const struct usb_action PO2030_50HZ[] = {
5176         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5177         {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
5178         {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
5179         {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
5180         {0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
5181         {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
5182         {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
5183         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5184         {0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
5185         {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
5186         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5187         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5188         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5189         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5190         {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5191         {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5192         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5193         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5194         {}
5195 };
5196
5197 static const struct usb_action PO2030_60HZ[] = {
5198         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5199         {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5200         {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
5201         {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
5202         {0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
5203         {0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
5204         {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
5205         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5206         {0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
5207         {0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
5208         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5209         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5210         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5211         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5212         {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,22,cc */
5213         {0xa0, 0x88, ZC3XX_R18D_YTARGET},               /* 01,8d,88,cc */
5214                                                         /* win: 01,8d,80 */
5215         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc */
5216         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
5217         {}
5218 };
5219
5220 static const struct usb_action PO2030_NoFliker[] = {
5221         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
5222         {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
5223         {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5224         {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
5225         {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
5226         {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
5227         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
5228         {}
5229 };
5230
5231 /* TEST */
5232 static const struct usb_action tas5130CK_Initial[] = {
5233         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5234         {0xa0, 0x01, 0x003b},
5235         {0xa0, 0x0e, 0x003a},
5236         {0xa0, 0x01, 0x0038},
5237         {0xa0, 0x0b, 0x0039},
5238         {0xa0, 0x00, 0x0038},
5239         {0xa0, 0x0b, 0x0039},
5240         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5241         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5242         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5243         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
5244         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5245         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5246         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5247         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5248         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5249         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5250         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5251         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5252         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5253         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5254         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5255         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5256         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5257         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5258         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5259         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5260         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5261         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5262         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5263         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5264         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5265         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5266         {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5267         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5268         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5269         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5270         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5271         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5272         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5273         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5274         {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5275         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5276         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5277         {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5278         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5279         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5280         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5281         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5282         {0xa0, 0xE7, ZC3XX_R093_I2CSETVALUE},
5283         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5284         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5285         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5286         {0xa0, 0x87, ZC3XX_R093_I2CSETVALUE},
5287         {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5288         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5289         {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5290         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5291         {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5292         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5293         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5294         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5295         {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5296         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5297         {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5298         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5299         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5300         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5301         {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5302         {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5303         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5304         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5305         {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5306         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5307         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5308         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5309         {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5310         {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5311         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5312         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5313         {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5314         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5315         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5316         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5317         {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5318         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5319         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5320         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5321         {0xa0, 0x2c, ZC3XX_R092_I2CADDRESSSELECT},
5322         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5323         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5324         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5325         {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5326         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5327         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5328         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5329         {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5330         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5331         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5332         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5333         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5334         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5335         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5336         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5337         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5338         {0xa0, 0x09, 0x01ad},
5339         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5340         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5341         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5342         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5343         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5344         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5345         {0xa0, 0x61, ZC3XX_R116_RGAIN},
5346         {0xa0, 0x65, ZC3XX_R118_BGAIN},
5347         {0xa0, 0x09, 0x01ad},
5348         {0xa0, 0x15, 0x01ae},
5349         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5350         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5351         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5352         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5353         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5354         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5355         {0xa0, 0xec, ZC3XX_R110_RGB20},
5356         {0xa0, 0x03, ZC3XX_R111_RGB21},
5357         {0xa0, 0x51, ZC3XX_R112_RGB22},
5358         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5359         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5360         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5361         {0xa0, 0x38, ZC3XX_R120_GAMMA00},       /* gamma > 5 */
5362         {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5363         {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5364         {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5365         {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5366         {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5367         {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5368         {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5369         {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5370         {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5371         {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5372         {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5373         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5374         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5375         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5376         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5377         {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5378         {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5379         {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5380         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5381         {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5382         {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5383         {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5384         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5385         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5386         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5387         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5388         {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5389         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5390         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5391         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5392         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5393         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5394         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5395         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5396         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5397         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5398         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5399         {0xa0, 0xec, ZC3XX_R110_RGB20},
5400         {0xa0, 0x03, ZC3XX_R111_RGB21},
5401         {0xa0, 0x51, ZC3XX_R112_RGB22},
5402         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5403         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5404         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5405         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5406         {0xa0, 0x09, ZC3XX_R093_I2CSETVALUE},
5407         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5408         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5409         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5410         {0xa0, 0x34, ZC3XX_R093_I2CSETVALUE},
5411         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5412         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5413         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5414         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5415         {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
5416         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5417         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5418         {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
5419         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5420         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5421         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5422         {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5423         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
5424         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5425         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
5426         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5427         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5428         {0xa0, 0x09, 0x01ad},
5429         {0xa0, 0x15, 0x01ae},
5430         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5431         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5432         {}
5433 };
5434
5435 static const struct usb_action tas5130CK_InitialScale[] = {
5436         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5437         {0xa0, 0x01, 0x003b},
5438         {0xa0, 0x0e, 0x003a},
5439         {0xa0, 0x01, 0x0038},
5440         {0xa0, 0x0b, 0x0039},
5441         {0xa0, 0x00, 0x0038},
5442         {0xa0, 0x0b, 0x0039},
5443         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5444         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5445         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5446         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
5447         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5448         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5449         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5450         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5451         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5452         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5453         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5454         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5455         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5456         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5457         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5458         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5459         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5460         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5461         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5462         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5463         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5464         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5465         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5466         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5467         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5468         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5469         {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5470         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5471         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5472         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5473         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5474         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5475         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5476         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5477         {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5478         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5479         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5480         {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5481         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5482         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5483         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5484         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5485         {0xa0, 0xe5, ZC3XX_R093_I2CSETVALUE},
5486         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5487         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5488         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5489         {0xa0, 0x85, ZC3XX_R093_I2CSETVALUE},
5490         {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5491         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5492         {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5493         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5494         {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5495         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5496         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5497         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5498         {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5499         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5500         {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5501         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5502         {0xa0, 0x50, ZC3XX_R094_I2CWRITEACK},
5503         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5504         {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5505         {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5506         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5507         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5508         {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5509         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5510         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5511         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5512         {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5513         {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5514         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5515         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5516         {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5517         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5518         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5519         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5520         {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5521         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5522         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5523         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5524         {0xa0, 0x2C, ZC3XX_R092_I2CADDRESSSELECT},
5525         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5526         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5527         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5528         {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5529         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5530         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5531         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5532         {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5533         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5534         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5535         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5536         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5537         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5538         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5539         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5540         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5541         {0xa0, 0x09, 0x01ad},
5542         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5543         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5544         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5545         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5546         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5547         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5548         {0xa0, 0x61, ZC3XX_R116_RGAIN},
5549         {0xa0, 0x65, ZC3XX_R118_BGAIN},
5550         {0xa0, 0x09, 0x01ad},
5551         {0xa0, 0x15, 0x01ae},
5552         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5553         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5554         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5555         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5556         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5557         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5558         {0xa0, 0xec, ZC3XX_R110_RGB20},
5559         {0xa0, 0x03, ZC3XX_R111_RGB21},
5560         {0xa0, 0x51, ZC3XX_R112_RGB22},
5561         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5562         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5563         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5564         {0xa0, 0x38, ZC3XX_R120_GAMMA00},       /* gamma > 5 */
5565         {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5566         {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5567         {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5568         {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5569         {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5570         {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5571         {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5572         {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5573         {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5574         {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5575         {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5576         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5577         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5578         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5579         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5580         {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5581         {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5582         {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5583         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5584         {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5585         {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5586         {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5587         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5588         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5589         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5590         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5591         {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5592         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5593         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5594         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5595         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5596         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5597         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5598         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5599         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5600         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5601         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5602         {0xa0, 0xec, ZC3XX_R110_RGB20},
5603         {0xa0, 0x03, ZC3XX_R111_RGB21},
5604         {0xa0, 0x51, ZC3XX_R112_RGB22},
5605         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5606         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5607         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5608         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5609         {0xa0, 0x62, ZC3XX_R093_I2CSETVALUE},
5610         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5611         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5612         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5613         {0xa0, 0xaa, ZC3XX_R093_I2CSETVALUE},
5614         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5615         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5616         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5617         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
5618         {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
5619         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5620         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5621         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5622         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5623         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5624         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5625         {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5626         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
5627         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
5628         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
5629         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5630         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
5631         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5632         {0xa0, 0x09, 0x01ad},
5633         {0xa0, 0x15, 0x01ae},
5634         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5635         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5636         {0xa0, 0x30, 0x0007},
5637         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
5638         {0xa0, 0x00, 0x0007},
5639         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5640         {}
5641 };
5642
5643 static const struct usb_action tas5130cxx_Initial[] = {
5644         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5645         {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
5646         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5647         {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5648         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5649         {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5650         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5651         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5652         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5653         {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5654         {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5655
5656         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5657         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5658         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5659         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5660
5661         {0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
5662         {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5663         {0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
5664         {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5665         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
5666         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5667         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
5668         {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5669         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5670         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5671         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5672         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
5673         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5674         {0xa0, 0x00, 0x01ad},
5675         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5676         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5677         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5678         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5679         {0xa1, 0x01, 0x0002},
5680         {0xa1, 0x01, 0x0008},
5681         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
5682         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5683         {0xa1, 0x01, 0x01c8},
5684         {0xa1, 0x01, 0x01c9},
5685         {0xa1, 0x01, 0x01ca},
5686         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5687
5688         {0xa0, 0x68, ZC3XX_R10A_RGB00}, /* matrix */
5689         {0xa0, 0xec, ZC3XX_R10B_RGB01},
5690         {0xa0, 0xec, ZC3XX_R10C_RGB02},
5691         {0xa0, 0xec, ZC3XX_R10D_RGB10},
5692         {0xa0, 0x68, ZC3XX_R10E_RGB11},
5693         {0xa0, 0xec, ZC3XX_R10F_RGB12},
5694         {0xa0, 0xec, ZC3XX_R110_RGB20},
5695         {0xa0, 0xec, ZC3XX_R111_RGB21},
5696         {0xa0, 0x68, ZC3XX_R112_RGB22},
5697
5698         {0xa1, 0x01, 0x018d},
5699         {0xa0, 0x90, ZC3XX_R18D_YTARGET},       /* 90 */
5700         {0xa1, 0x01, 0x0180},
5701         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5702         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5703
5704         {0xaa, 0xa3, 0x0001},
5705         {0xaa, 0xa4, 0x0077},
5706         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
5707         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW},
5708
5709         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 00 */
5710         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},      /* 03 */
5711         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW},      /* e8 */
5712         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 0 */
5713         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 0 */
5714         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW},        /* 7d */
5715
5716         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5717         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5718         {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 08 */
5719         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 24 */
5720         {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0},
5721         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5722         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
5723         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5724         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
5725         {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
5726         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},    /* 50 */
5727         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5728         {0xa1, 0x01, 0x0180},
5729         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5730         {}
5731 };
5732 static const struct usb_action tas5130cxx_InitialScale[] = {
5733 /*??    {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, */
5734         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5735         {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
5736
5737         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5738         {0xa1, 0x01, 0x0008},
5739
5740         {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5741         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5742         {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5743         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5744         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5745         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5746         {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5747         {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5748         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5749         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5750         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5751         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5752         {0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
5753         {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5754         {0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
5755         {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5756         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
5757         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5758         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
5759         {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5760         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5761         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5762         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5763         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
5764         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5765         {0xa0, 0x00, 0x01ad},
5766         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5767         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5768         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5769         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5770         {0xa1, 0x01, 0x0002},
5771         {0xa1, 0x01, 0x0008},
5772
5773         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5774         {0xa1, 0x01, 0x0008},   /* clock ? */
5775         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5776         {0xa1, 0x01, 0x01c8},
5777         {0xa1, 0x01, 0x01c9},
5778         {0xa1, 0x01, 0x01ca},
5779         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5780
5781         {0xa0, 0x68, ZC3XX_R10A_RGB00}, /* matrix */
5782         {0xa0, 0xec, ZC3XX_R10B_RGB01},
5783         {0xa0, 0xec, ZC3XX_R10C_RGB02},
5784         {0xa0, 0xec, ZC3XX_R10D_RGB10},
5785         {0xa0, 0x68, ZC3XX_R10E_RGB11},
5786         {0xa0, 0xec, ZC3XX_R10F_RGB12},
5787         {0xa0, 0xec, ZC3XX_R110_RGB20},
5788         {0xa0, 0xec, ZC3XX_R111_RGB21},
5789         {0xa0, 0x68, ZC3XX_R112_RGB22},
5790
5791         {0xa1, 0x01, 0x018d},
5792         {0xa0, 0x90, ZC3XX_R18D_YTARGET},
5793         {0xa1, 0x01, 0x0180},
5794         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5795         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5796         {0xaa, 0xa3, 0x0001},
5797         {0xaa, 0xa4, 0x0063},
5798         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
5799         {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW},
5800         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5801         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
5802         {0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW},
5803         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5804         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5805         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5806         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5807         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5808         {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5809         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
5810         {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0},
5811         {0xa0, 0xda, ZC3XX_R01E_HSYNC_1},
5812         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
5813         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5814         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
5815         {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
5816         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5817         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5818         {0xa1, 0x01, 0x0180},
5819         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5820         {}
5821 };
5822 static const struct usb_action tas5130cxx_50HZ[] = {
5823         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5824         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5825         {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
5826         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5827         {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
5828         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5829         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
5830         {0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,38,cc */
5831         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5832         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5833         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
5834         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5835         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5836         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5837         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5838         {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
5839         {0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
5840         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
5841         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5842         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5843         {}
5844 };
5845 static const struct usb_action tas5130cxx_50HZScale[] = {
5846         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5847         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5848         {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5849         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5850         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5851         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5852         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5853         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
5854         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5855         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5856         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5857         {0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
5858         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5859         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5860         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5861         {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
5862         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
5863         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
5864         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5865         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5866         {}
5867 };
5868 static const struct usb_action tas5130cxx_60HZ[] = {
5869         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5870         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5871         {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
5872         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5873         {0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
5874         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5875         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
5876         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5877         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5878         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5879         {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
5880         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5881         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5882         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5883         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5884         {0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
5885         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5886         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5887         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5888         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5889         {}
5890 };
5891 static const struct usb_action tas5130cxx_60HZScale[] = {
5892         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5893         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5894         {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5895         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5896         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5897         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5898         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5899         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
5900         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5901         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5902         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5903         {0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
5904         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5905         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5906         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5907         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
5908         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5909         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5910         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5911         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5912         {}
5913 };
5914 static const struct usb_action tas5130cxx_NoFliker[] = {
5915         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5916         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5917         {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
5918         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5919         {0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
5920         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5921         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
5922         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5923         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5924         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5925         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5926         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5927         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5928         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5929         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5930         {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5931         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5932         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5933         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5934         {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5935         {}
5936 };
5937
5938 static const struct usb_action tas5130cxx_NoFlikerScale[] = {
5939         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5940         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5941         {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
5942         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5943         {0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
5944         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5945         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5946         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5947         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5948         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5949         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5950         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5951         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5952         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5953         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5954         {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5955         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5956         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5957         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5958         {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5959         {}
5960 };
5961
5962 static const struct usb_action tas5130c_vf0250_Initial[] = {
5963         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc, */
5964         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},          /* 00,08,02,cc, */
5965         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc, */
5966         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},           /* 00,02,00,cc,
5967                                                          * 0<->10 */
5968         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc, */
5969         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc, */
5970         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc, */
5971         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc, */
5972         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
5973         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc, */
5974         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc, */
5975         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc, */
5976         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc, */
5977         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,00,cc, */
5978         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc, */
5979         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,00,cc, */
5980         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,e6,cc,
5981                                                          * 6<->8 */
5982         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,86,cc,
5983                                                          * 6<->8 */
5984         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},            /* 00,87,10,cc, */
5985         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
5986         {0xaa, 0x1b, 0x0024},           /* 00,1b,24,aa, */
5987         {0xdd, 0x00, 0x0080},           /* 00,00,80,dd, */
5988         {0xaa, 0x1b, 0x0000},           /* 00,1b,00,aa, */
5989         {0xaa, 0x13, 0x0002},           /* 00,13,02,aa, */
5990         {0xaa, 0x15, 0x0004},           /* 00,15,04,aa */
5991 /*??    {0xaa, 0x01, 0x0000}, */
5992         {0xaa, 0x01, 0x0000},
5993         {0xaa, 0x1a, 0x0000},           /* 00,1a,00,aa, */
5994         {0xaa, 0x1c, 0x0017},           /* 00,1c,17,aa, */
5995         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},           /* 00,86,82,cc, */
5996         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},            /* 00,87,83,cc, */
5997         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},            /* 00,88,84,cc, */
5998         {0xaa, 0x05, 0x0010},           /* 00,05,10,aa, */
5999         {0xaa, 0x0a, 0x0000},           /* 00,0a,00,aa, */
6000         {0xaa, 0x0b, 0x00a0},           /* 00,0b,a0,aa, */
6001         {0xaa, 0x0c, 0x0000},           /* 00,0c,00,aa, */
6002         {0xaa, 0x0d, 0x00a0},           /* 00,0d,a0,aa, */
6003         {0xaa, 0x0e, 0x0000},           /* 00,0e,00,aa, */
6004         {0xaa, 0x0f, 0x00a0},           /* 00,0f,a0,aa, */
6005         {0xaa, 0x10, 0x0000},           /* 00,10,00,aa, */
6006         {0xaa, 0x11, 0x00a0},           /* 00,11,a0,aa, */
6007 /*??    {0xa0, 0x00, 0x0039},
6008         {0xa1, 0x01, 0x0037}, */
6009         {0xaa, 0x16, 0x0001},           /* 00,16,01,aa, */
6010         {0xaa, 0x17, 0x00e8},           /* 00,17,e6,aa, (e6 -> e8) */
6011         {0xaa, 0x18, 0x0002},           /* 00,18,02,aa, */
6012         {0xaa, 0x19, 0x0088},           /* 00,19,86,aa, */
6013         {0xaa, 0x20, 0x0020},           /* 00,20,20,aa, */
6014         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc, */
6015         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc, */
6016         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc, */
6017         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},             /* 01,89,76,cc, */
6018         {0xa0, 0x09, 0x01ad},                           /* 01,ad,09,cc, */
6019         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc, */
6020         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc, */
6021         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc, */
6022         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc, */
6023         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},           /* 01,a8,60,cc, */
6024         {0xa0, 0x61, ZC3XX_R116_RGAIN},                 /* 01,16,61,cc, */
6025         {0xa0, 0x65, ZC3XX_R118_BGAIN},                 /* 01,18,65,cc */
6026         {}
6027 };
6028
6029 static const struct usb_action tas5130c_vf0250_InitialScale[] = {
6030         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc, */
6031         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},          /* 00,08,02,cc, */
6032         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc, */
6033         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},           /* 00,02,10,cc, */
6034         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc, */
6035         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc, */
6036         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc, */
6037         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc, */
6038         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
6039         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc, */
6040         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc, */
6041         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc, */
6042         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc, */
6043         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,00,cc, */
6044         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc, */
6045         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,00,cc, */
6046         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,e8,cc,
6047                                                          * 8<->6 */
6048         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,88,cc,
6049                                                          * 8<->6 */
6050         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},            /* 00,87,10,cc, */
6051         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
6052         {0xaa, 0x1b, 0x0024},           /* 00,1b,24,aa, */
6053         {0xdd, 0x00, 0x0080},           /* 00,00,80,dd, */
6054         {0xaa, 0x1b, 0x0000},           /* 00,1b,00,aa, */
6055         {0xaa, 0x13, 0x0002},           /* 00,13,02,aa, */
6056         {0xaa, 0x15, 0x0004},           /* 00,15,04,aa */
6057 /*??    {0xaa, 0x01, 0x0000}, */
6058         {0xaa, 0x01, 0x0000},
6059         {0xaa, 0x1a, 0x0000},           /* 00,1a,00,aa, */
6060         {0xaa, 0x1c, 0x0017},           /* 00,1c,17,aa, */
6061         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc, */
6062         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc, */
6063         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc, */
6064         {0xaa, 0x05, 0x0010},           /* 00,05,10,aa, */
6065         {0xaa, 0x0a, 0x0000},           /* 00,0a,00,aa, */
6066         {0xaa, 0x0b, 0x00a0},           /* 00,0b,a0,aa, */
6067         {0xaa, 0x0c, 0x0000},           /* 00,0c,00,aa, */
6068         {0xaa, 0x0d, 0x00a0},           /* 00,0d,a0,aa, */
6069         {0xaa, 0x0e, 0x0000},           /* 00,0e,00,aa, */
6070         {0xaa, 0x0f, 0x00a0},           /* 00,0f,a0,aa, */
6071         {0xaa, 0x10, 0x0000},           /* 00,10,00,aa, */
6072         {0xaa, 0x11, 0x00a0},           /* 00,11,a0,aa, */
6073 /*??    {0xa0, 0x00, 0x0039},
6074         {0xa1, 0x01, 0x0037}, */
6075         {0xaa, 0x16, 0x0001},           /* 00,16,01,aa, */
6076         {0xaa, 0x17, 0x00e8},           /* 00,17,e6,aa (e6 -> e8) */
6077         {0xaa, 0x18, 0x0002},           /* 00,18,02,aa, */
6078         {0xaa, 0x19, 0x0088},           /* 00,19,88,aa, */
6079         {0xaa, 0x20, 0x0020},           /* 00,20,20,aa, */
6080         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc, */
6081         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc, */
6082         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc, */
6083         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},             /* 01,89,76,cc, */
6084         {0xa0, 0x09, 0x01ad},                           /* 01,ad,09,cc, */
6085         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc, */
6086         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc, */
6087         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc, */
6088         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc, */
6089         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},           /* 01,a8,60,cc, */
6090         {0xa0, 0x61, ZC3XX_R116_RGAIN},         /* 01,16,61,cc, */
6091         {0xa0, 0x65, ZC3XX_R118_BGAIN},         /* 01,18,65,cc */
6092         {}
6093 };
6094 /* "50HZ" light frequency banding filter */
6095 static const struct usb_action tas5130c_vf0250_50HZ[] = {
6096         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6097         {0xaa, 0x83, 0x0001},           /* 00,83,01,aa */
6098         {0xaa, 0x84, 0x00aa},           /* 00,84,aa,aa */
6099         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6100         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0d,cc, */
6101         {0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,50,cc, */
6102         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6103         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6104         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,47,cc, */
6105         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6106         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6107         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6108         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6109         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6110         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6111         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6112         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6113         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6114         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6115         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6116         {}
6117 };
6118
6119 /* "50HZScale" light frequency banding filter */
6120 static const struct usb_action tas5130c_vf0250_50HZScale[] = {
6121         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6122         {0xaa, 0x83, 0x0003},           /* 00,83,03,aa */
6123         {0xaa, 0x84, 0x0054},           /* 00,84,54,aa */
6124         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6125         {0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0d,cc, */
6126         {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,50,cc, */
6127         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6128         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6129         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,8e,cc, */
6130         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6131         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6132         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6133         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6134         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6135         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6136         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6137         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6138         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6139         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6140         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6141         {}
6142 };
6143
6144 /* "60HZ" light frequency banding filter */
6145 static const struct usb_action tas5130c_vf0250_60HZ[] = {
6146         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6147         {0xaa, 0x83, 0x0001},           /* 00,83,01,aa */
6148         {0xaa, 0x84, 0x0062},           /* 00,84,62,aa */
6149         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6150         {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,05,cc, */
6151         {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,88,cc, */
6152         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6153         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6154         {0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,3b,cc, */
6155         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6156         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6157         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6158         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6159         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6160         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6161         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6162         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6163         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6164         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6165         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6166         {}
6167 };
6168
6169 /* "60HZScale" light frequency banding ilter */
6170 static const struct usb_action tas5130c_vf0250_60HZScale[] = {
6171         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6172         {0xaa, 0x83, 0x0002},           /* 00,83,02,aa */
6173         {0xaa, 0x84, 0x00c4},           /* 00,84,c4,aa */
6174         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6175         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,1,0b,cc, */
6176         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,2,10,cc, */
6177         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,5,00,cc, */
6178         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,6,00,cc, */
6179         {0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,7,76,cc, */
6180         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,c,0e,cc, */
6181         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,f,15,cc, */
6182         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,9,10,cc, */
6183         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,a,24,cc, */
6184         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,d,62,cc, */
6185         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,e,90,cc, */
6186         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,f,c8,cc, */
6187         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,0,ff,cc, */
6188         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,d,58,cc, */
6189         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6190         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,d,78,cc */
6191         {}
6192 };
6193
6194 /* "NoFliker" light frequency banding flter */
6195 static const struct usb_action tas5130c_vf0250_NoFliker[] = {
6196         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0c,cc, */
6197         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6198         {0xaa, 0x83, 0x0000},           /* 00,83,00,aa */
6199         {0xaa, 0x84, 0x0020},           /* 00,84,20,aa */
6200         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,0,00,cc, */
6201         {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,05,cc, */
6202         {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,88,cc, */
6203         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6204         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6205         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc, */
6206         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6207         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6208         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6209         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6210         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6211         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6212         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6213         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
6214         {}
6215 };
6216
6217 /* "NoFlikerScale" light frequency banding filter */
6218 static const struct usb_action tas5130c_vf0250_NoFlikerScale[] = {
6219         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0c,cc, */
6220         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6221         {0xaa, 0x83, 0x0000},           /* 00,83,00,aa */
6222         {0xaa, 0x84, 0x0020},           /* 00,84,20,aa */
6223         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6224         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc, */
6225         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,10,cc, */
6226         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6227         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6228         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc, */
6229         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6230         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6231         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6232         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6233         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6234         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6235         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6236         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
6237         {}
6238 };
6239
6240 static int reg_r_i(struct gspca_dev *gspca_dev,
6241                 __u16 index)
6242 {
6243         usb_control_msg(gspca_dev->dev,
6244                         usb_rcvctrlpipe(gspca_dev->dev, 0),
6245                         0xa1,
6246                         USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6247                         0x01,                   /* value */
6248                         index, gspca_dev->usb_buf, 1,
6249                         500);
6250         return gspca_dev->usb_buf[0];
6251 }
6252
6253 static int reg_r(struct gspca_dev *gspca_dev,
6254                 __u16 index)
6255 {
6256         int ret;
6257
6258         ret = reg_r_i(gspca_dev, index);
6259         PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
6260         return ret;
6261 }
6262
6263 static void reg_w_i(struct usb_device *dev,
6264                         __u8 value,
6265                         __u16 index)
6266 {
6267         usb_control_msg(dev,
6268                         usb_sndctrlpipe(dev, 0),
6269                         0xa0,
6270                         USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6271                         value, index, NULL, 0,
6272                         500);
6273 }
6274
6275 static void reg_w(struct usb_device *dev,
6276                         __u8 value,
6277                         __u16 index)
6278 {
6279         PDEBUG(D_USBO, "reg w [%04x] = %02x", index, value);
6280         reg_w_i(dev, value, index);
6281 }
6282
6283 static __u16 i2c_read(struct gspca_dev *gspca_dev,
6284                         __u8 reg)
6285 {
6286         __u8 retbyte;
6287         __u16 retval;
6288
6289         reg_w_i(gspca_dev->dev, reg, 0x92);
6290         reg_w_i(gspca_dev->dev, 0x02, 0x90);            /* <- read command */
6291         msleep(25);
6292         retbyte = reg_r_i(gspca_dev, 0x0091);           /* read status */
6293         retval = reg_r_i(gspca_dev, 0x0095);            /* read Lowbyte */
6294         retval |= reg_r_i(gspca_dev, 0x0096) << 8;      /* read Hightbyte */
6295         PDEBUG(D_USBO, "i2c r [%02x] -> %04x (%02x)",
6296                         reg, retval, retbyte);
6297         return retval;
6298 }
6299
6300 static __u8 i2c_write(struct gspca_dev *gspca_dev,
6301                         __u8 reg,
6302                         __u8 valL,
6303                         __u8 valH)
6304 {
6305         __u8 retbyte;
6306
6307         reg_w_i(gspca_dev->dev, reg, 0x92);
6308         reg_w_i(gspca_dev->dev, valL, 0x93);
6309         reg_w_i(gspca_dev->dev, valH, 0x94);
6310         reg_w_i(gspca_dev->dev, 0x01, 0x90);            /* <- write command */
6311         msleep(15);
6312         retbyte = reg_r_i(gspca_dev, 0x0091);           /* read status */
6313         PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
6314                         reg, valH, valL, retbyte);
6315         return retbyte;
6316 }
6317
6318 static void usb_exchange(struct gspca_dev *gspca_dev,
6319                         const struct usb_action *action)
6320 {
6321         while (action->req) {
6322                 switch (action->req) {
6323                 case 0xa0:      /* write register */
6324                         reg_w(gspca_dev->dev, action->val, action->idx);
6325                         break;
6326                 case 0xa1:      /* read status */
6327                         reg_r(gspca_dev, action->idx);
6328                         break;
6329                 case 0xaa:
6330                         i2c_write(gspca_dev,
6331                                   action->val,                  /* reg */
6332                                   action->idx & 0xff,           /* valL */
6333                                   action->idx >> 8);            /* valH */
6334                         break;
6335                 default:
6336 /*              case 0xdd:       * delay */
6337                         msleep(action->val / 64 + 10);
6338                         break;
6339                 }
6340                 action++;
6341 /*              msleep(1); */
6342         }
6343 }
6344
6345 static void setmatrix(struct gspca_dev *gspca_dev)
6346 {
6347         struct sd *sd = (struct sd *) gspca_dev;
6348         int i;
6349         const __u8 *matrix;
6350         static const __u8 gc0305_matrix[9] =
6351                 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
6352         static const __u8 ov7620_matrix[9] =
6353                 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
6354         static const __u8 pas202b_matrix[9] =
6355                 {0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
6356         static const __u8 po2030_matrix[9] =
6357                 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
6358         static const __u8 vf0250_matrix[9] =
6359                 {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
6360         static const __u8 *matrix_tb[SENSOR_MAX] = {
6361                 NULL,           /* SENSOR_CS2102 0 */
6362                 NULL,           /* SENSOR_CS2102K 1 */
6363                 gc0305_matrix,  /* SENSOR_GC0305 2 */
6364                 NULL,           /* SENSOR_HDCS2020b 3 */
6365                 NULL,           /* SENSOR_HV7131B 4 */
6366                 NULL,           /* SENSOR_HV7131C 5 */
6367                 NULL,           /* SENSOR_ICM105A 6 */
6368                 NULL,           /* SENSOR_MC501CB 7 */
6369                 ov7620_matrix,  /* SENSOR_OV7620 8 */
6370                 NULL,           /* SENSOR_OV7630C 9 */
6371                 NULL,           /* SENSOR_PAS106 10 */
6372                 pas202b_matrix, /* SENSOR_PAS202B 11 */
6373                 NULL,           /* SENSOR_PB0330 12 */
6374                 po2030_matrix,  /* SENSOR_PO2030 13 */
6375                 NULL,           /* SENSOR_TAS5130CK 14 */
6376                 NULL,           /* SENSOR_TAS5130CXX 15 */
6377                 vf0250_matrix,  /* SENSOR_TAS5130C_VF0250 16 */
6378         };
6379
6380         matrix = matrix_tb[sd->sensor];
6381         if (matrix == NULL)
6382                 return;         /* matrix already loaded */
6383         for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
6384                 reg_w(gspca_dev->dev, matrix[i], 0x010a + i);
6385 }
6386
6387 static void setbrightness(struct gspca_dev *gspca_dev)
6388 {
6389         struct sd *sd = (struct sd *) gspca_dev;
6390         __u8 brightness;
6391
6392         switch (sd->sensor) {
6393         case SENSOR_GC0305:
6394         case SENSOR_OV7620:
6395         case SENSOR_PO2030:
6396                 return;
6397         }
6398 /*fixme: is it really write to 011d and 018d for all other sensors? */
6399         brightness = sd->brightness;
6400         reg_w(gspca_dev->dev, brightness, 0x011d);
6401         if (sd->sensor == SENSOR_HV7131B)
6402                 return;
6403         if (brightness < 0x70)
6404                 brightness += 0x10;
6405         else
6406                 brightness = 0x80;
6407         reg_w(gspca_dev->dev, brightness, 0x018d);
6408 }
6409
6410 static void setsharpness(struct gspca_dev *gspca_dev)
6411 {
6412         struct sd *sd = (struct sd *) gspca_dev;
6413         struct usb_device *dev = gspca_dev->dev;
6414         int sharpness;
6415         static const __u8 sharpness_tb[][2] = {
6416                 {0x02, 0x03},
6417                 {0x04, 0x07},
6418                 {0x08, 0x0f},
6419                 {0x10, 0x1e}
6420         };
6421
6422         sharpness = sd->sharpness;
6423         reg_w(dev, sharpness_tb[sharpness][0], 0x01c6);
6424         reg_r(gspca_dev, 0x01c8);
6425         reg_r(gspca_dev, 0x01c9);
6426         reg_r(gspca_dev, 0x01ca);
6427         reg_w(dev, sharpness_tb[sharpness][1], 0x01cb);
6428 }
6429
6430 static void setcontrast(struct gspca_dev *gspca_dev)
6431 {
6432         struct sd *sd = (struct sd *) gspca_dev;
6433         struct usb_device *dev = gspca_dev->dev;
6434         const __u8 *Tgamma, *Tgradient;
6435         int g, i, k;
6436         static const __u8 kgamma_tb[16] =       /* delta for contrast */
6437                 {0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08,
6438                  0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
6439         static const __u8 kgrad_tb[16] =
6440                 {0x1b, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00,
6441                  0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x04};
6442         static const __u8 Tgamma_1[16] =
6443                 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
6444                  0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff};
6445         static const __u8 Tgradient_1[16] =
6446                 {0x00, 0x01, 0x05, 0x0b, 0x10, 0x15, 0x18, 0x1a,
6447                  0x1a, 0x18, 0x16, 0x14, 0x12, 0x0f, 0x0d, 0x06};
6448         static const __u8 Tgamma_2[16] =
6449                 {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
6450                  0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff};
6451         static const __u8 Tgradient_2[16] =
6452                 {0x05, 0x0f, 0x16, 0x1a, 0x19, 0x19, 0x17, 0x15,
6453                  0x12, 0x10, 0x0e, 0x0b, 0x09, 0x08, 0x06, 0x03};
6454         static const __u8 Tgamma_3[16] =
6455                 {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
6456                  0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff};
6457         static const __u8 Tgradient_3[16] =
6458                 {0x0c, 0x16, 0x1b, 0x1c, 0x19, 0x18, 0x15, 0x12,
6459                  0x10, 0x0d, 0x0b, 0x09, 0x08, 0x06, 0x05, 0x03};
6460         static const __u8 Tgamma_4[16] =
6461                 {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
6462                  0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff};
6463         static const __u8 Tgradient_4[16] =
6464                 {0x26, 0x22, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0d,
6465                  0x0b, 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02};
6466         static const __u8 Tgamma_5[16] =
6467                 {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
6468                  0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff};
6469         static const __u8 Tgradient_5[16] =
6470                 {0x37, 0x26, 0x20, 0x1a, 0x14, 0x10, 0x0e, 0x0b,
6471                  0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x02};
6472         static const __u8 Tgamma_6[16] =                /* ?? was gamma 5 */
6473                 {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
6474                  0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff};
6475         static const __u8 Tgradient_6[16] =
6476                 {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
6477                  0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
6478         static const __u8 *gamma_tb[] = {
6479                 NULL, Tgamma_1, Tgamma_2,
6480                 Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
6481         };
6482         static const __u8 *gradient_tb[] = {
6483                 NULL, Tgradient_1, Tgradient_2,
6484                 Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
6485         };
6486 #ifdef GSPCA_DEBUG
6487         __u8 v[16];
6488 #endif
6489
6490         Tgamma = gamma_tb[sd->gamma];
6491         Tgradient = gradient_tb[sd->gamma];
6492
6493         k = (sd->contrast - 128)                /* -128 / 128 */
6494                         * Tgamma[0];
6495         PDEBUG(D_CONF, "gamma:%d contrast:%d gamma coeff: %d/128",
6496                 sd->gamma, sd->contrast, k);
6497         for (i = 0; i < 16; i++) {
6498                 g = Tgamma[i] + kgamma_tb[i] * k / 128;
6499                 if (g > 0xff)
6500                         g = 0xff;
6501                 else if (g <= 0)
6502                         g = 1;
6503                 reg_w(dev, g, 0x0120 + i);      /* gamma */
6504 #ifdef GSPCA_DEBUG
6505                 if (gspca_debug & D_CONF)
6506                         v[i] = g;
6507 #endif
6508         }
6509         PDEBUG(D_CONF, "tb: %02x %02x %02x %02x %02x %02x %02x %02x",
6510                 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6511         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6512                 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6513         for (i = 0; i < 16; i++) {
6514                 g = Tgradient[i] - kgrad_tb[i] * k / 128;
6515                 if (g > 0xff)
6516                         g = 0xff;
6517                 else if (g <= 0) {
6518                         if (i != 15)
6519                                 g = 0;
6520                         else
6521                                 g = 1;
6522                 }
6523                 reg_w(dev, g, 0x0130 + i);      /* gradient */
6524 #ifdef GSPCA_DEBUG
6525                 if (gspca_debug & D_CONF)
6526                         v[i] = g;
6527 #endif
6528         }
6529         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6530                 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6531         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6532                 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6533 }
6534
6535 static void setquality(struct gspca_dev *gspca_dev)
6536 {
6537         struct sd *sd = (struct sd *) gspca_dev;
6538         struct usb_device *dev = gspca_dev->dev;
6539         __u8 quality;
6540         __u8 frxt;
6541
6542         switch (sd->sensor) {
6543         case SENSOR_GC0305:
6544         case SENSOR_HV7131B:
6545         case SENSOR_OV7620:
6546         case SENSOR_PO2030:
6547                 return;
6548         }
6549 /*fixme: is it really 0008 0007 0018 for all other sensors? */
6550         quality = sd->qindex;
6551         reg_w(dev, quality, 0x0008);
6552         frxt = 0x30;
6553         reg_w(dev, frxt, 0x0007);
6554         switch (quality) {
6555         case 0:
6556         case 1:
6557         case 2:
6558                 frxt = 0xff;
6559                 break;
6560         case 3:
6561                 frxt = 0xf0;
6562                 break;
6563         case 4:
6564                 frxt = 0xe0;
6565                 break;
6566         case 5:
6567                 frxt = 0x20;
6568                 break;
6569         }
6570         reg_w(dev, frxt, 0x0018);
6571 }
6572
6573 /* Matches the sensor's internal frame rate to the lighting frequency.
6574  * Valid frequencies are:
6575  *      50Hz, for European and Asian lighting (default)
6576  *      60Hz, for American lighting
6577  *      0 = No Fliker (for outdoore usage)
6578  * Returns: 0 for success
6579  */
6580 static int setlightfreq(struct gspca_dev *gspca_dev)
6581 {
6582         struct sd *sd = (struct sd *) gspca_dev;
6583         int i, mode;
6584         const struct usb_action *zc3_freq;
6585         static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
6586 /* SENSOR_CS2102 0 */
6587                 {cs2102_NoFliker, cs2102_NoFlikerScale,
6588                  cs2102_50HZ, cs2102_50HZScale,
6589                  cs2102_60HZ, cs2102_60HZScale},
6590 /* SENSOR_CS2102K 1 */
6591                 {cs2102_NoFliker, cs2102_NoFlikerScale,
6592                  NULL, NULL, /* currently disabled */
6593                  NULL, NULL},
6594 /* SENSOR_GC0305 2 */
6595                 {gc0305_NoFliker, gc0305_NoFliker,
6596                  gc0305_50HZ, gc0305_50HZ,
6597                  gc0305_60HZ, gc0305_60HZ},
6598 /* SENSOR_HDCS2020b 3 */
6599                 {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
6600                  hdcs2020b_50HZ, hdcs2020b_50HZ,
6601                  hdcs2020b_60HZ, hdcs2020b_60HZ},
6602 /* SENSOR_HV7131B 4 */
6603                 {hv7131b_NoFlikerScale, hv7131b_NoFliker,
6604                  hv7131b_50HZScale, hv7131b_50HZ,
6605                  hv7131b_60HZScale, hv7131b_60HZ},
6606 /* SENSOR_HV7131C 5 */
6607                 {NULL, NULL,
6608                  NULL, NULL,
6609                  NULL, NULL},
6610 /* SENSOR_ICM105A 6 */
6611                 {icm105a_NoFliker, icm105a_NoFlikerScale,
6612                  icm105a_50HZ, icm105a_50HZScale,
6613                  icm105a_60HZ, icm105a_60HZScale},
6614 /* SENSOR_MC501CB 7 */
6615                 {MC501CB_NoFliker, MC501CB_NoFlikerScale,
6616                  MC501CB_50HZ, MC501CB_50HZScale,
6617                  MC501CB_60HZ, MC501CB_60HZScale},
6618 /* SENSOR_OV7620 8 */
6619                 {OV7620_NoFliker, OV7620_NoFliker,
6620                  OV7620_50HZ, OV7620_50HZ,
6621                  OV7620_60HZ, OV7620_60HZ},
6622 /* SENSOR_OV7630C 9 */
6623                 {NULL, NULL,
6624                  NULL, NULL,
6625                  NULL, NULL},
6626 /* SENSOR_PAS106 10 */
6627                 {pas106b_NoFliker, pas106b_NoFliker,
6628                  pas106b_50HZ, pas106b_50HZ,
6629                  pas106b_60HZ, pas106b_60HZ},
6630 /* SENSOR_PAS202B 11 */
6631                 {pas202b_NoFlikerScale, pas202b_NoFliker,
6632                  pas202b_50HZScale, pas202b_50HZ,
6633                  pas202b_60HZScale, pas202b_60HZ},
6634 /* SENSOR_PB0330 12 */
6635                 {pb0330_NoFliker, pb0330_NoFlikerScale,
6636                  pb0330_50HZ, pb0330_50HZScale,
6637                  pb0330_60HZ, pb0330_60HZScale},
6638 /* SENSOR_PO2030 13 */
6639                 {PO2030_NoFliker, PO2030_NoFliker,
6640                  PO2030_50HZ, PO2030_50HZ,
6641                  PO2030_60HZ, PO2030_60HZ},
6642 /* SENSOR_TAS5130CK 14 */
6643                 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6644                  tas5130cxx_50HZ, tas5130cxx_50HZScale,
6645                  tas5130cxx_60HZ, tas5130cxx_60HZScale},
6646 /* SENSOR_TAS5130CXX 15 */
6647                 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6648                  tas5130cxx_50HZ, tas5130cxx_50HZScale,
6649                  tas5130cxx_60HZ, tas5130cxx_60HZScale},
6650 /* SENSOR_TAS5130C_VF0250 16 */
6651                 {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale,
6652                  tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale,
6653                  tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale},
6654         };
6655
6656         i = sd->lightfreq * 2;
6657         mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
6658         if (!mode)
6659                 i++;                    /* 640x480 */
6660         zc3_freq = freq_tb[(int) sd->sensor][i];
6661         if (zc3_freq != NULL) {
6662                 usb_exchange(gspca_dev, zc3_freq);
6663                 switch (sd->sensor) {
6664                 case SENSOR_GC0305:
6665                         if (mode                        /* if 320x240 */
6666                             && sd->lightfreq == 1)      /* and 50Hz */
6667                                 reg_w(gspca_dev->dev, 0x85, 0x018d);
6668                                                 /* win: 0x80, 0x018d */
6669                         break;
6670                 case SENSOR_OV7620:
6671                         if (!mode) {                    /* if 640x480 */
6672                                 if (sd->lightfreq != 0) /* and 50 or 60 Hz */
6673                                         reg_w(gspca_dev->dev, 0x40, 0x0002);
6674                                 else
6675                                         reg_w(gspca_dev->dev, 0x44, 0x0002);
6676                         }
6677                         break;
6678                 }
6679         }
6680         return 0;
6681 }
6682
6683 static void setautogain(struct gspca_dev *gspca_dev)
6684 {
6685         struct sd *sd = (struct sd *) gspca_dev;
6686         __u8 autoval;
6687
6688         if (sd->autogain)
6689                 autoval = 0x42;
6690         else
6691                 autoval = 0x02;
6692         reg_w(gspca_dev->dev, autoval, 0x0180);
6693 }
6694
6695 static void send_unknown(struct usb_device *dev, int sensor)
6696 {
6697         reg_w(dev, 0x01, 0x0000);               /* led off */
6698         switch (sensor) {
6699         case SENSOR_PAS106:
6700                 reg_w(dev, 0x03, 0x003a);
6701                 reg_w(dev, 0x0c, 0x003b);
6702                 reg_w(dev, 0x08, 0x0038);
6703                 break;
6704         case SENSOR_GC0305:
6705         case SENSOR_OV7620:
6706         case SENSOR_PB0330:
6707         case SENSOR_PO2030:
6708                 reg_w(dev, 0x0d, 0x003a);
6709                 reg_w(dev, 0x02, 0x003b);
6710                 reg_w(dev, 0x00, 0x0038);
6711                 break;
6712         }
6713 }
6714
6715 /* start probe 2 wires */
6716 static void start_2wr_probe(struct usb_device *dev, int sensor)
6717 {
6718         reg_w(dev, 0x01, 0x0000);
6719         reg_w(dev, sensor, 0x0010);
6720         reg_w(dev, 0x01, 0x0001);
6721         reg_w(dev, 0x03, 0x0012);
6722         reg_w(dev, 0x01, 0x0012);
6723 /*      msleep(2); */
6724 }
6725
6726 static int sif_probe(struct gspca_dev *gspca_dev)
6727 {
6728         __u16 checkword;
6729
6730         start_2wr_probe(gspca_dev->dev, 0x0f);          /* PAS106 */
6731         reg_w(gspca_dev->dev, 0x08, 0x008d);
6732         msleep(150);
6733         checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
6734                         | ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
6735         PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
6736         if (checkword == 0x0007) {
6737                 send_unknown(gspca_dev->dev, SENSOR_PAS106);
6738                 return 0x0f;                    /* PAS106 */
6739         }
6740         return -1;
6741 }
6742
6743 static int vga_2wr_probe(struct gspca_dev *gspca_dev)
6744 {
6745         struct usb_device *dev = gspca_dev->dev;
6746         __u8 retbyte;
6747         __u16 checkword;
6748
6749         start_2wr_probe(dev, 0x00);             /* HV7131B */
6750         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6751         retbyte = i2c_read(gspca_dev, 0x01);
6752         if (retbyte != 0)
6753                 return 0x00;                    /* HV7131B */
6754
6755         start_2wr_probe(dev, 0x04);             /* CS2102 */
6756         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6757         retbyte = i2c_read(gspca_dev, 0x01);
6758         if (retbyte != 0)
6759                 return 0x04;                    /* CS2102 */
6760
6761         start_2wr_probe(dev, 0x06);             /* OmniVision */
6762         reg_w(dev, 0x08, 0x008d);
6763         i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
6764         retbyte = i2c_read(gspca_dev, 0x11);
6765         if (retbyte != 0) {
6766                 /* (should have returned 0xaa) --> Omnivision? */
6767                 /* reg_r 0x10 -> 0x06 -->  */
6768                 goto ov_check;
6769         }
6770
6771         start_2wr_probe(dev, 0x08);             /* HDCS2020 */
6772         i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
6773         retbyte = i2c_read(gspca_dev, 0x15);
6774         if (retbyte != 0)
6775                 return 0x08;                    /* HDCS2020 */
6776
6777         start_2wr_probe(dev, 0x0a);             /* PB0330 */
6778         i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
6779         retbyte = i2c_read(gspca_dev, 0x07);
6780         if (retbyte != 0)
6781                 return 0x0a;                    /* PB0330 */
6782         retbyte = i2c_read(gspca_dev, 0x03);
6783         if (retbyte != 0)
6784                 return 0x0a;                    /* PB0330 ?? */
6785         retbyte = i2c_read(gspca_dev, 0x04);
6786         if (retbyte != 0)
6787                 return 0x0a;                    /* PB0330 ?? */
6788
6789         start_2wr_probe(dev, 0x0c);             /* ICM105A */
6790         i2c_write(gspca_dev, 0x01, 0x11, 0x00);
6791         retbyte = i2c_read(gspca_dev, 0x01);
6792         if (retbyte != 0)
6793                 return 0x0c;                    /* ICM105A */
6794
6795         start_2wr_probe(dev, 0x0e);             /* PAS202BCB */
6796         reg_w(dev, 0x08, 0x008d);
6797         i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
6798         msleep(500);
6799         retbyte = i2c_read(gspca_dev, 0x03);
6800         if (retbyte != 0)
6801                 return 0x0e;                    /* PAS202BCB */
6802
6803         start_2wr_probe(dev, 0x02);             /* ?? */
6804         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6805         retbyte = i2c_read(gspca_dev, 0x01);
6806         if (retbyte != 0)
6807                 return 0x02;                    /* ?? */
6808 ov_check:
6809         reg_r(gspca_dev, 0x0010);               /* ?? */
6810         reg_r(gspca_dev, 0x0010);
6811
6812         reg_w(dev, 0x01, 0x0000);
6813         reg_w(dev, 0x01, 0x0001);
6814         reg_w(dev, 0x06, 0x0010);               /* OmniVision */
6815         reg_w(dev, 0xa1, 0x008b);
6816         reg_w(dev, 0x08, 0x008d);
6817         msleep(500);
6818         reg_w(dev, 0x01, 0x0012);
6819         i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
6820         retbyte = i2c_read(gspca_dev, 0x0a);
6821         checkword = retbyte << 8;
6822         retbyte = i2c_read(gspca_dev, 0x0b);
6823         checkword |= retbyte;
6824         PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", checkword);
6825         switch (checkword) {
6826         case 0x7631:                            /* OV7630C */
6827                 reg_w(dev, 0x06, 0x0010);
6828                 break;
6829         case 0x7620:                            /* OV7620 */
6830         case 0x7648:                            /* OV7648 */
6831                 break;
6832         default:
6833                 return -1;                      /* not OmniVision */
6834         }
6835         return checkword;
6836 }
6837
6838 struct sensor_by_chipset_revision {
6839         __u16 revision;
6840         __u8 internal_sensor_id;
6841 };
6842 static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
6843         {0xc001, 0x13},         /* MI0360 */
6844         {0xe001, 0x13},
6845         {0x8001, 0x13},
6846         {0x8000, 0x14},         /* CS2102K */
6847         {0x8400, 0x15},         /* TAS5130K */
6848 };
6849
6850 static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6851 {
6852         struct sd *sd = (struct sd *) gspca_dev;
6853         struct usb_device *dev = gspca_dev->dev;
6854         int i;
6855         __u8 retbyte;
6856         __u16 checkword;
6857
6858 /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
6859         reg_w(dev, 0x02, 0x0010);
6860         reg_r(gspca_dev, 0x0010);
6861         reg_w(dev, 0x01, 0x0000);
6862         reg_w(dev, 0x00, 0x0010);
6863         reg_w(dev, 0x01, 0x0001);
6864         reg_w(dev, 0x91, 0x008b);
6865         reg_w(dev, 0x03, 0x0012);
6866         reg_w(dev, 0x01, 0x0012);
6867         reg_w(dev, 0x05, 0x0012);
6868         retbyte = i2c_read(gspca_dev, 0x14);
6869         if (retbyte != 0)
6870                 return 0x11;                    /* HV7131R */
6871         retbyte = i2c_read(gspca_dev, 0x15);
6872         if (retbyte != 0)
6873                 return 0x11;                    /* HV7131R */
6874         retbyte = i2c_read(gspca_dev, 0x16);
6875         if (retbyte != 0)
6876                 return 0x11;                    /* HV7131R */
6877
6878         reg_w(dev, 0x02, 0x0010);
6879         retbyte = reg_r(gspca_dev, 0x000b);
6880         checkword = retbyte << 8;
6881         retbyte = reg_r(gspca_dev, 0x000a);
6882         checkword |= retbyte;
6883         PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword);
6884         reg_r(gspca_dev, 0x0010);
6885         /* this is tested only once anyway */
6886         for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6887                 if (chipset_revision_sensor[i].revision == checkword) {
6888                         sd->chip_revision = checkword;
6889                         send_unknown(dev, SENSOR_PB0330);
6890                         return chipset_revision_sensor[i].internal_sensor_id;
6891                 }
6892         }
6893
6894         reg_w(dev, 0x01, 0x0000);       /* check ?? */
6895         reg_w(dev, 0x01, 0x0001);
6896         reg_w(dev, 0xdd, 0x008b);
6897         reg_w(dev, 0x0a, 0x0010);
6898         reg_w(dev, 0x03, 0x0012);
6899         reg_w(dev, 0x01, 0x0012);
6900         retbyte = i2c_read(gspca_dev, 0x00);
6901         if (retbyte != 0) {
6902                 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6903                 return 0x0a;                    /* ?? */
6904         }
6905
6906         reg_w(dev, 0x01, 0x0000);
6907         reg_w(dev, 0x01, 0x0001);
6908         reg_w(dev, 0x98, 0x008b);
6909         reg_w(dev, 0x01, 0x0010);
6910         reg_w(dev, 0x03, 0x0012);
6911         msleep(2);
6912         reg_w(dev, 0x01, 0x0012);
6913         retbyte = i2c_read(gspca_dev, 0x00);
6914         if (retbyte != 0) {
6915                 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte);
6916                 if (retbyte == 0x11)                    /* VF0250 */
6917                         return 0x0250;
6918                 if (retbyte == 0x29)                    /* gc0305 */
6919                         send_unknown(dev, SENSOR_GC0305);
6920                 return retbyte;
6921         }
6922
6923         reg_w(dev, 0x01, 0x0000);       /* check OmniVision */
6924         reg_w(dev, 0x01, 0x0001);
6925         reg_w(dev, 0xa1, 0x008b);
6926         reg_w(dev, 0x08, 0x008d);
6927         reg_w(dev, 0x06, 0x0010);
6928         reg_w(dev, 0x01, 0x0012);
6929         reg_w(dev, 0x05, 0x0012);
6930         if (i2c_read(gspca_dev, 0x1c) == 0x7f   /* OV7610 - manufacturer ID */
6931             && i2c_read(gspca_dev, 0x1d) == 0xa2) {
6932                 send_unknown(dev, SENSOR_OV7620);
6933                 return 0x06;            /* OmniVision confirm ? */
6934         }
6935
6936         reg_w(dev, 0x01, 0x0000);
6937         reg_w(dev, 0x00, 0x0002);
6938         reg_w(dev, 0x01, 0x0010);
6939         reg_w(dev, 0x01, 0x0001);
6940         reg_w(dev, 0xee, 0x008b);
6941         reg_w(dev, 0x03, 0x0012);
6942 /*      msleep(150); */
6943         reg_w(dev, 0x01, 0x0012);
6944         reg_w(dev, 0x05, 0x0012);
6945         retbyte = i2c_read(gspca_dev, 0x0000);          /* ID 0 */
6946         checkword = retbyte << 8;
6947         retbyte = i2c_read(gspca_dev, 0x0001);          /* ID 1 */
6948         checkword |= retbyte;
6949         PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword);
6950         if (checkword == 0x2030) {
6951                 retbyte = i2c_read(gspca_dev, 0x02);    /* revision number */
6952                 PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
6953                 send_unknown(dev, SENSOR_PO2030);
6954                 return checkword;
6955         }
6956
6957         reg_w(dev, 0x01, 0x0000);
6958         reg_w(dev, 0x0a, 0x0010);
6959         reg_w(dev, 0xd3, 0x008b);
6960         reg_w(dev, 0x01, 0x0001);
6961         reg_w(dev, 0x03, 0x0012);
6962         reg_w(dev, 0x01, 0x0012);
6963         reg_w(dev, 0x05, 0x0001);
6964         reg_w(dev, 0xd3, 0x008b);
6965         retbyte = i2c_read(gspca_dev, 0x01);
6966         if (retbyte != 0) {
6967                 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6968                 return 0x0a;                    /* ?? */
6969         }
6970         return -1;
6971 }
6972
6973 static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6974 {
6975         struct sd *sd = (struct sd *) gspca_dev;
6976         int sensor, sensor2;
6977
6978         switch (sd->sensor) {
6979         case SENSOR_MC501CB:
6980                 return -1;              /* don't probe */
6981         case SENSOR_TAS5130C_VF0250:
6982                         /* may probe but with no write in reg 0x0010 */
6983                 return -1;              /* don't probe */
6984         case SENSOR_PAS106:
6985                 sensor =  sif_probe(gspca_dev);
6986                 if (sensor >= 0)
6987                         return sensor;
6988                 break;
6989         }
6990         sensor = vga_2wr_probe(gspca_dev);
6991         if (sensor >= 0) {
6992                 if (sensor < 0x7600)
6993                         return sensor;
6994                 /* next probe is needed for OmniVision ? */
6995         }
6996         sensor2 = vga_3wr_probe(gspca_dev);
6997         if (sensor2 >= 0
6998             && sensor >= 0)
6999                 return sensor;
7000         return sensor2;
7001 }
7002
7003 /* this function is called at probe time */
7004 static int sd_config(struct gspca_dev *gspca_dev,
7005                         const struct usb_device_id *id)
7006 {
7007         struct sd *sd = (struct sd *) gspca_dev;
7008         struct cam *cam;
7009         int sensor;
7010         int vga = 1;            /* 1: vga, 0: sif */
7011         static const __u8 gamma[SENSOR_MAX] = {
7012                 5,      /* SENSOR_CS2102 0 */
7013                 5,      /* SENSOR_CS2102K 1 */
7014                 4,      /* SENSOR_GC0305 2 */
7015                 4,      /* SENSOR_HDCS2020b 3 */
7016                 4,      /* SENSOR_HV7131B 4 */
7017                 4,      /* SENSOR_HV7131C 5 */
7018                 4,      /* SENSOR_ICM105A 6 */
7019                 4,      /* SENSOR_MC501CB 7 */
7020                 3,      /* SENSOR_OV7620 8 */
7021                 4,      /* SENSOR_OV7630C 9 */
7022                 4,      /* SENSOR_PAS106 10 */
7023                 4,      /* SENSOR_PAS202B 11 */
7024                 4,      /* SENSOR_PB0330 12 */
7025                 4,      /* SENSOR_PO2030 13 */
7026                 4,      /* SENSOR_TAS5130CK 14 */
7027                 4,      /* SENSOR_TAS5130CXX 15 */
7028                 3,      /* SENSOR_TAS5130C_VF0250 16 */
7029         };
7030
7031         /* define some sensors from the vendor/product */
7032         sd->sharpness = 2;
7033         sd->sensor = id->driver_info;
7034         sensor = zcxx_probeSensor(gspca_dev);
7035         if (sensor >= 0)
7036                 PDEBUG(D_PROBE, "probe sensor -> %02x", sensor);
7037         if ((unsigned) force_sensor < SENSOR_MAX) {
7038                 sd->sensor = force_sensor;
7039                 PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
7040         } else {
7041                 switch (sensor) {
7042                 case -1:
7043                         switch (sd->sensor) {
7044                         case SENSOR_MC501CB:
7045                                 PDEBUG(D_PROBE, "Sensor MC501CB");
7046                                 break;
7047                         case SENSOR_TAS5130C_VF0250:
7048                                 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7049                                 break;
7050                         default:
7051                                 PDEBUG(D_PROBE,
7052                                         "Sensor UNKNOW_0 force Tas5130");
7053                                 sd->sensor = SENSOR_TAS5130CXX;
7054                         }
7055                         break;
7056                 case 0:
7057                         PDEBUG(D_PROBE, "Find Sensor HV7131B");
7058                         sd->sensor = SENSOR_HV7131B;
7059                         break;
7060                 case 0x04:
7061                         PDEBUG(D_PROBE, "Find Sensor CS2102");
7062                         sd->sensor = SENSOR_CS2102;
7063                         break;
7064                 case 0x08:
7065                         PDEBUG(D_PROBE, "Find Sensor HDCS2020(b)");
7066                         sd->sensor = SENSOR_HDCS2020b;
7067                         break;
7068                 case 0x0a:
7069                         PDEBUG(D_PROBE,
7070                                 "Find Sensor PB0330. Chip revision %x",
7071                                 sd->chip_revision);
7072                         sd->sensor = SENSOR_PB0330;
7073                         break;
7074                 case 0x0c:
7075                         PDEBUG(D_PROBE, "Find Sensor ICM105A");
7076                         sd->sensor = SENSOR_ICM105A;
7077                         break;
7078                 case 0x0e:
7079                         PDEBUG(D_PROBE, "Find Sensor PAS202B");
7080                         sd->sensor = SENSOR_PAS202B;
7081                         sd->sharpness = 1;
7082                         break;
7083                 case 0x0f:
7084                         PDEBUG(D_PROBE, "Find Sensor PAS106");
7085                         sd->sensor = SENSOR_PAS106;
7086                         vga = 0;                /* SIF */
7087                         break;
7088                 case 0x10:
7089                 case 0x12:
7090                         PDEBUG(D_PROBE, "Find Sensor TAS5130");
7091                         sd->sensor = SENSOR_TAS5130CXX;
7092                         break;
7093                 case 0x11:
7094                         PDEBUG(D_PROBE, "Find Sensor HV7131R(c)");
7095                         sd->sensor = SENSOR_HV7131C;
7096                         break;
7097                 case 0x13:
7098                         PDEBUG(D_PROBE,
7099                                 "Find Sensor MI0360. Chip revision %x",
7100                                 sd->chip_revision);
7101                         sd->sensor = SENSOR_PB0330;
7102                         break;
7103                 case 0x14:
7104                         PDEBUG(D_PROBE,
7105                                 "Find Sensor CS2102K?. Chip revision %x",
7106                                 sd->chip_revision);
7107                         sd->sensor = SENSOR_CS2102K;
7108                         break;
7109                 case 0x15:
7110                         PDEBUG(D_PROBE,
7111                                 "Find Sensor TAS5130CK?. Chip revision %x",
7112                                 sd->chip_revision);
7113                         sd->sensor = SENSOR_TAS5130CK;
7114                         break;
7115                 case 0x29:
7116                         PDEBUG(D_PROBE, "Find Sensor GC0305");
7117                         sd->sensor = SENSOR_GC0305;
7118                         break;
7119                 case 0x0250:
7120                         PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7121                         sd->sensor =  SENSOR_TAS5130C_VF0250;
7122                         break;
7123                 case 0x2030:
7124                         PDEBUG(D_PROBE, "Find Sensor PO2030");
7125                         sd->sensor = SENSOR_PO2030;
7126                         sd->sharpness = 0;              /* from win traces */
7127                         break;
7128                 case 0x7620:
7129                         PDEBUG(D_PROBE, "Find Sensor OV7620");
7130                         sd->sensor = SENSOR_OV7620;
7131                         break;
7132                 case 0x7648:
7133                         PDEBUG(D_PROBE, "Find Sensor OV7648");
7134                         sd->sensor = SENSOR_OV7620;     /* same sensor (?) */
7135                         break;
7136                 default:
7137                         PDEBUG(D_ERR|D_PROBE, "Unknown sensor %02x", sensor);
7138                         return -EINVAL;
7139                 }
7140         }
7141         if (sensor < 0x20) {
7142                 if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
7143                         reg_w(gspca_dev->dev, 0x02, 0x0010);
7144                 else
7145                         reg_w(gspca_dev->dev, sensor & 0x0f, 0x0010);
7146                 reg_r(gspca_dev, 0x0010);
7147         }
7148
7149         cam = &gspca_dev->cam;
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
7167         switch (sd->sensor) {
7168         case SENSOR_GC0305:
7169         case SENSOR_OV7620:
7170         case SENSOR_PO2030:
7171                 gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX);
7172                 break;
7173         case SENSOR_HV7131B:
7174         case SENSOR_HV7131C:
7175         case SENSOR_OV7630C:
7176                 gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
7177                 break;
7178         }
7179
7180         /* switch the led off */
7181         reg_w(gspca_dev->dev, 0x01, 0x0000);
7182         return 0;
7183 }
7184
7185 /* this function is called at probe and resume time */
7186 static int sd_init(struct gspca_dev *gspca_dev)
7187 {
7188         reg_w(gspca_dev->dev, 0x01, 0x0000);
7189         return 0;
7190 }
7191
7192 static int sd_start(struct gspca_dev *gspca_dev)
7193 {
7194         struct sd *sd = (struct sd *) gspca_dev;
7195         struct usb_device *dev = gspca_dev->dev;
7196         const struct usb_action *zc3_init;
7197         int mode;
7198         static const struct usb_action *init_tb[SENSOR_MAX][2] = {
7199                 {cs2102_InitialScale, cs2102_Initial},          /* 0 */
7200                 {cs2102K_InitialScale, cs2102K_Initial},        /* 1 */
7201                 {gc0305_Initial, gc0305_InitialScale},          /* 2 */
7202                 {hdcs2020xb_InitialScale, hdcs2020xb_Initial},  /* 3 */
7203                 {hv7131bxx_InitialScale, hv7131bxx_Initial},    /* 4 */
7204                 {hv7131cxx_InitialScale, hv7131cxx_Initial},    /* 5 */
7205                 {icm105axx_InitialScale, icm105axx_Initial},    /* 6 */
7206                 {MC501CB_InitialScale, MC501CB_Initial},        /* 7 */
7207                 {OV7620_mode0, OV7620_mode1},                   /* 8 */
7208                 {ov7630c_InitialScale, ov7630c_Initial},        /* 9 */
7209                 {pas106b_InitialScale, pas106b_Initial},        /* 10 */
7210                 {pas202b_Initial, pas202b_InitialScale},        /* 11 */
7211                 {pb0330xx_InitialScale, pb0330xx_Initial},      /* 12 */
7212 /* or           {pb03303x_InitialScale, pb03303x_Initial}, */
7213                 {PO2030_mode0, PO2030_mode1},                   /* 13 */
7214                 {tas5130CK_InitialScale, tas5130CK_Initial},    /* 14 */
7215                 {tas5130cxx_InitialScale, tas5130cxx_Initial},  /* 15 */
7216                 {tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial},
7217                                                                 /* 16 */
7218         };
7219
7220         mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
7221         zc3_init = init_tb[(int) sd->sensor][mode];
7222         switch (sd->sensor) {
7223         case SENSOR_HV7131C:
7224                 zcxx_probeSensor(gspca_dev);
7225                 break;
7226         case SENSOR_PAS106:
7227                 usb_exchange(gspca_dev, pas106b_Initial_com);
7228                 break;
7229         case SENSOR_PB0330:
7230                 if (mode) {
7231                         if (sd->chip_revision == 0xc001
7232                             || sd->chip_revision == 0xe001
7233                             || sd->chip_revision == 0x8001)
7234                                 zc3_init = pb03303x_Initial;
7235                 } else {
7236                         if (sd->chip_revision == 0xc001
7237                             || sd->chip_revision == 0xe001
7238                             || sd->chip_revision == 0x8001)
7239                                 zc3_init = pb03303x_InitialScale;
7240                 }
7241                 break;
7242         }
7243         usb_exchange(gspca_dev, zc3_init);
7244
7245         switch (sd->sensor) {
7246         case SENSOR_GC0305:
7247         case SENSOR_OV7620:
7248         case SENSOR_PO2030:
7249         case SENSOR_TAS5130C_VF0250:
7250                 msleep(100);                    /* ?? */
7251                 reg_r(gspca_dev, 0x0002);       /* --> 0x40 */
7252                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7253                 reg_w(dev, 0x15, 0x01ae);
7254                 reg_w(dev, 0x0d, 0x003a);
7255                 reg_w(dev, 0x02, 0x003b);
7256                 reg_w(dev, 0x00, 0x0038);
7257                 break;
7258         }
7259
7260         setmatrix(gspca_dev);
7261         setbrightness(gspca_dev);
7262         switch (sd->sensor) {
7263         case SENSOR_OV7620:
7264                 reg_r(gspca_dev, 0x0008);
7265                 reg_w(dev, 0x00, 0x0008);
7266                 break;
7267         case SENSOR_PAS202B:
7268         case SENSOR_GC0305:
7269                 reg_r(gspca_dev, 0x0008);
7270                 /* fall thru */
7271         case SENSOR_PO2030:
7272                 reg_w(dev, 0x03, 0x0008);
7273                 break;
7274         }
7275         setsharpness(gspca_dev);
7276
7277         /* set the gamma tables when not set */
7278         switch (sd->sensor) {
7279         case SENSOR_CS2102:             /* gamma set in xxx_Initial */
7280         case SENSOR_CS2102K:
7281         case SENSOR_HDCS2020b:
7282         case SENSOR_PB0330:             /* pb with chip_revision - see above */
7283         case SENSOR_OV7630C:
7284         case SENSOR_TAS5130CK:
7285                 break;
7286         default:
7287                 setcontrast(gspca_dev);
7288                 break;
7289         }
7290         setmatrix(gspca_dev);                   /* one more time? */
7291         switch (sd->sensor) {
7292         case SENSOR_OV7620:
7293         case SENSOR_PAS202B:
7294                 reg_r(gspca_dev, 0x0180);       /* from win */
7295                 reg_w(dev, 0x00, 0x0180);
7296                 break;
7297         default:
7298                 setquality(gspca_dev);
7299                 break;
7300         }
7301         setlightfreq(gspca_dev);
7302
7303         switch (sd->sensor) {
7304         case SENSOR_GC0305:
7305                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7306                 reg_w(dev, 0x15, 0x01ae);
7307                 /* fall thru */
7308         case SENSOR_PAS202B:
7309         case SENSOR_PO2030:
7310 /*              reg_w(dev, 0x40, ZC3XX_R117_GGAIN);  * (from win traces) */
7311                 reg_r(gspca_dev, 0x0180);
7312                 break;
7313         case SENSOR_OV7620:
7314                 reg_w(dev, 0x09, 0x01ad);
7315                 reg_w(dev, 0x15, 0x01ae);
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);
7320                 reg_r(gspca_dev, 0x0180);
7321                 break;
7322         }
7323
7324         setautogain(gspca_dev);
7325         switch (sd->sensor) {
7326         case SENSOR_PAS202B:
7327                 reg_w(dev, 0x00, 0x0007);       /* (from win traces) */
7328                 break;
7329         case SENSOR_PO2030:
7330                 msleep(500);
7331                 reg_r(gspca_dev, 0x0008);
7332                 reg_r(gspca_dev, 0x0007);
7333                 reg_w(dev, 0x00, 0x0007);       /* (from win traces) */
7334                 reg_w(dev, 0x02, 0x0008);
7335                 break;
7336         }
7337         if (sd->sensor == SENSOR_PAS202B)
7338                 reg_w(dev, 0x02, ZC3XX_R008_CLOCKSETTING);
7339         return 0;
7340 }
7341
7342 /* called on streamoff with alt 0 and on disconnect */
7343 static void sd_stop0(struct gspca_dev *gspca_dev)
7344 {
7345         struct sd *sd = (struct sd *) gspca_dev;
7346
7347         if (!gspca_dev->present)
7348                 return;
7349         send_unknown(gspca_dev->dev, sd->sensor);
7350 }
7351
7352 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
7353                         struct gspca_frame *frame,
7354                         __u8 *data,
7355                         int len)
7356 {
7357
7358         if (data[0] == 0xff && data[1] == 0xd8) {       /* start of frame */
7359                 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
7360                                         data, 0);
7361                 /* put the JPEG header in the new frame */
7362                 jpeg_put_header(gspca_dev, frame,
7363                                 ((struct sd *) gspca_dev)->qindex,
7364                                 0x21);
7365                 /* remove the webcam's header:
7366                  * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
7367                  *      - 'ss ss' is the frame sequence number (BE)
7368                  *      - 'ww ww' and 'hh hh' are the window dimensions (BE)
7369                  *      - 'pp pp' is the packet sequence number (BE)
7370                  */
7371                 data += 18;
7372                 len -= 18;
7373         }
7374         gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
7375 }
7376
7377 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
7378 {
7379         struct sd *sd = (struct sd *) gspca_dev;
7380
7381         sd->brightness = val;
7382         if (gspca_dev->streaming)
7383                 setbrightness(gspca_dev);
7384         return 0;
7385 }
7386
7387 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
7388 {
7389         struct sd *sd = (struct sd *) gspca_dev;
7390
7391         *val = sd->brightness;
7392         return 0;
7393 }
7394
7395 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
7396 {
7397         struct sd *sd = (struct sd *) gspca_dev;
7398
7399         sd->contrast = val;
7400         if (gspca_dev->streaming)
7401                 setcontrast(gspca_dev);
7402         return 0;
7403 }
7404
7405 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
7406 {
7407         struct sd *sd = (struct sd *) gspca_dev;
7408
7409         *val = sd->contrast;
7410         return 0;
7411 }
7412
7413 static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
7414 {
7415         struct sd *sd = (struct sd *) gspca_dev;
7416
7417         sd->autogain = val;
7418         if (gspca_dev->streaming)
7419                 setautogain(gspca_dev);
7420         return 0;
7421 }
7422
7423 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val)
7424 {
7425         struct sd *sd = (struct sd *) gspca_dev;
7426
7427         *val = sd->autogain;
7428         return 0;
7429 }
7430
7431 static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val)
7432 {
7433         struct sd *sd = (struct sd *) gspca_dev;
7434
7435         sd->gamma = val;
7436         if (gspca_dev->streaming)
7437                 setcontrast(gspca_dev);
7438         return 0;
7439 }
7440
7441 static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val)
7442 {
7443         struct sd *sd = (struct sd *) gspca_dev;
7444
7445         *val = sd->gamma;
7446         return 0;
7447 }
7448
7449 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
7450 {
7451         struct sd *sd = (struct sd *) gspca_dev;
7452
7453         sd->lightfreq = val;
7454         if (gspca_dev->streaming)
7455                 setlightfreq(gspca_dev);
7456         return 0;
7457 }
7458
7459 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
7460 {
7461         struct sd *sd = (struct sd *) gspca_dev;
7462
7463         *val = sd->lightfreq;
7464         return 0;
7465 }
7466
7467 static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
7468 {
7469         struct sd *sd = (struct sd *) gspca_dev;
7470
7471         sd->sharpness = val;
7472         if (gspca_dev->streaming)
7473                 setsharpness(gspca_dev);
7474         return 0;
7475 }
7476
7477 static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
7478 {
7479         struct sd *sd = (struct sd *) gspca_dev;
7480
7481         *val = sd->sharpness;
7482         return 0;
7483 }
7484
7485 static int sd_querymenu(struct gspca_dev *gspca_dev,
7486                         struct v4l2_querymenu *menu)
7487 {
7488         switch (menu->id) {
7489         case V4L2_CID_POWER_LINE_FREQUENCY:
7490                 switch (menu->index) {
7491                 case 0:         /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
7492                         strcpy((char *) menu->name, "NoFliker");
7493                         return 0;
7494                 case 1:         /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
7495                         strcpy((char *) menu->name, "50 Hz");
7496                         return 0;
7497                 case 2:         /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
7498                         strcpy((char *) menu->name, "60 Hz");
7499                         return 0;
7500                 }
7501                 break;
7502         }
7503         return -EINVAL;
7504 }
7505
7506 static const struct sd_desc sd_desc = {
7507         .name = MODULE_NAME,
7508         .ctrls = sd_ctrls,
7509         .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
7510         .config = sd_config,
7511         .init = sd_init,
7512         .start = sd_start,
7513         .stop0 = sd_stop0,
7514         .pkt_scan = sd_pkt_scan,
7515         .querymenu = sd_querymenu,
7516 };
7517
7518 static const __devinitdata struct usb_device_id device_table[] = {
7519         {USB_DEVICE(0x041e, 0x041e)},
7520         {USB_DEVICE(0x041e, 0x4017)},
7521         {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
7522         {USB_DEVICE(0x041e, 0x401e)},
7523         {USB_DEVICE(0x041e, 0x401f)},
7524         {USB_DEVICE(0x041e, 0x4022)},
7525         {USB_DEVICE(0x041e, 0x4029)},
7526         {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
7527         {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
7528         {USB_DEVICE(0x041e, 0x4036)},
7529         {USB_DEVICE(0x041e, 0x403a)},
7530         {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250},
7531         {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250},
7532         {USB_DEVICE(0x0458, 0x7007)},
7533         {USB_DEVICE(0x0458, 0x700c)},
7534         {USB_DEVICE(0x0458, 0x700f)},
7535         {USB_DEVICE(0x0461, 0x0a00)},
7536         {USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
7537         {USB_DEVICE(0x046d, 0x08a0)},
7538         {USB_DEVICE(0x046d, 0x08a1)},
7539         {USB_DEVICE(0x046d, 0x08a2)},
7540         {USB_DEVICE(0x046d, 0x08a3)},
7541         {USB_DEVICE(0x046d, 0x08a6)},
7542         {USB_DEVICE(0x046d, 0x08a7)},
7543         {USB_DEVICE(0x046d, 0x08a9)},
7544         {USB_DEVICE(0x046d, 0x08aa)},
7545         {USB_DEVICE(0x046d, 0x08ac)},
7546         {USB_DEVICE(0x046d, 0x08ad)},
7547 #if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
7548         {USB_DEVICE(0x046d, 0x08ae)},
7549 #endif
7550         {USB_DEVICE(0x046d, 0x08af)},
7551         {USB_DEVICE(0x046d, 0x08b9)},
7552         {USB_DEVICE(0x046d, 0x08d7)},
7553         {USB_DEVICE(0x046d, 0x08d9)},
7554         {USB_DEVICE(0x046d, 0x08d8)},
7555         {USB_DEVICE(0x046d, 0x08da)},
7556         {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
7557         {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
7558         {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
7559         {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
7560         {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
7561         {USB_DEVICE(0x055f, 0xc005)},
7562         {USB_DEVICE(0x055f, 0xd003)},
7563         {USB_DEVICE(0x055f, 0xd004)},
7564         {USB_DEVICE(0x0698, 0x2003)},
7565         {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
7566         {USB_DEVICE(0x0ac8, 0x0302)},
7567         {USB_DEVICE(0x0ac8, 0x301b)},
7568 #if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
7569         {USB_DEVICE(0x0ac8, 0x303b)},
7570 #endif
7571         {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250},
7572         {USB_DEVICE(0x0ac8, 0x307b)},
7573         {USB_DEVICE(0x10fd, 0x0128)},
7574         {USB_DEVICE(0x10fd, 0x804d)},
7575         {USB_DEVICE(0x10fd, 0x8050)},
7576         {}                      /* end of entry */
7577 };
7578 #undef DVNAME
7579 MODULE_DEVICE_TABLE(usb, device_table);
7580
7581 /* -- device connect -- */
7582 static int sd_probe(struct usb_interface *intf,
7583                         const struct usb_device_id *id)
7584 {
7585         return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7586                                 THIS_MODULE);
7587 }
7588
7589 /* USB driver */
7590 static struct usb_driver sd_driver = {
7591         .name = MODULE_NAME,
7592         .id_table = device_table,
7593         .probe = sd_probe,
7594         .disconnect = gspca_disconnect,
7595 #ifdef CONFIG_PM
7596         .suspend = gspca_suspend,
7597         .resume = gspca_resume,
7598 #endif
7599 };
7600
7601 static int __init sd_mod_init(void)
7602 {
7603         if (usb_register(&sd_driver) < 0)
7604                 return -1;
7605         PDEBUG(D_PROBE, "registered");
7606         return 0;
7607 }
7608
7609 static void __exit sd_mod_exit(void)
7610 {
7611         usb_deregister(&sd_driver);
7612         PDEBUG(D_PROBE, "deregistered");
7613 }
7614
7615 module_init(sd_mod_init);
7616 module_exit(sd_mod_exit);
7617
7618 module_param(force_sensor, int, 0644);
7619 MODULE_PARM_DESC(force_sensor,
7620         "Force sensor. Only for experts!!!");