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