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