Merge branch 'core/debugobjects' of git://git.kernel.org/pub/scm/linux/kernel/git...
[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 #include "jpeg.h"
27
28 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, "
29                 "Serge A. Suchkov <Serge.A.S@tochka.ru>");
30 MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
31 MODULE_LICENSE("GPL");
32
33 static int force_sensor = -1;
34
35 #define QUANT_VAL 1             /* quantization table */
36 #include "zc3xx-reg.h"
37
38 /* specific webcam descriptor */
39 struct sd {
40         struct gspca_dev gspca_dev;     /* !! must be the first item */
41
42         __u8 brightness;
43         __u8 contrast;
44         __u8 gamma;
45         __u8 autogain;
46         __u8 lightfreq;
47         __u8 sharpness;
48         u8 quality;                     /* image quality */
49 #define QUALITY_MIN 40
50 #define QUALITY_MAX 60
51 #define QUALITY_DEF 50
52
53         signed char sensor;             /* Type of image sensor chip */
54 /* !! values used in different tables */
55 #define SENSOR_ADCM2700 0
56 #define SENSOR_CS2102 1
57 #define SENSOR_CS2102K 2
58 #define SENSOR_GC0305 3
59 #define SENSOR_HDCS2020b 4
60 #define SENSOR_HV7131B 5
61 #define SENSOR_HV7131C 6
62 #define SENSOR_ICM105A 7
63 #define SENSOR_MC501CB 8
64 #define SENSOR_OV7620 9
65 /*#define SENSOR_OV7648 9 - same values */
66 #define SENSOR_OV7630C 10
67 #define SENSOR_PAS106 11
68 #define SENSOR_PAS202B 12
69 #define SENSOR_PB0330 13
70 #define SENSOR_PO2030 14
71 #define SENSOR_TAS5130CK 15
72 #define SENSOR_TAS5130CXX 16
73 #define SENSOR_TAS5130C_VF0250 17
74 #define SENSOR_MAX 18
75         unsigned short chip_revision;
76
77         u8 *jpeg_hdr;
78 };
79
80 /* V4L2 controls supported by the driver */
81 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
82 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
83 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
84 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
85 static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
86 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
87 static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val);
88 static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val);
89 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
90 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
91 static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
92 static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
93
94 static struct ctrl sd_ctrls[] = {
95 #define BRIGHTNESS_IDX 0
96 #define SD_BRIGHTNESS 0
97         {
98             {
99                 .id      = V4L2_CID_BRIGHTNESS,
100                 .type    = V4L2_CTRL_TYPE_INTEGER,
101                 .name    = "Brightness",
102                 .minimum = 0,
103                 .maximum = 255,
104                 .step    = 1,
105                 .default_value = 128,
106             },
107             .set = sd_setbrightness,
108             .get = sd_getbrightness,
109         },
110 #define SD_CONTRAST 1
111         {
112             {
113                 .id      = V4L2_CID_CONTRAST,
114                 .type    = V4L2_CTRL_TYPE_INTEGER,
115                 .name    = "Contrast",
116                 .minimum = 0,
117                 .maximum = 256,
118                 .step    = 1,
119                 .default_value = 128,
120             },
121             .set = sd_setcontrast,
122             .get = sd_getcontrast,
123         },
124 #define SD_GAMMA 2
125         {
126             {
127                 .id      = V4L2_CID_GAMMA,
128                 .type    = V4L2_CTRL_TYPE_INTEGER,
129                 .name    = "Gamma",
130                 .minimum = 1,
131                 .maximum = 6,
132                 .step    = 1,
133                 .default_value = 4,
134             },
135             .set = sd_setgamma,
136             .get = sd_getgamma,
137         },
138 #define SD_AUTOGAIN 3
139         {
140             {
141                 .id      = V4L2_CID_AUTOGAIN,
142                 .type    = V4L2_CTRL_TYPE_BOOLEAN,
143                 .name    = "Auto Gain",
144                 .minimum = 0,
145                 .maximum = 1,
146                 .step    = 1,
147                 .default_value = 1,
148             },
149             .set = sd_setautogain,
150             .get = sd_getautogain,
151         },
152 #define LIGHTFREQ_IDX 4
153 #define SD_FREQ 4
154         {
155             {
156                 .id      = V4L2_CID_POWER_LINE_FREQUENCY,
157                 .type    = V4L2_CTRL_TYPE_MENU,
158                 .name    = "Light frequency filter",
159                 .minimum = 0,
160                 .maximum = 2,   /* 0: 0, 1: 50Hz, 2:60Hz */
161                 .step    = 1,
162                 .default_value = 1,
163             },
164             .set = sd_setfreq,
165             .get = sd_getfreq,
166         },
167 #define SD_SHARPNESS 5
168         {
169             {
170                 .id      = V4L2_CID_SHARPNESS,
171                 .type    = V4L2_CTRL_TYPE_INTEGER,
172                 .name    = "Sharpness",
173                 .minimum = 0,
174                 .maximum = 3,
175                 .step    = 1,
176                 .default_value = 2,
177             },
178             .set = sd_setsharpness,
179             .get = sd_getsharpness,
180         },
181 };
182
183 static const struct v4l2_pix_format vga_mode[] = {
184         {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
185                 .bytesperline = 320,
186                 .sizeimage = 320 * 240 * 3 / 8 + 590,
187                 .colorspace = V4L2_COLORSPACE_JPEG,
188                 .priv = 1},
189         {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
190                 .bytesperline = 640,
191                 .sizeimage = 640 * 480 * 3 / 8 + 590,
192                 .colorspace = V4L2_COLORSPACE_JPEG,
193                 .priv = 0},
194 };
195
196 static const struct v4l2_pix_format sif_mode[] = {
197         {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
198                 .bytesperline = 176,
199                 .sizeimage = 176 * 144 * 3 / 8 + 590,
200                 .colorspace = V4L2_COLORSPACE_JPEG,
201                 .priv = 1},
202         {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
203                 .bytesperline = 352,
204                 .sizeimage = 352 * 288 * 3 / 8 + 590,
205                 .colorspace = V4L2_COLORSPACE_JPEG,
206                 .priv = 0},
207 };
208
209 /* usb exchanges */
210 struct usb_action {
211         __u8    req;
212         __u8    val;
213         __u16   idx;
214 };
215
216 static const struct usb_action adcm2700_Initial[] = {
217         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc */
218         {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},           /* 00,02,04,cc */
219         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},          /* 00,08,03,cc */
220         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
221         {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,d3,cc */
222         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
223         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc */
224         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
225         {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,d8,cc */
226         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
227         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
228         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
229         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc */
230         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc */
231         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,00,cc */
232         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc */
233         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,00,cc */
234         {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,de,cc */
235         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,86,cc */
236         {0xbb, 0x00, 0x0400},                           /* 04,00,00,bb */
237         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
238         {0xbb, 0x0f, 0x140f},                           /* 14,0f,0f,bb */
239         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,37,cc */
240         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc */
241         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},             /* 01,89,06,cc */
242         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc */
243         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc */
244         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
245         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc */
246         {0xa0, 0x58, ZC3XX_R116_RGAIN},                 /* 01,16,58,cc */
247         {0xa0, 0x5a, ZC3XX_R118_BGAIN},                 /* 01,18,5a,cc */
248         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,02,cc */
249         {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,d3,cc */
250         {0xbb, 0x00, 0x0408},                           /* 04,00,08,bb */
251         {0xdd, 0x00, 0x0200},                           /* 00,02,00,dd */
252         {0xbb, 0x00, 0x0400},                           /* 04,00,00,bb */
253         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
254         {0xbb, 0x0f, 0x140f},                           /* 14,0f,0f,bb */
255         {0xbb, 0xe0, 0x0c2e},                           /* 0c,e0,2e,bb */
256         {0xbb, 0x01, 0x2000},                           /* 20,01,00,bb */
257         {0xbb, 0x96, 0x2400},                           /* 24,96,00,bb */
258         {0xbb, 0x06, 0x1006},                           /* 10,06,06,bb */
259         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
260         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
261         {0xaa, 0xfe, 0x0002},                           /* 00,fe,02,aa */
262         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
263         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
264         {0xbb, 0x5f, 0x2090},                           /* 20,5f,90,bb */
265         {0xbb, 0x01, 0x8000},                           /* 80,01,00,bb */
266         {0xbb, 0x09, 0x8400},                           /* 84,09,00,bb */
267         {0xbb, 0x86, 0x0002},                           /* 00,86,02,bb */
268         {0xbb, 0xe6, 0x0401},                           /* 04,e6,01,bb */
269         {0xbb, 0x86, 0x0802},                           /* 08,86,02,bb */
270         {0xbb, 0xe6, 0x0c01},                           /* 0c,e6,01,bb */
271         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
272         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
273         {0xaa, 0xfe, 0x0000},                           /* 00,fe,00,aa */
274         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
275         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
276         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
277         {0xaa, 0xfe, 0x0020},                           /* 00,fe,20,aa */
278 /*mswin+*/
279         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
280         {0xaa, 0xfe, 0x0002},
281         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
282         {0xaa, 0xb4, 0xcd37},
283         {0xaa, 0xa4, 0x0004},
284         {0xaa, 0xa8, 0x0007},
285         {0xaa, 0xac, 0x0004},
286 /*mswin-*/
287         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
288         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
289         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
290         {0xaa, 0xfe, 0x0000},                           /* 00,fe,00,aa */
291         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
292         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
293         {0xbb, 0x04, 0x0400},                           /* 04,04,00,bb */
294         {0xdd, 0x00, 0x0100},                           /* 00,01,00,dd */
295         {0xbb, 0x01, 0x0400},                           /* 04,01,00,bb */
296         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
297         {0xaa, 0xfe, 0x0002},                           /* 00,fe,02,aa */
298         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
299         {0xbb, 0x41, 0x2803},                           /* 28,41,03,bb */
300         {0xbb, 0x40, 0x2c03},                           /* 2c,40,03,bb */
301         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
302         {0xaa, 0xfe, 0x0010},                           /* 00,fe,10,aa */
303         {}
304 };
305 static const struct usb_action adcm2700_InitialScale[] = {
306         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc */
307         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},           /* 00,02,10,cc */
308         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},          /* 00,08,03,cc */
309         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
310         {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,d3,cc */
311         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
312         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc */
313         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
314         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,d0,cc */
315         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
316         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
317         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
318         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc */
319         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc */
320         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,00,cc */
321         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc */
322         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,00,cc */
323         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,d8,cc */
324         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,88,cc */
325         {0xbb, 0x00, 0x0400},                           /* 04,00,00,bb */
326         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
327         {0xbb, 0x0f, 0x140f},                           /* 14,0f,0f,bb */
328         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,37,cc */
329         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc */
330         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},             /* 01,89,06,cc */
331         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc */
332         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc */
333         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
334         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc */
335         {0xa0, 0x58, ZC3XX_R116_RGAIN},                 /* 01,16,58,cc */
336         {0xa0, 0x5a, ZC3XX_R118_BGAIN},                 /* 01,18,5a,cc */
337         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,02,cc */
338         {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,d3,cc */
339         {0xbb, 0x00, 0x0408},                           /* 04,00,08,bb */
340         {0xdd, 0x00, 0x0200},                           /* 00,02,00,dd */
341         {0xbb, 0x00, 0x0400},                           /* 04,00,00,bb */
342         {0xdd, 0x00, 0x0050},                           /* 00,00,50,dd */
343         {0xbb, 0x0f, 0x140f},                           /* 14,0f,0f,bb */
344         {0xbb, 0xe0, 0x0c2e},                           /* 0c,e0,2e,bb */
345         {0xbb, 0x01, 0x2000},                           /* 20,01,00,bb */
346         {0xbb, 0x96, 0x2400},                           /* 24,96,00,bb */
347         {0xbb, 0x06, 0x1006},                           /* 10,06,06,bb */
348         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
349         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
350         {0xaa, 0xfe, 0x0002},                           /* 00,fe,02,aa */
351         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
352         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
353         {0xbb, 0x5f, 0x2090},                           /* 20,5f,90,bb */
354         {0xbb, 0x01, 0x8000},                           /* 80,01,00,bb */
355         {0xbb, 0x09, 0x8400},                           /* 84,09,00,bb */
356         {0xbb, 0x86, 0x0002},                           /* 00,88,02,bb */
357         {0xbb, 0xe6, 0x0401},                           /* 04,e6,01,bb */
358         {0xbb, 0x86, 0x0802},                           /* 08,88,02,bb */
359         {0xbb, 0xe6, 0x0c01},                           /* 0c,e6,01,bb */
360         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
361         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
362         {0xaa, 0xfe, 0x0000},                           /* 00,fe,00,aa */
363         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
364         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
365         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
366         {0xaa, 0xfe, 0x0020},                           /* 00,fe,20,aa */
367         /*******/
368         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
369         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
370         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
371         {0xaa, 0xfe, 0x0000},                           /* 00,fe,00,aa */
372         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
373         {0xdd, 0x00, 0x0010},                           /* 00,00,10,dd */
374         {0xbb, 0x04, 0x0400},                           /* 04,04,00,bb */
375         {0xdd, 0x00, 0x0100},                           /* 00,01,00,dd */
376         {0xbb, 0x01, 0x0400},                           /* 04,01,00,bb */
377         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
378         {0xaa, 0xfe, 0x0002},                           /* 00,fe,02,aa */
379         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
380         {0xbb, 0x41, 0x2803},                           /* 28,41,03,bb */
381         {0xbb, 0x40, 0x2c03},                           /* 2c,40,03,bb */
382         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
383         {0xaa, 0xfe, 0x0010},                           /* 00,fe,10,aa */
384         {}
385 };
386 static const struct usb_action adcm2700_50HZ[] = {
387         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
388         {0xaa, 0xfe, 0x0002},                           /* 00,fe,02,aa */
389         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
390         {0xbb, 0x05, 0x8400},                           /* 84,05,00,bb */
391         {0xbb, 0xd0, 0xb007},                           /* b0,d0,07,bb */
392         {0xbb, 0xa0, 0xb80f},                           /* b8,a0,0f,bb */
393         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
394         {0xaa, 0xfe, 0x0010},                           /* 00,fe,10,aa */
395         {0xaa, 0x26, 0x00d0},                           /* 00,26,d0,aa */
396         {0xaa, 0x28, 0x0002},                           /* 00,28,02,aa */
397         {}
398 };
399 static const struct usb_action adcm2700_60HZ[] = {
400         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
401         {0xaa, 0xfe, 0x0002},                           /* 00,fe,02,aa */
402         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
403         {0xbb, 0x07, 0x8400},                           /* 84,07,00,bb */
404         {0xbb, 0x82, 0xb006},                           /* b0,82,06,bb */
405         {0xbb, 0x04, 0xb80d},                           /* b8,04,0d,bb */
406         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
407         {0xaa, 0xfe, 0x0010},                           /* 00,fe,10,aa */
408         {0xaa, 0x26, 0x0057},                           /* 00,26,57,aa */
409         {0xaa, 0x28, 0x0002},                           /* 00,28,02,aa */
410         {}
411 };
412 static const struct usb_action adcm2700_NoFliker[] = {
413         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
414         {0xaa, 0xfe, 0x0002},                           /* 00,fe,02,aa */
415         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0a,cc */
416         {0xbb, 0x07, 0x8400},                           /* 84,07,00,bb */
417         {0xbb, 0x05, 0xb000},                           /* b0,05,00,bb */
418         {0xbb, 0xa0, 0xb801},                           /* b8,a0,01,bb */
419         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
420         {0xaa, 0xfe, 0x0010},                           /* 00,fe,10,aa */
421         {}
422 };
423 static const struct usb_action cs2102_Initial[] = {
424         {0xa1, 0x01, 0x0008},
425         {0xa1, 0x01, 0x0008},
426         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
427         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
428         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
429         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
430         {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
431         {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
432         {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
433         {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
434         {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
435         {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
436         {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
437         {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
438         {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
439         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
440         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
441         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
442         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
443         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
444         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
445         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
446         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
447         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
448         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
449         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
450         {0xaa, 0x02, 0x0008},
451         {0xaa, 0x03, 0x0000},
452         {0xaa, 0x11, 0x0000},
453         {0xaa, 0x12, 0x0089},
454         {0xaa, 0x13, 0x0000},
455         {0xaa, 0x14, 0x00e9},
456         {0xaa, 0x20, 0x0000},
457         {0xaa, 0x22, 0x0000},
458         {0xaa, 0x0b, 0x0004},
459         {0xaa, 0x30, 0x0030},
460         {0xaa, 0x31, 0x0030},
461         {0xaa, 0x32, 0x0030},
462         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
463         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
464         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
465         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
466         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
467         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
468         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
469         {0xa0, 0x10, 0x01ae},
470         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
471         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
472         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
473         {0xa0, 0x00, 0x01ad},
474         {0xa1, 0x01, 0x0002},
475         {0xa1, 0x01, 0x0008},
476         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
477         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
478         {0xa1, 0x01, 0x01c8},
479         {0xa1, 0x01, 0x01c9},
480         {0xa1, 0x01, 0x01ca},
481         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
482         {0xa0, 0x24, ZC3XX_R120_GAMMA00},       /* gamma 5 */
483         {0xa0, 0x44, ZC3XX_R121_GAMMA01},
484         {0xa0, 0x64, ZC3XX_R122_GAMMA02},
485         {0xa0, 0x84, ZC3XX_R123_GAMMA03},
486         {0xa0, 0x9d, ZC3XX_R124_GAMMA04},
487         {0xa0, 0xb2, ZC3XX_R125_GAMMA05},
488         {0xa0, 0xc4, ZC3XX_R126_GAMMA06},
489         {0xa0, 0xd3, ZC3XX_R127_GAMMA07},
490         {0xa0, 0xe0, ZC3XX_R128_GAMMA08},
491         {0xa0, 0xeb, ZC3XX_R129_GAMMA09},
492         {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
493         {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
494         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
495         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
496         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
497         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
498         {0xa0, 0x18, ZC3XX_R130_GAMMA10},
499         {0xa0, 0x20, ZC3XX_R131_GAMMA11},
500         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
501         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
502         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
503         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
504         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
505         {0xa0, 0x0e, ZC3XX_R137_GAMMA17},
506         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
507         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
508         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
509         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
510         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
511         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
512         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
513         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
514         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
515         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
516         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
517         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
518         {0xa0, 0x58, ZC3XX_R10E_RGB11},
519         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
520         {0xa0, 0xf4, ZC3XX_R110_RGB20},
521         {0xa0, 0xf4, ZC3XX_R111_RGB21},
522         {0xa0, 0x58, ZC3XX_R112_RGB22},
523         {0xa1, 0x01, 0x0180},
524         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
525         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
526         {0xaa, 0x23, 0x0001},
527         {0xaa, 0x24, 0x0055},
528         {0xaa, 0x25, 0x00cc},
529         {0xaa, 0x21, 0x003f},
530         {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
531         {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
532         {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
533         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
534         {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
535         {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
536         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
537         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
538         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
539         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
540         {0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
541         {0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
542         {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
543         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
544         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
545         {0xa1, 0x01, 0x0180},
546         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
547         {0xa0, 0x40, ZC3XX_R116_RGAIN},
548         {0xa0, 0x40, ZC3XX_R117_GGAIN},
549         {0xa0, 0x40, ZC3XX_R118_BGAIN},
550         {}
551 };
552
553 static const struct usb_action cs2102_InitialScale[] = {
554         {0xa1, 0x01, 0x0008},
555         {0xa1, 0x01, 0x0008},
556         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
557         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
558         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
559         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
560         {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
561         {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
562         {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
563         {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
564         {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
565         {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
566         {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
567         {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
568         {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
569         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
570         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
571         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
572         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
573         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
574         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
575         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
576         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
577         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
578         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
579         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
580         {0xaa, 0x02, 0x0008},
581         {0xaa, 0x03, 0x0000},
582         {0xaa, 0x11, 0x0001},
583         {0xaa, 0x12, 0x0087},
584         {0xaa, 0x13, 0x0001},
585         {0xaa, 0x14, 0x00e7},
586         {0xaa, 0x20, 0x0000},
587         {0xaa, 0x22, 0x0000},
588         {0xaa, 0x0b, 0x0004},
589         {0xaa, 0x30, 0x0030},
590         {0xaa, 0x31, 0x0030},
591         {0xaa, 0x32, 0x0030},
592         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
593         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
594         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
595         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
596         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
597         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
598         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
599         {0xa0, 0x15, 0x01ae},
600         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
601         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
602         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
603         {0xa0, 0x00, 0x01ad},
604         {0xa1, 0x01, 0x0002},
605         {0xa1, 0x01, 0x0008},
606         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
607         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
608         {0xa1, 0x01, 0x01c8},
609         {0xa1, 0x01, 0x01c9},
610         {0xa1, 0x01, 0x01ca},
611         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
612         {0xa0, 0x24, ZC3XX_R120_GAMMA00},       /* gamma 5 */
613         {0xa0, 0x44, ZC3XX_R121_GAMMA01},
614         {0xa0, 0x64, ZC3XX_R122_GAMMA02},
615         {0xa0, 0x84, ZC3XX_R123_GAMMA03},
616         {0xa0, 0x9d, ZC3XX_R124_GAMMA04},
617         {0xa0, 0xb2, ZC3XX_R125_GAMMA05},
618         {0xa0, 0xc4, ZC3XX_R126_GAMMA06},
619         {0xa0, 0xd3, ZC3XX_R127_GAMMA07},
620         {0xa0, 0xe0, ZC3XX_R128_GAMMA08},
621         {0xa0, 0xeb, ZC3XX_R129_GAMMA09},
622         {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
623         {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
624         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
625         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
626         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
627         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
628         {0xa0, 0x18, ZC3XX_R130_GAMMA10},
629         {0xa0, 0x20, ZC3XX_R131_GAMMA11},
630         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
631         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
632         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
633         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
634         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
635         {0xa0, 0x0e, ZC3XX_R137_GAMMA17},
636         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
637         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
638         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
639         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
640         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
641         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
642         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
643         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
644         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
645         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
646         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
647         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
648         {0xa0, 0x58, ZC3XX_R10E_RGB11},
649         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
650         {0xa0, 0xf4, ZC3XX_R110_RGB20},
651         {0xa0, 0xf4, ZC3XX_R111_RGB21},
652         {0xa0, 0x58, ZC3XX_R112_RGB22},
653         {0xa1, 0x01, 0x0180},
654         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
655         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
656         {0xaa, 0x23, 0x0000},
657         {0xaa, 0x24, 0x00aa},
658         {0xaa, 0x25, 0x00e6},
659         {0xaa, 0x21, 0x003f},
660         {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
661         {0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
662         {0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
663         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
664         {0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
665         {0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
666         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
667         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
668         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
669         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
670         {0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
671         {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
672         {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
673         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
674         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
675         {0xa1, 0x01, 0x0180},
676         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
677         {0xa0, 0x40, ZC3XX_R116_RGAIN},
678         {0xa0, 0x40, ZC3XX_R117_GGAIN},
679         {0xa0, 0x40, ZC3XX_R118_BGAIN},
680         {}
681 };
682 static const struct usb_action cs2102_50HZ[] = {
683         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
684         {0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */
685         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
686         {0xaa, 0x04, 0x00ac}, /* 00,04,ac,aa */
687         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
688         {0xaa, 0x11, 0x00ac}, /* 00,11,ac,aa */
689         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
690         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
691         {0xaa, 0x1d, 0x00ac}, /* 00,1d,ac,aa */
692         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
693         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
694         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
695         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
696         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
697         {0xa0, 0x42, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,42,cc */
698         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
699         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
700         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
701         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
702         {0xa0, 0x8c, ZC3XX_R01D_HSYNC_0}, /* 00,1d,8c,cc */
703         {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
704         {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
705         {}
706 };
707 static const struct usb_action cs2102_50HZScale[] = {
708         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
709         {0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */
710         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
711         {0xaa, 0x04, 0x00a1}, /* 00,04,a1,aa */
712         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
713         {0xaa, 0x11, 0x00a1}, /* 00,11,a1,aa */
714         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
715         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
716         {0xaa, 0x1d, 0x00a1}, /* 00,1d,a1,aa */
717         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
718         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
719         {0xa0, 0xf7, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f7,cc */
720         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
721         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
722         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
723         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
724         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
725         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
726         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
727         {0xa0, 0x93, ZC3XX_R01D_HSYNC_0}, /* 00,1d,93,cc */
728         {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
729         {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
730         {}
731 };
732 static const struct usb_action cs2102_60HZ[] = {
733         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
734         {0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */
735         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
736         {0xaa, 0x04, 0x00aa}, /* 00,04,aa,aa */
737         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
738         {0xaa, 0x11, 0x00aa}, /* 00,11,aa,aa */
739         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
740         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
741         {0xaa, 0x1d, 0x00aa}, /* 00,1d,aa,aa */
742         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
743         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
744         {0xa0, 0xe4, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e4,cc */
745         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
746         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
747         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3a,cc */
748         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
749         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
750         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
751         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
752         {0xa0, 0x5d, ZC3XX_R01D_HSYNC_0}, /* 00,1d,5d,cc */
753         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
754         {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */
755         {}
756 };
757 static const struct usb_action cs2102_60HZScale[] = {
758         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
759         {0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */
760         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
761         {0xaa, 0x04, 0x00be}, /* 00,04,be,aa */
762         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
763         {0xaa, 0x11, 0x00be}, /* 00,11,be,aa */
764         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
765         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
766         {0xaa, 0x1d, 0x00be}, /* 00,1d,be,aa */
767         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
768         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
769         {0xa0, 0xfc, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,fc,cc */
770         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
771         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
772         {0xa0, 0x69, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,69,cc */
773         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
774         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
775         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
776         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
777         {0xa0, 0xb7, ZC3XX_R01D_HSYNC_0}, /* 00,1d,b7,cc */
778         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
779         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
780         {}
781 };
782 static const struct usb_action cs2102_NoFliker[] = {
783         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
784         {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
785         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
786         {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
787         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
788         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
789         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
790         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
791         {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
792         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
793         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
794         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
795         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
796         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
797         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
798         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
799         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
800         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
801         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
802         {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
803         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
804         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
805         {}
806 };
807 static const struct usb_action cs2102_NoFlikerScale[] = {
808         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
809         {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
810         {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
811         {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
812         {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
813         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
814         {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
815         {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
816         {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
817         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
818         {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
819         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
820         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
821         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
822         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
823         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
824         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
825         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
826         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
827         {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
828         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
829         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
830         {}
831 };
832
833 /* CS2102_KOCOM */
834 static const struct usb_action cs2102K_Initial[] = {
835         {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
836         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
837         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
838         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
839         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
840         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
841         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
842         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
843         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
844         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
845         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
846         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
847         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
848         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
849         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
850         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
851         {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
852         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
853         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
854         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
855         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
856         {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
857         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
858         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
859         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
860         {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
861         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
862         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
863         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
864         {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
865         {0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
866         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
867         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
868         {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
869         {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
870         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
871         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
872         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
873         {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
874         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
875         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
876         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
877         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
878         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
879         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
880         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
881         {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
882         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
883         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
884         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
885         {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
886         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
887         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
888         {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
889         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
890         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
891         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
892         {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
893         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
894         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
895         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
896         {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
897         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
898         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
899         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
900         {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
901         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
902         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
903         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
904         {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
905         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
906         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
907         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
908         {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
909         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
910         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
911         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
912         {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
913         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
914         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
915         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
916         {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
917         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
918         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
919         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
920         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
921         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
922         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
923         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
924         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
925         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
926         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
927         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
928         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
929         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
930         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
931         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
932         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
933         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
934         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
935         {0xa0, 0x00, 0x01ad},
936         {0xa0, 0x01, 0x01b1},
937         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
938         {0xa0, 0x60, ZC3XX_R116_RGAIN},
939         {0xa0, 0x40, ZC3XX_R117_GGAIN},
940         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
941         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
942         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
943         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
944         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
945         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
946         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
947         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
948         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
949         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
950         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
951         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
952         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
953         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
954         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
955         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
956         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
957         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
958         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
959         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
960         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
961         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
962         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
963         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
964         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
965         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
966         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
967         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
968         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
969         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
970         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
971         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
972         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
973         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
974         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
975         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
976         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
977         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
978         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
979         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
980         {0xa0, 0x58, ZC3XX_R10E_RGB11},
981         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
982         {0xa0, 0xf4, ZC3XX_R110_RGB20},
983         {0xa0, 0xf4, ZC3XX_R111_RGB21},
984         {0xa0, 0x58, ZC3XX_R112_RGB22},
985         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
986         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
987         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
988         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
989         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
990         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
991         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
992         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
993         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
994         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
995         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
996         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
997         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
998         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
999         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1000         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1001         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1002         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1003         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1004         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1005         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1006         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1007         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1008         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1009         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1010         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1011         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1012         {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1013         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1014         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1015         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1016         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1017         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1018         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1019         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1020         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1021         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1022         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1023         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1024         {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1025         {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1026         {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1027         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1028         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1029         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1030         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1031         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1032         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1033         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1034         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1035         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1036         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1037         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1038         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1039         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1040         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1041         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1042         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1043         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1044         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1045         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1046         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1047         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1048         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1049         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1050         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1051         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1052         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1053         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1054         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1055         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1056         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1057         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1058         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1059         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1060         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1061         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1062         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1063         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1064         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1065         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1066         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1067         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1068         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1069         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1070         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1071         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1072         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1073         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1074         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1075         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1076         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1077         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1078         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1079         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1080         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1081         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1082         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1083         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1084         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1085         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1086         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1087         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1088         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1089         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1090         {}
1091 };
1092
1093 static const struct usb_action cs2102K_InitialScale[] = {
1094         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1095         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1096         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1097         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1098         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1099         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1100         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1101         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1102         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1103         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1104         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1105         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1106         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1107         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1108         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1109         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1110         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1111 /*fixme: next sequence = i2c exchanges*/
1112         {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
1113         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1114         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1115         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1116         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1117         {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
1118         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1119         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1120         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1121         {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
1122         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1123         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1124         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1125         {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
1126         {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
1127         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1128         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1129         {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
1130         {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
1131         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1132         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1133         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
1134         {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
1135         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1136         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1137         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
1138         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1139         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1140         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1141         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
1142         {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
1143         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1144         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1145         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
1146         {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
1147         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1148         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1149         {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
1150         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1151         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1152         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1153         {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
1154         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1155         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1156         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1157         {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
1158         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1159         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1160         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1161         {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
1162         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1163         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1164         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1165         {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
1166         {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1167         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1168         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1169         {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
1170         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1171         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1172         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1173         {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
1174         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1175         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1176         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1177         {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
1178         {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1179         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1180         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1181         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1182         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1183         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1184         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1185         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1186         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1187         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
1188         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1189         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1190         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1191         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1192         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1193         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1194         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1195         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1196         {0xa0, 0x00, 0x01ad},
1197         {0xa0, 0x01, 0x01b1},
1198         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1199         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1200         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1201         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1202         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1203         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1204         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1205         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
1206         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1207         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1208         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1209         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1210         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1211         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1212         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1213         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1214         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1215         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1216         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1217         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1218         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1219         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1220         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1221         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1222         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1223         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1224         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1225         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1226         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1227         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1228         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1229         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1230         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1231         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1232         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1233         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1234         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1235         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1236         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1237         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1238         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1239         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1240         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1241         {0xa0, 0x58, ZC3XX_R10E_RGB11},
1242         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1243         {0xa0, 0xf4, ZC3XX_R110_RGB20},
1244         {0xa0, 0xf4, ZC3XX_R111_RGB21},
1245         {0xa0, 0x58, ZC3XX_R112_RGB22},
1246         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1247         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1248         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1249         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1250         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1251         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1252         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1253         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1254         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1255         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1256         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1257         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1258         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1259         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1260         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1261         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1262         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1263         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1264         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1265         {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1266         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1267         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1268         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1269         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1270         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1271         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1272         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1273         {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1274         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1275         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1276         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1277         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1278         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1279         {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1280         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1281         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1282         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1283         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1284         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1285         {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1286         {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1287         {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1288         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1289         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1290         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1291         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1292         {0xa0, 0x60, ZC3XX_R116_RGAIN},
1293         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1294         {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1295         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1296         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1297         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1298         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1299         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1300         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1301         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1302         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1303         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1304         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1305         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1306         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1307         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1308         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1309         {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1310         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1311         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1312         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1313         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1314         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1315         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1316         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1317         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1318         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1319         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1320         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1321         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1322         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1323         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1324         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1325         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1326         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1327         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1328         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1329         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1330         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1331         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1332         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1333         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1334         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1335         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1336         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1337         {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1338         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1339         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1340         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1341         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1342         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1343         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1344         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1345         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1346         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1347         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1348         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1349         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1350         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1351 /*fixme:what does the next sequence?*/
1352         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1353         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1354         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1355         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1356         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1357         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1358         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1359         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1360         {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1361         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1362         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1363         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1364         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1365         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1366         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1367         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1368         {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1369         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1370         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1371         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1372         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1373         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1374         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1375         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1376         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1377         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1378         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1379         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1380         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
1381         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1382         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1383         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1384         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1385         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1386         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1387         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1388         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1389         {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1390         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1391         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1392         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1393         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1394         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1395         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1396         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1397         {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1398         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1399         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1400         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1401         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1402         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1403         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1404         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1405         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1406         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1407         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1408         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1409         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1410         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1411         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1412         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1413         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1414         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1415         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1416         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1417         {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1418         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1419         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1420         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1421         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1422         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1423         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1424         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1425         {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1426         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1427         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1428         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1429         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1430         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1431         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1432         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1433         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1434         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1435         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1436         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1437         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1438         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1439         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1440         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1441         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1442         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1443         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1444         {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1445         {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1446         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1447         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1448         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1449         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1450         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1451         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1452         {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1453         {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1454         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1455         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1456         {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1457         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1458         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1459         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1460         {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1461         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1462         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1463         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1464         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1465         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1466         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1467         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1468         {}
1469 };
1470
1471 static const struct usb_action gc0305_Initial[] = {     /* 640x480 */
1472         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1473         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,03,cc */
1474         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
1475         {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},   /* 00,02,04,cc */
1476         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
1477         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1478         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
1479         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc */
1480         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
1481         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
1482         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
1483         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
1484         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
1485         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
1486         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
1487         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e6,cc */
1488         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,86,cc */
1489         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
1490         {0xaa, 0x13, 0x0002},   /* 00,13,02,aa */
1491         {0xaa, 0x15, 0x0003},   /* 00,15,03,aa */
1492         {0xaa, 0x01, 0x0000},   /* 00,01,00,aa */
1493         {0xaa, 0x02, 0x0000},   /* 00,02,00,aa */
1494         {0xaa, 0x1a, 0x0000},   /* 00,1a,00,aa */
1495         {0xaa, 0x1c, 0x0017},   /* 00,1c,17,aa */
1496         {0xaa, 0x1d, 0x0080},   /* 00,1d,80,aa */
1497         {0xaa, 0x1f, 0x0008},   /* 00,1f,08,aa */
1498         {0xaa, 0x21, 0x0012},   /* 00,21,12,aa */
1499         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc */
1500         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc */
1501         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc */
1502         {0xaa, 0x05, 0x0000},   /* 00,05,00,aa */
1503         {0xaa, 0x0a, 0x0000},   /* 00,0a,00,aa */
1504         {0xaa, 0x0b, 0x00b0},   /* 00,0b,b0,aa */
1505         {0xaa, 0x0c, 0x0000},   /* 00,0c,00,aa */
1506         {0xaa, 0x0d, 0x00b0},   /* 00,0d,b0,aa */
1507         {0xaa, 0x0e, 0x0000},   /* 00,0e,00,aa */
1508         {0xaa, 0x0f, 0x00b0},   /* 00,0f,b0,aa */
1509         {0xaa, 0x10, 0x0000},   /* 00,10,00,aa */
1510         {0xaa, 0x11, 0x00b0},   /* 00,11,b0,aa */
1511         {0xaa, 0x16, 0x0001},   /* 00,16,01,aa */
1512         {0xaa, 0x17, 0x00e6},   /* 00,17,e6,aa */
1513         {0xaa, 0x18, 0x0002},   /* 00,18,02,aa */
1514         {0xaa, 0x19, 0x0086},   /* 00,19,86,aa */
1515         {0xaa, 0x20, 0x0000},   /* 00,20,00,aa */
1516         {0xaa, 0x1b, 0x0020},   /* 00,1b,20,aa */
1517         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc */
1518         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc */
1519         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1520         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},     /* 01,89,76,cc */
1521         {0xa0, 0x09, 0x01ad},   /* 01,ad,09,cc */
1522         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1523         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
1524         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
1525         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
1526         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,60,cc */
1527         {0xa0, 0x85, ZC3XX_R18D_YTARGET},       /* 01,8d,85,cc */
1528         {0xa0, 0x00, 0x011e},   /* 01,1e,00,cc */
1529         {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1530         {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1531         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1532         {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
1533         {}
1534 };
1535 static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
1536         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1537         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,03,cc */
1538         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc */
1539         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},   /* 00,02,10,cc */
1540         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
1541         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1542         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
1543         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc */
1544         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
1545         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
1546         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
1547         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
1548         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
1549         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
1550         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
1551         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e8,cc */
1552         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,88,cc */
1553         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
1554         {0xaa, 0x13, 0x0000},   /* 00,13,00,aa */
1555         {0xaa, 0x15, 0x0001},   /* 00,15,01,aa */
1556         {0xaa, 0x01, 0x0000},   /* 00,01,00,aa */
1557         {0xaa, 0x02, 0x0000},   /* 00,02,00,aa */
1558         {0xaa, 0x1a, 0x0000},   /* 00,1a,00,aa */
1559         {0xaa, 0x1c, 0x0017},   /* 00,1c,17,aa */
1560         {0xaa, 0x1d, 0x0080},   /* 00,1d,80,aa */
1561         {0xaa, 0x1f, 0x0008},   /* 00,1f,08,aa */
1562         {0xaa, 0x21, 0x0012},   /* 00,21,12,aa */
1563         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc */
1564         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc */
1565         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc */
1566         {0xaa, 0x05, 0x0000},   /* 00,05,00,aa */
1567         {0xaa, 0x0a, 0x0000},   /* 00,0a,00,aa */
1568         {0xaa, 0x0b, 0x00b0},   /* 00,0b,b0,aa */
1569         {0xaa, 0x0c, 0x0000},   /* 00,0c,00,aa */
1570         {0xaa, 0x0d, 0x00b0},   /* 00,0d,b0,aa */
1571         {0xaa, 0x0e, 0x0000},   /* 00,0e,00,aa */
1572         {0xaa, 0x0f, 0x00b0},   /* 00,0f,b0,aa */
1573         {0xaa, 0x10, 0x0000},   /* 00,10,00,aa */
1574         {0xaa, 0x11, 0x00b0},   /* 00,11,b0,aa */
1575         {0xaa, 0x16, 0x0001},   /* 00,16,01,aa */
1576         {0xaa, 0x17, 0x00e8},   /* 00,17,e8,aa */
1577         {0xaa, 0x18, 0x0002},   /* 00,18,02,aa */
1578         {0xaa, 0x19, 0x0088},   /* 00,19,88,aa */
1579         {0xaa, 0x20, 0x0000},   /* 00,20,00,aa */
1580         {0xaa, 0x1b, 0x0020},   /* 00,1b,20,aa */
1581         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc */
1582         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc */
1583         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1584         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},     /* 01,89,76,cc */
1585         {0xa0, 0x09, 0x01ad},   /* 01,ad,09,cc */
1586         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1587         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
1588         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
1589         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
1590         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,60,cc */
1591         {0xa0, 0x00, 0x011e},   /* 01,1e,00,cc */
1592         {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1593         {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1594         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1595         {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
1596         {}
1597 };
1598 static const struct usb_action gc0305_50HZ[] = {
1599         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1600         {0xaa, 0x83, 0x0002},   /* 00,83,02,aa */
1601         {0xaa, 0x84, 0x0038},   /* 00,84,38,aa */       /* win: 00,84,ec */
1602         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1603         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc */
1604         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,18,cc */
1605                                                         /* win: 01,92,10 */
1606         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1607         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1608         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,8e,cc */
1609                                                         /* win: 01,97,ec */
1610         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1611         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1612         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc */
1613         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
1614         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1615         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1616         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1617         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1618         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1619         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
1620 /*      {0xa0, 0x85, ZC3XX_R18D_YTARGET},        * 01,8d,85,cc *
1621                                                  * if 640x480 */
1622         {}
1623 };
1624 static const struct usb_action gc0305_60HZ[] = {
1625         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1626         {0xaa, 0x83, 0x0000},   /* 00,83,00,aa */
1627         {0xaa, 0x84, 0x00ec},   /* 00,84,ec,aa */
1628         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1629         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc */
1630         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,10,cc */
1631         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1632         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1633         {0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,ec,cc */
1634         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1635         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1636         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc */
1637         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
1638         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1639         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1640         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1641         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1642         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1643         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
1644         {0xa0, 0x80, ZC3XX_R18D_YTARGET},       /* 01,8d,80,cc */
1645         {}
1646 };
1647
1648 static const struct usb_action gc0305_NoFliker[] = {
1649         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
1650         {0xaa, 0x82, 0x0000},   /* 00,82,00,aa */
1651         {0xaa, 0x83, 0x0000},   /* 00,83,00,aa */
1652         {0xaa, 0x84, 0x0020},   /* 00,84,20,aa */
1653         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
1654         {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,00,cc */
1655         {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,48,cc */
1656         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
1657         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
1658         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc */
1659         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0e,cc */
1660         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,15,cc */
1661         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},       /* 00,1d,62,cc */
1662         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},       /* 00,1e,90,cc */
1663         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},       /* 00,1f,c8,cc */
1664         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},       /* 00,20,ff,cc */
1665         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,60,cc */
1666         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
1667         {0xa0, 0x80, ZC3XX_R18D_YTARGET},       /* 01,8d,80,cc */
1668         {}
1669 };
1670
1671 static const struct usb_action hdcs2020xb_Initial[] = {
1672         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1673         {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1674         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* qtable 0x05 */
1675         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1676         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1677         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1678         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1679         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1680         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1681         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1682         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1683         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1684         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1685         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1686         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1687         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1688         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1689         {0xaa, 0x1c, 0x0000},
1690         {0xaa, 0x0a, 0x0001},
1691         {0xaa, 0x0b, 0x0006},
1692         {0xaa, 0x0c, 0x007b},
1693         {0xaa, 0x0d, 0x00a7},
1694         {0xaa, 0x03, 0x00fb},
1695         {0xaa, 0x05, 0x0000},
1696         {0xaa, 0x06, 0x0003},
1697         {0xaa, 0x09, 0x0008},
1698
1699         {0xaa, 0x0f, 0x0018},   /* set sensor gain */
1700         {0xaa, 0x10, 0x0018},
1701         {0xaa, 0x11, 0x0018},
1702         {0xaa, 0x12, 0x0018},
1703
1704         {0xaa, 0x15, 0x004e},
1705         {0xaa, 0x1c, 0x0004},
1706         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1707         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1708         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1709         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1710         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1711         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1712         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1713         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1714         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1715         {0xa1, 0x01, 0x0002},
1716         {0xa1, 0x01, 0x0008},
1717         {0xa1, 0x01, 0x0180},
1718         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1719         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1720         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1721         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1722         {0xa1, 0x01, 0x0008},
1723         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1724         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1725         {0xa1, 0x01, 0x01c8},
1726         {0xa1, 0x01, 0x01c9},
1727         {0xa1, 0x01, 0x01ca},
1728         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1729         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
1730         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1731         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1732         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1733         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1734         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1735         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1736         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1737         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1738         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1739         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1740         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1741         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1742         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1743         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1744         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1745         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1746         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1747         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1748         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1749         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1750         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1751         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1752         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1753         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1754         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1755         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1756         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1757         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1758         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1759         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1760         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1761
1762         {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1763         {0xa0, 0xed, ZC3XX_R10B_RGB01},
1764         {0xa0, 0xed, ZC3XX_R10C_RGB02},
1765         {0xa0, 0xed, ZC3XX_R10D_RGB10},
1766         {0xa0, 0x66, ZC3XX_R10E_RGB11},
1767         {0xa0, 0xed, ZC3XX_R10F_RGB12},
1768         {0xa0, 0xed, ZC3XX_R110_RGB20},
1769         {0xa0, 0xed, ZC3XX_R111_RGB21},
1770         {0xa0, 0x66, ZC3XX_R112_RGB22},
1771
1772         {0xa1, 0x01, 0x0180},
1773         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1774         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1775         {0xaa, 0x13, 0x0031},
1776         {0xaa, 0x14, 0x0001},
1777         {0xaa, 0x0e, 0x0004},
1778         {0xaa, 0x19, 0x00cd},
1779         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1780         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1781         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1782         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1783         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1784         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1785         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1786         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1787
1788         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 0x14 */
1789         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1790         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1791         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1792         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1793         {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1794         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1795         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1796         {0xa1, 0x01, 0x0180},
1797         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1798         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1799         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1800         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1801         {}
1802 };
1803 static const struct usb_action hdcs2020xb_InitialScale[] = {
1804         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1805         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1806         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1807         {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1808         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1809         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1810         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1811         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1812         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1813         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1814         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1815         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1816         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1817         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1818         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1819         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1820         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1821         {0xaa, 0x1c, 0x0000},
1822         {0xaa, 0x0a, 0x0001},
1823         {0xaa, 0x0b, 0x0006},
1824         {0xaa, 0x0c, 0x007a},
1825         {0xaa, 0x0d, 0x00a7},
1826         {0xaa, 0x03, 0x00fb},
1827         {0xaa, 0x05, 0x0000},
1828         {0xaa, 0x06, 0x0003},
1829         {0xaa, 0x09, 0x0008},
1830         {0xaa, 0x0f, 0x0018},   /* original setting */
1831         {0xaa, 0x10, 0x0018},
1832         {0xaa, 0x11, 0x0018},
1833         {0xaa, 0x12, 0x0018},
1834         {0xaa, 0x15, 0x004e},
1835         {0xaa, 0x1c, 0x0004},
1836         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1837         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1838         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1839         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1840         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1841         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1842         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1843         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1844         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1845         {0xa1, 0x01, 0x0002},
1846         {0xa1, 0x01, 0x0008},
1847         {0xa1, 0x01, 0x0180},
1848         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1849         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1850         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1851         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1852         {0xa1, 0x01, 0x0008},
1853         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
1854         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
1855         {0xa1, 0x01, 0x01c8},
1856         {0xa1, 0x01, 0x01c9},
1857         {0xa1, 0x01, 0x01ca},
1858         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
1859         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
1860         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1861         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1862         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1863         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1864         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1865         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1866         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1867         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1868         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1869         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1870         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1871         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1872         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1873         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1874         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1875         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1876         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1877         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1878         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1879         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1880         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1881         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1882         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1883         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1884         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1885         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1886         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1887         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1888         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1889         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1890         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1891         {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1892         {0xa0, 0xed, ZC3XX_R10B_RGB01},
1893         {0xa0, 0xed, ZC3XX_R10C_RGB02},
1894         {0xa0, 0xed, ZC3XX_R10D_RGB10},
1895         {0xa0, 0x66, ZC3XX_R10E_RGB11},
1896         {0xa0, 0xed, ZC3XX_R10F_RGB12},
1897         {0xa0, 0xed, ZC3XX_R110_RGB20},
1898         {0xa0, 0xed, ZC3XX_R111_RGB21},
1899         {0xa0, 0x66, ZC3XX_R112_RGB22},
1900         {0xa1, 0x01, 0x0180},
1901         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1902         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1903  /**** set exposure ***/
1904         {0xaa, 0x13, 0x0031},
1905         {0xaa, 0x14, 0x0001},
1906         {0xaa, 0x0e, 0x0004},
1907         {0xaa, 0x19, 0x00cd},
1908         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1909         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1910         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1911         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1912         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1913         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1914         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1915         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1916         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1917         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1918         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1919         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1920         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1921         {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1922         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1923         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1924         {0xa1, 0x01, 0x0180},
1925         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1926         {0xa0, 0x40, ZC3XX_R116_RGAIN},
1927         {0xa0, 0x40, ZC3XX_R117_GGAIN},
1928         {0xa0, 0x40, ZC3XX_R118_BGAIN},
1929         {}
1930 };
1931 static const struct usb_action hdcs2020b_50HZ[] = {
1932         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1933         {0xaa, 0x13, 0x0018},                   /* 00,13,18,aa */
1934         {0xaa, 0x14, 0x0001},                   /* 00,14,01,aa */
1935         {0xaa, 0x0e, 0x0005},                   /* 00,0e,05,aa */
1936         {0xaa, 0x19, 0x001f},                   /* 00,19,1f,aa */
1937         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1938         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1939         {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
1940         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1941         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1942         {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
1943         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1944         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1945         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1946         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1947         {0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
1948         {0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
1949         {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
1950         {}
1951 };
1952 static const struct usb_action hdcs2020b_60HZ[] = {
1953         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1954         {0xaa, 0x13, 0x0031},                   /* 00,13,31,aa */
1955         {0xaa, 0x14, 0x0001},                   /* 00,14,01,aa */
1956         {0xaa, 0x0e, 0x0004},                   /* 00,0e,04,aa */
1957         {0xaa, 0x19, 0x00cd},                   /* 00,19,cd,aa */
1958         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1959         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1960         {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
1961         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1962         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1963         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
1964         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1965         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1966         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1967         {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1968         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1969         {0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
1970         {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
1971         {}
1972 };
1973 static const struct usb_action hdcs2020b_NoFliker[] = {
1974         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1975         {0xaa, 0x13, 0x0010},                   /* 00,13,10,aa */
1976         {0xaa, 0x14, 0x0001},                   /* 00,14,01,aa */
1977         {0xaa, 0x0e, 0x0004},                   /* 00,0e,04,aa */
1978         {0xaa, 0x19, 0x0000},                   /* 00,19,00,aa */
1979         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1980         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1981         {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
1982         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1983         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1984         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1985         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1986         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1987         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
1988         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
1989         {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1990         {0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
1991         {0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
1992         {}
1993 };
1994
1995 static const struct usb_action hv7131bxx_Initial[] = {          /* 320x240 */
1996         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1997         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1998         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1999         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2000         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2001         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
2002         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2003         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2004         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2005         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2006         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2007         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2008         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2009         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2010         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2011         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2012         {0xaa, 0x30, 0x002d},
2013         {0xaa, 0x01, 0x0005},
2014         {0xaa, 0x11, 0x0000},
2015         {0xaa, 0x13, 0x0001},   /* {0xaa, 0x13, 0x0000}, */
2016         {0xaa, 0x14, 0x0001},
2017         {0xaa, 0x15, 0x00e8},
2018         {0xaa, 0x16, 0x0002},
2019         {0xaa, 0x17, 0x0086},           /* 00,17,88,aa */
2020         {0xaa, 0x31, 0x0038},
2021         {0xaa, 0x32, 0x0038},
2022         {0xaa, 0x33, 0x0038},
2023         {0xaa, 0x5b, 0x0001},
2024         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2025         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2026         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2027         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
2028         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2029         {0xa0, 0x00, 0x01ad},
2030         {0xa0, 0xc0, 0x019b},
2031         {0xa0, 0xa0, 0x019c},
2032         {0xa0, 0x02, ZC3XX_R188_MINGAIN},
2033         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2034         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2035         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2036         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2037         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2038         {0xaa, 0x02, 0x0090},                   /* 00,02,80,aa */
2039         {}
2040 };
2041
2042 static const struct usb_action hv7131bxx_InitialScale[] = {     /* 640x480*/
2043         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2044         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2045         {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
2046         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2047         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2048         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
2049         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2050         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2051         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2052         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2053         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2054         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2055         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2056         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2057         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2058         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2059         {0xaa, 0x30, 0x002d},
2060         {0xaa, 0x01, 0x0005},
2061         {0xaa, 0x11, 0x0001},
2062         {0xaa, 0x13, 0x0000},   /* {0xaa, 0x13, 0x0001}; */
2063         {0xaa, 0x14, 0x0001},
2064         {0xaa, 0x15, 0x00e6},
2065         {0xaa, 0x16, 0x0002},
2066         {0xaa, 0x17, 0x0086},
2067         {0xaa, 0x31, 0x0038},
2068         {0xaa, 0x32, 0x0038},
2069         {0xaa, 0x33, 0x0038},
2070         {0xaa, 0x5b, 0x0001},
2071         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2072         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2073         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2074         {0xa0, 0x70, ZC3XX_R18D_YTARGET},
2075         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2076         {0xa0, 0x00, 0x01ad},
2077         {0xa0, 0xc0, 0x019b},
2078         {0xa0, 0xa0, 0x019c},
2079         {0xa0, 0x02, ZC3XX_R188_MINGAIN},
2080         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2081         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2082         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2083         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2084         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2085         {0xaa, 0x02, 0x0090},   /* {0xaa, 0x02, 0x0080}, */
2086         {}
2087 };
2088 static const struct usb_action hv7131b_50HZ[] = {       /* 640x480*/
2089         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2090         {0xaa, 0x25, 0x0007},                   /* 00,25,07,aa */
2091         {0xaa, 0x26, 0x0053},                   /* 00,26,53,aa */
2092         {0xaa, 0x27, 0x0000},                   /* 00,27,00,aa */
2093         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2094         {0xaa, 0x21, 0x0050},                   /* 00,21,50,aa */
2095         {0xaa, 0x22, 0x001b},                   /* 00,22,1b,aa */
2096         {0xaa, 0x23, 0x00fc},                   /* 00,23,fc,aa */
2097         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2098         {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,9b,cc */
2099         {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,80,cc */
2100         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
2101         {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,ea,cc */
2102         {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,60,cc */
2103         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0c,cc */
2104         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,18,cc */
2105         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,18,cc */
2106         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
2107         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2108         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},       /* 00,1e,50,cc */
2109         {0xa0, 0x1b, ZC3XX_R01F_HSYNC_2},       /* 00,1f,1b,cc */
2110         {0xa0, 0xfc, ZC3XX_R020_HSYNC_3},       /* 00,20,fc,cc */
2111         {}
2112 };
2113 static const struct usb_action hv7131b_50HZScale[] = {  /* 320x240 */
2114         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2115         {0xaa, 0x25, 0x0007},                   /* 00,25,07,aa */
2116         {0xaa, 0x26, 0x0053},                   /* 00,26,53,aa */
2117         {0xaa, 0x27, 0x0000},                   /* 00,27,00,aa */
2118         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2119         {0xaa, 0x21, 0x0050},                   /* 00,21,50,aa */
2120         {0xaa, 0x22, 0x0012},                   /* 00,22,12,aa */
2121         {0xaa, 0x23, 0x0080},                   /* 00,23,80,aa */
2122         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2123         {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,9b,cc */
2124         {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,80,cc */
2125         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,01,cc */
2126         {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,d4,cc */
2127         {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,c0,cc */
2128         {0xa0, 0x07, ZC3XX_R18C_AEFREEZE},      /* 01,8c,07,cc */
2129         {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,0f,cc */
2130         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,18,cc */
2131         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
2132         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2133         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},       /* 00,1e,50,cc */
2134         {0xa0, 0x12, ZC3XX_R01F_HSYNC_2},       /* 00,1f,12,cc */
2135         {0xa0, 0x80, ZC3XX_R020_HSYNC_3},       /* 00,20,80,cc */
2136         {}
2137 };
2138 static const struct usb_action hv7131b_60HZ[] = {       /* 640x480*/
2139         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2140         {0xaa, 0x25, 0x0007},                   /* 00,25,07,aa */
2141         {0xaa, 0x26, 0x00a1},                   /* 00,26,a1,aa */
2142         {0xaa, 0x27, 0x0020},                   /* 00,27,20,aa */
2143         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2144         {0xaa, 0x21, 0x0040},                   /* 00,21,40,aa */
2145         {0xaa, 0x22, 0x0013},                   /* 00,22,13,aa */
2146         {0xaa, 0x23, 0x004c},                   /* 00,23,4c,aa */
2147         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2148         {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,4d,cc */
2149         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,60,cc */
2150         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
2151         {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,c3,cc */
2152         {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,50,cc */
2153         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},      /* 01,8c,0c,cc */
2154         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,18,cc */
2155         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,18,cc */
2156         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
2157         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2158         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},       /* 00,1e,40,cc */
2159         {0xa0, 0x13, ZC3XX_R01F_HSYNC_2},       /* 00,1f,13,cc */
2160         {0xa0, 0x4c, ZC3XX_R020_HSYNC_3},       /* 00,20,4c,cc */
2161         {}
2162 };
2163 static const struct usb_action hv7131b_60HZScale[] = {  /* 320x240 */
2164         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2165         {0xaa, 0x25, 0x0007},                   /* 00,25,07,aa */
2166         {0xaa, 0x26, 0x00a1},                   /* 00,26,a1,aa */
2167         {0xaa, 0x27, 0x0020},                   /* 00,27,20,aa */
2168         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2169         {0xaa, 0x21, 0x00a0},                   /* 00,21,a0,aa */
2170         {0xaa, 0x22, 0x0016},                   /* 00,22,16,aa */
2171         {0xaa, 0x23, 0x0040},                   /* 00,23,40,aa */
2172         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2173         {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,4d,cc */
2174         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,60,cc */
2175         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,01,cc */
2176         {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,86,cc */
2177         {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,a0,cc */
2178         {0xa0, 0x07, ZC3XX_R18C_AEFREEZE},      /* 01,8c,07,cc */
2179         {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,0f,cc */
2180         {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,18,cc */
2181         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
2182         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2183         {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},       /* 00,1e,a0,cc */
2184         {0xa0, 0x16, ZC3XX_R01F_HSYNC_2},       /* 00,1f,16,cc */
2185         {0xa0, 0x40, ZC3XX_R020_HSYNC_3},       /* 00,20,40,cc */
2186         {}
2187 };
2188 static const struct usb_action hv7131b_NoFliker[] = {   /* 640x480*/
2189         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2190         {0xaa, 0x25, 0x0003},                   /* 00,25,03,aa */
2191         {0xaa, 0x26, 0x0000},                   /* 00,26,00,aa */
2192         {0xaa, 0x27, 0x0000},                   /* 00,27,00,aa */
2193         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2194         {0xaa, 0x21, 0x0010},                   /* 00,21,10,aa */
2195         {0xaa, 0x22, 0x0000},                   /* 00,22,00,aa */
2196         {0xaa, 0x23, 0x0003},                   /* 00,23,03,aa */
2197         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2198         {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,f8,cc */
2199         {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,00,cc */
2200         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
2201         {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,02,cc */
2202         {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,00,cc */
2203         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
2204         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
2205         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,00,cc */
2206         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,00,cc */
2207         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2208         {0xa0, 0x10, ZC3XX_R01E_HSYNC_1},       /* 00,1e,10,cc */
2209         {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},       /* 00,1f,00,cc */
2210         {0xa0, 0x03, ZC3XX_R020_HSYNC_3},       /* 00,20,03,cc */
2211         {}
2212 };
2213 static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
2214         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2215         {0xaa, 0x25, 0x0003},                   /* 00,25,03,aa */
2216         {0xaa, 0x26, 0x0000},                   /* 00,26,00,aa */
2217         {0xaa, 0x27, 0x0000},                   /* 00,27,00,aa */
2218         {0xaa, 0x20, 0x0000},                   /* 00,20,00,aa */
2219         {0xaa, 0x21, 0x00a0},                   /* 00,21,a0,aa */
2220         {0xaa, 0x22, 0x0016},                   /* 00,22,16,aa */
2221         {0xaa, 0x23, 0x0040},                   /* 00,23,40,aa */
2222         {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,2f,cc */
2223         {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,f8,cc */
2224         {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,00,cc */
2225         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
2226         {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,02,cc */
2227         {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,00,cc */
2228         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
2229         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
2230         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,00,cc */
2231         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,00,cc */
2232         {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},       /* 00,1d,00,cc */
2233         {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},       /* 00,1e,a0,cc */
2234         {0xa0, 0x16, ZC3XX_R01F_HSYNC_2},       /* 00,1f,16,cc */
2235         {0xa0, 0x40, ZC3XX_R020_HSYNC_3},       /* 00,20,40,cc */
2236         {}
2237 };
2238
2239 static const struct usb_action hv7131cxx_Initial[] = {
2240         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2241         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2242         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2243         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2244         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2245         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2246         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2247         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2248         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2249         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2250         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2251         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2252         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2253         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2254         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2255         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2256         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2257         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2258         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2259         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2260         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2261         {0xaa, 0x01, 0x000c},
2262         {0xaa, 0x11, 0x0000},
2263         {0xaa, 0x13, 0x0000},
2264         {0xaa, 0x14, 0x0001},
2265         {0xaa, 0x15, 0x00e8},
2266         {0xaa, 0x16, 0x0002},
2267         {0xaa, 0x17, 0x0088},
2268
2269         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2270         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2271         {0xa0, 0x89, ZC3XX_R18D_YTARGET},
2272         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2273         {0xa0, 0x00, 0x01ad},
2274         {0xa0, 0xc0, 0x019b},
2275         {0xa0, 0xa0, 0x019c},
2276         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2277         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2278         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2279         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2280         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2281         {0xa1, 0x01, 0x0002},
2282         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2283         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2284         {0xa1, 0x01, 0x0091},
2285         {0xa1, 0x01, 0x0095},
2286         {0xa1, 0x01, 0x0096},
2287
2288         {0xa1, 0x01, 0x0008},
2289         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2290         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2291         {0xa1, 0x01, 0x01c8},
2292         {0xa1, 0x01, 0x01c9},
2293         {0xa1, 0x01, 0x01ca},
2294         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2295
2296         {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
2297         {0xa0, 0xf0, ZC3XX_R10B_RGB01},
2298         {0xa0, 0xf0, ZC3XX_R10C_RGB02},
2299         {0xa0, 0xf0, ZC3XX_R10D_RGB10},
2300         {0xa0, 0x60, ZC3XX_R10E_RGB11},
2301         {0xa0, 0xf0, ZC3XX_R10F_RGB12},
2302         {0xa0, 0xf0, ZC3XX_R110_RGB20},
2303         {0xa0, 0xf0, ZC3XX_R111_RGB21},
2304         {0xa0, 0x60, ZC3XX_R112_RGB22},
2305         {0xa1, 0x01, 0x0180},
2306         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2307         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2308         {0xaa, 0x25, 0x0007},
2309         {0xaa, 0x26, 0x0053},
2310         {0xaa, 0x27, 0x0000},
2311
2312         {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 2f */
2313         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 9b */
2314         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 80 */
2315         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2316         {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2317         {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2318         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2319         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2320         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2321         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2322         {0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
2323         {0xa1, 0x01, 0x001d},
2324         {0xa1, 0x01, 0x001e},
2325         {0xa1, 0x01, 0x001f},
2326         {0xa1, 0x01, 0x0020},
2327         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2328         {0xa1, 0x01, 0x0180},
2329         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2330         {}
2331 };
2332
2333 static const struct usb_action hv7131cxx_InitialScale[] = {
2334         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2335
2336         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* diff */
2337         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2338         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2339         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2340         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2341
2342         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2343         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2344
2345         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2346         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2347         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2348         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 1e0 */
2349
2350         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2351         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2352         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2353         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2354         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2355         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2356         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2357         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2358         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2359         {0xaa, 0x01, 0x000c},
2360         {0xaa, 0x11, 0x0000},
2361         {0xaa, 0x13, 0x0000},
2362         {0xaa, 0x14, 0x0001},
2363         {0xaa, 0x15, 0x00e8},
2364         {0xaa, 0x16, 0x0002},
2365         {0xaa, 0x17, 0x0088},
2366
2367         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00 */
2368
2369         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2370         {0xa0, 0x89, ZC3XX_R18D_YTARGET},
2371         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2372         {0xa0, 0x00, 0x01ad},
2373         {0xa0, 0xc0, 0x019b},
2374         {0xa0, 0xa0, 0x019c},
2375         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2376         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2377         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2378         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2379         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2380         {0xa1, 0x01, 0x0002},
2381         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2382                                                 /* read the i2c chips ident */
2383         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2384         {0xa1, 0x01, 0x0091},
2385         {0xa1, 0x01, 0x0095},
2386         {0xa1, 0x01, 0x0096},
2387
2388         {0xa1, 0x01, 0x0008},
2389         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2390         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2391         {0xa1, 0x01, 0x01c8},
2392         {0xa1, 0x01, 0x01c9},
2393         {0xa1, 0x01, 0x01ca},
2394         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2395
2396         {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
2397         {0xa0, 0xf0, ZC3XX_R10B_RGB01},
2398         {0xa0, 0xf0, ZC3XX_R10C_RGB02},
2399         {0xa0, 0xf0, ZC3XX_R10D_RGB10},
2400         {0xa0, 0x60, ZC3XX_R10E_RGB11},
2401         {0xa0, 0xf0, ZC3XX_R10F_RGB12},
2402         {0xa0, 0xf0, ZC3XX_R110_RGB20},
2403         {0xa0, 0xf0, ZC3XX_R111_RGB21},
2404         {0xa0, 0x60, ZC3XX_R112_RGB22},
2405         {0xa1, 0x01, 0x0180},
2406         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2407         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2408         {0xaa, 0x25, 0x0007},
2409         {0xaa, 0x26, 0x0053},
2410         {0xaa, 0x27, 0x0000},
2411
2412         {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 2f */
2413         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 9b */
2414         {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},      /* 80 */
2415
2416         {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2417         {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2418         {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2419
2420         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2421         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2422         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2423         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2424         {0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
2425         {0xa1, 0x01, 0x001d},
2426         {0xa1, 0x01, 0x001e},
2427         {0xa1, 0x01, 0x001f},
2428         {0xa1, 0x01, 0x0020},
2429         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2430         {0xa1, 0x01, 0x0180},
2431         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2432         {}
2433 };
2434
2435 static const struct usb_action icm105axx_Initial[] = {
2436         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2437         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2438         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2439         {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2440         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2441         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2442         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2443         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2444         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2445         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2446         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2447         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2448         {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2449         {0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
2450         {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2451         {0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
2452         {0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
2453         {0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
2454         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2455         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2456         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2457         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2458         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2459         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2460         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2461         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2462         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2463         {0xaa, 0x01, 0x0010},
2464         {0xaa, 0x03, 0x0000},
2465         {0xaa, 0x04, 0x0001},
2466         {0xaa, 0x05, 0x0020},
2467         {0xaa, 0x06, 0x0001},
2468         {0xaa, 0x08, 0x0000},
2469         {0xaa, 0x03, 0x0001},
2470         {0xaa, 0x04, 0x0011},
2471         {0xaa, 0x05, 0x00a0},
2472         {0xaa, 0x06, 0x0001},
2473         {0xaa, 0x08, 0x0000},
2474         {0xaa, 0x03, 0x0002},
2475         {0xaa, 0x04, 0x0013},
2476         {0xaa, 0x05, 0x0020},
2477         {0xaa, 0x06, 0x0001},
2478         {0xaa, 0x08, 0x0000},
2479         {0xaa, 0x03, 0x0003},
2480         {0xaa, 0x04, 0x0015},
2481         {0xaa, 0x05, 0x0020},
2482         {0xaa, 0x06, 0x0005},
2483         {0xaa, 0x08, 0x0000},
2484         {0xaa, 0x03, 0x0004},
2485         {0xaa, 0x04, 0x0017},
2486         {0xaa, 0x05, 0x0020},
2487         {0xaa, 0x06, 0x000d},
2488         {0xaa, 0x08, 0x0000},
2489         {0xaa, 0x03, 0x0005},
2490         {0xaa, 0x04, 0x0019},
2491         {0xaa, 0x05, 0x0020},
2492         {0xaa, 0x06, 0x0005},
2493         {0xaa, 0x08, 0x0000},
2494         {0xaa, 0x03, 0x0006},
2495         {0xaa, 0x04, 0x0017},
2496         {0xaa, 0x05, 0x0026},
2497         {0xaa, 0x06, 0x0005},
2498         {0xaa, 0x08, 0x0000},
2499         {0xaa, 0x03, 0x0007},
2500         {0xaa, 0x04, 0x0019},
2501         {0xaa, 0x05, 0x0022},
2502         {0xaa, 0x06, 0x0005},
2503         {0xaa, 0x08, 0x0000},
2504         {0xaa, 0x03, 0x0008},
2505         {0xaa, 0x04, 0x0021},
2506         {0xaa, 0x05, 0x00aa},
2507         {0xaa, 0x06, 0x0005},
2508         {0xaa, 0x08, 0x0000},
2509         {0xaa, 0x03, 0x0009},
2510         {0xaa, 0x04, 0x0023},
2511         {0xaa, 0x05, 0x00aa},
2512         {0xaa, 0x06, 0x000d},
2513         {0xaa, 0x08, 0x0000},
2514         {0xaa, 0x03, 0x000a},
2515         {0xaa, 0x04, 0x0025},
2516         {0xaa, 0x05, 0x00aa},
2517         {0xaa, 0x06, 0x0005},
2518         {0xaa, 0x08, 0x0000},
2519         {0xaa, 0x03, 0x000b},
2520         {0xaa, 0x04, 0x00ec},
2521         {0xaa, 0x05, 0x002e},
2522         {0xaa, 0x06, 0x0005},
2523         {0xaa, 0x08, 0x0000},
2524         {0xaa, 0x03, 0x000c},
2525         {0xaa, 0x04, 0x00fa},
2526         {0xaa, 0x05, 0x002a},
2527         {0xaa, 0x06, 0x0005},
2528         {0xaa, 0x08, 0x0000},
2529         {0xaa, 0x07, 0x000d},
2530         {0xaa, 0x01, 0x0005},
2531         {0xaa, 0x94, 0x0002},
2532         {0xaa, 0x90, 0x0000},
2533         {0xaa, 0x91, 0x001f},
2534         {0xaa, 0x10, 0x0064},
2535         {0xaa, 0x9b, 0x00f0},
2536         {0xaa, 0x9c, 0x0002},
2537         {0xaa, 0x14, 0x001a},
2538         {0xaa, 0x20, 0x0080},
2539         {0xaa, 0x22, 0x0080},
2540         {0xaa, 0x24, 0x0080},
2541         {0xaa, 0x26, 0x0080},
2542         {0xaa, 0x00, 0x0084},
2543         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2544         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2545         {0xaa, 0xa8, 0x00c0},
2546         {0xa1, 0x01, 0x0002},
2547         {0xa1, 0x01, 0x0008},
2548         {0xa1, 0x01, 0x0180},
2549         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2550         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2551         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2552         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2553         {0xa1, 0x01, 0x0008},
2554
2555         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2556         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2557         {0xa1, 0x01, 0x01c8},
2558         {0xa1, 0x01, 0x01c9},
2559         {0xa1, 0x01, 0x01ca},
2560         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2561         {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2562         {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2563         {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2564         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2565         {0xa0, 0x52, ZC3XX_R10E_RGB11},
2566         {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2567         {0xa0, 0xf7, ZC3XX_R110_RGB20},
2568         {0xa0, 0xf7, ZC3XX_R111_RGB21},
2569         {0xa0, 0x52, ZC3XX_R112_RGB22},
2570         {0xa1, 0x01, 0x0180},
2571         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2572         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2573         {0xaa, 0x0d, 0x0003},
2574         {0xaa, 0x0c, 0x008c},
2575         {0xaa, 0x0e, 0x0095},
2576         {0xaa, 0x0f, 0x0002},
2577         {0xaa, 0x1c, 0x0094},
2578         {0xaa, 0x1d, 0x0002},
2579         {0xaa, 0x20, 0x0080},
2580         {0xaa, 0x22, 0x0080},
2581         {0xaa, 0x24, 0x0080},
2582         {0xaa, 0x26, 0x0080},
2583         {0xaa, 0x00, 0x0084},
2584         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2585         {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
2586         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2587         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2588         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
2589         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2590         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2591         {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
2592         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2593         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2594         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2595         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2596         {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
2597         {0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
2598         {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
2599         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2600         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2601         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
2602         {0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
2603         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2604         {0xa1, 0x01, 0x0180},
2605         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2606         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2607         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2608         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2609         {}
2610 };
2611
2612 static const struct usb_action icm105axx_InitialScale[] = {
2613         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2614         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2615         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2616         {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2617         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2618         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2619         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2620         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2621         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2622         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2623         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2624         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2625         {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2626         {0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
2627         {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2628         {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
2629         {0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
2630         {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
2631         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2632         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2633         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2634         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2635         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2636         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2637         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2638         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2639         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2640         {0xaa, 0x01, 0x0010},
2641         {0xaa, 0x03, 0x0000},
2642         {0xaa, 0x04, 0x0001},
2643         {0xaa, 0x05, 0x0020},
2644         {0xaa, 0x06, 0x0001},
2645         {0xaa, 0x08, 0x0000},
2646         {0xaa, 0x03, 0x0001},
2647         {0xaa, 0x04, 0x0011},
2648         {0xaa, 0x05, 0x00a0},
2649         {0xaa, 0x06, 0x0001},
2650         {0xaa, 0x08, 0x0000},
2651         {0xaa, 0x03, 0x0002},
2652         {0xaa, 0x04, 0x0013},
2653         {0xaa, 0x05, 0x0020},
2654         {0xaa, 0x06, 0x0001},
2655         {0xaa, 0x08, 0x0000},
2656         {0xaa, 0x03, 0x0003},
2657         {0xaa, 0x04, 0x0015},
2658         {0xaa, 0x05, 0x0020},
2659         {0xaa, 0x06, 0x0005},
2660         {0xaa, 0x08, 0x0000},
2661         {0xaa, 0x03, 0x0004},
2662         {0xaa, 0x04, 0x0017},
2663         {0xaa, 0x05, 0x0020},
2664         {0xaa, 0x06, 0x000d},
2665         {0xaa, 0x08, 0x0000},
2666         {0xaa, 0x03, 0x0005},
2667         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
2668         {0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
2669         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
2670         {0xa1, 0x01, 0x0091},
2671         {0xaa, 0x05, 0x0020},
2672         {0xaa, 0x06, 0x0005},
2673         {0xaa, 0x08, 0x0000},
2674         {0xaa, 0x03, 0x0006},
2675         {0xaa, 0x04, 0x0017},
2676         {0xaa, 0x05, 0x0026},
2677         {0xaa, 0x06, 0x0005},
2678         {0xaa, 0x08, 0x0000},
2679         {0xaa, 0x03, 0x0007},
2680         {0xaa, 0x04, 0x0019},
2681         {0xaa, 0x05, 0x0022},
2682         {0xaa, 0x06, 0x0005},
2683         {0xaa, 0x08, 0x0000},
2684         {0xaa, 0x03, 0x0008},
2685         {0xaa, 0x04, 0x0021},
2686         {0xaa, 0x05, 0x00aa},
2687         {0xaa, 0x06, 0x0005},
2688         {0xaa, 0x08, 0x0000},
2689         {0xaa, 0x03, 0x0009},
2690         {0xaa, 0x04, 0x0023},
2691         {0xaa, 0x05, 0x00aa},
2692         {0xaa, 0x06, 0x000d},
2693         {0xaa, 0x08, 0x0000},
2694         {0xaa, 0x03, 0x000a},
2695         {0xaa, 0x04, 0x0025},
2696         {0xaa, 0x05, 0x00aa},
2697         {0xaa, 0x06, 0x0005},
2698         {0xaa, 0x08, 0x0000},
2699         {0xaa, 0x03, 0x000b},
2700         {0xaa, 0x04, 0x00ec},
2701         {0xaa, 0x05, 0x002e},
2702         {0xaa, 0x06, 0x0005},
2703         {0xaa, 0x08, 0x0000},
2704         {0xaa, 0x03, 0x000c},
2705         {0xaa, 0x04, 0x00fa},
2706         {0xaa, 0x05, 0x002a},
2707         {0xaa, 0x06, 0x0005},
2708         {0xaa, 0x08, 0x0000},
2709         {0xaa, 0x07, 0x000d},
2710         {0xaa, 0x01, 0x0005},
2711         {0xaa, 0x94, 0x0002},
2712         {0xaa, 0x90, 0x0000},
2713         {0xaa, 0x91, 0x0010},
2714         {0xaa, 0x10, 0x0064},
2715         {0xaa, 0x9b, 0x00f0},
2716         {0xaa, 0x9c, 0x0002},
2717         {0xaa, 0x14, 0x001a},
2718         {0xaa, 0x20, 0x0080},
2719         {0xaa, 0x22, 0x0080},
2720         {0xaa, 0x24, 0x0080},
2721         {0xaa, 0x26, 0x0080},
2722         {0xaa, 0x00, 0x0084},
2723         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2724         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2725         {0xaa, 0xa8, 0x0080},
2726         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
2727         {0xa1, 0x01, 0x0002},
2728         {0xa1, 0x01, 0x0008},
2729         {0xa1, 0x01, 0x0180},
2730         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2731         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2732         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2733         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2734         {0xa1, 0x01, 0x0008},
2735
2736         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
2737         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
2738         {0xa1, 0x01, 0x01c8},
2739         {0xa1, 0x01, 0x01c9},
2740         {0xa1, 0x01, 0x01ca},
2741         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
2742
2743         {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2744         {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2745         {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2746         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2747         {0xa0, 0x52, ZC3XX_R10E_RGB11},
2748         {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2749         {0xa0, 0xf7, ZC3XX_R110_RGB20},
2750         {0xa0, 0xf7, ZC3XX_R111_RGB21},
2751         {0xa0, 0x52, ZC3XX_R112_RGB22},
2752         {0xa1, 0x01, 0x0180},
2753         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2754         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2755         {0xaa, 0x0d, 0x0003},
2756         {0xaa, 0x0c, 0x0020},
2757         {0xaa, 0x0e, 0x000e},
2758         {0xaa, 0x0f, 0x0002},
2759         {0xaa, 0x1c, 0x000d},
2760         {0xaa, 0x1d, 0x0002},
2761         {0xaa, 0x20, 0x0080},
2762         {0xaa, 0x22, 0x0080},
2763         {0xaa, 0x24, 0x0080},
2764         {0xaa, 0x26, 0x0080},
2765         {0xaa, 0x00, 0x0084},
2766         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2767         {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
2768         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2769         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2770         {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
2771         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2772         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2773         {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
2774         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2775         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2776         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2777         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2778         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
2779         {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
2780         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
2781         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2782         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2783         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2784         {0xa1, 0x01, 0x0180},
2785         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2786         {0xa0, 0x40, ZC3XX_R116_RGAIN},
2787         {0xa0, 0x40, ZC3XX_R117_GGAIN},
2788         {0xa0, 0x40, ZC3XX_R118_BGAIN},
2789         {}
2790 };
2791 static const struct usb_action icm105a_50HZ[] = {
2792         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2793         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2794         {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
2795         {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
2796         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2797         {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
2798         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2799         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2800         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2801         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2802         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2803         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2804         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2805         {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
2806         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2807         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2808         {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
2809         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2810         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2811         {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
2812         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2813         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2814         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2815         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2816         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
2817         {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
2818         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2819         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2820         {}
2821 };
2822 static const struct usb_action icm105a_50HZScale[] = {
2823         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2824         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2825         {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
2826         {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
2827         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2828         {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
2829         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2830         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2831         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2832         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2833         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2834         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2835         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2836         {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
2837         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2838         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2839         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2840         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2841         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2842         {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
2843         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2844         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2845         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2846         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2847         {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
2848         {0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
2849         {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
2850         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2851         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2852         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2853         {}
2854 };
2855 static const struct usb_action icm105a_60HZ[] = {
2856         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2857         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2858         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2859         {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2860         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2861         {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
2862         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2863         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2864         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2865         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2866         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2867         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2868         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2869         {0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
2870         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2871         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2872         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
2873         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2874         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2875         {0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
2876         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2877         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2878         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2879         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2880         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2881         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2882         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2883         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2884         {}
2885 };
2886 static const struct usb_action icm105a_60HZScale[] = {
2887         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2888         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2889         {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
2890         {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
2891         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2892         {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
2893         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2894         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2895         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2896         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2897         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2898         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2899         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2900         {0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
2901         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2902         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2903         {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
2904         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2905         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2906         {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
2907         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2908         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2909         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2910         {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2911         {0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
2912         {0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
2913         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2914         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2915         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2916         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2917         {}
2918 };
2919 static const struct usb_action icm105a_NoFliker[] = {
2920         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2921         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2922         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2923         {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2924         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2925         {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
2926         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2927         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2928         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2929         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2930         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2931         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2932         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2933         {0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
2934         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2935         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2936         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2937         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2938         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2939         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2940         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2941         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2942         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2943         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2944         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2945         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2946         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2947         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2948         {}
2949 };
2950 static const struct usb_action icm105a_NoFlikerScale[] = {
2951         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2952         {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2953         {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2954         {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
2955         {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2956         {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
2957         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2958         {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2959         {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2960         {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2961         {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2962         {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2963         {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2964         {0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
2965         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2966         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2967         {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2968         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2969         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2970         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2971         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2972         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2973         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2974         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2975         {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2976         {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2977         {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2978         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2979         {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2980         {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2981         {}
2982 };
2983
2984 static const struct usb_action MC501CB_InitialScale[] = {
2985         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2986         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
2987         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2988         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2989         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2990         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2991         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2992         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2993         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2994         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2995         {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
2996         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2997         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2998         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2999         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3000         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3001         {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3002         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3003         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3004         {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
3005         {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
3006         {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
3007         {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
3008         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3009         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3010         {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3011         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3012         {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3013         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3014         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3015         {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3016         {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3017         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3018         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3019         {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3020         {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3021         {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
3022         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3023         {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
3024         {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3025         {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3026         {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3027         {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3028         {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3029         {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3030         {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3031         {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3032         {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3033         {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3034         {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3035         {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3036         {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3037         {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3038         {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3039         {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3040         {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3041         {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3042         {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3043         {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3044         {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
3045         {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3046         {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3047         {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3048         {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3049         {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3050         {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3051         {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3052         {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3053         {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3054         {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3055         {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3056         {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3057         {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3058         {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3059         {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3060         {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3061         {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3062         {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3063         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3064         {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3065         {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3066         {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3067         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3068         {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
3069         {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3070         {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
3071         {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
3072         {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
3073         {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
3074         {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3075         {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3076         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3077         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3078         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3079         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3080         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3081         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3082         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3083         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3084         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3085         {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3086         {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
3087         {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
3088         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3089         {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3090         {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3091         {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3092         {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3093         {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3094         {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3095
3096         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3097         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3098         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3099         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3100         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3101         {}
3102 };
3103
3104 static const struct usb_action MC501CB_Initial[] = {     /* 320x240 */
3105         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3106         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
3107         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
3108         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3109         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
3110         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3111         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3112         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3113         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3114         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3115         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3116         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3117         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3118         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3119         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3120         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3121         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
3122         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3123         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
3124         {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
3125         {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
3126         {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
3127         {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
3128         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3129         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3130         {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3131         {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3132         {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3133         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3134         {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3135         {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3136         {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3137         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3138         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3139         {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3140         {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3141         {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
3142         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3143         {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
3144         {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3145         {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3146         {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3147         {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3148         {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3149         {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3150         {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3151         {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3152         {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3153         {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3154         {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3155         {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3156         {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3157         {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3158         {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3159         {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3160         {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3161         {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3162         {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3163         {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3164         {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
3165         {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3166         {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3167         {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3168         {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3169         {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3170         {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3171         {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3172         {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3173         {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3174         {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3175         {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3176         {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3177         {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3178         {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3179         {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3180         {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3181         {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3182         {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3183         {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3184         {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3185         {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3186         {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3187         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3188         {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
3189         {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3190         {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
3191         {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
3192         {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
3193         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3194         {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3195         {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3196         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3197         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3198         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3199         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3200         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3201         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3202         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3203         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3204         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3205         {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3206         {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
3207         {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
3208         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3209         {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3210         {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3211         {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3212         {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3213         {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3214         {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3215         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3216         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3217         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3218         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3219         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3220         {}
3221 };
3222
3223 static const struct usb_action MC501CB_50HZ[] = {
3224         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3225         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3226         {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3227         {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3228         {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3229         {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
3230         {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
3231         {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
3232         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3233         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3234         {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3235         {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3236         {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3237         {}
3238 };
3239
3240 static const struct usb_action MC501CB_50HZScale[] = {
3241         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3242         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3243         {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3244         {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3245         {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3246         {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
3247         {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
3248         {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
3249         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3250         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3251         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3252         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3253         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3254         {}
3255 };
3256
3257 static const struct usb_action MC501CB_60HZ[] = {
3258         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3259         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3260         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3261         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3262         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3263         {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3264         {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3265         {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3266         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3267         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3268         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3269         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3270         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3271         {}
3272 };
3273
3274 static const struct usb_action MC501CB_60HZScale[] = {
3275         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3276         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3277         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3278         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3279         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3280         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3281         {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3282         {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3283         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3284         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3285         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3286         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3287         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3288         {}
3289 };
3290
3291 static const struct usb_action MC501CB_NoFliker[] = {
3292         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3293         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3294         {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3295         {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3296         {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3297         {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3298         {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3299         {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3300         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3301         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3302         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3303         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3304         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3305         {}
3306 };
3307
3308 static const struct usb_action MC501CB_NoFlikerScale[] = {
3309         {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3310         {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3311         {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3312         {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3313         {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3314         {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3315         {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3316         {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3317         {}
3318 };
3319
3320 /* from zs211.inf - HKR,%OV7620%,Initial - 640x480 */
3321 static const struct usb_action OV7620_mode0[] = {
3322         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3323         {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
3324         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3325         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3326         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3327         {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3328         {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3329         {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3330         {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3331         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3332         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3333         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3334         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3335         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3336         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3337         {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3338         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3339         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3340         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3341         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3342         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3343         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3344         {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3345         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3346         {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3347         {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3348         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3349         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3350         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3351         {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3352         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3353         {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3354         {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3355         {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3356         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3357         {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3358         {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3359         {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3360         {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3361         {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3362         {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3363         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3364         {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3365         {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3366         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3367         {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3368         {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3369         {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3370         {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3371         {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3372         {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3373         {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3374         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3375         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3376         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3377         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3378         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3379         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3380         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3381         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3382         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3383         {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3384         {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3385         {0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
3386         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3387         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
3388         {}
3389 };
3390
3391 /* from zs211.inf - HKR,%OV7620%,InitialScale - 320x240 */
3392 static const struct usb_action OV7620_mode1[] = {
3393         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3394         {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},   /* 00,02,50,cc */
3395         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00,08,00,cc */
3396                                                 /* mx change? */
3397         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3398         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3399         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},     /* 00,83,02,cc */
3400         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},     /* 00,85,01,cc */
3401         {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,80,cc */
3402         {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID},    /* 00,87,81,cc */
3403         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},    /* 00,88,10,cc */
3404         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3405         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3406         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3407         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3408         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3409         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3410         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3411         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3412         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
3413         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
3414         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
3415         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
3416         {0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,d6,cc */
3417                                                 /* OV7648 00,9c,d8,cc */
3418         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,88,cc */
3419         {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3420         {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3421         {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3422         {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3423         {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3424         {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3425         {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3426         {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3427         {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3428         {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3429         {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3430         {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3431         {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3432         {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3433         {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3434         {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3435         {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3436         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3437         {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3438         {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3439         {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3440         {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3441         {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3442         {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3443         {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3444         {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3445         {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3446         {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3447         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3448         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3449         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3450         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},     /* 01,89,06,cc */
3451         {0xa0, 0x00, 0x01ad},                   /* 01,ad,00,cc */
3452         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3453         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},   /* 01,cb,13,cc */
3454         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3455         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},  /* 03,01,08,cc */
3456         {0xa0, 0x68, ZC3XX_R116_RGAIN},         /* 01,16,68,cc */
3457         {0xa0, 0x52, ZC3XX_R118_BGAIN},         /* 01,18,52,cc */
3458         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},    /* 01,1d,50,cc */
3459         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3460         {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},   /* 01,a8,50,cc */
3461         {}
3462 };
3463
3464 /* from zs211.inf - HKR,%OV7620%\AE,50HZ */
3465 static const struct usb_action OV7620_50HZ[] = {
3466         {0xaa, 0x13, 0x00a3},   /* 00,13,a3,aa */
3467         {0xdd, 0x00, 0x0100},   /* 00,01,00,dd */
3468         {0xaa, 0x2b, 0x0096},   /* 00,2b,96,aa */
3469         {0xaa, 0x75, 0x008a},   /* 00,75,8a,aa */
3470         {0xaa, 0x2d, 0x0005},   /* 00,2d,05,aa */
3471         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
3472         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,04,cc */
3473         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,18,cc */
3474         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
3475         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
3476         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,83,cc */
3477         {0xaa, 0x10, 0x0082},                           /* 00,10,82,aa */
3478         {0xaa, 0x76, 0x0003},                           /* 00,76,03,aa */
3479 /*      {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},            * 00,02,40,cc
3480                                                          if mode0 (640x480) */
3481         {}
3482 };
3483
3484 /* from zs211.inf - HKR,%OV7620%\AE,60HZ */
3485 static const struct usb_action OV7620_60HZ[] = {
3486         {0xaa, 0x13, 0x00a3},                   /* 00,13,a3,aa */
3487                                                 /* (bug in zs211.inf) */
3488         {0xdd, 0x00, 0x0100},                   /* 00,01,00,dd */
3489         {0xaa, 0x2b, 0x0000},                   /* 00,2b,00,aa */
3490         {0xaa, 0x75, 0x008a},                   /* 00,75,8a,aa */
3491         {0xaa, 0x2d, 0x0005},                   /* 00,2d,05,aa */
3492         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3493         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3494         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3495         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3496         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3497         {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3498         {0xaa, 0x10, 0x0020},                   /* 00,10,20,aa */
3499         {0xaa, 0x76, 0x0003},                   /* 00,76,03,aa */
3500 /*      {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},    * 00,02,40,cc
3501                                                  * if mode0 (640x480) */
3502 /* ?? in gspca v1, it was
3503         {0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3504         {0xa1, 0x01, 0x0037},           */
3505         {}
3506 };
3507
3508 /* from zs211.inf - HKR,%OV7620%\AE,NoFliker */
3509 static const struct usb_action OV7620_NoFliker[] = {
3510         {0xaa, 0x13, 0x00a3},                   /* 00,13,a3,aa */
3511                                                 /* (bug in zs211.inf) */
3512         {0xdd, 0x00, 0x0100},                   /* 00,01,00,dd */
3513         {0xaa, 0x2b, 0x0000},                   /* 00,2b,00,aa */
3514         {0xaa, 0x75, 0x008e},                   /* 00,75,8e,aa */
3515         {0xaa, 0x2d, 0x0001},                   /* 00,2d,01,aa */
3516         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3517         {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3518         {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3519         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3520         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3521         {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
3522 /*      {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT},    * 00,02,44,cc
3523                                                  - if mode1 (320x240) */
3524 /* ?? was
3525         {0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3526         {0xa1, 0x01, 0x0037},           */
3527         {}
3528 };
3529
3530 static const struct usb_action ov7630c_Initial[] = {
3531         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3532         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3533         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3534         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3535         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3536         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3537         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3538         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3539         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3540         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3541         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3542         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3543         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3544         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3545         {0xaa, 0x12, 0x0080},
3546         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3547         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3548         {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3549         {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3550         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3551         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3552         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3553         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3554         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3555         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
3556         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
3557         {0xaa, 0x12, 0x0069},
3558         {0xaa, 0x04, 0x0020},
3559         {0xaa, 0x06, 0x0050},
3560         {0xaa, 0x13, 0x0083},
3561         {0xaa, 0x14, 0x0000},
3562         {0xaa, 0x15, 0x0024},
3563         {0xaa, 0x17, 0x0018},
3564         {0xaa, 0x18, 0x00ba},
3565         {0xaa, 0x19, 0x0002},
3566         {0xaa, 0x1a, 0x00f6},
3567         {0xaa, 0x1b, 0x0002},
3568         {0xaa, 0x20, 0x00c2},
3569         {0xaa, 0x24, 0x0060},
3570         {0xaa, 0x25, 0x0040},
3571         {0xaa, 0x26, 0x0030},
3572         {0xaa, 0x27, 0x00ea},
3573         {0xaa, 0x28, 0x00a0},
3574         {0xaa, 0x21, 0x0000},
3575         {0xaa, 0x2a, 0x0081},
3576         {0xaa, 0x2b, 0x0096},
3577         {0xaa, 0x2d, 0x0094},
3578         {0xaa, 0x2f, 0x003d},
3579         {0xaa, 0x30, 0x0024},
3580         {0xaa, 0x60, 0x0000},
3581         {0xaa, 0x61, 0x0040},
3582         {0xaa, 0x68, 0x007c},
3583         {0xaa, 0x6f, 0x0015},
3584         {0xaa, 0x75, 0x0088},
3585         {0xaa, 0x77, 0x00b5},
3586         {0xaa, 0x01, 0x0060},
3587         {0xaa, 0x02, 0x0060},
3588         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3589         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3590         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3591         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3592         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3593         {0xa0, 0x00, 0x01ad},
3594         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3595         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3596         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3597         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3598         {0xa0, 0x60, ZC3XX_R116_RGAIN},
3599         {0xa0, 0x46, ZC3XX_R118_BGAIN},
3600         {0xa0, 0x04, ZC3XX_R113_RGB03},
3601 /* 0x10, */
3602         {0xa1, 0x01, 0x0002},
3603         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3604         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3605         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3606         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3607         {0xa0, 0x50, ZC3XX_R10E_RGB11},
3608         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3609         {0xa0, 0xf8, ZC3XX_R110_RGB20},
3610         {0xa0, 0xf8, ZC3XX_R111_RGB21},
3611         {0xa0, 0x50, ZC3XX_R112_RGB22},
3612 /* 0x03, */
3613         {0xa1, 0x01, 0x0008},
3614         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
3615         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
3616         {0xa1, 0x01, 0x01c8},
3617         {0xa1, 0x01, 0x01c9},
3618         {0xa1, 0x01, 0x01ca},
3619         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
3620         {0xa0, 0x01, ZC3XX_R120_GAMMA00},       /* gamma 2 ?*/
3621         {0xa0, 0x0c, ZC3XX_R121_GAMMA01},
3622         {0xa0, 0x1f, ZC3XX_R122_GAMMA02},
3623         {0xa0, 0x3a, ZC3XX_R123_GAMMA03},
3624         {0xa0, 0x53, ZC3XX_R124_GAMMA04},
3625         {0xa0, 0x6d, ZC3XX_R125_GAMMA05},
3626         {0xa0, 0x85, ZC3XX_R126_GAMMA06},
3627         {0xa0, 0x9c, ZC3XX_R127_GAMMA07},
3628         {0xa0, 0xb0, ZC3XX_R128_GAMMA08},
3629         {0xa0, 0xc2, ZC3XX_R129_GAMMA09},
3630         {0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
3631         {0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
3632         {0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
3633         {0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
3634         {0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
3635         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3636         {0xa0, 0x05, ZC3XX_R130_GAMMA10},
3637         {0xa0, 0x0f, ZC3XX_R131_GAMMA11},
3638         {0xa0, 0x16, ZC3XX_R132_GAMMA12},
3639         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
3640         {0xa0, 0x19, ZC3XX_R134_GAMMA14},
3641         {0xa0, 0x19, ZC3XX_R135_GAMMA15},
3642         {0xa0, 0x17, ZC3XX_R136_GAMMA16},
3643         {0xa0, 0x15, ZC3XX_R137_GAMMA17},
3644         {0xa0, 0x12, ZC3XX_R138_GAMMA18},
3645         {0xa0, 0x10, ZC3XX_R139_GAMMA19},
3646         {0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
3647         {0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
3648         {0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
3649         {0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
3650         {0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
3651         {0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
3652         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3653         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3654         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3655         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3656         {0xa0, 0x50, ZC3XX_R10E_RGB11},
3657         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3658         {0xa0, 0xf8, ZC3XX_R110_RGB20},
3659         {0xa0, 0xf8, ZC3XX_R111_RGB21},
3660         {0xa0, 0x50, ZC3XX_R112_RGB22},
3661
3662         {0xa1, 0x01, 0x0180},
3663         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3664         {0xaa, 0x10, 0x001b},
3665         {0xaa, 0x76, 0x0002},
3666         {0xaa, 0x2a, 0x0081},
3667         {0xaa, 0x2b, 0x0000},
3668         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3669         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
3670         {0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
3671         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3672         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3673         {0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
3674         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3675         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3676         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3677         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3678         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3679         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3680         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3681         {0xaa, 0x13, 0x0083},   /* 40 */
3682         {0xa1, 0x01, 0x0180},
3683         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3684         {}
3685 };
3686
3687 static const struct usb_action ov7630c_InitialScale[] = {
3688         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3689         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
3690         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3691         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3692         {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3693         {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3694         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3695         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3696         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3697         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3698         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3699         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3700
3701         {0xaa, 0x12, 0x0080},
3702         {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3703         {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3704         {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3705         {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3706         {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3707         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3708         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3709         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3710         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3711         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
3712         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
3713         {0xaa, 0x12, 0x0069},   /* i2c */
3714         {0xaa, 0x04, 0x0020},
3715         {0xaa, 0x06, 0x0050},
3716         {0xaa, 0x13, 0x00c3},
3717         {0xaa, 0x14, 0x0000},
3718         {0xaa, 0x15, 0x0024},
3719         {0xaa, 0x19, 0x0003},
3720         {0xaa, 0x1a, 0x00f6},
3721         {0xaa, 0x1b, 0x0002},
3722         {0xaa, 0x20, 0x00c2},
3723         {0xaa, 0x24, 0x0060},
3724         {0xaa, 0x25, 0x0040},
3725         {0xaa, 0x26, 0x0030},
3726         {0xaa, 0x27, 0x00ea},
3727         {0xaa, 0x28, 0x00a0},
3728         {0xaa, 0x21, 0x0000},
3729         {0xaa, 0x2a, 0x0081},
3730         {0xaa, 0x2b, 0x0096},
3731         {0xaa, 0x2d, 0x0084},
3732         {0xaa, 0x2f, 0x003d},
3733         {0xaa, 0x30, 0x0024},
3734         {0xaa, 0x60, 0x0000},
3735         {0xaa, 0x61, 0x0040},
3736         {0xaa, 0x68, 0x007c},
3737         {0xaa, 0x6f, 0x0015},
3738         {0xaa, 0x75, 0x0088},
3739         {0xaa, 0x77, 0x00b5},
3740         {0xaa, 0x01, 0x0060},
3741         {0xaa, 0x02, 0x0060},
3742         {0xaa, 0x17, 0x0018},
3743         {0xaa, 0x18, 0x00ba},
3744         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3745         {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3746         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3747         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3748         {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3749         {0xa0, 0x00, 0x01ad},
3750         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3751         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3752         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3753         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3754         {0xa0, 0x60, ZC3XX_R116_RGAIN},
3755         {0xa0, 0x46, ZC3XX_R118_BGAIN},
3756         {0xa0, 0x04, ZC3XX_R113_RGB03},
3757
3758         {0xa1, 0x01, 0x0002},
3759         {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3760         {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3761         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3762         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3763         {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3764         {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3765         {0xa0, 0x00, ZC3XX_R110_RGB20},
3766         {0xa0, 0xf6, ZC3XX_R111_RGB21},
3767         {0xa0, 0x4a, ZC3XX_R112_RGB22},
3768
3769         {0xa1, 0x01, 0x0008},
3770         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
3771         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
3772         {0xa1, 0x01, 0x01c8},
3773         {0xa1, 0x01, 0x01c9},
3774         {0xa1, 0x01, 0x01ca},
3775         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
3776         {0xa0, 0x16, ZC3XX_R120_GAMMA00},       /* gamma ~4 */
3777         {0xa0, 0x3a, ZC3XX_R121_GAMMA01},
3778         {0xa0, 0x5b, ZC3XX_R122_GAMMA02},
3779         {0xa0, 0x7c, ZC3XX_R123_GAMMA03},
3780         {0xa0, 0x94, ZC3XX_R124_GAMMA04},
3781         {0xa0, 0xa9, ZC3XX_R125_GAMMA05},
3782         {0xa0, 0xbb, ZC3XX_R126_GAMMA06},
3783         {0xa0, 0xca, ZC3XX_R127_GAMMA07},
3784         {0xa0, 0xd7, ZC3XX_R128_GAMMA08},
3785         {0xa0, 0xe1, ZC3XX_R129_GAMMA09},
3786         {0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
3787         {0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
3788         {0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
3789         {0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
3790         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
3791         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3792         {0xa0, 0x20, ZC3XX_R130_GAMMA10},
3793         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
3794         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
3795         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
3796         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
3797         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
3798         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
3799         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
3800         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
3801         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
3802         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
3803         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
3804         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
3805         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
3806         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
3807         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
3808         {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3809         {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3810         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3811         {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3812         {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3813         {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3814         {0xa0, 0x00, ZC3XX_R110_RGB20},
3815         {0xa0, 0xf6, ZC3XX_R111_RGB21},
3816         {0xa0, 0x4a, ZC3XX_R112_RGB22},
3817
3818         {0xa1, 0x01, 0x0180},
3819         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3820         {0xaa, 0x10, 0x000d},
3821         {0xaa, 0x76, 0x0002},
3822         {0xaa, 0x2a, 0x0081},
3823         {0xaa, 0x2b, 0x0000},
3824         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3825         {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
3826         {0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
3827         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3828         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3829         {0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
3830         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3831         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3832         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3833         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3834         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3835         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3836         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3837         {0xaa, 0x13, 0x00c3},
3838
3839         {0xa1, 0x01, 0x0180},
3840         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3841         {}
3842 };
3843
3844 static const struct usb_action pas106b_Initial_com[] = {
3845 /* Sream and Sensor specific */
3846         {0xa1, 0x01, 0x0010},   /* CMOSSensorSelect */
3847 /* System */
3848         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
3849         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
3850 /* Picture size */
3851         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* ClockSelect */
3852         {0xa0, 0x03, 0x003a},
3853         {0xa0, 0x0c, 0x003b},
3854         {0xa0, 0x04, 0x0038},
3855         {}
3856 };
3857
3858 static const struct usb_action pas106b_Initial[] = {    /* 176x144 */
3859 /* JPEG control */
3860         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3861 /* Sream and Sensor specific */
3862         {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
3863 /* Picture size */
3864         {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
3865         {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
3866         {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
3867         {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
3868 /* System */
3869         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3870 /* Sream and Sensor specific */
3871         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3872         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3873 /* Sensor Interface */
3874         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3875 /* Window inside sensor array */
3876         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3877         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3878         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3879         {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3880         {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
3881 /* Init the sensor */
3882         {0xaa, 0x02, 0x0004},
3883         {0xaa, 0x08, 0x0000},
3884         {0xaa, 0x09, 0x0005},
3885         {0xaa, 0x0a, 0x0002},
3886         {0xaa, 0x0b, 0x0002},
3887         {0xaa, 0x0c, 0x0005},
3888         {0xaa, 0x0d, 0x0000},
3889         {0xaa, 0x0e, 0x0002},
3890         {0xaa, 0x14, 0x0081},
3891
3892 /* Other registors */
3893         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
3894 /* Frame retreiving */
3895         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
3896 /* Gains */
3897         {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
3898 /* Unknown */
3899         {0xa0, 0x00, 0x01ad},
3900 /* Sharpness */
3901         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3902         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3903 /* Other registors */
3904         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3905 /* Auto exposure and white balance */
3906         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3907 /*Dead pixels */
3908         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3909 /* EEPROM */
3910         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3911 /* JPEG control */
3912         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3913         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3914         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3915 /* Other registers */
3916         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3917 /* Auto exposure and white balance */
3918         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3919 /*Dead pixels */
3920         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3921 /* EEPROM */
3922         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3923 /* JPEG control */
3924         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3925         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3926         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3927
3928         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
3929         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
3930         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3931         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
3932         {0xa0, 0x58, ZC3XX_R10E_RGB11},
3933         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
3934         {0xa0, 0xf4, ZC3XX_R110_RGB20},
3935         {0xa0, 0xf4, ZC3XX_R111_RGB21},
3936         {0xa0, 0x58, ZC3XX_R112_RGB22},
3937 /* Auto correction */
3938         {0xa0, 0x03, ZC3XX_R181_WINXSTART},
3939         {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3940         {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3941         {0xa0, 0x03, ZC3XX_R184_WINYSTART},
3942         {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3943         {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3944         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3945
3946 /* Auto exposure and white balance */
3947         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3948         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3949         {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
3950         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3951         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3952         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
3953         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
3954         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
3955 /* sensor on */
3956         {0xaa, 0x07, 0x00b1},
3957         {0xaa, 0x05, 0x0003},
3958         {0xaa, 0x04, 0x0001},
3959         {0xaa, 0x03, 0x003b},
3960 /* Gains */
3961         {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3962         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3963         {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
3964         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
3965 /* Auto correction */
3966         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3967         {0xa1, 0x01, 0x0180},                           /* AutoCorrectEnable */
3968         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3969 /* Gains */
3970         {0xa0, 0x40, ZC3XX_R116_RGAIN},
3971         {0xa0, 0x40, ZC3XX_R117_GGAIN},
3972         {0xa0, 0x40, ZC3XX_R118_BGAIN},
3973         {}
3974 };
3975
3976 static const struct usb_action pas106b_InitialScale[] = {       /* 352x288 */
3977 /* JPEG control */
3978         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3979 /* Sream and Sensor specific */
3980         {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
3981 /* Picture size */
3982         {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
3983         {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
3984         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3985         {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
3986 /* System */
3987         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3988 /* Sream and Sensor specific */
3989         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3990         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3991 /* Sensor Interface */
3992         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3993 /* Window inside sensor array */
3994         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3995         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3996         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3997         {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3998         {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
3999 /* Init the sensor */
4000         {0xaa, 0x02, 0x0004},
4001         {0xaa, 0x08, 0x0000},
4002         {0xaa, 0x09, 0x0005},
4003         {0xaa, 0x0a, 0x0002},
4004         {0xaa, 0x0b, 0x0002},
4005         {0xaa, 0x0c, 0x0005},
4006         {0xaa, 0x0d, 0x0000},
4007         {0xaa, 0x0e, 0x0002},
4008         {0xaa, 0x14, 0x0081},
4009
4010 /* Other registors */
4011         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4012 /* Frame retreiving */
4013         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4014 /* Gains */
4015         {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
4016 /* Unknown */
4017         {0xa0, 0x00, 0x01ad},
4018 /* Sharpness */
4019         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4020         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4021 /* Other registors */
4022         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4023 /* Auto exposure and white balance */
4024         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4025         {0xa0, 0x80, ZC3XX_R18D_YTARGET},
4026 /*Dead pixels */
4027         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4028 /* EEPROM */
4029         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4030 /* JPEG control */
4031         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4032         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4033         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4034 /* Other registers */
4035         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4036 /* Auto exposure and white balance */
4037         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4038 /*Dead pixels */
4039         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4040 /* EEPROM */
4041         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4042 /* JPEG control */
4043         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4044         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4045         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4046
4047         {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
4048         {0xa0, 0xf4, ZC3XX_R10B_RGB01},
4049         {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4050         {0xa0, 0xf4, ZC3XX_R10D_RGB10},
4051         {0xa0, 0x58, ZC3XX_R10E_RGB11},
4052         {0xa0, 0xf4, ZC3XX_R10F_RGB12},
4053         {0xa0, 0xf4, ZC3XX_R110_RGB20},
4054         {0xa0, 0xf4, ZC3XX_R111_RGB21},
4055         {0xa0, 0x58, ZC3XX_R112_RGB22},
4056 /* Auto correction */
4057         {0xa0, 0x03, ZC3XX_R181_WINXSTART},
4058         {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
4059         {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
4060         {0xa0, 0x03, ZC3XX_R184_WINYSTART},
4061         {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
4062         {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
4063         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4064
4065 /* Auto exposure and white balance */
4066         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4067         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4068         {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
4069
4070         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4071         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4072         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
4073
4074         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4075         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4076 /* sensor on */
4077         {0xaa, 0x07, 0x00b1},
4078         {0xaa, 0x05, 0x0003},
4079         {0xaa, 0x04, 0x0001},
4080         {0xaa, 0x03, 0x003b},
4081 /* Gains */
4082         {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
4083         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
4084         {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
4085         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4086 /* Auto correction */
4087         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4088         {0xa1, 0x01, 0x0180},                           /* AutoCorrectEnable */
4089         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4090 /* Gains */
4091         {0xa0, 0x40, ZC3XX_R116_RGAIN},
4092         {0xa0, 0x40, ZC3XX_R117_GGAIN},
4093         {0xa0, 0x40, ZC3XX_R118_BGAIN},
4094
4095         {0xa0, 0x00, 0x0007},                   /* AutoCorrectEnable */
4096         {0xa0, 0xff, ZC3XX_R018_FRAMELOST},     /* Frame adjust */
4097         {}
4098 };
4099 static const struct usb_action pas106b_50HZ[] = {
4100         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4101         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4102         {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
4103         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4104         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4105         {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
4106         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4107         {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,30,cc */
4108         {0xaa, 0x03, 0x0021},                   /* 00,03,21,aa */
4109         {0xaa, 0x04, 0x000c},                   /* 00,04,0c,aa */
4110         {0xaa, 0x05, 0x0002},                   /* 00,05,02,aa */
4111         {0xaa, 0x07, 0x001c},                   /* 00,07,1c,aa */
4112         {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
4113         {}
4114 };
4115 static const struct usb_action pas106b_60HZ[] = {
4116         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4117         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4118         {0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
4119         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4120         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4121         {0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
4122         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4123         {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,30,cc */
4124         {0xaa, 0x03, 0x001c},                   /* 00,03,1c,aa */
4125         {0xaa, 0x04, 0x0004},                   /* 00,04,04,aa */
4126         {0xaa, 0x05, 0x0001},                   /* 00,05,01,aa */
4127         {0xaa, 0x07, 0x00c4},                   /* 00,07,c4,aa */
4128         {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
4129         {}
4130 };
4131 static const struct usb_action pas106b_NoFliker[] = {
4132         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4133         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4134         {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
4135         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4136         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4137         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
4138         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
4139         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
4140         {0xaa, 0x03, 0x0013},                   /* 00,03,13,aa */
4141         {0xaa, 0x04, 0x0000},                   /* 00,04,00,aa */
4142         {0xaa, 0x05, 0x0001},                   /* 00,05,01,aa */
4143         {0xaa, 0x07, 0x0030},                   /* 00,07,30,aa */
4144         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
4145         {}
4146 };
4147
4148 /* from usbvm31b.inf */
4149 static const struct usb_action pas202b_Initial[] = {    /* 640x480 */
4150         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc */
4151         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},          /* 00,08,00,cc */
4152         {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0e,cc */
4153         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},           /* 00,02,00,cc */
4154         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
4155         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc */
4156         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
4157         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc */
4158         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
4159         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
4160         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
4161         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},       /* 00,8d,08,cc */
4162         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc */
4163         {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,03,cc */
4164         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc */
4165         {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,03,cc */
4166         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},         /* 00,9b,01,cc */
4167         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,e6,cc */
4168         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},          /* 00,9d,02,cc */
4169         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,86,cc */
4170         {0xaa, 0x02, 0x0002},                   /* 00,02,04,aa --> 02 */
4171         {0xaa, 0x07, 0x0006},                           /* 00,07,06,aa */
4172         {0xaa, 0x08, 0x0002},                           /* 00,08,02,aa */
4173         {0xaa, 0x09, 0x0006},                           /* 00,09,06,aa */
4174         {0xaa, 0x0a, 0x0001},                           /* 00,0a,01,aa */
4175         {0xaa, 0x0b, 0x0001},                           /* 00,0b,01,aa */
4176         {0xaa, 0x0c, 0x0008},                           /* 00,0c,08,aa */
4177         {0xaa, 0x0d, 0x0000},                           /* 00,0d,00,aa */
4178         {0xaa, 0x10, 0x0000},                           /* 00,10,00,aa */
4179         {0xaa, 0x12, 0x0005},                           /* 00,12,05,aa */
4180         {0xaa, 0x13, 0x0063},                           /* 00,13,63,aa */
4181         {0xaa, 0x15, 0x0070},                           /* 00,15,70,aa */
4182         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc */
4183         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc */
4184         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},             /* 01,89,06,cc */
4185         {0xa0, 0x00, 0x01ad},                           /* 01,ad,00,cc */
4186         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc */
4187         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc */
4188         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
4189         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc */
4190         {0xa0, 0x70, ZC3XX_R18D_YTARGET},               /* 01,8d,70,cc */
4191         {}
4192 };
4193 static const struct usb_action pas202b_InitialScale[] = {       /* 320x240 */
4194         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc */
4195         {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},          /* 00,08,00,cc */
4196         {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,0e,cc */
4197         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},           /* 00,02,10,cc */
4198         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc */
4199         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc */
4200         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc */
4201         {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,d0,cc */
4202         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc */
4203         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc */
4204         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc */
4205         {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},       /* 00,8d,08,cc */
4206         {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,08,cc */
4207         {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,02,cc */
4208         {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,08,cc */
4209         {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,02,cc */
4210         {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},         /* 00,9b,01,cc */
4211         {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,d8,cc */
4212         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},          /* 00,9d,02,cc */
4213         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,88,cc */
4214         {0xaa, 0x02, 0x0002},                           /* 00,02,02,aa */
4215         {0xaa, 0x07, 0x0006},                           /* 00,07,06,aa */
4216         {0xaa, 0x08, 0x0002},                           /* 00,08,02,aa */
4217         {0xaa, 0x09, 0x0006},                           /* 00,09,06,aa */
4218         {0xaa, 0x0a, 0x0001},                           /* 00,0a,01,aa */
4219         {0xaa, 0x0b, 0x0001},                           /* 00,0b,01,aa */
4220         {0xaa, 0x0c, 0x0008},                           /* 00,0c,08,aa */
4221         {0xaa, 0x0d, 0x0000},                           /* 00,0d,00,aa */
4222         {0xaa, 0x10, 0x0000},                           /* 00,10,00,aa */
4223         {0xaa, 0x12, 0x0005},                           /* 00,12,05,aa */
4224         {0xaa, 0x13, 0x0063},                           /* 00,13,63,aa */
4225         {0xaa, 0x15, 0x0070},                           /* 00,15,70,aa */
4226         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,37,cc */
4227         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc */
4228         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},             /* 01,89,06,cc */
4229         {0xa0, 0x00, 0x01ad},                           /* 01,ad,00,cc */
4230         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc */
4231         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc */
4232         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc */
4233         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc */
4234         {0xa0, 0x70, ZC3XX_R18D_YTARGET},               /* 01,8d,70,cc */
4235         {}
4236 };
4237 static const struct usb_action pas202b_50HZ[] = {
4238         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4239         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4240         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4241         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4242         {0xaa, 0x21, 0x0068},                           /* 00,21,68,aa */
4243         {0xaa, 0x03, 0x0044},                           /* 00,03,44,aa */
4244         {0xaa, 0x04, 0x0009},                           /* 00,04,09,aa */
4245         {0xaa, 0x05, 0x0028},                           /* 00,05,28,aa */
4246         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4247         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4248         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,14,cc */
4249         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
4250         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4251         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,07,cc */
4252         {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,d2,cc */
4253         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4254         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4255         {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,4d,cc */
4256         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4257         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4258         {0xa0, 0x44, ZC3XX_R01D_HSYNC_0},               /* 00,1d,44,cc */
4259         {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},               /* 00,1e,6f,cc */
4260         {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},               /* 00,1f,ad,cc */
4261         {0xa0, 0xeb, ZC3XX_R020_HSYNC_3},               /* 00,20,eb,cc */
4262         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4263         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4264         {}
4265 };
4266 static const struct usb_action pas202b_50HZScale[] = {
4267         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4268         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4269         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4270         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4271         {0xaa, 0x21, 0x006c},                           /* 00,21,6c,aa */
4272         {0xaa, 0x03, 0x0041},                           /* 00,03,41,aa */
4273         {0xaa, 0x04, 0x0009},                           /* 00,04,09,aa */
4274         {0xaa, 0x05, 0x002c},                           /* 00,05,2c,aa */
4275         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4276         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4277         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,14,cc */
4278         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
4279         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4280         {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0f,cc */
4281         {0xa0, 0xbe, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,be,cc */
4282         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4283         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4284         {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,9b,cc */
4285         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4286         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4287         {0xa0, 0x41, ZC3XX_R01D_HSYNC_0},               /* 00,1d,41,cc */
4288         {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},               /* 00,1e,6f,cc */
4289         {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},               /* 00,1f,ad,cc */
4290         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc */
4291         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4292         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4293         {}
4294 };
4295 static const struct usb_action pas202b_60HZ[] = {
4296         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4297         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4298         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4299         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4300         {0xaa, 0x21, 0x0000},                           /* 00,21,00,aa */
4301         {0xaa, 0x03, 0x0045},                           /* 00,03,45,aa */
4302         {0xaa, 0x04, 0x0008},                           /* 00,04,08,aa */
4303         {0xaa, 0x05, 0x0000},                           /* 00,05,00,aa */
4304         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4305         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4306         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,14,cc */
4307         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
4308         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4309         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,07,cc */
4310         {0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,c0,cc */
4311         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4312         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4313         {0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,40,cc */
4314         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4315         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4316         {0xa0, 0x45, ZC3XX_R01D_HSYNC_0},               /* 00,1d,45,cc */
4317         {0xa0, 0x8e, ZC3XX_R01E_HSYNC_1},               /* 00,1e,8e,cc */
4318         {0xa0, 0xc1, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c1,cc */
4319         {0xa0, 0xf5, ZC3XX_R020_HSYNC_3},               /* 00,20,f5,cc */
4320         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4321         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4322         {}
4323 };
4324 static const struct usb_action pas202b_60HZScale[] = {
4325         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4326         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4327         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4328         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4329         {0xaa, 0x21, 0x0004},                           /* 00,21,04,aa */
4330         {0xaa, 0x03, 0x0042},                           /* 00,03,42,aa */
4331         {0xaa, 0x04, 0x0008},                           /* 00,04,08,aa */
4332         {0xaa, 0x05, 0x0004},                           /* 00,05,04,aa */
4333         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4334         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4335         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,14,cc */
4336         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc */
4337         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4338         {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0f,cc */
4339         {0xa0, 0x9f, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,9f,cc */
4340         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4341         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4342         {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,81,cc */
4343         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4344         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4345         {0xa0, 0x42, ZC3XX_R01D_HSYNC_0},               /* 00,1d,42,cc */
4346         {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},               /* 00,1e,6f,cc */
4347         {0xa0, 0xaf, ZC3XX_R01F_HSYNC_2},               /* 00,1f,af,cc */
4348         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc */
4349         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4350         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4351         {}
4352 };
4353 static const struct usb_action pas202b_NoFliker[] = {
4354         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4355         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4356         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4357         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4358         {0xaa, 0x21, 0x0020},                           /* 00,21,20,aa */
4359         {0xaa, 0x03, 0x0040},                           /* 00,03,40,aa */
4360         {0xaa, 0x04, 0x0008},                           /* 00,04,08,aa */
4361         {0xaa, 0x05, 0x0020},                           /* 00,05,20,aa */
4362         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4363         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4364         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4365         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,07,cc */
4366         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,f0,cc */
4367         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4368         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4369         {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,02,cc */
4370         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4371         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4372         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,00,cc */
4373         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,00,cc */
4374         {0xa0, 0x40, ZC3XX_R01D_HSYNC_0},               /* 00,1d,40,cc */
4375         {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},               /* 00,1e,60,cc */
4376         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},               /* 00,1f,90,cc */
4377         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc */
4378         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4379         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4380         {}
4381 };
4382 static const struct usb_action pas202b_NoFlikerScale[] = {
4383         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},         /* 00,19,00,cc */
4384         {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},            /* 00,87,20,cc */
4385         {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},            /* 00,88,21,cc */
4386         {0xaa, 0x20, 0x0002},                           /* 00,20,02,aa */
4387         {0xaa, 0x21, 0x0010},                           /* 00,21,10,aa */
4388         {0xaa, 0x03, 0x0040},                           /* 00,03,40,aa */
4389         {0xaa, 0x04, 0x0008},                           /* 00,04,08,aa */
4390         {0xaa, 0x05, 0x0010},                           /* 00,05,10,aa */
4391         {0xaa, 0x0e, 0x0001},                           /* 00,0e,01,aa */
4392         {0xaa, 0x0f, 0x0000},                           /* 00,0f,00,aa */
4393         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc */
4394         {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0f,cc */
4395         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,f0,cc */
4396         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc */
4397         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc */
4398         {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,02,cc */
4399         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},              /* 01,8c,10,cc */
4400         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,20,cc */
4401         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,00,cc */
4402         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,00,cc */
4403         {0xa0, 0x40, ZC3XX_R01D_HSYNC_0},               /* 00,1d,40,cc */
4404         {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},               /* 00,1e,60,cc */
4405         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},               /* 00,1f,90,cc */
4406         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc */
4407         {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},            /* 00,87,0f,cc */
4408         {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},            /* 00,88,0e,cc */
4409         {}
4410 };
4411
4412 static const struct usb_action pb03303x_Initial[] = {
4413         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4414         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4415         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4416         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4417         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4418         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4419         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4420         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4421         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR}, /* 8b -> dc */
4422         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4423         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4424         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4425         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4426         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4427         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4428         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4429         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4430         {0xaa, 0x01, 0x0001},
4431         {0xaa, 0x06, 0x0000},
4432         {0xaa, 0x08, 0x0483},
4433         {0xaa, 0x01, 0x0004},
4434         {0xaa, 0x08, 0x0006},
4435         {0xaa, 0x02, 0x0011},
4436         {0xaa, 0x03, 0x01e7},
4437         {0xaa, 0x04, 0x0287},
4438         {0xaa, 0x07, 0x3002},
4439         {0xaa, 0x20, 0x1100},
4440         {0xaa, 0x35, 0x0050},
4441         {0xaa, 0x30, 0x0005},
4442         {0xaa, 0x31, 0x0000},
4443         {0xaa, 0x58, 0x0078},
4444         {0xaa, 0x62, 0x0411},
4445         {0xaa, 0x2b, 0x0028},
4446         {0xaa, 0x2c, 0x0030},
4447         {0xaa, 0x2d, 0x0030},
4448         {0xaa, 0x2e, 0x0028},
4449         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4450         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4451         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4452         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4453         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4454         {0xa0, 0x00, 0x01ad},
4455         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4456         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4457         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4458         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4459         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4460         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
4461         {0xa0, 0x61, ZC3XX_R116_RGAIN},
4462         {0xa0, 0x65, ZC3XX_R118_BGAIN},
4463
4464         {0xa1, 0x01, 0x0002},
4465         {0xa0, 0x09, 0x01ad},
4466         {0xa0, 0x15, 0x01ae},
4467         {0xa0, 0x0d, 0x003a},
4468         {0xa0, 0x02, 0x003b},
4469         {0xa0, 0x00, 0x0038},
4470         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4471         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4472         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4473         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4474         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4475         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4476         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4477         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4478         {0xa0, 0x50, ZC3XX_R112_RGB22},
4479
4480         {0xa1, 0x01, 0x0008},
4481         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4482         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4483         {0xa1, 0x01, 0x01c8},
4484         {0xa1, 0x01, 0x01c9},
4485         {0xa1, 0x01, 0x01ca},
4486         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4487         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
4488         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
4489         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
4490         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
4491         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
4492         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
4493         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
4494         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
4495         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
4496         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
4497         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
4498         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
4499         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
4500         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
4501         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
4502         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4503         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
4504         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4505         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4506         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4507         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4508         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4509         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4510         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4511         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4512         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4513         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4514         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4515         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4516         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4517         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
4518         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
4519         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4520         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4521         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4522         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4523         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4524         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4525         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4526         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4527         {0xa0, 0x50, ZC3XX_R112_RGB22},
4528
4529         {0xa1, 0x01, 0x0180},
4530         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4531         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4532         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4533         {0xaa, 0x05, 0x0009},
4534         {0xaa, 0x09, 0x0134},
4535         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4536         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4537         {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
4538         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4539         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4540         {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
4541         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4542         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4543         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4544         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4545         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4546         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4547         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4548         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4549         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4550         {0xa0, 0x09, 0x01ad},
4551         {0xa0, 0x15, 0x01ae},
4552         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4553         {0xa1, 0x01, 0x0180},
4554         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4555         {}
4556 };
4557
4558 static const struct usb_action pb03303x_InitialScale[] = {
4559         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4560         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4561         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4562         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4563         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4564         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4565         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4566         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4567         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR}, /* 8b -> dc */
4568         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4569         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4570         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4571         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4572         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4573         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4574         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4575         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4576         {0xaa, 0x01, 0x0001},
4577         {0xaa, 0x06, 0x0000},
4578         {0xaa, 0x08, 0x0483},
4579         {0xaa, 0x01, 0x0004},
4580         {0xaa, 0x08, 0x0006},
4581         {0xaa, 0x02, 0x0011},
4582         {0xaa, 0x03, 0x01e7},
4583         {0xaa, 0x04, 0x0287},
4584         {0xaa, 0x07, 0x3002},
4585         {0xaa, 0x20, 0x1100},
4586         {0xaa, 0x35, 0x0050},
4587         {0xaa, 0x30, 0x0005},
4588         {0xaa, 0x31, 0x0000},
4589         {0xaa, 0x58, 0x0078},
4590         {0xaa, 0x62, 0x0411},
4591         {0xaa, 0x2b, 0x0028},
4592         {0xaa, 0x2c, 0x0030},
4593         {0xaa, 0x2d, 0x0030},
4594         {0xaa, 0x2e, 0x0028},
4595         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4596         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4597         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4598         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4599         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4600         {0xa0, 0x00, 0x01ad},
4601         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4602         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4603         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4604         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4605         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4606         {0xa0, 0x78, ZC3XX_R18D_YTARGET},
4607         {0xa0, 0x61, ZC3XX_R116_RGAIN},
4608         {0xa0, 0x65, ZC3XX_R118_BGAIN},
4609
4610         {0xa1, 0x01, 0x0002},
4611
4612         {0xa0, 0x09, 0x01ad},
4613         {0xa0, 0x15, 0x01ae},
4614
4615         {0xa0, 0x0d, 0x003a},
4616         {0xa0, 0x02, 0x003b},
4617         {0xa0, 0x00, 0x0038},
4618         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4619         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4620         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4621         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4622         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4623         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4624         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4625         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4626         {0xa0, 0x50, ZC3XX_R112_RGB22},
4627
4628         {0xa1, 0x01, 0x0008},
4629         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4630         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4631         {0xa1, 0x01, 0x01c8},
4632         {0xa1, 0x01, 0x01c9},
4633         {0xa1, 0x01, 0x01ca},
4634         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4635
4636         {0xa0, 0x13, ZC3XX_R120_GAMMA00},       /* gamma 4 */
4637         {0xa0, 0x38, ZC3XX_R121_GAMMA01},
4638         {0xa0, 0x59, ZC3XX_R122_GAMMA02},
4639         {0xa0, 0x79, ZC3XX_R123_GAMMA03},
4640         {0xa0, 0x92, ZC3XX_R124_GAMMA04},
4641         {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
4642         {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
4643         {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
4644         {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
4645         {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
4646         {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
4647         {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
4648         {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
4649         {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
4650         {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
4651         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4652         {0xa0, 0x26, ZC3XX_R130_GAMMA10},
4653         {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4654         {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4655         {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4656         {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4657         {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4658         {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4659         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4660         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4661         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4662         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4663         {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4664         {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4665         {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4666         {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
4667         {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
4668         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4669         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4670         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4671         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4672         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4673         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4674         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4675         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4676         {0xa0, 0x50, ZC3XX_R112_RGB22},
4677
4678         {0xa1, 0x01, 0x0180},
4679         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4680         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4681         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4682         {0xaa, 0x05, 0x0009},
4683         {0xaa, 0x09, 0x0134},
4684         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4685         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4686         {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
4687         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4688         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4689         {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
4690         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4691         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4692         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4693         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4694         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4695         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4696         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4697         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4698         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4699         {0xa0, 0x09, 0x01ad},
4700         {0xa0, 0x15, 0x01ae},
4701         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4702         {0xa1, 0x01, 0x0180},
4703         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4704         {}
4705 };
4706 static const struct usb_action pb0330xx_Initial[] = {
4707         {0xa1, 0x01, 0x0008},
4708         {0xa1, 0x01, 0x0008},
4709         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4710         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
4711         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4712         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4713         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4714         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4715         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4716         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4717         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4718         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4719         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4720         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4721         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4722         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4723         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4724         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4725         {0xaa, 0x01, 0x0006},
4726         {0xaa, 0x02, 0x0011},
4727         {0xaa, 0x03, 0x01e7},
4728         {0xaa, 0x04, 0x0287},
4729         {0xaa, 0x06, 0x0003},
4730         {0xaa, 0x07, 0x3002},
4731         {0xaa, 0x20, 0x1100},
4732         {0xaa, 0x2f, 0xf7b0},
4733         {0xaa, 0x30, 0x0005},
4734         {0xaa, 0x31, 0x0000},
4735         {0xaa, 0x34, 0x0100},
4736         {0xaa, 0x35, 0x0060},
4737         {0xaa, 0x3d, 0x068f},
4738         {0xaa, 0x40, 0x01e0},
4739         {0xaa, 0x58, 0x0078},
4740         {0xaa, 0x62, 0x0411},
4741         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4742         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4743         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4744         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4745         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4746         {0xa0, 0x00, 0x01ad},
4747         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4748         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4749         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4750         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4751         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4752         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4753         {0xa1, 0x01, 0x0002},
4754         {0xa0, 0x09, 0x01ad},
4755         {0xa0, 0x15, 0x01ae},
4756         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
4757         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
4758         {0xa1, 0x01, 0x0091},
4759         {0xa1, 0x01, 0x0095},
4760         {0xa1, 0x01, 0x0096},
4761         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4762         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4763         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4764         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4765         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4766         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4767         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4768         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4769         {0xa0, 0x50, ZC3XX_R112_RGB22},
4770         {0xa1, 0x01, 0x0008},
4771         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4772         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4773         {0xa1, 0x01, 0x01c8},
4774         {0xa1, 0x01, 0x01c9},
4775         {0xa1, 0x01, 0x01ca},
4776         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4777
4778         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4779         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4780         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4781         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4782         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4783         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4784         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4785         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4786         {0xa0, 0x50, ZC3XX_R112_RGB22},
4787         {0xa1, 0x01, 0x0180},
4788         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4789         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4790         {0xaa, 0x05, 0x0066},
4791         {0xaa, 0x09, 0x02b2},
4792         {0xaa, 0x10, 0x0002},
4793
4794         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4795         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4796         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4797         {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4798         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4799         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4800         {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4801         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4802         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4803         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4804         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4805         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4806         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4807         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4808         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4809         {0xa0, 0x09, 0x01ad},
4810         {0xa0, 0x15, 0x01ae},
4811         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4812         {0xa1, 0x01, 0x0180},
4813         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4814         {0xa1, 0x01, 0x0008},
4815         {0xa1, 0x01, 0x0007},
4816 /*      {0xa0, 0x30, 0x0007}, */
4817 /*      {0xa0, 0x00, 0x0007}, */
4818         {}
4819 };
4820
4821 static const struct usb_action pb0330xx_InitialScale[] = {
4822         {0xa1, 0x01, 0x0008},
4823         {0xa1, 0x01, 0x0008},
4824         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4825         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
4826         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4827         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* 10 */
4828         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4829         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4830         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4831         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4832         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4833         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4834         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4835         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4836         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4837         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4838         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4839         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4840         {0xaa, 0x01, 0x0006},
4841         {0xaa, 0x02, 0x0011},
4842         {0xaa, 0x03, 0x01e7},
4843         {0xaa, 0x04, 0x0287},
4844         {0xaa, 0x06, 0x0003},
4845         {0xaa, 0x07, 0x3002},
4846         {0xaa, 0x20, 0x1100},
4847         {0xaa, 0x2f, 0xf7b0},
4848         {0xaa, 0x30, 0x0005},
4849         {0xaa, 0x31, 0x0000},
4850         {0xaa, 0x34, 0x0100},
4851         {0xaa, 0x35, 0x0060},
4852         {0xaa, 0x3d, 0x068f},
4853         {0xaa, 0x40, 0x01e0},
4854         {0xaa, 0x58, 0x0078},
4855         {0xaa, 0x62, 0x0411},
4856         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4857         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4858         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4859         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4860         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4861         {0xa0, 0x00, 0x01ad},
4862         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4863         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4864         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4865         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4866         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4867         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4868         {0xa1, 0x01, 0x0002},
4869         {0xa0, 0x09, 0x01ad},
4870         {0xa0, 0x15, 0x01ae},
4871         {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
4872         {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
4873         {0xa1, 0x01, 0x0091},
4874         {0xa1, 0x01, 0x0095},
4875         {0xa1, 0x01, 0x0096},
4876         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4877         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4878         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4879         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4880         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4881         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4882         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4883         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4884         {0xa0, 0x50, ZC3XX_R112_RGB22},
4885         {0xa1, 0x01, 0x0008},
4886         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
4887         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
4888         {0xa1, 0x01, 0x01c8},
4889         {0xa1, 0x01, 0x01c9},
4890         {0xa1, 0x01, 0x01ca},
4891         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
4892
4893         {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4894         {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4895         {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4896         {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4897         {0xa0, 0x50, ZC3XX_R10E_RGB11},
4898         {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4899         {0xa0, 0xf8, ZC3XX_R110_RGB20},
4900         {0xa0, 0xf8, ZC3XX_R111_RGB21},
4901         {0xa0, 0x50, ZC3XX_R112_RGB22},
4902         {0xa1, 0x01, 0x0180},
4903         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4904         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4905         {0xaa, 0x05, 0x0066},
4906         {0xaa, 0x09, 0x02b2},
4907         {0xaa, 0x10, 0x0002},
4908         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4909         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4910         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4911         {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4912         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4913         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4914         {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4915         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4916         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4917         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4918         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4919         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4920         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4921         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4922         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4923         {0xa0, 0x09, 0x01ad},
4924         {0xa0, 0x15, 0x01ae},
4925         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4926         {0xa1, 0x01, 0x0180},
4927         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4928         {0xa1, 0x01, 0x0008},
4929         {0xa1, 0x01, 0x0007},
4930 /*      {0xa0, 0x30, 0x0007}, */
4931 /*      {0xa0, 0x00, 0x0007}, */
4932         {}
4933 };
4934 static const struct usb_action pb0330_50HZ[] = {
4935         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4936         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4937         {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,ee,cc */
4938         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4939         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4940         {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
4941         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4942         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4943         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4944         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4945         {0xa0, 0x68, ZC3XX_R01D_HSYNC_0}, /* 00,1d,68,cc */
4946         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
4947         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
4948         {}
4949 };
4950 static const struct usb_action pb0330_50HZScale[] = {
4951         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4952         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4953         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4954         {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
4955         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4956         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4957         {0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
4958         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4959         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4960         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4961         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4962         {0xa0, 0xe5, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e5,cc */
4963         {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f0,cc */
4964         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
4965         {}
4966 };
4967 static const struct usb_action pb0330_60HZ[] = {
4968         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4969         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4970         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4971         {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,dd,cc */
4972         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4973         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4974         {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
4975         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4976         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4977         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4978         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4979         {0xa0, 0x43, ZC3XX_R01D_HSYNC_0}, /* 00,1d,43,cc */
4980         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
4981         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4982         {}
4983 };
4984 static const struct usb_action pb0330_60HZScale[] = {
4985         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4986         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4987         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4988         {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
4989         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4990         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4991         {0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
4992         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4993         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4994         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4995         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4996         {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
4997         {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
4998         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4999         {}
5000 };
5001 static const struct usb_action pb0330_NoFliker[] = {
5002         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5003         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5004         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
5005         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5006         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5007         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5008         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5009         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5010         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5011         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5012         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5013         {0xa0, 0x09, ZC3XX_R01D_HSYNC_0}, /* 00,1d,09,cc */
5014         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
5015         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
5016         {}
5017 };
5018 static const struct usb_action pb0330_NoFlikerScale[] = {
5019         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5020         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5021         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
5022         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5023         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5024         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5025         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5026         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},      /* 01,8c,10,cc */
5027         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},    /* 01,8f,20,cc */
5028         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5029         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5030         {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},       /* 00,1d,09,cc */
5031         {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},       /* 00,1e,40,cc */
5032         {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},       /* 00,1f,90,cc */
5033         {}
5034 };
5035
5036 /* from oem9.inf - HKR,%PO2030%,Initial - 640x480 - (close to CS2102) */
5037 static const struct usb_action PO2030_mode0[] = {
5038         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5039         {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},   /* 00,02,04,cc */
5040         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5041         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5042         {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5043         {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5044         {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5045         {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5046         {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5047         {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5048         {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5049         {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5050         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5051         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5052         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5053         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5054         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5055         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5056         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5057         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5058         {0xaa, 0x8d, 0x0008},                   /* 00,8d,08,aa */
5059         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},  /* 00,98,00,cc */
5060         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},  /* 00,9a,00,cc */
5061         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},     /* 01,1a,00,cc */
5062         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},     /* 01,1c,00,cc */
5063         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},  /* 00,9c,e6,cc */
5064         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},   /* 00,9e,86,cc */
5065         {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
5066         {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5067         {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
5068         {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
5069         {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5070         {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5071         {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5072         {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5073         {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5074         {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5075         {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5076         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5077         {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5078         {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5079         {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5080         {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5081         {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5082         {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5083         {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5084         {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5085         {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5086         {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5087         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5088         {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5089         {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5090         {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5091         {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5092         {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5093         {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5094         {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5095         {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5096         {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5097         {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5098         {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5099         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5100         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5101         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5102         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
5103         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5104         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5105         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5106         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5107         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5108         {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5109         {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
5110         {}
5111 };
5112
5113 /* from oem9.inf - HKR,%PO2030%,InitialScale - 320x240 */
5114 static const struct usb_action PO2030_mode1[] = {
5115         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5116         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
5117         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5118         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5119         {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5120         {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5121         {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5122         {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5123         {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5124         {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5125         {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5126         {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5127         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5128         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5129         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5130         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5131         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5132         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5133         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5134         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5135         {0xaa, 0x8d, 0x0008},                   /* 00,8d,08,aa */
5136         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
5137         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
5138         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
5139         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
5140         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
5141         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
5142         {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
5143         {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5144         {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
5145         {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
5146         {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5147         {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5148         {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5149         {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5150         {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5151         {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5152         {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5153         {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5154         {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5155         {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5156         {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5157         {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5158         {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5159         {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5160         {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5161         {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5162         {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5163         {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5164         {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5165         {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5166         {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5167         {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5168         {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5169         {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5170         {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5171         {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5172         {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5173         {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5174         {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5175         {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5176         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5177         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5178         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5179         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
5180         {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5181         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5182         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5183         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5184         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5185         {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5186         {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
5187         {}
5188 };
5189
5190 static const struct usb_action PO2030_50HZ[] = {
5191         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5192         {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
5193         {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
5194         {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
5195         {0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
5196         {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
5197         {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
5198         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5199         {0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
5200         {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
5201         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5202         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5203         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5204         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5205         {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5206         {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5207         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5208         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5209         {}
5210 };
5211
5212 static const struct usb_action PO2030_60HZ[] = {
5213         {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5214         {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5215         {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
5216         {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
5217         {0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
5218         {0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
5219         {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
5220         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5221         {0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
5222         {0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
5223         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5224         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5225         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5226         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5227         {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,22,cc */
5228         {0xa0, 0x88, ZC3XX_R18D_YTARGET},               /* 01,8d,88,cc */
5229                                                         /* win: 01,8d,80 */
5230         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc */
5231         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc */
5232         {}
5233 };
5234
5235 static const struct usb_action PO2030_NoFliker[] = {
5236         {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
5237         {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
5238         {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5239         {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
5240         {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
5241         {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
5242         {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
5243         {}
5244 };
5245
5246 /* TEST */
5247 static const struct usb_action tas5130CK_Initial[] = {
5248         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5249         {0xa0, 0x01, 0x003b},
5250         {0xa0, 0x0e, 0x003a},
5251         {0xa0, 0x01, 0x0038},
5252         {0xa0, 0x0b, 0x0039},
5253         {0xa0, 0x00, 0x0038},
5254         {0xa0, 0x0b, 0x0039},
5255         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5256         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5257         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5258         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
5259         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5260         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5261         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5262         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5263         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5264         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5265         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5266         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5267         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5268         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5269         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5270         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5271         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5272         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5273         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5274         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5275         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5276         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5277         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5278         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5279         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5280         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5281         {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5282         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5283         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5284         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5285         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5286         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5287         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5288         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5289         {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5290         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5291         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5292         {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5293         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5294         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5295         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5296         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5297         {0xa0, 0xE7, ZC3XX_R093_I2CSETVALUE},
5298         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5299         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5300         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5301         {0xa0, 0x87, ZC3XX_R093_I2CSETVALUE},
5302         {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5303         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5304         {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5305         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5306         {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5307         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5308         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5309         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5310         {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5311         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5312         {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5313         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5314         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5315         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5316         {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5317         {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5318         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5319         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5320         {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5321         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5322         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5323         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5324         {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5325         {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5326         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5327         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5328         {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5329         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5330         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5331         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5332         {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5333         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5334         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5335         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5336         {0xa0, 0x2c, ZC3XX_R092_I2CADDRESSSELECT},
5337         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5338         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5339         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5340         {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5341         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5342         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5343         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5344         {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5345         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5346         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5347         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5348         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5349         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5350         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5351         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5352         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5353         {0xa0, 0x09, 0x01ad},
5354         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5355         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5356         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5357         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5358         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5359         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5360         {0xa0, 0x61, ZC3XX_R116_RGAIN},
5361         {0xa0, 0x65, ZC3XX_R118_BGAIN},
5362         {0xa0, 0x09, 0x01ad},
5363         {0xa0, 0x15, 0x01ae},
5364         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5365         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5366         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5367         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5368         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5369         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5370         {0xa0, 0xec, ZC3XX_R110_RGB20},
5371         {0xa0, 0x03, ZC3XX_R111_RGB21},
5372         {0xa0, 0x51, ZC3XX_R112_RGB22},
5373         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5374         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5375         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5376         {0xa0, 0x38, ZC3XX_R120_GAMMA00},       /* gamma > 5 */
5377         {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5378         {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5379         {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5380         {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5381         {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5382         {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5383         {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5384         {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5385         {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5386         {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5387         {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5388         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5389         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5390         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5391         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5392         {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5393         {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5394         {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5395         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5396         {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5397         {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5398         {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5399         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5400         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5401         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5402         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5403         {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5404         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5405         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5406         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5407         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5408         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5409         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5410         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5411         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5412         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5413         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5414         {0xa0, 0xec, ZC3XX_R110_RGB20},
5415         {0xa0, 0x03, ZC3XX_R111_RGB21},
5416         {0xa0, 0x51, ZC3XX_R112_RGB22},
5417         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5418         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5419         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5420         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5421         {0xa0, 0x09, ZC3XX_R093_I2CSETVALUE},
5422         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5423         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5424         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5425         {0xa0, 0x34, ZC3XX_R093_I2CSETVALUE},
5426         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5427         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5428         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5429         {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5430         {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
5431         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5432         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5433         {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
5434         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5435         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5436         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5437         {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5438         {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
5439         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5440         {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
5441         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5442         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5443         {0xa0, 0x09, 0x01ad},
5444         {0xa0, 0x15, 0x01ae},
5445         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5446         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5447         {}
5448 };
5449
5450 static const struct usb_action tas5130CK_InitialScale[] = {
5451         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5452         {0xa0, 0x01, 0x003b},
5453         {0xa0, 0x0e, 0x003a},
5454         {0xa0, 0x01, 0x0038},
5455         {0xa0, 0x0b, 0x0039},
5456         {0xa0, 0x00, 0x0038},
5457         {0xa0, 0x0b, 0x0039},
5458         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5459         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5460         {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5461         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
5462         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5463         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5464         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5465         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5466         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5467         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5468         {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5469         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5470         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5471         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5472         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5473         {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5474         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5475         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5476         {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5477         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5478         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5479         {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5480         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5481         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5482         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5483         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5484         {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5485         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5486         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5487         {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5488         {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5489         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5490         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5491         {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5492         {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5493         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5494         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5495         {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5496         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5497         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5498         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5499         {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5500         {0xa0, 0xe5, ZC3XX_R093_I2CSETVALUE},
5501         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5502         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5503         {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5504         {0xa0, 0x85, ZC3XX_R093_I2CSETVALUE},
5505         {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5506         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5507         {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5508         {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5509         {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5510         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5511         {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5512         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5513         {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5514         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5515         {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5516         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5517         {0xa0, 0x50, ZC3XX_R094_I2CWRITEACK},
5518         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5519         {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5520         {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5521         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5522         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5523         {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5524         {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5525         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5526         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5527         {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5528         {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5529         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5530         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5531         {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5532         {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5533         {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5534         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5535         {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5536         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5537         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5538         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5539         {0xa0, 0x2C, ZC3XX_R092_I2CADDRESSSELECT},
5540         {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5541         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5542         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5543         {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5544         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5545         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5546         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5547         {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5548         {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5549         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5550         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5551         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5552         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5553         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5554         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5555         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5556         {0xa0, 0x09, 0x01ad},
5557         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5558         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5559         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5560         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5561         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5562         {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5563         {0xa0, 0x61, ZC3XX_R116_RGAIN},
5564         {0xa0, 0x65, ZC3XX_R118_BGAIN},
5565         {0xa0, 0x09, 0x01ad},
5566         {0xa0, 0x15, 0x01ae},
5567         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5568         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5569         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5570         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5571         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5572         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5573         {0xa0, 0xec, ZC3XX_R110_RGB20},
5574         {0xa0, 0x03, ZC3XX_R111_RGB21},
5575         {0xa0, 0x51, ZC3XX_R112_RGB22},
5576         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5577         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5578         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5579         {0xa0, 0x38, ZC3XX_R120_GAMMA00},       /* gamma > 5 */
5580         {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5581         {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5582         {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5583         {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5584         {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5585         {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5586         {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5587         {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5588         {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5589         {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5590         {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5591         {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5592         {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5593         {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5594         {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5595         {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5596         {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5597         {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5598         {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5599         {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5600         {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5601         {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5602         {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5603         {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5604         {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5605         {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5606         {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5607         {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5608         {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5609         {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5610         {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5611         {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5612         {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5613         {0xa0, 0x03, ZC3XX_R10C_RGB02},
5614         {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5615         {0xa0, 0x51, ZC3XX_R10E_RGB11},
5616         {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5617         {0xa0, 0xec, ZC3XX_R110_RGB20},
5618         {0xa0, 0x03, ZC3XX_R111_RGB21},
5619         {0xa0, 0x51, ZC3XX_R112_RGB22},
5620         {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5621         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5622         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5623         {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5624         {0xa0, 0x62, ZC3XX_R093_I2CSETVALUE},
5625         {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5626         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5627         {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5628         {0xa0, 0xaa, ZC3XX_R093_I2CSETVALUE},
5629         {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5630         {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5631         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5632         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
5633         {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
5634         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5635         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5636         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5637         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5638         {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5639         {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5640         {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5641         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
5642         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
5643         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
5644         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5645         {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
5646         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5647         {0xa0, 0x09, 0x01ad},
5648         {0xa0, 0x15, 0x01ae},
5649         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5650         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5651         {0xa0, 0x30, 0x0007},
5652         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
5653         {0xa0, 0x00, 0x0007},
5654         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5655         {}
5656 };
5657
5658 static const struct usb_action tas5130cxx_Initial[] = {
5659         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5660         {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
5661         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5662         {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5663         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5664         {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5665         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5666         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5667         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5668         {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5669         {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5670
5671         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5672         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5673         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5674         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5675
5676         {0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
5677         {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5678         {0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
5679         {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5680         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
5681         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5682         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
5683         {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5684         {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5685         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5686         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5687         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
5688         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5689         {0xa0, 0x00, 0x01ad},
5690         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5691         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5692         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5693         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5694         {0xa1, 0x01, 0x0002},
5695         {0xa1, 0x01, 0x0008},
5696         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* clock ? */
5697         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5698         {0xa1, 0x01, 0x01c8},
5699         {0xa1, 0x01, 0x01c9},
5700         {0xa1, 0x01, 0x01ca},
5701         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5702
5703         {0xa0, 0x68, ZC3XX_R10A_RGB00}, /* matrix */
5704         {0xa0, 0xec, ZC3XX_R10B_RGB01},
5705         {0xa0, 0xec, ZC3XX_R10C_RGB02},
5706         {0xa0, 0xec, ZC3XX_R10D_RGB10},
5707         {0xa0, 0x68, ZC3XX_R10E_RGB11},
5708         {0xa0, 0xec, ZC3XX_R10F_RGB12},
5709         {0xa0, 0xec, ZC3XX_R110_RGB20},
5710         {0xa0, 0xec, ZC3XX_R111_RGB21},
5711         {0xa0, 0x68, ZC3XX_R112_RGB22},
5712
5713         {0xa1, 0x01, 0x018d},
5714         {0xa0, 0x90, ZC3XX_R18D_YTARGET},       /* 90 */
5715         {0xa1, 0x01, 0x0180},
5716         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5717         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5718
5719         {0xaa, 0xa3, 0x0001},
5720         {0xaa, 0xa4, 0x0077},
5721         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
5722         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW},
5723
5724         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 00 */
5725         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},      /* 03 */
5726         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW},      /* e8 */
5727         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 0 */
5728         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 0 */
5729         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW},        /* 7d */
5730
5731         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5732         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5733         {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 08 */
5734         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 24 */
5735         {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0},
5736         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5737         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
5738         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5739         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
5740         {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
5741         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},    /* 50 */
5742         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5743         {0xa1, 0x01, 0x0180},
5744         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5745         {}
5746 };
5747 static const struct usb_action tas5130cxx_InitialScale[] = {
5748 /*??    {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, */
5749         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5750         {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
5751
5752         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5753         {0xa1, 0x01, 0x0008},
5754
5755         {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5756         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5757         {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5758         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5759         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5760         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5761         {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5762         {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5763         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5764         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5765         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5766         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5767         {0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
5768         {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5769         {0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
5770         {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5771         {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
5772         {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5773         {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
5774         {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5775         {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5776         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5777         {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5778         {0xa0, 0x68, ZC3XX_R18D_YTARGET},
5779         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5780         {0xa0, 0x00, 0x01ad},
5781         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5782         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5783         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5784         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5785         {0xa1, 0x01, 0x0002},
5786         {0xa1, 0x01, 0x0008},
5787
5788         {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5789         {0xa1, 0x01, 0x0008},   /* clock ? */
5790         {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
5791         {0xa1, 0x01, 0x01c8},
5792         {0xa1, 0x01, 0x01c9},
5793         {0xa1, 0x01, 0x01ca},
5794         {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},   /* sharpness- */
5795
5796         {0xa0, 0x68, ZC3XX_R10A_RGB00}, /* matrix */
5797         {0xa0, 0xec, ZC3XX_R10B_RGB01},
5798         {0xa0, 0xec, ZC3XX_R10C_RGB02},
5799         {0xa0, 0xec, ZC3XX_R10D_RGB10},
5800         {0xa0, 0x68, ZC3XX_R10E_RGB11},
5801         {0xa0, 0xec, ZC3XX_R10F_RGB12},
5802         {0xa0, 0xec, ZC3XX_R110_RGB20},
5803         {0xa0, 0xec, ZC3XX_R111_RGB21},
5804         {0xa0, 0x68, ZC3XX_R112_RGB22},
5805
5806         {0xa1, 0x01, 0x018d},
5807         {0xa0, 0x90, ZC3XX_R18D_YTARGET},
5808         {0xa1, 0x01, 0x0180},
5809         {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5810         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5811         {0xaa, 0xa3, 0x0001},
5812         {0xaa, 0xa4, 0x0063},
5813         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
5814         {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW},
5815         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5816         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
5817         {0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW},
5818         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5819         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5820         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5821         {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5822         {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5823         {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5824         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
5825         {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0},
5826         {0xa0, 0xda, ZC3XX_R01E_HSYNC_1},
5827         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
5828         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5829         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
5830         {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
5831         {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5832         {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5833         {0xa1, 0x01, 0x0180},
5834         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5835         {}
5836 };
5837 static const struct usb_action tas5130cxx_50HZ[] = {
5838         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5839         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5840         {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
5841         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5842         {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
5843         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5844         {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
5845         {0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,38,cc */
5846         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5847         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5848         {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
5849         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5850         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5851         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5852         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5853         {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
5854         {0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
5855         {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
5856         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5857         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5858         {}
5859 };
5860 static const struct usb_action tas5130cxx_50HZScale[] = {
5861         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5862         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5863         {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5864         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5865         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5866         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5867         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5868         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
5869         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5870         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5871         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5872         {0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
5873         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5874         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5875         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5876         {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
5877         {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
5878         {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
5879         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5880         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5881         {}
5882 };
5883 static const struct usb_action tas5130cxx_60HZ[] = {
5884         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5885         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5886         {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
5887         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5888         {0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
5889         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5890         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
5891         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5892         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5893         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5894         {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
5895         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5896         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5897         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5898         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5899         {0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
5900         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5901         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5902         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5903         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5904         {}
5905 };
5906 static const struct usb_action tas5130cxx_60HZScale[] = {
5907         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5908         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5909         {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5910         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5911         {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5912         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5913         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5914         {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
5915         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5916         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5917         {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5918         {0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
5919         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5920         {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5921         {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5922         {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
5923         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5924         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5925         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5926         {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5927         {}
5928 };
5929 static const struct usb_action tas5130cxx_NoFliker[] = {
5930         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5931         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5932         {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
5933         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5934         {0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
5935         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5936         {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
5937         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5938         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5939         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5940         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5941         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5942         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5943         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5944         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5945         {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5946         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5947         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5948         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5949         {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5950         {}
5951 };
5952
5953 static const struct usb_action tas5130cxx_NoFlikerScale[] = {
5954         {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5955         {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5956         {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
5957         {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5958         {0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
5959         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5960         {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5961         {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5962         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5963         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5964         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5965         {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5966         {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5967         {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5968         {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5969         {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5970         {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5971         {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5972         {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5973         {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5974         {}
5975 };
5976
5977 static const struct usb_action tas5130c_vf0250_Initial[] = {
5978         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc, */
5979         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},          /* 00,08,02,cc, */
5980         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc, */
5981         {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},           /* 00,02,00,cc,
5982                                                          * 0<->10 */
5983         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc, */
5984         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc, */
5985         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc, */
5986         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc, */
5987         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
5988         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc, */
5989         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc, */
5990         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc, */
5991         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc, */
5992         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,00,cc, */
5993         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc, */
5994         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,00,cc, */
5995         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,e6,cc,
5996                                                          * 6<->8 */
5997         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,86,cc,
5998                                                          * 6<->8 */
5999         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},            /* 00,87,10,cc, */
6000         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
6001         {0xaa, 0x1b, 0x0024},           /* 00,1b,24,aa, */
6002         {0xdd, 0x00, 0x0080},           /* 00,00,80,dd, */
6003         {0xaa, 0x1b, 0x0000},           /* 00,1b,00,aa, */
6004         {0xaa, 0x13, 0x0002},           /* 00,13,02,aa, */
6005         {0xaa, 0x15, 0x0004},           /* 00,15,04,aa */
6006 /*??    {0xaa, 0x01, 0x0000}, */
6007         {0xaa, 0x01, 0x0000},
6008         {0xaa, 0x1a, 0x0000},           /* 00,1a,00,aa, */
6009         {0xaa, 0x1c, 0x0017},           /* 00,1c,17,aa, */
6010         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},           /* 00,86,82,cc, */
6011         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},            /* 00,87,83,cc, */
6012         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},            /* 00,88,84,cc, */
6013         {0xaa, 0x05, 0x0010},           /* 00,05,10,aa, */
6014         {0xaa, 0x0a, 0x0000},           /* 00,0a,00,aa, */
6015         {0xaa, 0x0b, 0x00a0},           /* 00,0b,a0,aa, */
6016         {0xaa, 0x0c, 0x0000},           /* 00,0c,00,aa, */
6017         {0xaa, 0x0d, 0x00a0},           /* 00,0d,a0,aa, */
6018         {0xaa, 0x0e, 0x0000},           /* 00,0e,00,aa, */
6019         {0xaa, 0x0f, 0x00a0},           /* 00,0f,a0,aa, */
6020         {0xaa, 0x10, 0x0000},           /* 00,10,00,aa, */
6021         {0xaa, 0x11, 0x00a0},           /* 00,11,a0,aa, */
6022 /*??    {0xa0, 0x00, 0x0039},
6023         {0xa1, 0x01, 0x0037}, */
6024         {0xaa, 0x16, 0x0001},           /* 00,16,01,aa, */
6025         {0xaa, 0x17, 0x00e8},           /* 00,17,e6,aa, (e6 -> e8) */
6026         {0xaa, 0x18, 0x0002},           /* 00,18,02,aa, */
6027         {0xaa, 0x19, 0x0088},           /* 00,19,86,aa, */
6028         {0xaa, 0x20, 0x0020},           /* 00,20,20,aa, */
6029         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc, */
6030         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc, */
6031         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc, */
6032         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},             /* 01,89,76,cc, */
6033         {0xa0, 0x09, 0x01ad},                           /* 01,ad,09,cc, */
6034         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc, */
6035         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc, */
6036         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc, */
6037         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc, */
6038         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},           /* 01,a8,60,cc, */
6039         {0xa0, 0x61, ZC3XX_R116_RGAIN},                 /* 01,16,61,cc, */
6040         {0xa0, 0x65, ZC3XX_R118_BGAIN},                 /* 01,18,65,cc */
6041         {}
6042 };
6043
6044 static const struct usb_action tas5130c_vf0250_InitialScale[] = {
6045         {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},         /* 00,00,01,cc, */
6046         {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},          /* 00,08,02,cc, */
6047         {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},      /* 00,10,01,cc, */
6048         {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},           /* 00,02,10,cc, */
6049         {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},        /* 00,03,02,cc, */
6050         {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},         /* 00,04,80,cc, */
6051         {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},       /* 00,05,01,cc, */
6052         {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},        /* 00,06,e0,cc, */
6053         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
6054         {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},       /* 00,01,01,cc, */
6055         {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,03,cc, */
6056         {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,01,cc, */
6057         {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},          /* 00,98,00,cc, */
6058         {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},          /* 00,9a,00,cc, */
6059         {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},             /* 01,1a,00,cc, */
6060         {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},             /* 01,1c,00,cc, */
6061         {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},          /* 00,9c,e8,cc,
6062                                                          * 8<->6 */
6063         {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},           /* 00,9e,88,cc,
6064                                                          * 8<->6 */
6065         {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},            /* 00,87,10,cc, */
6066         {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},         /* 00,8b,98,cc, */
6067         {0xaa, 0x1b, 0x0024},           /* 00,1b,24,aa, */
6068         {0xdd, 0x00, 0x0080},           /* 00,00,80,dd, */
6069         {0xaa, 0x1b, 0x0000},           /* 00,1b,00,aa, */
6070         {0xaa, 0x13, 0x0002},           /* 00,13,02,aa, */
6071         {0xaa, 0x15, 0x0004},           /* 00,15,04,aa */
6072 /*??    {0xaa, 0x01, 0x0000}, */
6073         {0xaa, 0x01, 0x0000},
6074         {0xaa, 0x1a, 0x0000},           /* 00,1a,00,aa, */
6075         {0xaa, 0x1c, 0x0017},           /* 00,1c,17,aa, */
6076         {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},   /* 00,86,82,cc, */
6077         {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},    /* 00,87,83,cc, */
6078         {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},    /* 00,88,84,cc, */
6079         {0xaa, 0x05, 0x0010},           /* 00,05,10,aa, */
6080         {0xaa, 0x0a, 0x0000},           /* 00,0a,00,aa, */
6081         {0xaa, 0x0b, 0x00a0},           /* 00,0b,a0,aa, */
6082         {0xaa, 0x0c, 0x0000},           /* 00,0c,00,aa, */
6083         {0xaa, 0x0d, 0x00a0},           /* 00,0d,a0,aa, */
6084         {0xaa, 0x0e, 0x0000},           /* 00,0e,00,aa, */
6085         {0xaa, 0x0f, 0x00a0},           /* 00,0f,a0,aa, */
6086         {0xaa, 0x10, 0x0000},           /* 00,10,00,aa, */
6087         {0xaa, 0x11, 0x00a0},           /* 00,11,a0,aa, */
6088 /*??    {0xa0, 0x00, 0x0039},
6089         {0xa1, 0x01, 0x0037}, */
6090         {0xaa, 0x16, 0x0001},           /* 00,16,01,aa, */
6091         {0xaa, 0x17, 0x00e8},           /* 00,17,e6,aa (e6 -> e8) */
6092         {0xaa, 0x18, 0x0002},           /* 00,18,02,aa, */
6093         {0xaa, 0x19, 0x0088},           /* 00,19,88,aa, */
6094         {0xaa, 0x20, 0x0020},           /* 00,20,20,aa, */
6095         {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /* 01,01,b7,cc, */
6096         {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},      /* 00,12,05,cc, */
6097         {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0d,cc, */
6098         {0xa0, 0x76, ZC3XX_R189_AWBSTATUS},             /* 01,89,76,cc, */
6099         {0xa0, 0x09, 0x01ad},                           /* 01,ad,09,cc, */
6100         {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},         /* 01,c5,03,cc, */
6101         {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},           /* 01,cb,13,cc, */
6102         {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},        /* 02,50,08,cc, */
6103         {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},          /* 03,01,08,cc, */
6104         {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},           /* 01,a8,60,cc, */
6105         {0xa0, 0x61, ZC3XX_R116_RGAIN},         /* 01,16,61,cc, */
6106         {0xa0, 0x65, ZC3XX_R118_BGAIN},         /* 01,18,65,cc */
6107         {}
6108 };
6109 /* "50HZ" light frequency banding filter */
6110 static const struct usb_action tas5130c_vf0250_50HZ[] = {
6111         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6112         {0xaa, 0x83, 0x0001},           /* 00,83,01,aa */
6113         {0xaa, 0x84, 0x00aa},           /* 00,84,aa,aa */
6114         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6115         {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0d,cc, */
6116         {0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,50,cc, */
6117         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6118         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6119         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,47,cc, */
6120         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6121         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6122         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6123         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6124         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6125         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6126         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6127         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6128         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6129         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6130         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6131         {}
6132 };
6133
6134 /* "50HZScale" light frequency banding filter */
6135 static const struct usb_action tas5130c_vf0250_50HZScale[] = {
6136         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6137         {0xaa, 0x83, 0x0003},           /* 00,83,03,aa */
6138         {0xaa, 0x84, 0x0054},           /* 00,84,54,aa */
6139         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6140         {0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0d,cc, */
6141         {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,50,cc, */
6142         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6143         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6144         {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,8e,cc, */
6145         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6146         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6147         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6148         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6149         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6150         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6151         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6152         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6153         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6154         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6155         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6156         {}
6157 };
6158
6159 /* "60HZ" light frequency banding filter */
6160 static const struct usb_action tas5130c_vf0250_60HZ[] = {
6161         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6162         {0xaa, 0x83, 0x0001},           /* 00,83,01,aa */
6163         {0xaa, 0x84, 0x0062},           /* 00,84,62,aa */
6164         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6165         {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,05,cc, */
6166         {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,88,cc, */
6167         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6168         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6169         {0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,3b,cc, */
6170         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6171         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6172         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,a9,10,cc, */
6173         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,aa,24,cc, */
6174         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6175         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6176         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6177         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6178         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6179         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6180         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,8d,78,cc */
6181         {}
6182 };
6183
6184 /* "60HZScale" light frequency banding ilter */
6185 static const struct usb_action tas5130c_vf0250_60HZScale[] = {
6186         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6187         {0xaa, 0x83, 0x0002},           /* 00,83,02,aa */
6188         {0xaa, 0x84, 0x00c4},           /* 00,84,c4,aa */
6189         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6190         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,1,0b,cc, */
6191         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,2,10,cc, */
6192         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,5,00,cc, */
6193         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,6,00,cc, */
6194         {0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,7,76,cc, */
6195         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,c,0e,cc, */
6196         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,f,15,cc, */
6197         {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},      /* 01,9,10,cc, */
6198         {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},       /* 01,a,24,cc, */
6199         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,d,62,cc, */
6200         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,e,90,cc, */
6201         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,f,c8,cc, */
6202         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,0,ff,cc, */
6203         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,d,58,cc, */
6204         {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,42,cc, */
6205         {0xa0, 0x78, ZC3XX_R18D_YTARGET},               /* 01,d,78,cc */
6206         {}
6207 };
6208
6209 /* "NoFliker" light frequency banding flter */
6210 static const struct usb_action tas5130c_vf0250_NoFliker[] = {
6211         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0c,cc, */
6212         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6213         {0xaa, 0x83, 0x0000},           /* 00,83,00,aa */
6214         {0xaa, 0x84, 0x0020},           /* 00,84,20,aa */
6215         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,0,00,cc, */
6216         {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,05,cc, */
6217         {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,88,cc, */
6218         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6219         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6220         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc, */
6221         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6222         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6223         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6224         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6225         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6226         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6227         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6228         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
6229         {}
6230 };
6231
6232 /* "NoFlikerScale" light frequency banding filter */
6233 static const struct usb_action tas5130c_vf0250_NoFlikerScale[] = {
6234         {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},         /* 01,00,0c,cc, */
6235         {0xaa, 0x82, 0x0000},           /* 00,82,00,aa */
6236         {0xaa, 0x83, 0x0000},           /* 00,83,00,aa */
6237         {0xaa, 0x84, 0x0020},           /* 00,84,20,aa */
6238         {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},     /* 01,90,00,cc, */
6239         {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},      /* 01,91,0b,cc, */
6240         {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},      /* 01,92,10,cc, */
6241         {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},       /* 01,95,00,cc, */
6242         {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},        /* 01,96,00,cc, */
6243         {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},        /* 01,97,10,cc, */
6244         {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},              /* 01,8c,0e,cc, */
6245         {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},            /* 01,8f,15,cc, */
6246         {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},               /* 00,1d,62,cc, */
6247         {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},               /* 00,1e,90,cc, */
6248         {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},               /* 00,1f,c8,cc, */
6249         {0xa0, 0xff, ZC3XX_R020_HSYNC_3},               /* 00,20,ff,cc, */
6250         {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},            /* 01,1d,58,cc, */
6251         {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},     /* 01,80,03,cc */
6252         {}
6253 };
6254
6255 static u8 reg_r_i(struct gspca_dev *gspca_dev,
6256                 __u16 index)
6257 {
6258         usb_control_msg(gspca_dev->dev,
6259                         usb_rcvctrlpipe(gspca_dev->dev, 0),
6260                         0xa1,
6261                         USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6262                         0x01,                   /* value */
6263                         index, gspca_dev->usb_buf, 1,
6264                         500);
6265         return gspca_dev->usb_buf[0];
6266 }
6267
6268 static u8 reg_r(struct gspca_dev *gspca_dev,
6269                 __u16 index)
6270 {
6271         u8 ret;
6272
6273         ret = reg_r_i(gspca_dev, index);
6274         PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
6275         return ret;
6276 }
6277
6278 static void reg_w_i(struct usb_device *dev,
6279                         __u8 value,
6280                         __u16 index)
6281 {
6282         usb_control_msg(dev,
6283                         usb_sndctrlpipe(dev, 0),
6284                         0xa0,
6285                         USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6286                         value, index, NULL, 0,
6287                         500);
6288 }
6289
6290 static void reg_w(struct usb_device *dev,
6291                         __u8 value,
6292                         __u16 index)
6293 {
6294         PDEBUG(D_USBO, "reg w [%04x] = %02x", index, value);
6295         reg_w_i(dev, value, index);
6296 }
6297
6298 static __u16 i2c_read(struct gspca_dev *gspca_dev,
6299                         __u8 reg)
6300 {
6301         __u8 retbyte;
6302         __u16 retval;
6303
6304         reg_w_i(gspca_dev->dev, reg, 0x0092);
6305         reg_w_i(gspca_dev->dev, 0x02, 0x0090);          /* <- read command */
6306         msleep(25);
6307         retbyte = reg_r_i(gspca_dev, 0x0091);           /* read status */
6308         retval = reg_r_i(gspca_dev, 0x0095);            /* read Lowbyte */
6309         retval |= reg_r_i(gspca_dev, 0x0096) << 8;      /* read Hightbyte */
6310         PDEBUG(D_USBO, "i2c r [%02x] -> %04x (%02x)",
6311                         reg, retval, retbyte);
6312         return retval;
6313 }
6314
6315 static __u8 i2c_write(struct gspca_dev *gspca_dev,
6316                         __u8 reg,
6317                         __u8 valL,
6318                         __u8 valH)
6319 {
6320         __u8 retbyte;
6321
6322         reg_w_i(gspca_dev->dev, reg, 0x92);
6323         reg_w_i(gspca_dev->dev, valL, 0x93);
6324         reg_w_i(gspca_dev->dev, valH, 0x94);
6325         reg_w_i(gspca_dev->dev, 0x01, 0x90);            /* <- write command */
6326         msleep(15);
6327         retbyte = reg_r_i(gspca_dev, 0x0091);           /* read status */
6328         PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
6329                         reg, valH, valL, retbyte);
6330         return retbyte;
6331 }
6332
6333 static void usb_exchange(struct gspca_dev *gspca_dev,
6334                         const struct usb_action *action)
6335 {
6336         while (action->req) {
6337                 switch (action->req) {
6338                 case 0xa0:      /* write register */
6339                         reg_w(gspca_dev->dev, action->val, action->idx);
6340                         break;
6341                 case 0xa1:      /* read status */
6342                         reg_r(gspca_dev, action->idx);
6343                         break;
6344                 case 0xaa:
6345                         i2c_write(gspca_dev,
6346                                   action->val,                  /* reg */
6347                                   action->idx & 0xff,           /* valL */
6348                                   action->idx >> 8);            /* valH */
6349                         break;
6350                 case 0xbb:
6351                         i2c_write(gspca_dev,
6352                                   action->idx >> 8,             /* reg */
6353                                   action->idx & 0xff,           /* valL */
6354                                   action->val);                 /* valH */
6355                         break;
6356                 default:
6357 /*              case 0xdd:       * delay */
6358                         msleep(action->val / 64 + 10);
6359                         break;
6360                 }
6361                 action++;
6362 /*              msleep(1); */
6363         }
6364 }
6365
6366 static void setmatrix(struct gspca_dev *gspca_dev)
6367 {
6368         struct sd *sd = (struct sd *) gspca_dev;
6369         int i;
6370         const __u8 *matrix;
6371         static const u8 adcm2700_matrix[9] =
6372 /*              {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; */
6373 /*ms-win*/
6374                 {0x74, 0xed, 0xed, 0xed, 0x74, 0xed, 0xed, 0xed, 0x74};
6375         static const __u8 gc0305_matrix[9] =
6376                 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
6377         static const __u8 ov7620_matrix[9] =
6378                 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
6379         static const __u8 pas202b_matrix[9] =
6380                 {0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
6381         static const __u8 po2030_matrix[9] =
6382                 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
6383         static const __u8 vf0250_matrix[9] =
6384                 {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
6385         static const __u8 *matrix_tb[SENSOR_MAX] = {
6386                 adcm2700_matrix, /* SENSOR_ADCM2700 0 */
6387                 NULL,           /* SENSOR_CS2102 1 */
6388                 NULL,           /* SENSOR_CS2102K 2 */
6389                 gc0305_matrix,  /* SENSOR_GC0305 3 */
6390                 NULL,           /* SENSOR_HDCS2020b 4 */
6391                 NULL,           /* SENSOR_HV7131B 5 */
6392                 NULL,           /* SENSOR_HV7131C 6 */
6393                 NULL,           /* SENSOR_ICM105A 7 */
6394                 NULL,           /* SENSOR_MC501CB 8 */
6395                 ov7620_matrix,  /* SENSOR_OV7620 9 */
6396                 NULL,           /* SENSOR_OV7630C 10 */
6397                 NULL,           /* SENSOR_PAS106 11 */
6398                 pas202b_matrix, /* SENSOR_PAS202B 12 */
6399                 NULL,           /* SENSOR_PB0330 13 */
6400                 po2030_matrix,  /* SENSOR_PO2030 14 */
6401                 NULL,           /* SENSOR_TAS5130CK 15 */
6402                 NULL,           /* SENSOR_TAS5130CXX 16 */
6403                 vf0250_matrix,  /* SENSOR_TAS5130C_VF0250 17 */
6404         };
6405
6406         matrix = matrix_tb[sd->sensor];
6407         if (matrix == NULL)
6408                 return;         /* matrix already loaded */
6409         for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
6410                 reg_w(gspca_dev->dev, matrix[i], 0x010a + i);
6411 }
6412
6413 static void setbrightness(struct gspca_dev *gspca_dev)
6414 {
6415         struct sd *sd = (struct sd *) gspca_dev;
6416         __u8 brightness;
6417
6418         switch (sd->sensor) {
6419         case SENSOR_GC0305:
6420         case SENSOR_OV7620:
6421         case SENSOR_PO2030:
6422                 return;
6423         }
6424 /*fixme: is it really write to 011d and 018d for all other sensors? */
6425         brightness = sd->brightness;
6426         reg_w(gspca_dev->dev, brightness, 0x011d);
6427         switch (sd->sensor) {
6428         case SENSOR_ADCM2700:
6429         case SENSOR_HV7131B:
6430                 return;
6431         }
6432         if (brightness < 0x70)
6433                 brightness += 0x10;
6434         else
6435                 brightness = 0x80;
6436         reg_w(gspca_dev->dev, brightness, 0x018d);
6437 }
6438
6439 static void setsharpness(struct gspca_dev *gspca_dev)
6440 {
6441         struct sd *sd = (struct sd *) gspca_dev;
6442         struct usb_device *dev = gspca_dev->dev;
6443         int sharpness;
6444         static const __u8 sharpness_tb[][2] = {
6445                 {0x02, 0x03},
6446                 {0x04, 0x07},
6447                 {0x08, 0x0f},
6448                 {0x10, 0x1e}
6449         };
6450
6451         sharpness = sd->sharpness;
6452         reg_w(dev, sharpness_tb[sharpness][0], 0x01c6);
6453         reg_r(gspca_dev, 0x01c8);
6454         reg_r(gspca_dev, 0x01c9);
6455         reg_r(gspca_dev, 0x01ca);
6456         reg_w(dev, sharpness_tb[sharpness][1], 0x01cb);
6457 }
6458
6459 static void setcontrast(struct gspca_dev *gspca_dev)
6460 {
6461         struct sd *sd = (struct sd *) gspca_dev;
6462         struct usb_device *dev = gspca_dev->dev;
6463         const __u8 *Tgamma, *Tgradient;
6464         int g, i, k;
6465         static const __u8 kgamma_tb[16] =       /* delta for contrast */
6466                 {0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08,
6467                  0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
6468         static const __u8 kgrad_tb[16] =
6469                 {0x1b, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00,
6470                  0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x04};
6471         static const __u8 Tgamma_1[16] =
6472                 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
6473                  0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff};
6474         static const __u8 Tgradient_1[16] =
6475                 {0x00, 0x01, 0x05, 0x0b, 0x10, 0x15, 0x18, 0x1a,
6476                  0x1a, 0x18, 0x16, 0x14, 0x12, 0x0f, 0x0d, 0x06};
6477         static const __u8 Tgamma_2[16] =
6478                 {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
6479                  0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff};
6480         static const __u8 Tgradient_2[16] =
6481                 {0x05, 0x0f, 0x16, 0x1a, 0x19, 0x19, 0x17, 0x15,
6482                  0x12, 0x10, 0x0e, 0x0b, 0x09, 0x08, 0x06, 0x03};
6483         static const __u8 Tgamma_3[16] =
6484                 {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
6485                  0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff};
6486         static const __u8 Tgradient_3[16] =
6487                 {0x0c, 0x16, 0x1b, 0x1c, 0x19, 0x18, 0x15, 0x12,
6488                  0x10, 0x0d, 0x0b, 0x09, 0x08, 0x06, 0x05, 0x03};
6489         static const __u8 Tgamma_4[16] =
6490                 {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
6491                  0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff};
6492         static const __u8 Tgradient_4[16] =
6493                 {0x26, 0x22, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0d,
6494                  0x0b, 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02};
6495         static const __u8 Tgamma_5[16] =
6496                 {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
6497                  0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff};
6498         static const __u8 Tgradient_5[16] =
6499                 {0x37, 0x26, 0x20, 0x1a, 0x14, 0x10, 0x0e, 0x0b,
6500                  0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x02};
6501         static const __u8 Tgamma_6[16] =                /* ?? was gamma 5 */
6502                 {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
6503                  0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff};
6504         static const __u8 Tgradient_6[16] =
6505                 {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
6506                  0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
6507         static const __u8 *gamma_tb[] = {
6508                 NULL, Tgamma_1, Tgamma_2,
6509                 Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
6510         };
6511         static const __u8 *gradient_tb[] = {
6512                 NULL, Tgradient_1, Tgradient_2,
6513                 Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
6514         };
6515 #ifdef GSPCA_DEBUG
6516         __u8 v[16];
6517 #endif
6518
6519         Tgamma = gamma_tb[sd->gamma];
6520         Tgradient = gradient_tb[sd->gamma];
6521
6522         k = (sd->contrast - 128)                /* -128 / 128 */
6523                         * Tgamma[0];
6524         PDEBUG(D_CONF, "gamma:%d contrast:%d gamma coeff: %d/128",
6525                 sd->gamma, sd->contrast, k);
6526         for (i = 0; i < 16; i++) {
6527                 g = Tgamma[i] + kgamma_tb[i] * k / 128;
6528                 if (g > 0xff)
6529                         g = 0xff;
6530                 else if (g <= 0)
6531                         g = 1;
6532                 reg_w(dev, g, 0x0120 + i);      /* gamma */
6533 #ifdef GSPCA_DEBUG
6534                 if (gspca_debug & D_CONF)
6535                         v[i] = g;
6536 #endif
6537         }
6538         PDEBUG(D_CONF, "tb: %02x %02x %02x %02x %02x %02x %02x %02x",
6539                 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6540         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6541                 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6542         for (i = 0; i < 16; i++) {
6543                 g = Tgradient[i] - kgrad_tb[i] * k / 128;
6544                 if (g > 0xff)
6545                         g = 0xff;
6546                 else if (g <= 0) {
6547                         if (i != 15)
6548                                 g = 0;
6549                         else
6550                                 g = 1;
6551                 }
6552                 reg_w(dev, g, 0x0130 + i);      /* gradient */
6553 #ifdef GSPCA_DEBUG
6554                 if (gspca_debug & D_CONF)
6555                         v[i] = g;
6556 #endif
6557         }
6558         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6559                 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6560         PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
6561                 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6562 }
6563
6564 static void setquality(struct gspca_dev *gspca_dev)
6565 {
6566         struct sd *sd = (struct sd *) gspca_dev;
6567         struct usb_device *dev = gspca_dev->dev;
6568         __u8 frxt;
6569
6570         switch (sd->sensor) {
6571         case SENSOR_ADCM2700:
6572         case SENSOR_GC0305:
6573         case SENSOR_HV7131B:
6574         case SENSOR_OV7620:
6575         case SENSOR_PO2030:
6576                 return;
6577         }
6578 /*fixme: is it really 0008 0007 0018 for all other sensors? */
6579         reg_w(dev, QUANT_VAL, 0x0008);
6580         frxt = 0x30;
6581         reg_w(dev, frxt, 0x0007);
6582 #if QUANT_VAL == 0 || QUANT_VAL == 1 || QUANT_VAL == 2
6583         frxt = 0xff;
6584 #elif QUANT_VAL == 3
6585         frxt = 0xf0;
6586 #elif QUANT_VAL == 4
6587         frxt = 0xe0;
6588 #else
6589         frxt = 0x20;
6590 #endif
6591         reg_w(dev, frxt, 0x0018);
6592 }
6593
6594 /* Matches the sensor's internal frame rate to the lighting frequency.
6595  * Valid frequencies are:
6596  *      50Hz, for European and Asian lighting (default)
6597  *      60Hz, for American lighting
6598  *      0 = No Fliker (for outdoore usage)
6599  * Returns: 0 for success
6600  */
6601 static int setlightfreq(struct gspca_dev *gspca_dev)
6602 {
6603         struct sd *sd = (struct sd *) gspca_dev;
6604         int i, mode;
6605         const struct usb_action *zc3_freq;
6606         static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
6607 /* SENSOR_ADCM2700 0 */
6608                 {adcm2700_NoFliker, adcm2700_NoFliker,
6609                  adcm2700_50HZ, adcm2700_50HZ,
6610                  adcm2700_60HZ, adcm2700_60HZ},
6611 /* SENSOR_CS2102 1 */
6612                 {cs2102_NoFliker, cs2102_NoFlikerScale,
6613                  cs2102_50HZ, cs2102_50HZScale,
6614                  cs2102_60HZ, cs2102_60HZScale},
6615 /* SENSOR_CS2102K 2 */
6616                 {cs2102_NoFliker, cs2102_NoFlikerScale,
6617                  NULL, NULL, /* currently disabled */
6618                  NULL, NULL},
6619 /* SENSOR_GC0305 3 */
6620                 {gc0305_NoFliker, gc0305_NoFliker,
6621                  gc0305_50HZ, gc0305_50HZ,
6622                  gc0305_60HZ, gc0305_60HZ},
6623 /* SENSOR_HDCS2020b 4 */
6624                 {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
6625                  hdcs2020b_50HZ, hdcs2020b_50HZ,
6626                  hdcs2020b_60HZ, hdcs2020b_60HZ},
6627 /* SENSOR_HV7131B 5 */
6628                 {hv7131b_NoFlikerScale, hv7131b_NoFliker,
6629                  hv7131b_50HZScale, hv7131b_50HZ,
6630                  hv7131b_60HZScale, hv7131b_60HZ},
6631 /* SENSOR_HV7131C 6 */
6632                 {NULL, NULL,
6633                  NULL, NULL,
6634                  NULL, NULL},
6635 /* SENSOR_ICM105A 7 */
6636                 {icm105a_NoFliker, icm105a_NoFlikerScale,
6637                  icm105a_50HZ, icm105a_50HZScale,
6638                  icm105a_60HZ, icm105a_60HZScale},
6639 /* SENSOR_MC501CB 8 */
6640                 {MC501CB_NoFliker, MC501CB_NoFlikerScale,
6641                  MC501CB_50HZ, MC501CB_50HZScale,
6642                  MC501CB_60HZ, MC501CB_60HZScale},
6643 /* SENSOR_OV7620 9 */
6644                 {OV7620_NoFliker, OV7620_NoFliker,
6645                  OV7620_50HZ, OV7620_50HZ,
6646                  OV7620_60HZ, OV7620_60HZ},
6647 /* SENSOR_OV7630C 10 */
6648                 {NULL, NULL,
6649                  NULL, NULL,
6650                  NULL, NULL},
6651 /* SENSOR_PAS106 11 */
6652                 {pas106b_NoFliker, pas106b_NoFliker,
6653                  pas106b_50HZ, pas106b_50HZ,
6654                  pas106b_60HZ, pas106b_60HZ},
6655 /* SENSOR_PAS202B 12 */
6656                 {pas202b_NoFlikerScale, pas202b_NoFliker,
6657                  pas202b_50HZScale, pas202b_50HZ,
6658                  pas202b_60HZScale, pas202b_60HZ},
6659 /* SENSOR_PB0330 13 */
6660                 {pb0330_NoFliker, pb0330_NoFlikerScale,
6661                  pb0330_50HZ, pb0330_50HZScale,
6662                  pb0330_60HZ, pb0330_60HZScale},
6663 /* SENSOR_PO2030 14 */
6664                 {PO2030_NoFliker, PO2030_NoFliker,
6665                  PO2030_50HZ, PO2030_50HZ,
6666                  PO2030_60HZ, PO2030_60HZ},
6667 /* SENSOR_TAS5130CK 15 */
6668                 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6669                  tas5130cxx_50HZ, tas5130cxx_50HZScale,
6670                  tas5130cxx_60HZ, tas5130cxx_60HZScale},
6671 /* SENSOR_TAS5130CXX 16 */
6672                 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6673                  tas5130cxx_50HZ, tas5130cxx_50HZScale,
6674                  tas5130cxx_60HZ, tas5130cxx_60HZScale},
6675 /* SENSOR_TAS5130C_VF0250 17 */
6676                 {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale,
6677                  tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale,
6678                  tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale},
6679         };
6680
6681         i = sd->lightfreq * 2;
6682         mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
6683         if (!mode)
6684                 i++;                    /* 640x480 */
6685         zc3_freq = freq_tb[(int) sd->sensor][i];
6686         if (zc3_freq != NULL) {
6687                 usb_exchange(gspca_dev, zc3_freq);
6688                 switch (sd->sensor) {
6689                 case SENSOR_GC0305:
6690                         if (mode                        /* if 320x240 */
6691                             && sd->lightfreq == 1)      /* and 50Hz */
6692                                 reg_w(gspca_dev->dev, 0x85, 0x018d);
6693                                                 /* win: 0x80, 0x018d */
6694                         break;
6695                 case SENSOR_OV7620:
6696                         if (!mode) {                    /* if 640x480 */
6697                                 if (sd->lightfreq != 0) /* and 50 or 60 Hz */
6698                                         reg_w(gspca_dev->dev, 0x40, 0x0002);
6699                                 else
6700                                         reg_w(gspca_dev->dev, 0x44, 0x0002);
6701                         }
6702                         break;
6703                 }
6704         }
6705         return 0;
6706 }
6707
6708 static void setautogain(struct gspca_dev *gspca_dev)
6709 {
6710         struct sd *sd = (struct sd *) gspca_dev;
6711         __u8 autoval;
6712
6713         if (sd->autogain)
6714                 autoval = 0x42;
6715         else
6716                 autoval = 0x02;
6717         reg_w(gspca_dev->dev, autoval, 0x0180);
6718 }
6719
6720 static void send_unknown(struct usb_device *dev, int sensor)
6721 {
6722         reg_w(dev, 0x01, 0x0000);               /* led off */
6723         switch (sensor) {
6724         case SENSOR_PAS106:
6725                 reg_w(dev, 0x03, 0x003a);
6726                 reg_w(dev, 0x0c, 0x003b);
6727                 reg_w(dev, 0x08, 0x0038);
6728                 break;
6729         case SENSOR_ADCM2700:
6730         case SENSOR_GC0305:
6731         case SENSOR_OV7620:
6732         case SENSOR_PB0330:
6733         case SENSOR_PO2030:
6734                 reg_w(dev, 0x0d, 0x003a);
6735                 reg_w(dev, 0x02, 0x003b);
6736                 reg_w(dev, 0x00, 0x0038);
6737                 break;
6738         }
6739 }
6740
6741 /* start probe 2 wires */
6742 static void start_2wr_probe(struct usb_device *dev, int sensor)
6743 {
6744         reg_w(dev, 0x01, 0x0000);
6745         reg_w(dev, sensor, 0x0010);
6746         reg_w(dev, 0x01, 0x0001);
6747         reg_w(dev, 0x03, 0x0012);
6748         reg_w(dev, 0x01, 0x0012);
6749 /*      msleep(2); */
6750 }
6751
6752 static int sif_probe(struct gspca_dev *gspca_dev)
6753 {
6754         __u16 checkword;
6755
6756         start_2wr_probe(gspca_dev->dev, 0x0f);          /* PAS106 */
6757         reg_w(gspca_dev->dev, 0x08, 0x008d);
6758         msleep(150);
6759         checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
6760                         | ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
6761         PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
6762         if (checkword == 0x0007) {
6763                 send_unknown(gspca_dev->dev, SENSOR_PAS106);
6764                 return 0x0f;                    /* PAS106 */
6765         }
6766         return -1;
6767 }
6768
6769 static int vga_2wr_probe(struct gspca_dev *gspca_dev)
6770 {
6771         struct usb_device *dev = gspca_dev->dev;
6772         u16 retword;
6773
6774         start_2wr_probe(dev, 0x00);             /* HV7131B */
6775         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6776         retword = i2c_read(gspca_dev, 0x01);
6777         if (retword != 0)
6778                 return 0x00;                    /* HV7131B */
6779
6780         start_2wr_probe(dev, 0x04);             /* CS2102 */
6781         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6782         retword = i2c_read(gspca_dev, 0x01);
6783         if (retword != 0)
6784                 return 0x04;                    /* CS2102 */
6785
6786         start_2wr_probe(dev, 0x06);             /* OmniVision */
6787         reg_w(dev, 0x08, 0x008d);
6788         i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
6789         retword = i2c_read(gspca_dev, 0x11);
6790         if (retword != 0) {
6791                 /* (should have returned 0xaa) --> Omnivision? */
6792                 /* reg_r 0x10 -> 0x06 -->  */
6793                 goto ov_check;
6794         }
6795
6796         start_2wr_probe(dev, 0x08);             /* HDCS2020 */
6797         i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
6798         retword = i2c_read(gspca_dev, 0x15);
6799         if (retword != 0)
6800                 return 0x08;                    /* HDCS2020 */
6801
6802         start_2wr_probe(dev, 0x0a);             /* PB0330 */
6803         i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
6804         retword = i2c_read(gspca_dev, 0x07);
6805         if (retword != 0)
6806                 return 0x0a;                    /* PB0330 */
6807         retword = i2c_read(gspca_dev, 0x03);
6808         if (retword != 0)
6809                 return 0x0a;                    /* PB0330 ?? */
6810         retword = i2c_read(gspca_dev, 0x04);
6811         if (retword != 0)
6812                 return 0x0a;                    /* PB0330 ?? */
6813
6814         start_2wr_probe(dev, 0x0c);             /* ICM105A */
6815         i2c_write(gspca_dev, 0x01, 0x11, 0x00);
6816         retword = i2c_read(gspca_dev, 0x01);
6817         if (retword != 0)
6818                 return 0x0c;                    /* ICM105A */
6819
6820         start_2wr_probe(dev, 0x0e);             /* PAS202BCB */
6821         reg_w(dev, 0x08, 0x008d);
6822         i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
6823         msleep(500);
6824         retword = i2c_read(gspca_dev, 0x03);
6825         if (retword != 0)
6826                 return 0x0e;                    /* PAS202BCB */
6827
6828         start_2wr_probe(dev, 0x02);             /* ?? */
6829         i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6830         retword = i2c_read(gspca_dev, 0x01);
6831         if (retword != 0)
6832                 return 0x02;                    /* ?? */
6833 ov_check:
6834         reg_r(gspca_dev, 0x0010);               /* ?? */
6835         reg_r(gspca_dev, 0x0010);
6836
6837         reg_w(dev, 0x01, 0x0000);
6838         reg_w(dev, 0x01, 0x0001);
6839         reg_w(dev, 0x06, 0x0010);               /* OmniVision */
6840         reg_w(dev, 0xa1, 0x008b);
6841         reg_w(dev, 0x08, 0x008d);
6842         msleep(500);
6843         reg_w(dev, 0x01, 0x0012);
6844         i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
6845         retword = i2c_read(gspca_dev, 0x0a) << 8;
6846         retword |= i2c_read(gspca_dev, 0x0b);
6847         PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", retword);
6848         switch (retword) {
6849         case 0x7631:                            /* OV7630C */
6850                 reg_w(dev, 0x06, 0x0010);
6851                 break;
6852         case 0x7620:                            /* OV7620 */
6853         case 0x7648:                            /* OV7648 */
6854                 break;
6855         default:
6856                 return -1;                      /* not OmniVision */
6857         }
6858         return retword;
6859 }
6860
6861 struct sensor_by_chipset_revision {
6862         __u16 revision;
6863         __u8 internal_sensor_id;
6864 };
6865 static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
6866         {0xc001, 0x13},         /* MI0360 */
6867         {0xe001, 0x13},
6868         {0x8001, 0x13},
6869         {0x8000, 0x14},         /* CS2102K */
6870         {0x8400, 0x15},         /* TAS5130K */
6871         {0x4001, 0x16},         /* ADCM2700 */
6872 };
6873
6874 static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6875 {
6876         struct sd *sd = (struct sd *) gspca_dev;
6877         struct usb_device *dev = gspca_dev->dev;
6878         int i;
6879         __u8 retbyte;
6880         u16 retword;
6881
6882 /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
6883         reg_w(dev, 0x02, 0x0010);
6884         reg_r(gspca_dev, 0x0010);
6885         reg_w(dev, 0x01, 0x0000);
6886         reg_w(dev, 0x00, 0x0010);
6887         reg_w(dev, 0x01, 0x0001);
6888         reg_w(dev, 0x91, 0x008b);
6889         reg_w(dev, 0x03, 0x0012);
6890         reg_w(dev, 0x01, 0x0012);
6891         reg_w(dev, 0x05, 0x0012);
6892         retword = i2c_read(gspca_dev, 0x14);
6893         if (retword != 0)
6894                 return 0x11;                    /* HV7131R */
6895         retword = i2c_read(gspca_dev, 0x15);
6896         if (retword != 0)
6897                 return 0x11;                    /* HV7131R */
6898         retword = i2c_read(gspca_dev, 0x16);
6899         if (retword != 0)
6900                 return 0x11;                    /* HV7131R */
6901
6902         reg_w(dev, 0x02, 0x0010);
6903         retword = reg_r(gspca_dev, 0x000b) << 8;
6904         retword |= reg_r(gspca_dev, 0x000a);
6905         PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword);
6906         reg_r(gspca_dev, 0x0010);
6907         /* this is tested only once anyway */
6908         for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6909                 if (chipset_revision_sensor[i].revision == retword) {
6910                         sd->chip_revision = retword;
6911                         send_unknown(dev, SENSOR_PB0330);
6912                         return chipset_revision_sensor[i].internal_sensor_id;
6913                 }
6914         }
6915
6916         reg_w(dev, 0x01, 0x0000);       /* check ?? */
6917         reg_w(dev, 0x01, 0x0001);
6918         reg_w(dev, 0xdd, 0x008b);
6919         reg_w(dev, 0x0a, 0x0010);
6920         reg_w(dev, 0x03, 0x0012);
6921         reg_w(dev, 0x01, 0x0012);
6922         retword = i2c_read(gspca_dev, 0x00);
6923         if (retword != 0) {
6924                 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6925                 return 0x0a;                    /* ?? */
6926         }
6927
6928         reg_w(dev, 0x01, 0x0000);
6929         reg_w(dev, 0x01, 0x0001);
6930         reg_w(dev, 0x98, 0x008b);
6931         reg_w(dev, 0x01, 0x0010);
6932         reg_w(dev, 0x03, 0x0012);
6933         msleep(2);
6934         reg_w(dev, 0x01, 0x0012);
6935         retword = i2c_read(gspca_dev, 0x00);
6936         if (retword != 0) {
6937                 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retword);
6938                 if (retword == 0x0011)                  /* VF0250 */
6939                         return 0x0250;
6940                 if (retword == 0x0029)                  /* gc0305 */
6941                         send_unknown(dev, SENSOR_GC0305);
6942                 return retword;
6943         }
6944
6945         reg_w(dev, 0x01, 0x0000);       /* check OmniVision */
6946         reg_w(dev, 0x01, 0x0001);
6947         reg_w(dev, 0xa1, 0x008b);
6948         reg_w(dev, 0x08, 0x008d);
6949         reg_w(dev, 0x06, 0x0010);
6950         reg_w(dev, 0x01, 0x0012);
6951         reg_w(dev, 0x05, 0x0012);
6952         if (i2c_read(gspca_dev, 0x1c) == 0x007f /* OV7610 - manufacturer ID */
6953             && i2c_read(gspca_dev, 0x1d) == 0x00a2) {
6954                 send_unknown(dev, SENSOR_OV7620);
6955                 return 0x06;            /* OmniVision confirm ? */
6956         }
6957
6958         reg_w(dev, 0x01, 0x0000);
6959         reg_w(dev, 0x00, 0x0002);
6960         reg_w(dev, 0x01, 0x0010);
6961         reg_w(dev, 0x01, 0x0001);
6962         reg_w(dev, 0xee, 0x008b);
6963         reg_w(dev, 0x03, 0x0012);
6964 /*      msleep(150); */
6965         reg_w(dev, 0x01, 0x0012);
6966         reg_w(dev, 0x05, 0x0012);
6967         retword = i2c_read(gspca_dev, 0x00) << 8;       /* ID 0 */
6968         retword |= i2c_read(gspca_dev, 0x01);           /* ID 1 */
6969         PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", retword);
6970         if (retword == 0x2030) {
6971                 retbyte = i2c_read(gspca_dev, 0x02);    /* revision number */
6972                 PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
6973                 send_unknown(dev, SENSOR_PO2030);
6974                 return retword;
6975         }
6976
6977         reg_w(dev, 0x01, 0x0000);
6978         reg_w(dev, 0x0a, 0x0010);
6979         reg_w(dev, 0xd3, 0x008b);
6980         reg_w(dev, 0x01, 0x0001);
6981         reg_w(dev, 0x03, 0x0012);
6982         reg_w(dev, 0x01, 0x0012);
6983         reg_w(dev, 0x05, 0x0001);
6984         reg_w(dev, 0xd3, 0x008b);
6985         retword = i2c_read(gspca_dev, 0x01);
6986         if (retword != 0) {
6987                 PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword);
6988                 return retword;
6989         }
6990         return -1;
6991 }
6992
6993 static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6994 {
6995         struct sd *sd = (struct sd *) gspca_dev;
6996         int sensor;
6997
6998         switch (sd->sensor) {
6999         case SENSOR_MC501CB:
7000                 return -1;              /* don't probe */
7001         case SENSOR_TAS5130C_VF0250:
7002                         /* may probe but with no write in reg 0x0010 */
7003                 return -1;              /* don't probe */
7004         case SENSOR_PAS106:
7005                 sensor =  sif_probe(gspca_dev);
7006                 if (sensor >= 0)
7007                         return sensor;
7008                 break;
7009         }
7010         sensor = vga_2wr_probe(gspca_dev);
7011         if (sensor >= 0)
7012                 return sensor;
7013         return vga_3wr_probe(gspca_dev);
7014 }
7015
7016 /* this function is called at probe time */
7017 static int sd_config(struct gspca_dev *gspca_dev,
7018                         const struct usb_device_id *id)
7019 {
7020         struct sd *sd = (struct sd *) gspca_dev;
7021         struct cam *cam;
7022         int sensor;
7023         int vga = 1;            /* 1: vga, 0: sif */
7024         static const __u8 gamma[SENSOR_MAX] = {
7025                 4,      /* SENSOR_ADCM2700 0 */
7026                 5,      /* SENSOR_CS2102 1 */
7027                 5,      /* SENSOR_CS2102K 2 */
7028                 4,      /* SENSOR_GC0305 3 */
7029                 4,      /* SENSOR_HDCS2020b 4 */
7030                 4,      /* SENSOR_HV7131B 5 */
7031                 4,      /* SENSOR_HV7131C 6 */
7032                 4,      /* SENSOR_ICM105A 7 */
7033                 4,      /* SENSOR_MC501CB 8 */
7034                 3,      /* SENSOR_OV7620 9 */
7035                 4,      /* SENSOR_OV7630C 10 */
7036                 4,      /* SENSOR_PAS106 11 */
7037                 4,      /* SENSOR_PAS202B 12 */
7038                 4,      /* SENSOR_PB0330 13 */
7039                 4,      /* SENSOR_PO2030 14 */
7040                 4,      /* SENSOR_TAS5130CK 15 */
7041                 4,      /* SENSOR_TAS5130CXX 16 */
7042                 3,      /* SENSOR_TAS5130C_VF0250 17 */
7043         };
7044
7045         /* define some sensors from the vendor/product */
7046         sd->sharpness = 2;
7047         sd->sensor = id->driver_info;
7048         sensor = zcxx_probeSensor(gspca_dev);
7049         if (sensor >= 0)
7050                 PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
7051         if ((unsigned) force_sensor < SENSOR_MAX) {
7052                 sd->sensor = force_sensor;
7053                 PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
7054         } else {
7055                 switch (sensor) {
7056                 case -1:
7057                         switch (sd->sensor) {
7058                         case SENSOR_MC501CB:
7059                                 PDEBUG(D_PROBE, "Sensor MC501CB");
7060                                 break;
7061                         case SENSOR_TAS5130C_VF0250:
7062                                 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7063                                 break;
7064                         default:
7065                                 PDEBUG(D_PROBE,
7066                                         "Sensor UNKNOW_0 force Tas5130");
7067                                 sd->sensor = SENSOR_TAS5130CXX;
7068                         }
7069                         break;
7070                 case 0:
7071                         PDEBUG(D_PROBE, "Find Sensor HV7131B");
7072                         sd->sensor = SENSOR_HV7131B;
7073                         break;
7074                 case 0x04:
7075                         PDEBUG(D_PROBE, "Find Sensor CS2102");
7076                         sd->sensor = SENSOR_CS2102;
7077                         break;
7078                 case 0x08:
7079                         PDEBUG(D_PROBE, "Find Sensor HDCS2020(b)");
7080                         sd->sensor = SENSOR_HDCS2020b;
7081                         break;
7082                 case 0x0a:
7083                         PDEBUG(D_PROBE,
7084                                 "Find Sensor PB0330. Chip revision %x",
7085                                 sd->chip_revision);
7086                         sd->sensor = SENSOR_PB0330;
7087                         break;
7088                 case 0x0c:
7089                         PDEBUG(D_PROBE, "Find Sensor ICM105A");
7090                         sd->sensor = SENSOR_ICM105A;
7091                         break;
7092                 case 0x0e:
7093                         PDEBUG(D_PROBE, "Find Sensor PAS202B");
7094                         sd->sensor = SENSOR_PAS202B;
7095                         sd->sharpness = 1;
7096                         break;
7097                 case 0x0f:
7098                         PDEBUG(D_PROBE, "Find Sensor PAS106");
7099                         sd->sensor = SENSOR_PAS106;
7100                         vga = 0;                /* SIF */
7101                         break;
7102                 case 0x10:
7103                 case 0x12:
7104                         PDEBUG(D_PROBE, "Find Sensor TAS5130");
7105                         sd->sensor = SENSOR_TAS5130CXX;
7106                         break;
7107                 case 0x11:
7108                         PDEBUG(D_PROBE, "Find Sensor HV7131R(c)");
7109                         sd->sensor = SENSOR_HV7131C;
7110                         break;
7111                 case 0x13:
7112                         PDEBUG(D_PROBE,
7113                                 "Find Sensor MI0360. Chip revision %x",
7114                                 sd->chip_revision);
7115                         sd->sensor = SENSOR_PB0330;
7116                         break;
7117                 case 0x14:
7118                         PDEBUG(D_PROBE,
7119                                 "Find Sensor CS2102K?. Chip revision %x",
7120                                 sd->chip_revision);
7121                         sd->sensor = SENSOR_CS2102K;
7122                         break;
7123                 case 0x15:
7124                         PDEBUG(D_PROBE,
7125                                 "Find Sensor TAS5130CK?. Chip revision %x",
7126                                 sd->chip_revision);
7127                         sd->sensor = SENSOR_TAS5130CK;
7128                         break;
7129                 case 0x16:
7130                         PDEBUG(D_PROBE, "Find Sensor ADCM2700");
7131                         sd->sensor = SENSOR_ADCM2700;
7132                         break;
7133                 case 0x29:
7134                         PDEBUG(D_PROBE, "Find Sensor GC0305");
7135                         sd->sensor = SENSOR_GC0305;
7136                         break;
7137                 case 0x0250:
7138                         PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7139                         sd->sensor =  SENSOR_TAS5130C_VF0250;
7140                         break;
7141                 case 0x2030:
7142                         PDEBUG(D_PROBE, "Find Sensor PO2030");
7143                         sd->sensor = SENSOR_PO2030;
7144                         sd->sharpness = 0;              /* from win traces */
7145                         break;
7146                 case 0x7620:
7147                         PDEBUG(D_PROBE, "Find Sensor OV7620");
7148                         sd->sensor = SENSOR_OV7620;
7149                         break;
7150                 case 0x7631:
7151                         PDEBUG(D_PROBE, "Find Sensor OV7630C");
7152                         sd->sensor = SENSOR_OV7630C;
7153                         break;
7154                 case 0x7648:
7155                         PDEBUG(D_PROBE, "Find Sensor OV7648");
7156                         sd->sensor = SENSOR_OV7620;     /* same sensor (?) */
7157                         break;
7158                 default:
7159                         PDEBUG(D_ERR|D_PROBE, "Unknown sensor %04x", sensor);
7160                         return -EINVAL;
7161                 }
7162         }
7163         if (sensor < 0x20) {
7164                 if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
7165                         reg_w(gspca_dev->dev, 0x02, 0x0010);
7166                 else
7167                         reg_w(gspca_dev->dev, sensor & 0x0f, 0x0010);
7168                 reg_r(gspca_dev, 0x0010);
7169         }
7170
7171         cam = &gspca_dev->cam;
7172 /*fixme:test*/
7173         gspca_dev->nbalt--;
7174         if (vga) {
7175                 cam->cam_mode = vga_mode;
7176                 cam->nmodes = ARRAY_SIZE(vga_mode);
7177         } else {
7178                 cam->cam_mode = sif_mode;
7179                 cam->nmodes = ARRAY_SIZE(sif_mode);
7180         }
7181         sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
7182         sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value;
7183         sd->gamma = gamma[(int) sd->sensor];
7184         sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value;
7185         sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value;
7186         sd->quality = QUALITY_DEF;
7187
7188         switch (sd->sensor) {
7189         case SENSOR_GC0305:
7190         case SENSOR_OV7620:
7191         case SENSOR_PO2030:
7192                 gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX);
7193                 break;
7194         case SENSOR_HV7131B:
7195         case SENSOR_HV7131C:
7196         case SENSOR_OV7630C:
7197                 gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
7198                 break;
7199         }
7200
7201         /* switch the led off */
7202         reg_w(gspca_dev->dev, 0x01, 0x0000);
7203         return 0;
7204 }
7205
7206 /* this function is called at probe and resume time */
7207 static int sd_init(struct gspca_dev *gspca_dev)
7208 {
7209         reg_w(gspca_dev->dev, 0x01, 0x0000);
7210         return 0;
7211 }
7212
7213 static int sd_start(struct gspca_dev *gspca_dev)
7214 {
7215         struct sd *sd = (struct sd *) gspca_dev;
7216         struct usb_device *dev = gspca_dev->dev;
7217         const struct usb_action *zc3_init;
7218         int mode;
7219         static const struct usb_action *init_tb[SENSOR_MAX][2] = {
7220                 {adcm2700_Initial, adcm2700_InitialScale},      /* 0 */
7221                 {cs2102_InitialScale, cs2102_Initial},          /* 1 */
7222                 {cs2102K_InitialScale, cs2102K_Initial},        /* 2 */
7223                 {gc0305_Initial, gc0305_InitialScale},          /* 3 */
7224                 {hdcs2020xb_InitialScale, hdcs2020xb_Initial},  /* 4 */
7225                 {hv7131bxx_InitialScale, hv7131bxx_Initial},    /* 5 */
7226                 {hv7131cxx_InitialScale, hv7131cxx_Initial},    /* 6 */
7227                 {icm105axx_InitialScale, icm105axx_Initial},    /* 7 */
7228                 {MC501CB_InitialScale, MC501CB_Initial},        /* 8 */
7229                 {OV7620_mode0, OV7620_mode1},                   /* 9 */
7230                 {ov7630c_InitialScale, ov7630c_Initial},        /* 10 */
7231                 {pas106b_InitialScale, pas106b_Initial},        /* 11 */
7232                 {pas202b_Initial, pas202b_InitialScale},        /* 12 */
7233                 {pb0330xx_InitialScale, pb0330xx_Initial},      /* 13 */
7234 /* or           {pb03303x_InitialScale, pb03303x_Initial}, */
7235                 {PO2030_mode0, PO2030_mode1},                   /* 14 */
7236                 {tas5130CK_InitialScale, tas5130CK_Initial},    /* 15 */
7237                 {tas5130cxx_InitialScale, tas5130cxx_Initial},  /* 16 */
7238                 {tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial},
7239                                                                 /* 17 */
7240         };
7241
7242         /* create the JPEG header */
7243         sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
7244         jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
7245                         0x21);          /* JPEG 422 */
7246         jpeg_set_qual(sd->jpeg_hdr, sd->quality);
7247
7248         mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
7249         zc3_init = init_tb[(int) sd->sensor][mode];
7250         switch (sd->sensor) {
7251         case SENSOR_HV7131C:
7252                 zcxx_probeSensor(gspca_dev);
7253                 break;
7254         case SENSOR_PAS106:
7255                 usb_exchange(gspca_dev, pas106b_Initial_com);
7256                 break;
7257         case SENSOR_PB0330:
7258                 if (mode) {
7259                         if (sd->chip_revision == 0xc001
7260                             || sd->chip_revision == 0xe001
7261                             || sd->chip_revision == 0x8001)
7262                                 zc3_init = pb03303x_Initial;
7263                 } else {
7264                         if (sd->chip_revision == 0xc001
7265                             || sd->chip_revision == 0xe001
7266                             || sd->chip_revision == 0x8001)
7267                                 zc3_init = pb03303x_InitialScale;
7268                 }
7269                 break;
7270         }
7271         usb_exchange(gspca_dev, zc3_init);
7272
7273         switch (sd->sensor) {
7274         case SENSOR_ADCM2700:
7275         case SENSOR_GC0305:
7276         case SENSOR_OV7620:
7277         case SENSOR_PO2030:
7278         case SENSOR_TAS5130C_VF0250:
7279 /*              msleep(100);                     * ?? */
7280                 reg_r(gspca_dev, 0x0002);       /* --> 0x40 */
7281                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7282                 reg_w(dev, 0x15, 0x01ae);
7283                 reg_w(dev, 0x0d, 0x003a);
7284                 reg_w(dev, 0x02, 0x003b);
7285                 reg_w(dev, 0x00, 0x0038);
7286                 break;
7287         }
7288
7289         setmatrix(gspca_dev);
7290         setbrightness(gspca_dev);
7291         switch (sd->sensor) {
7292         case SENSOR_ADCM2700:
7293         case SENSOR_OV7620:
7294                 reg_r(gspca_dev, 0x0008);
7295                 reg_w(dev, 0x00, 0x0008);
7296                 break;
7297         case SENSOR_PAS202B:
7298         case SENSOR_GC0305:
7299                 reg_r(gspca_dev, 0x0008);
7300                 /* fall thru */
7301         case SENSOR_PO2030:
7302                 reg_w(dev, 0x03, 0x0008);
7303                 break;
7304         }
7305         setsharpness(gspca_dev);
7306
7307         /* set the gamma tables when not set */
7308         switch (sd->sensor) {
7309         case SENSOR_CS2102:             /* gamma set in xxx_Initial */
7310         case SENSOR_CS2102K:
7311         case SENSOR_HDCS2020b:
7312         case SENSOR_PB0330:             /* pb with chip_revision - see above */
7313         case SENSOR_OV7630C:
7314         case SENSOR_TAS5130CK:
7315                 break;
7316         default:
7317                 setcontrast(gspca_dev);
7318                 break;
7319         }
7320         setmatrix(gspca_dev);                   /* one more time? */
7321         switch (sd->sensor) {
7322         case SENSOR_OV7620:
7323         case SENSOR_PAS202B:
7324                 reg_r(gspca_dev, 0x0180);       /* from win */
7325                 reg_w(dev, 0x00, 0x0180);
7326                 break;
7327         default:
7328                 setquality(gspca_dev);
7329                 break;
7330         }
7331         setlightfreq(gspca_dev);
7332
7333         switch (sd->sensor) {
7334         case SENSOR_ADCM2700:
7335                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7336                 reg_w(dev, 0x15, 0x01ae);
7337                 reg_w(dev, 0x02, 0x0180);
7338                                                 /* ms-win + */
7339                 reg_w(dev, 0x40, 0x0117);
7340                 break;
7341         case SENSOR_GC0305:
7342                 reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
7343                 reg_w(dev, 0x15, 0x01ae);
7344                 /* fall thru */
7345         case SENSOR_PAS202B:
7346         case SENSOR_PO2030:
7347 /*              reg_w(dev, 0x40, ZC3XX_R117_GGAIN);  * (from win traces) */
7348                 reg_r(gspca_dev, 0x0180);
7349                 break;
7350         case SENSOR_OV7620:
7351                 reg_w(dev, 0x09, 0x01ad);
7352                 reg_w(dev, 0x15, 0x01ae);
7353                 i2c_read(gspca_dev, 0x13);      /*fixme: returns 0xa3 */
7354                 i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
7355                                          /*fixme: returned value to send? */
7356                 reg_w(dev, 0x40, 0x0117);
7357                 reg_r(gspca_dev, 0x0180);
7358                 break;
7359         }
7360
7361         setautogain(gspca_dev);
7362         switch (sd->sensor) {
7363         case SENSOR_PO2030:
7364                 msleep(500);
7365                 reg_r(gspca_dev, 0x0008);
7366                 reg_r(gspca_dev, 0x0007);
7367                 /*fall thru*/
7368         case SENSOR_PAS202B:
7369                 reg_w(dev, 0x00, 0x0007);       /* (from win traces) */
7370                 reg_w(dev, 0x02, ZC3XX_R008_CLOCKSETTING);
7371                 break;
7372         }
7373         return 0;
7374 }
7375
7376 /* called on streamoff with alt 0 and on disconnect */
7377 static void sd_stop0(struct gspca_dev *gspca_dev)
7378 {
7379         struct sd *sd = (struct sd *) gspca_dev;
7380
7381         kfree(sd->jpeg_hdr);
7382         if (!gspca_dev->present)
7383                 return;
7384         send_unknown(gspca_dev->dev, sd->sensor);
7385 }
7386
7387 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
7388                         struct gspca_frame *frame,
7389                         __u8 *data,
7390                         int len)
7391 {
7392         struct sd *sd = (struct sd *) gspca_dev;
7393
7394         if (data[0] == 0xff && data[1] == 0xd8) {       /* start of frame */
7395                 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
7396                                         data, 0);
7397                 /* put the JPEG header in the new frame */
7398                 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
7399                         sd->jpeg_hdr, JPEG_HDR_SZ);
7400
7401                 /* remove the webcam's header:
7402                  * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
7403                  *      - 'ss ss' is the frame sequence number (BE)
7404                  *      - 'ww ww' and 'hh hh' are the window dimensions (BE)
7405                  *      - 'pp pp' is the packet sequence number (BE)
7406                  */
7407                 data += 18;
7408                 len -= 18;
7409         }
7410         gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
7411 }
7412
7413 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
7414 {
7415         struct sd *sd = (struct sd *) gspca_dev;
7416
7417         sd->brightness = val;
7418         if (gspca_dev->streaming)
7419                 setbrightness(gspca_dev);
7420         return 0;
7421 }
7422
7423 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
7424 {
7425         struct sd *sd = (struct sd *) gspca_dev;
7426
7427         *val = sd->brightness;
7428         return 0;
7429 }
7430
7431 static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
7432 {
7433         struct sd *sd = (struct sd *) gspca_dev;
7434
7435         sd->contrast = val;
7436         if (gspca_dev->streaming)
7437                 setcontrast(gspca_dev);
7438         return 0;
7439 }
7440
7441 static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
7442 {
7443         struct sd *sd = (struct sd *) gspca_dev;
7444
7445         *val = sd->contrast;
7446         return 0;
7447 }
7448
7449 static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
7450 {
7451         struct sd *sd = (struct sd *) gspca_dev;
7452
7453         sd->autogain = val;
7454         if (gspca_dev->streaming)
7455                 setautogain(gspca_dev);
7456         return 0;
7457 }
7458
7459 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val)
7460 {
7461         struct sd *sd = (struct sd *) gspca_dev;
7462
7463         *val = sd->autogain;
7464         return 0;
7465 }
7466
7467 static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val)
7468 {
7469         struct sd *sd = (struct sd *) gspca_dev;
7470
7471         sd->gamma = val;
7472         if (gspca_dev->streaming)
7473                 setcontrast(gspca_dev);
7474         return 0;
7475 }
7476
7477 static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val)
7478 {
7479         struct sd *sd = (struct sd *) gspca_dev;
7480
7481         *val = sd->gamma;
7482         return 0;
7483 }
7484
7485 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
7486 {
7487         struct sd *sd = (struct sd *) gspca_dev;
7488
7489         sd->lightfreq = val;
7490         if (gspca_dev->streaming)
7491                 setlightfreq(gspca_dev);
7492         return 0;
7493 }
7494
7495 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
7496 {
7497         struct sd *sd = (struct sd *) gspca_dev;
7498
7499         *val = sd->lightfreq;
7500         return 0;
7501 }
7502
7503 static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
7504 {
7505         struct sd *sd = (struct sd *) gspca_dev;
7506
7507         sd->sharpness = val;
7508         if (gspca_dev->streaming)
7509                 setsharpness(gspca_dev);
7510         return 0;
7511 }
7512
7513 static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
7514 {
7515         struct sd *sd = (struct sd *) gspca_dev;
7516
7517         *val = sd->sharpness;
7518         return 0;
7519 }
7520
7521 static int sd_querymenu(struct gspca_dev *gspca_dev,
7522                         struct v4l2_querymenu *menu)
7523 {
7524         switch (menu->id) {
7525         case V4L2_CID_POWER_LINE_FREQUENCY:
7526                 switch (menu->index) {
7527                 case 0:         /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
7528                         strcpy((char *) menu->name, "NoFliker");
7529                         return 0;
7530                 case 1:         /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
7531                         strcpy((char *) menu->name, "50 Hz");
7532                         return 0;
7533                 case 2:         /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
7534                         strcpy((char *) menu->name, "60 Hz");
7535                         return 0;
7536                 }
7537                 break;
7538         }
7539         return -EINVAL;
7540 }
7541
7542 static int sd_set_jcomp(struct gspca_dev *gspca_dev,
7543                         struct v4l2_jpegcompression *jcomp)
7544 {
7545         struct sd *sd = (struct sd *) gspca_dev;
7546
7547         if (jcomp->quality < QUALITY_MIN)
7548                 sd->quality = QUALITY_MIN;
7549         else if (jcomp->quality > QUALITY_MAX)
7550                 sd->quality = QUALITY_MAX;
7551         else
7552                 sd->quality = jcomp->quality;
7553         if (gspca_dev->streaming)
7554                 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
7555         return 0;
7556 }
7557
7558 static int sd_get_jcomp(struct gspca_dev *gspca_dev,
7559                         struct v4l2_jpegcompression *jcomp)
7560 {
7561         struct sd *sd = (struct sd *) gspca_dev;
7562
7563         memset(jcomp, 0, sizeof *jcomp);
7564         jcomp->quality = sd->quality;
7565         jcomp->jpeg_markers = V4L2_JPEG_MARKER_DHT
7566                         | V4L2_JPEG_MARKER_DQT;
7567         return 0;
7568 }
7569
7570 static const struct sd_desc sd_desc = {
7571         .name = MODULE_NAME,
7572         .ctrls = sd_ctrls,
7573         .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
7574         .config = sd_config,
7575         .init = sd_init,
7576         .start = sd_start,
7577         .stop0 = sd_stop0,
7578         .pkt_scan = sd_pkt_scan,
7579         .querymenu = sd_querymenu,
7580         .get_jcomp = sd_get_jcomp,
7581         .set_jcomp = sd_set_jcomp,
7582 };
7583
7584 static const __devinitdata struct usb_device_id device_table[] = {
7585         {USB_DEVICE(0x041e, 0x041e)},
7586         {USB_DEVICE(0x041e, 0x4017)},
7587         {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
7588         {USB_DEVICE(0x041e, 0x401e)},
7589         {USB_DEVICE(0x041e, 0x401f)},
7590         {USB_DEVICE(0x041e, 0x4022)},
7591         {USB_DEVICE(0x041e, 0x4029)},
7592         {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
7593         {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
7594         {USB_DEVICE(0x041e, 0x4036)},
7595         {USB_DEVICE(0x041e, 0x403a)},
7596         {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250},
7597         {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250},
7598         {USB_DEVICE(0x0458, 0x7007)},
7599         {USB_DEVICE(0x0458, 0x700c)},
7600         {USB_DEVICE(0x0458, 0x700f)},
7601         {USB_DEVICE(0x0461, 0x0a00)},
7602         {USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
7603         {USB_DEVICE(0x046d, 0x08a0)},
7604         {USB_DEVICE(0x046d, 0x08a1)},
7605         {USB_DEVICE(0x046d, 0x08a2)},
7606         {USB_DEVICE(0x046d, 0x08a3)},
7607         {USB_DEVICE(0x046d, 0x08a6)},
7608         {USB_DEVICE(0x046d, 0x08a7)},
7609         {USB_DEVICE(0x046d, 0x08a9)},
7610         {USB_DEVICE(0x046d, 0x08aa)},
7611         {USB_DEVICE(0x046d, 0x08ac)},
7612         {USB_DEVICE(0x046d, 0x08ad)},
7613 #if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
7614         {USB_DEVICE(0x046d, 0x08ae)},
7615 #endif
7616         {USB_DEVICE(0x046d, 0x08af)},
7617         {USB_DEVICE(0x046d, 0x08b9)},
7618         {USB_DEVICE(0x046d, 0x08d7)},
7619         {USB_DEVICE(0x046d, 0x08d9)},
7620         {USB_DEVICE(0x046d, 0x08d8)},
7621         {USB_DEVICE(0x046d, 0x08da)},
7622         {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
7623         {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
7624         {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
7625         {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
7626         {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
7627         {USB_DEVICE(0x055f, 0xc005)},
7628         {USB_DEVICE(0x055f, 0xd003)},
7629         {USB_DEVICE(0x055f, 0xd004)},
7630         {USB_DEVICE(0x0698, 0x2003)},
7631         {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
7632         {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},
7633         {USB_DEVICE(0x0ac8, 0x301b)},
7634         {USB_DEVICE(0x0ac8, 0x303b)},
7635         {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250},
7636         {USB_DEVICE(0x0ac8, 0x307b)},
7637         {USB_DEVICE(0x10fd, 0x0128)},
7638         {USB_DEVICE(0x10fd, 0x804d)},
7639         {USB_DEVICE(0x10fd, 0x8050)},
7640         {}                      /* end of entry */
7641 };
7642 #undef DVNAME
7643 MODULE_DEVICE_TABLE(usb, device_table);
7644
7645 /* -- device connect -- */
7646 static int sd_probe(struct usb_interface *intf,
7647                         const struct usb_device_id *id)
7648 {
7649         return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7650                                 THIS_MODULE);
7651 }
7652
7653 /* USB driver */
7654 static struct usb_driver sd_driver = {
7655         .name = MODULE_NAME,
7656         .id_table = device_table,
7657         .probe = sd_probe,
7658         .disconnect = gspca_disconnect,
7659 #ifdef CONFIG_PM
7660         .suspend = gspca_suspend,
7661         .resume = gspca_resume,
7662 #endif
7663 };
7664
7665 static int __init sd_mod_init(void)
7666 {
7667         int ret;
7668         ret = usb_register(&sd_driver);
7669         if (ret < 0)
7670                 return ret;
7671         PDEBUG(D_PROBE, "registered");
7672         return 0;
7673 }
7674
7675 static void __exit sd_mod_exit(void)
7676 {
7677         usb_deregister(&sd_driver);
7678         PDEBUG(D_PROBE, "deregistered");
7679 }
7680
7681 module_init(sd_mod_init);
7682 module_exit(sd_mod_exit);
7683
7684 module_param(force_sensor, int, 0644);
7685 MODULE_PARM_DESC(force_sensor,
7686         "Force sensor. Only for experts!!!");