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