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