blob: 5c9113098e7fffbf208fdee134e6954be4a03d16 [file] [log] [blame]
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001/*
Jean-Francois Moine47c833922010-01-07 15:59:12 -03002 * Z-Star/Vimicro zc301/zc302p/vc30x library
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003 *
Jean-Francois Moine47c833922010-01-07 15:59:12 -03004 * Copyright (C) 2009-2010 Jean-Francois Moine <http://moinejf.free.fr>
5 * Copyright (C) 2004 2005 2006 Michel Xhaard mxhaard@magic.fr
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * 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.
20 */
21
22#define MODULE_NAME "zc3xx"
23
Jean-François Moine83d1aa32010-08-04 05:11:23 -030024#ifdef CONFIG_INPUT
Hans de Goede1a3510262010-01-29 11:05:25 -030025#include <linux/input.h>
Jean-François Moine83d1aa32010-08-04 05:11:23 -030026#endif
Jean-Francois Moined43fa322008-06-12 10:58:58 -030027#include "gspca.h"
Jean-Francois Moine71cb2762009-03-03 05:33:41 -030028#include "jpeg.h"
Jean-Francois Moined43fa322008-06-12 10:58:58 -030029
Jean-Francois Moine47c833922010-01-07 15:59:12 -030030MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>, "
Jean-Francois Moined43fa322008-06-12 10:58:58 -030031 "Serge A. Suchkov <Serge.A.S@tochka.ru>");
32MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
33MODULE_LICENSE("GPL");
34
Jean-Francois Moined43fa322008-06-12 10:58:58 -030035static int force_sensor = -1;
36
Jean-Francois Moine36e819d2009-01-07 16:49:57 -030037#define QUANT_VAL 1 /* quantization table */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -030038#include "zc3xx-reg.h"
Jean-Francois Moined43fa322008-06-12 10:58:58 -030039
40/* specific webcam descriptor */
41struct sd {
42 struct gspca_dev gspca_dev; /* !! must be the first item */
43
Jean-François Moinea9dfc012010-06-04 06:21:48 -030044 u8 brightness;
Jean-Francois Moine47c833922010-01-07 15:59:12 -030045 u8 contrast;
46 u8 gamma;
47 u8 autogain;
48 u8 lightfreq;
49 u8 sharpness;
Jean-Francois Moine71cb2762009-03-03 05:33:41 -030050 u8 quality; /* image quality */
Jean-François Moinedb6cf422010-06-04 05:48:52 -030051#define QUALITY_MIN 50
52#define QUALITY_MAX 80
53#define QUALITY_DEF 70
Jean-Francois Moined43fa322008-06-12 10:58:58 -030054
Jean-Francois Moine47c833922010-01-07 15:59:12 -030055 u8 sensor; /* Type of image sensor chip */
Jean-François Moine83d1aa32010-08-04 05:11:23 -030056 u16 chip_revision;
Jean-Francois Moine71cb2762009-03-03 05:33:41 -030057
Jean-François Moine9a731a32010-06-04 05:26:42 -030058 u8 jpeg_hdr[JPEG_HDR_SZ];
Jean-Francois Moined43fa322008-06-12 10:58:58 -030059};
Jean-François Moine83d1aa32010-08-04 05:11:23 -030060enum sensors {
61 SENSOR_ADCM2700,
62 SENSOR_CS2102,
63 SENSOR_CS2102K,
64 SENSOR_GC0305,
65 SENSOR_HDCS2020b,
66 SENSOR_HV7131B,
67 SENSOR_HV7131R,
68 SENSOR_ICM105A,
69 SENSOR_MC501CB,
70 SENSOR_MI0360SOC, /* = MT9V111 */
71 SENSOR_OV7620, /* OV7648 - same values */
72 SENSOR_OV7630C,
73 SENSOR_PAS106,
74 SENSOR_PAS202B,
75 SENSOR_PB0330,
76 SENSOR_PO2030,
77 SENSOR_TAS5130CK,
78 SENSOR_TAS5130C,
79 SENSOR_TAS5130C_VF0250,
80 SENSOR_MAX
81};
Jean-Francois Moined43fa322008-06-12 10:58:58 -030082
83/* V4L2 controls supported by the driver */
Jean-François Moinea9dfc012010-06-04 06:21:48 -030084static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
85static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moined43fa322008-06-12 10:58:58 -030086static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
87static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
88static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
89static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030090static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val);
Jean-Francois Moined43fa322008-06-12 10:58:58 -030091static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030092static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
93static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
94static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
95static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moined43fa322008-06-12 10:58:58 -030096
Marton Nemeth7e64dc42009-12-30 09:12:41 -030097static const struct ctrl sd_ctrls[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -030098 {
99 {
Jean-François Moinea9dfc012010-06-04 06:21:48 -0300100 .id = V4L2_CID_BRIGHTNESS,
101 .type = V4L2_CTRL_TYPE_INTEGER,
102 .name = "Brightness",
103 .minimum = 0,
104 .maximum = 255,
105 .step = 1,
106#define BRIGHTNESS_DEF 128
107 .default_value = BRIGHTNESS_DEF,
108 },
109 .set = sd_setbrightness,
110 .get = sd_getbrightness,
111 },
112 {
113 {
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300114 .id = V4L2_CID_CONTRAST,
115 .type = V4L2_CTRL_TYPE_INTEGER,
116 .name = "Contrast",
117 .minimum = 0,
Jean-Francois Moinefd180462010-01-04 15:54:59 -0300118 .maximum = 255,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300119 .step = 1,
Jean-Francois Moine47c833922010-01-07 15:59:12 -0300120#define CONTRAST_DEF 128
121 .default_value = CONTRAST_DEF,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300122 },
123 .set = sd_setcontrast,
124 .get = sd_getcontrast,
125 },
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300126 {
127 {
128 .id = V4L2_CID_GAMMA,
129 .type = V4L2_CTRL_TYPE_INTEGER,
130 .name = "Gamma",
131 .minimum = 1,
132 .maximum = 6,
133 .step = 1,
134 .default_value = 4,
135 },
136 .set = sd_setgamma,
137 .get = sd_getgamma,
138 },
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300139 {
140 {
141 .id = V4L2_CID_AUTOGAIN,
142 .type = V4L2_CTRL_TYPE_BOOLEAN,
143 .name = "Auto Gain",
144 .minimum = 0,
145 .maximum = 1,
146 .step = 1,
Jean-Francois Moine47c833922010-01-07 15:59:12 -0300147#define AUTOGAIN_DEF 1
148 .default_value = AUTOGAIN_DEF,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300149 },
150 .set = sd_setautogain,
151 .get = sd_getautogain,
152 },
Jean-François Moinea9dfc012010-06-04 06:21:48 -0300153#define LIGHTFREQ_IDX 4
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300154 {
155 {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300156 .id = V4L2_CID_POWER_LINE_FREQUENCY,
157 .type = V4L2_CTRL_TYPE_MENU,
158 .name = "Light frequency filter",
159 .minimum = 0,
160 .maximum = 2, /* 0: 0, 1: 50Hz, 2:60Hz */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300161 .step = 1,
Jean-Francois Moine47c833922010-01-07 15:59:12 -0300162#define FREQ_DEF 0
163 .default_value = FREQ_DEF,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300164 },
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300165 .set = sd_setfreq,
166 .get = sd_getfreq,
167 },
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300168 {
169 {
170 .id = V4L2_CID_SHARPNESS,
171 .type = V4L2_CTRL_TYPE_INTEGER,
172 .name = "Sharpness",
173 .minimum = 0,
174 .maximum = 3,
175 .step = 1,
Jean-Francois Moine47c833922010-01-07 15:59:12 -0300176#define SHARPNESS_DEF 2
177 .default_value = SHARPNESS_DEF,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300178 },
179 .set = sd_setsharpness,
180 .get = sd_getsharpness,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300181 },
182};
183
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300184static const struct v4l2_pix_format vga_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300185 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
186 .bytesperline = 320,
187 .sizeimage = 320 * 240 * 3 / 8 + 590,
188 .colorspace = V4L2_COLORSPACE_JPEG,
189 .priv = 1},
190 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
191 .bytesperline = 640,
192 .sizeimage = 640 * 480 * 3 / 8 + 590,
193 .colorspace = V4L2_COLORSPACE_JPEG,
194 .priv = 0},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300195};
196
Hans de Goede9919fe82010-01-13 07:12:28 -0300197static const struct v4l2_pix_format broken_vga_mode[] = {
198 {320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
199 .bytesperline = 320,
200 .sizeimage = 320 * 232 * 4 / 8 + 590,
201 .colorspace = V4L2_COLORSPACE_JPEG,
202 .priv = 1},
203 {640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
204 .bytesperline = 640,
205 .sizeimage = 640 * 472 * 3 / 8 + 590,
206 .colorspace = V4L2_COLORSPACE_JPEG,
207 .priv = 0},
208};
209
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300210static const struct v4l2_pix_format sif_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300211 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
212 .bytesperline = 176,
213 .sizeimage = 176 * 144 * 3 / 8 + 590,
214 .colorspace = V4L2_COLORSPACE_JPEG,
215 .priv = 1},
216 {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
217 .bytesperline = 352,
218 .sizeimage = 352 * 288 * 3 / 8 + 590,
219 .colorspace = V4L2_COLORSPACE_JPEG,
220 .priv = 0},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300221};
222
223/* usb exchanges */
224struct usb_action {
Jean-Francois Moine47c833922010-01-07 15:59:12 -0300225 u8 req;
226 u8 val;
227 u16 idx;
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300228};
229
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300230static const struct usb_action adcm2700_Initial[] = {
231 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
232 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300233 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300234 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
235 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
236 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
237 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
238 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
239 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
240 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
241 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
242 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
243 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
244 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
245 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
246 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
247 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
248 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
249 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
250 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
251 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
252 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300253 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300254 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
255 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
256 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
257 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
258 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
259 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
260 {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */
261 {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */
262 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
263 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
264 {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */
265 {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */
266 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
267 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
268 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
269 {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */
270 {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */
271 {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */
272 {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */
273 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
274 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
275 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
276 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
277 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
278 {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */
279 {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */
280 {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */
281 {0xbb, 0x86, 0x0002}, /* 00,86,02,bb */
282 {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
283 {0xbb, 0x86, 0x0802}, /* 08,86,02,bb */
284 {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */
285 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
286 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
287 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
288 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
289 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
290 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
291 {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300292/*mswin+*/
293 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
294 {0xaa, 0xfe, 0x0002},
295 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
296 {0xaa, 0xb4, 0xcd37},
297 {0xaa, 0xa4, 0x0004},
298 {0xaa, 0xa8, 0x0007},
299 {0xaa, 0xac, 0x0004},
300/*mswin-*/
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300301 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
302 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
303 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
304 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
305 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
306 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
307 {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */
308 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
309 {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */
310 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
311 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
312 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
313 {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */
314 {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */
315 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
316 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
317 {}
318};
319static const struct usb_action adcm2700_InitialScale[] = {
320 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
321 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300322 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300323 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
324 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
325 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
326 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
327 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
328 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
329 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
330 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
331 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
332 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
333 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
334 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
335 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
336 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
337 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
338 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
339 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
340 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
341 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300342 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300343 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
344 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
345 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
346 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
347 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
348 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
349 {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */
350 {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */
351 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
352 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
353 {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */
354 {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */
355 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
356 {0xdd, 0x00, 0x0050}, /* 00,00,50,dd */
357 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
358 {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */
359 {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */
360 {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */
361 {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */
362 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
363 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
364 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
365 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
366 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
367 {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */
368 {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */
369 {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300370 {0xbb, 0x86, 0x0002}, /* 00,88,02,bb */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300371 {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300372 {0xbb, 0x86, 0x0802}, /* 08,88,02,bb */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300373 {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */
374 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
375 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
376 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
377 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
378 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
379 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
380 {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */
381 /*******/
382 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
383 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
384 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
385 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
386 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
387 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
388 {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */
389 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
390 {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */
391 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
392 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
393 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
394 {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */
395 {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */
396 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
397 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
398 {}
399};
400static const struct usb_action adcm2700_50HZ[] = {
401 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
402 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
403 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
404 {0xbb, 0x05, 0x8400}, /* 84,05,00,bb */
405 {0xbb, 0xd0, 0xb007}, /* b0,d0,07,bb */
406 {0xbb, 0xa0, 0xb80f}, /* b8,a0,0f,bb */
407 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
408 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
409 {0xaa, 0x26, 0x00d0}, /* 00,26,d0,aa */
410 {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */
411 {}
412};
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300413static const struct usb_action adcm2700_60HZ[] = {
414 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
415 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
416 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
417 {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */
418 {0xbb, 0x82, 0xb006}, /* b0,82,06,bb */
419 {0xbb, 0x04, 0xb80d}, /* b8,04,0d,bb */
420 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
421 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
422 {0xaa, 0x26, 0x0057}, /* 00,26,57,aa */
423 {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */
424 {}
425};
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300426static const struct usb_action adcm2700_NoFliker[] = {
427 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
428 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
429 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
430 {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */
431 {0xbb, 0x05, 0xb000}, /* b0,05,00,bb */
432 {0xbb, 0xa0, 0xb801}, /* b8,a0,01,bb */
433 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
434 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
435 {}
436};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300437static const struct usb_action cs2102_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300438 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
439 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
440 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
441 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
442 {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
443 {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
444 {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
445 {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
446 {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
447 {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
448 {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
449 {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
450 {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
451 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
452 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
453 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
454 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
455 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
456 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
457 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
458 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
459 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
460 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
461 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300462 {0xaa, 0x02, 0x0008},
463 {0xaa, 0x03, 0x0000},
464 {0xaa, 0x11, 0x0000},
465 {0xaa, 0x12, 0x0089},
466 {0xaa, 0x13, 0x0000},
467 {0xaa, 0x14, 0x00e9},
468 {0xaa, 0x20, 0x0000},
469 {0xaa, 0x22, 0x0000},
470 {0xaa, 0x0b, 0x0004},
471 {0xaa, 0x30, 0x0030},
472 {0xaa, 0x31, 0x0030},
473 {0xaa, 0x32, 0x0030},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300474 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
475 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
476 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
477 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
478 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
479 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
480 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300481 {0xa0, 0x10, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300482 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
483 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
484 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300485 {0xa0, 0x00, 0x01ad},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300486 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300487};
488
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300489static const struct usb_action cs2102_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300490 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
491 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
492 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
493 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
494 {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
495 {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
496 {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
497 {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
498 {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
499 {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
500 {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
501 {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
502 {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
503 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
504 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
505 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
506 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
507 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
508 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
509 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
510 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
511 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
512 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
513 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300514 {0xaa, 0x02, 0x0008},
515 {0xaa, 0x03, 0x0000},
516 {0xaa, 0x11, 0x0001},
517 {0xaa, 0x12, 0x0087},
518 {0xaa, 0x13, 0x0001},
519 {0xaa, 0x14, 0x00e7},
520 {0xaa, 0x20, 0x0000},
521 {0xaa, 0x22, 0x0000},
522 {0xaa, 0x0b, 0x0004},
523 {0xaa, 0x30, 0x0030},
524 {0xaa, 0x31, 0x0030},
525 {0xaa, 0x32, 0x0030},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300526 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
527 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
528 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
529 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
530 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
531 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
532 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300533 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300534 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
535 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
536 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300537 {0xa0, 0x00, 0x01ad},
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300538 {}
539};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300540static const struct usb_action cs2102_50HZScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300541 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
542 {0xaa, 0x23, 0x0001},
543 {0xaa, 0x24, 0x005f},
544 {0xaa, 0x25, 0x0090},
545 {0xaa, 0x21, 0x00dd},
546 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
547 {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
548 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
549 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
550 {0xa0, 0x3a, ZC3XX_R196_ANTIFLICKERMID},
551 {0xa0, 0x98, ZC3XX_R197_ANTIFLICKERLOW},
552 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
553 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
554 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
555 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
556 {0xa0, 0xdd, ZC3XX_R01D_HSYNC_0},
557 {0xa0, 0xe4, ZC3XX_R01E_HSYNC_1},
558 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
559 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
560 {}
561};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300562static const struct usb_action cs2102_50HZ[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300563 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
564 {0xaa, 0x23, 0x0000},
565 {0xaa, 0x24, 0x00af},
566 {0xaa, 0x25, 0x00c8},
567 {0xaa, 0x21, 0x0068},
568 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
569 {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
570 {0xa0, 0x90, ZC3XX_R192_EXPOSURELIMITLOW},
571 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
572 {0xa0, 0x1d, ZC3XX_R196_ANTIFLICKERMID},
573 {0xa0, 0x4c, ZC3XX_R197_ANTIFLICKERLOW},
574 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
575 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
576 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
577 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
578 {0xa0, 0x68, ZC3XX_R01D_HSYNC_0},
579 {0xa0, 0xe3, ZC3XX_R01E_HSYNC_1},
580 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
581 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
582 {}
583};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300584static const struct usb_action cs2102_60HZScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300585 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
586 {0xaa, 0x23, 0x0001},
587 {0xaa, 0x24, 0x0055},
588 {0xaa, 0x25, 0x00cc},
589 {0xaa, 0x21, 0x003f},
590 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
591 {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
592 {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
593 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
594 {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
595 {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
596 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
597 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
598 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
599 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
600 {0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
601 {0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
602 {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
603 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
604 {}
605};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300606static const struct usb_action cs2102_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300607 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300608 {0xaa, 0x23, 0x0000},
609 {0xaa, 0x24, 0x00aa},
610 {0xaa, 0x25, 0x00e6},
611 {0xaa, 0x21, 0x003f},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300612 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
613 {0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
614 {0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
615 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
616 {0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
617 {0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
618 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
619 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
620 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
621 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
622 {0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
623 {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
624 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
625 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300626 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300627};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300628static const struct usb_action cs2102_NoFlikerScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300629 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
630 {0xaa, 0x23, 0x0001},
631 {0xaa, 0x24, 0x005f},
632 {0xaa, 0x25, 0x0000},
633 {0xaa, 0x21, 0x0001},
634 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
635 {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
636 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
637 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
638 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
639 {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
640 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
641 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
642 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
643 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
644 {0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
645 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
646 {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
647 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300648 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300649};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300650static const struct usb_action cs2102_NoFliker[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300651 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
652 {0xaa, 0x23, 0x0000},
653 {0xaa, 0x24, 0x00af},
654 {0xaa, 0x25, 0x0080},
655 {0xaa, 0x21, 0x0001},
656 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
657 {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
658 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
659 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
660 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
661 {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
662 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
663 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
664 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
665 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
666 {0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
667 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
668 {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
669 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300670 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300671};
672
673/* CS2102_KOCOM */
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300674static const struct usb_action cs2102K_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300675 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
676 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
677 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
678 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
679 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
680 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
681 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
682 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
683 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
684 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
685 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
686 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
687 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
688 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
689 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
690 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
691 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
692 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
693 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
694 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
695 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
696 {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
697 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
698 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
699 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
700 {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
701 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
702 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
703 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
704 {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
705 {0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
706 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
707 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
708 {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
709 {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
710 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
711 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
712 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
713 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
714 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
715 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
716 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
717 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
718 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
719 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
720 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
721 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
722 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
723 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
724 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
725 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
726 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
727 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
728 {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
729 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
730 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
731 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
732 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
733 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
734 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
735 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
736 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
737 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
738 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
739 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
740 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
741 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
742 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
743 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
744 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
745 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
746 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
747 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
748 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
749 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
750 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
751 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
752 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
753 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
754 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
755 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
756 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
757 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
758 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
759 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
760 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
761 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
762 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
763 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
764 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
765 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
766 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
767 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
768 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
769 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
770 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
771 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
772 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
773 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
774 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300775 {0xa0, 0x00, 0x01ad},
776 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300777 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
778 {0xa0, 0x60, ZC3XX_R116_RGAIN},
779 {0xa0, 0x40, ZC3XX_R117_GGAIN},
780 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
781 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
782 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
783 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
784 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
785 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
786 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
787 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
788 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
789 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
790 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
791 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
792 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
793 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
794 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
795 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
796 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
797 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
798 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
799 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
800 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
801 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
802 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
803 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
804 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
805 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
806 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
807 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
808 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
809 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
810 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
811 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
812 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
813 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
814 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
815 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
816 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
817 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
818 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
819 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
820 {0xa0, 0x58, ZC3XX_R10E_RGB11},
821 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
822 {0xa0, 0xf4, ZC3XX_R110_RGB20},
823 {0xa0, 0xf4, ZC3XX_R111_RGB21},
824 {0xa0, 0x58, ZC3XX_R112_RGB22},
825 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
826 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
827 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
828 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
829 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
830 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
831 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
832 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
833 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
834 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
835 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
836 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
837 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
838 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
839 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
840 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
841 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
842 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
843 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
844 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
845 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
846 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
847 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
848 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
849 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
850 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
851 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
852 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
853 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
854 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
855 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
856 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
857 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
858 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
859 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
860 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
861 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
862 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
863 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
864 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
865 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
866 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
867 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
868 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
869 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
870 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
871 {0xa0, 0x60, ZC3XX_R116_RGAIN},
872 {0xa0, 0x40, ZC3XX_R117_GGAIN},
873 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
874 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
875 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
876 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
877 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
878 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
879 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
880 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
881 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
882 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
883 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
884 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
885 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
886 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
887 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
888 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
889 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
890 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
891 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
892 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
893 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
894 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
895 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
896 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
897 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
898 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
899 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
900 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
901 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
902 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
903 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
904 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
905 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
906 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
907 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
908 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
909 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
910 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
911 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
912 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
913 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
914 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
915 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
916 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
917 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
918 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
919 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
920 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
921 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
922 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
923 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
924 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
925 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
926 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
927 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
928 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
929 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300930 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300931};
932
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300933static const struct usb_action cs2102K_Initial[] = {
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -0300934 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300935 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
936 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
937 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
938 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
939 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
940 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
941 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
942 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
943 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
944 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
945 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
946 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
947 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
948 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
949 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
950 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -0300951/*fixme: next sequence = i2c exchanges*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300952 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
953 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
954 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
955 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
956 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
957 {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
958 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
959 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
960 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
961 {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
962 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
963 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
964 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
965 {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
966 {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
967 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
968 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
969 {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
970 {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
971 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
972 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
973 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
974 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
975 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
976 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
977 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
978 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
979 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
980 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
981 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
982 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
983 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
984 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
985 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
986 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
987 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
988 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
989 {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
990 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
991 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
992 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
993 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
994 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
995 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
996 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
997 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
998 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
999 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1000 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1001 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
1002 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1003 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1004 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1005 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
1006 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1007 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1008 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1009 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
1010 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1011 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1012 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1013 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
1014 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1015 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1016 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1017 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
1018 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1019 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1020 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1021 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1022 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1023 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1024 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1025 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1026 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1027 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
1028 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1029 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1030 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1031 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1032 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1033 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1034 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1035 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001036 {0xa0, 0x00, 0x01ad},
1037 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001038 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1039 {0xa0, 0x60, ZC3XX_R116_RGAIN},
1040 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1041 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1042 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1043 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
1044 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1045 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1046 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1047 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1048 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1049 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1050 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1051 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1052 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1053 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1054 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1055 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1056 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1057 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1058 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1059 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1060 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1061 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1062 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1063 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1064 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1065 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1066 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1067 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1068 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1069 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1070 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1071 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1072 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1073 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1074 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1075 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1076 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1077 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1078 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1079 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1080 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1081 {0xa0, 0x58, ZC3XX_R10E_RGB11},
1082 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1083 {0xa0, 0xf4, ZC3XX_R110_RGB20},
1084 {0xa0, 0xf4, ZC3XX_R111_RGB21},
1085 {0xa0, 0x58, ZC3XX_R112_RGB22},
1086 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1087 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1088 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1089 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1090 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1091 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1092 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1093 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1094 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1095 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1096 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1097 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1098 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1099 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1100 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1101 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1102 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1103 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1104 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1105 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1106 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1107 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1108 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1109 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1110 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1111 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1112 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1113 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1114 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1115 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1116 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1117 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1118 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1119 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1120 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1121 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1122 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1123 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1124 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1125 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1126 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1127 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1128 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1129 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1130 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1131 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1132 {0xa0, 0x60, ZC3XX_R116_RGAIN},
1133 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1134 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001135 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1136 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1137 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1138 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1139 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1140 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1141 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1142 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1143 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1144 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1145 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1146 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1147 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1148 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1149 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1150 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1151 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1152 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1153 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1154 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1155 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1156 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1157 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1158 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1159 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1160 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1161 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1162 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1163 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1164 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1165 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1166 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1167 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1168 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1169 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1170 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1171 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1172 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1173 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1174 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1175 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1176 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1177 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1178 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1179 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1180 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1181 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1182 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1183 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1184 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1185 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1186 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1187 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1188 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1189 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1190 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -03001191/*fixme:what does the next sequence?*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001192 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1193 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1194 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1195 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1196 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1197 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1198 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1199 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1200 {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1201 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1202 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1203 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1204 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1205 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1206 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1207 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1208 {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1209 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1210 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1211 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1212 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1213 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1214 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1215 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1216 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1217 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1218 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1219 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1220 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
1221 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1222 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1223 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1224 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1225 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1226 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1227 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1228 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1229 {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1230 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1231 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1232 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1233 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1234 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1235 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1236 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1237 {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1238 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1239 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1240 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1241 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1242 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1243 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1244 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1245 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1246 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1247 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1248 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1249 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1250 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1251 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1252 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1253 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1254 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1255 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1256 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1257 {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1258 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1259 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1260 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1261 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1262 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1263 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1264 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1265 {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1266 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1267 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1268 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1269 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1270 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1271 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1272 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1273 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1274 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1275 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1276 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1277 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1278 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1279 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1280 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1281 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1282 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1283 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1284 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1285 {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1286 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1287 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1288 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1289 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1290 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1291 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1292 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1293 {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1294 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1295 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1296 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1297 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1298 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1299 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1300 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1301 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1302 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1303 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1304 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1305 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1306 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1307 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001308 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001309};
1310
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001311static const struct usb_action gc0305_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001312 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1313 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
1314 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
1315 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
1316 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
1317 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1318 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
1319 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
1320 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
1321 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
1322 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
1323 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
1324 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
1325 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
1326 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
1327 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
1328 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
1329 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001330 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa */
1331 {0xaa, 0x15, 0x0003}, /* 00,15,03,aa */
1332 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
1333 {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
1334 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
1335 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
1336 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
1337 {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
1338 {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001339 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
1340 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
1341 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001342 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
1343 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
1344 {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
1345 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
1346 {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
1347 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
1348 {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
1349 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
1350 {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
1351 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
1352 {0xaa, 0x17, 0x00e6}, /* 00,17,e6,aa */
1353 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
1354 {0xaa, 0x19, 0x0086}, /* 00,19,86,aa */
1355 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1356 {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001357 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
1358 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
1359 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1360 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001361 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001362 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1363 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
1364 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
1365 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
1366 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
1367 {0xa0, 0x85, ZC3XX_R18D_YTARGET}, /* 01,8d,85,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001368 {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001369 {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1370 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1371 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1372 {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001373 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001374};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001375static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001376 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1377 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
1378 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
1379 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
1380 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
1381 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1382 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
1383 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
1384 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
1385 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
1386 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
1387 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
1388 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
1389 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
1390 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
1391 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
1392 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
1393 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001394 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
1395 {0xaa, 0x15, 0x0001}, /* 00,15,01,aa */
1396 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
1397 {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
1398 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
1399 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
1400 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
1401 {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
1402 {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001403 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
1404 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
1405 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001406 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
1407 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
1408 {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
1409 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
1410 {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
1411 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
1412 {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
1413 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
1414 {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
1415 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
1416 {0xaa, 0x17, 0x00e8}, /* 00,17,e8,aa */
1417 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
1418 {0xaa, 0x19, 0x0088}, /* 00,19,88,aa */
1419 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1420 {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001421 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
1422 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
1423 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1424 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001425 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001426 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1427 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
1428 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
1429 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
1430 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001431 {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001432 {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1433 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1434 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1435 {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001436 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001437};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001438static const struct usb_action gc0305_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001439 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1440 {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */
1441 {0xaa, 0x84, 0x0038}, /* 00,84,38,aa */ /* win: 00,84,ec */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001442 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1443 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
1444 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
1445 /* win: 01,92,10 */
1446 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1447 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1448 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc */
1449 /* win: 01,97,ec */
1450 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1451 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1452 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
1453 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1454 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1455 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1456 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1457 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1458 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1459 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
1460/* {0xa0, 0x85, ZC3XX_R18D_YTARGET}, * 01,8d,85,cc *
1461 * if 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001462 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001463};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001464static const struct usb_action gc0305_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001465 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1466 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
1467 {0xaa, 0x84, 0x00ec}, /* 00,84,ec,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001468 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1469 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
1470 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
1471 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1472 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1473 {0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,ec,cc */
1474 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1475 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1476 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
1477 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1478 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1479 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1480 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1481 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1482 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1483 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
1484 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001485 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001486};
1487
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001488static const struct usb_action gc0305_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001489 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001490 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1491 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
1492 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001493 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1494 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,00,cc */
1495 {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,48,cc */
1496 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1497 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1498 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1499 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1500 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1501 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1502 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1503 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1504 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1505 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1506 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
1507 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001508 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001509};
1510
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001511static const struct usb_action hdcs2020b_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001512 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1513 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1514 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* qtable 0x05 */
1515 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1516 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1517 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1518 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1519 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1520 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1521 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1522 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1523 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1524 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1525 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1526 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1527 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1528 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001529 {0xaa, 0x1c, 0x0000},
1530 {0xaa, 0x0a, 0x0001},
1531 {0xaa, 0x0b, 0x0006},
1532 {0xaa, 0x0c, 0x007b},
1533 {0xaa, 0x0d, 0x00a7},
1534 {0xaa, 0x03, 0x00fb},
1535 {0xaa, 0x05, 0x0000},
1536 {0xaa, 0x06, 0x0003},
1537 {0xaa, 0x09, 0x0008},
1538
1539 {0xaa, 0x0f, 0x0018}, /* set sensor gain */
1540 {0xaa, 0x10, 0x0018},
1541 {0xaa, 0x11, 0x0018},
1542 {0xaa, 0x12, 0x0018},
1543
1544 {0xaa, 0x15, 0x004e},
1545 {0xaa, 0x1c, 0x0004},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001546 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1547 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1548 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1549 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1550 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1551 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1552 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1553 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1554 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001555 {0xa1, 0x01, 0x0002},
1556 {0xa1, 0x01, 0x0008},
1557 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001558 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1559 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1560 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1561 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001562 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001563 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1564 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001565 {0xa1, 0x01, 0x01c8},
1566 {0xa1, 0x01, 0x01c9},
1567 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001568 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1569 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1570 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1571 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1572 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1573 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1574 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1575 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1576 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1577 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1578 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1579 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1580 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1581 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1582 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1583 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1584 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1585 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1586 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1587 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1588 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1589 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1590 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1591 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1592 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1593 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1594 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1595 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1596 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1597 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1598 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1599 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1600 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001601
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001602 {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1603 {0xa0, 0xed, ZC3XX_R10B_RGB01},
1604 {0xa0, 0xed, ZC3XX_R10C_RGB02},
1605 {0xa0, 0xed, ZC3XX_R10D_RGB10},
1606 {0xa0, 0x66, ZC3XX_R10E_RGB11},
1607 {0xa0, 0xed, ZC3XX_R10F_RGB12},
1608 {0xa0, 0xed, ZC3XX_R110_RGB20},
1609 {0xa0, 0xed, ZC3XX_R111_RGB21},
1610 {0xa0, 0x66, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001611
1612 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001613 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1614 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001615 {0xaa, 0x13, 0x0031},
1616 {0xaa, 0x14, 0x0001},
1617 {0xaa, 0x0e, 0x0004},
1618 {0xaa, 0x19, 0x00cd},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001619 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1620 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1621 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1622 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1623 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1624 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1625 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1626 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001627
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001628 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 0x14 */
1629 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1630 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1631 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1632 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1633 {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1634 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1635 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001636 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001637 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1638 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1639 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1640 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001641 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001642};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001643static const struct usb_action hdcs2020b_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001644 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1645 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1646 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1647 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1648 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1649 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1650 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1651 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1652 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1653 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1654 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1655 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1656 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1657 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1658 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1659 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1660 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001661 {0xaa, 0x1c, 0x0000},
1662 {0xaa, 0x0a, 0x0001},
1663 {0xaa, 0x0b, 0x0006},
1664 {0xaa, 0x0c, 0x007a},
1665 {0xaa, 0x0d, 0x00a7},
1666 {0xaa, 0x03, 0x00fb},
1667 {0xaa, 0x05, 0x0000},
1668 {0xaa, 0x06, 0x0003},
1669 {0xaa, 0x09, 0x0008},
1670 {0xaa, 0x0f, 0x0018}, /* original setting */
1671 {0xaa, 0x10, 0x0018},
1672 {0xaa, 0x11, 0x0018},
1673 {0xaa, 0x12, 0x0018},
1674 {0xaa, 0x15, 0x004e},
1675 {0xaa, 0x1c, 0x0004},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001676 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1677 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1678 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1679 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1680 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1681 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1682 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1683 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1684 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001685 {0xa1, 0x01, 0x0002},
1686 {0xa1, 0x01, 0x0008},
1687 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001688 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1689 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1690 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1691 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001692 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001693 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1694 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001695 {0xa1, 0x01, 0x01c8},
1696 {0xa1, 0x01, 0x01c9},
1697 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001698 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1699 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1700 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1701 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1702 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1703 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1704 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1705 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1706 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1707 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1708 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1709 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1710 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1711 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1712 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1713 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1714 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1715 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1716 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1717 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1718 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1719 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1720 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1721 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1722 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1723 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1724 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1725 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1726 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1727 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1728 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1729 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1730 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1731 {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1732 {0xa0, 0xed, ZC3XX_R10B_RGB01},
1733 {0xa0, 0xed, ZC3XX_R10C_RGB02},
1734 {0xa0, 0xed, ZC3XX_R10D_RGB10},
1735 {0xa0, 0x66, ZC3XX_R10E_RGB11},
1736 {0xa0, 0xed, ZC3XX_R10F_RGB12},
1737 {0xa0, 0xed, ZC3XX_R110_RGB20},
1738 {0xa0, 0xed, ZC3XX_R111_RGB21},
1739 {0xa0, 0x66, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001740 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001741 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1742 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001743 /**** set exposure ***/
1744 {0xaa, 0x13, 0x0031},
1745 {0xaa, 0x14, 0x0001},
1746 {0xaa, 0x0e, 0x0004},
1747 {0xaa, 0x19, 0x00cd},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001748 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1749 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1750 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1751 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1752 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1753 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1754 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1755 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1756 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1757 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1758 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1759 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1760 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1761 {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1762 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1763 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001764 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001765 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1766 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1767 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1768 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001769 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001770};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001771static const struct usb_action hdcs2020b_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001772 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001773 {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
1774 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1775 {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */
1776 {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001777 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1778 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1779 {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
1780 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1781 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1782 {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
1783 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1784 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1785 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1786 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1787 {0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
1788 {0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
1789 {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001790 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001791};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001792static const struct usb_action hdcs2020b_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001793 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001794 {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
1795 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1796 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
1797 {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001798 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1799 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1800 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
1801 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1802 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1803 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
1804 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1805 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1806 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1807 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1808 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1809 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
1810 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001811 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001812};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001813static const struct usb_action hdcs2020b_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001814 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001815 {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
1816 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1817 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
1818 {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001819 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1820 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1821 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
1822 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1823 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1824 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1825 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1826 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1827 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
1828 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
1829 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1830 {0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
1831 {0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001832 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001833};
1834
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001835static const struct usb_action hv7131b_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001836 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1837 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1838 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1839 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1840 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
1841 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
1842 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1843 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1844 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1845 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1846 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1847 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1848 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1849 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1850 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1851 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001852 {0xaa, 0x30, 0x002d},
1853 {0xaa, 0x01, 0x0005},
1854 {0xaa, 0x11, 0x0000},
1855 {0xaa, 0x13, 0x0001}, /* {0xaa, 0x13, 0x0000}, */
1856 {0xaa, 0x14, 0x0001},
1857 {0xaa, 0x15, 0x00e8},
1858 {0xaa, 0x16, 0x0002},
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03001859 {0xaa, 0x17, 0x0086}, /* 00,17,88,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001860 {0xaa, 0x31, 0x0038},
1861 {0xaa, 0x32, 0x0038},
1862 {0xaa, 0x33, 0x0038},
1863 {0xaa, 0x5b, 0x0001},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001864 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1865 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1866 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1867 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
1868 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001869 {0xa0, 0x00, 0x01ad},
1870 {0xa0, 0xc0, 0x019b},
1871 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001872 {0xa0, 0x02, ZC3XX_R188_MINGAIN},
1873 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1874 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1875 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1876 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1877 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03001878 {0xaa, 0x02, 0x0090}, /* 00,02,80,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001879 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001880};
1881
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001882static const struct usb_action hv7131b_Initial[] = { /* 640x480*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001883 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1884 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1885 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1886 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1887 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
1888 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
1889 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1890 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1891 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1892 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1893 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1894 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1895 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1896 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1897 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1898 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001899 {0xaa, 0x30, 0x002d},
1900 {0xaa, 0x01, 0x0005},
1901 {0xaa, 0x11, 0x0001},
1902 {0xaa, 0x13, 0x0000}, /* {0xaa, 0x13, 0x0001}; */
1903 {0xaa, 0x14, 0x0001},
1904 {0xaa, 0x15, 0x00e6},
1905 {0xaa, 0x16, 0x0002},
1906 {0xaa, 0x17, 0x0086},
1907 {0xaa, 0x31, 0x0038},
1908 {0xaa, 0x32, 0x0038},
1909 {0xaa, 0x33, 0x0038},
1910 {0xaa, 0x5b, 0x0001},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001911 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1912 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1913 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1914 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1915 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001916 {0xa0, 0x00, 0x01ad},
1917 {0xa0, 0xc0, 0x019b},
1918 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001919 {0xa0, 0x02, ZC3XX_R188_MINGAIN},
1920 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1921 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1922 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1923 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1924 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001925 {0xaa, 0x02, 0x0090}, /* {0xaa, 0x02, 0x0080}, */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001926 {}
1927};
1928static const struct usb_action hv7131b_50HZ[] = { /* 640x480*/
1929 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1930 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1931 {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
1932 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
1933 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1934 {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
1935 {0xaa, 0x22, 0x001b}, /* 00,22,1b,aa */
1936 {0xaa, 0x23, 0x00fc}, /* 00,23,fc,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001937 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1938 {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
1939 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
1940 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1941 {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,ea,cc */
1942 {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,60,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001943 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
1944 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
1945 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1946 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1947 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1948 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
1949 {0xa0, 0x1b, ZC3XX_R01F_HSYNC_2}, /* 00,1f,1b,cc */
1950 {0xa0, 0xfc, ZC3XX_R020_HSYNC_3}, /* 00,20,fc,cc */
1951 {}
1952};
1953static const struct usb_action hv7131b_50HZScale[] = { /* 320x240 */
1954 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1955 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1956 {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
1957 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
1958 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1959 {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
1960 {0xaa, 0x22, 0x0012}, /* 00,22,12,aa */
1961 {0xaa, 0x23, 0x0080}, /* 00,23,80,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001962 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1963 {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
1964 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
1965 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
1966 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,d4,cc */
1967 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,c0,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001968 {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
1969 {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
1970 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1971 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1972 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1973 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
1974 {0xa0, 0x12, ZC3XX_R01F_HSYNC_2}, /* 00,1f,12,cc */
1975 {0xa0, 0x80, ZC3XX_R020_HSYNC_3}, /* 00,20,80,cc */
1976 {}
1977};
1978static const struct usb_action hv7131b_60HZ[] = { /* 640x480*/
1979 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1980 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1981 {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
1982 {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
1983 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1984 {0xaa, 0x21, 0x0040}, /* 00,21,40,aa */
1985 {0xaa, 0x22, 0x0013}, /* 00,22,13,aa */
1986 {0xaa, 0x23, 0x004c}, /* 00,23,4c,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001987 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1988 {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
1989 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
1990 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1991 {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,c3,cc */
1992 {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,50,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001993 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
1994 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
1995 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1996 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1997 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1998 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
1999 {0xa0, 0x13, ZC3XX_R01F_HSYNC_2}, /* 00,1f,13,cc */
2000 {0xa0, 0x4c, ZC3XX_R020_HSYNC_3}, /* 00,20,4c,cc */
2001 {}
2002};
2003static const struct usb_action hv7131b_60HZScale[] = { /* 320x240 */
2004 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2005 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
2006 {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
2007 {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
2008 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2009 {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
2010 {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
2011 {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002012 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2013 {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
2014 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
2015 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
2016 {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,86,cc */
2017 {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,a0,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002018 {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
2019 {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
2020 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
2021 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
2022 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2023 {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
2024 {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
2025 {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
2026 {}
2027};
2028static const struct usb_action hv7131b_NoFliker[] = { /* 640x480*/
2029 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2030 {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
2031 {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
2032 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
2033 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2034 {0xaa, 0x21, 0x0010}, /* 00,21,10,aa */
2035 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2036 {0xaa, 0x23, 0x0003}, /* 00,23,03,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002037 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2038 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
2039 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
2040 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2041 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
2042 {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002043 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2044 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2045 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2046 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2047 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2048 {0xa0, 0x10, ZC3XX_R01E_HSYNC_1}, /* 00,1e,10,cc */
2049 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2}, /* 00,1f,00,cc */
2050 {0xa0, 0x03, ZC3XX_R020_HSYNC_3}, /* 00,20,03,cc */
2051 {}
2052};
2053static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
2054 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2055 {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
2056 {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
2057 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
2058 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2059 {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
2060 {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
2061 {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002062 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2063 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
2064 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
2065 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2066 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
2067 {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002068 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2069 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2070 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2071 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2072 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2073 {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
2074 {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
2075 {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002076 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002077};
2078
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002079/* from lPEPI264v.inf (hv7131b!) */
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002080static const struct usb_action hv7131r_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002081 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2082 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2083 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2084 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2085 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2086 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002087 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002088 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002089 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2090 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2091 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2092 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2093 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2094 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2095 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2096 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2097 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2098 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2099 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2100 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002101 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2102 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002103 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002104 {0xaa, 0x01, 0x000c},
2105 {0xaa, 0x11, 0x0000},
2106 {0xaa, 0x13, 0x0000},
2107 {0xaa, 0x14, 0x0001},
2108 {0xaa, 0x15, 0x00e8},
2109 {0xaa, 0x16, 0x0002},
2110 {0xaa, 0x17, 0x0088},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002111 {0xaa, 0x30, 0x000b},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002112 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2113 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002114 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002115 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002116 {0xa0, 0x00, 0x01ad},
2117 {0xa0, 0xc0, 0x019b},
2118 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002119 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2120 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2121 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2122 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2123 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002124 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002125};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002126static const struct usb_action hv7131r_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002127 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002128 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002129 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2130 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2131 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2132 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002133 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002134 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002135 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2136 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2137 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002138 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002139
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002140 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2141 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2142 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002143 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002144 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002145 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002146 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2147 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002148 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2149 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002150 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002151 {0xaa, 0x01, 0x000c},
2152 {0xaa, 0x11, 0x0000},
2153 {0xaa, 0x13, 0x0000},
2154 {0xaa, 0x14, 0x0001},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002155 {0xaa, 0x15, 0x00e6},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002156 {0xaa, 0x16, 0x0002},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002157 {0xaa, 0x17, 0x0086},
2158 {0xaa, 0x30, 0x000b},
2159 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002160 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002161 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002162 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002163 {0xa0, 0x00, 0x01ad},
2164 {0xa0, 0xc0, 0x019b},
2165 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002166 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2167 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2168 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2169 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2170 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002171 {}
2172};
2173static const struct usb_action hv7131r_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002174 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002175 {0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
2176 {0xa0, 0x68, ZC3XX_R191_EXPOSURELIMITMID},
2177 {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
2178 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2179 {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},
2180 {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},
2181 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2182 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2183 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2184 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2185 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2186 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2187 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2188 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2189 {}
2190};
2191static const struct usb_action hv7131r_50HZScale[] = {
2192 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2193 {0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
2194 {0xa0, 0xd1, ZC3XX_R191_EXPOSURELIMITMID},
2195 {0xa0, 0x40, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002196 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2197 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2198 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002199 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002200 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002201 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002202 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2203 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2204 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2205 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2206 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2207 {}
2208};
2209static const struct usb_action hv7131r_60HZ[] = {
2210 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2211 {0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
2212 {0xa0, 0x1a, ZC3XX_R191_EXPOSURELIMITMID},
2213 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
2214 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2215 {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},
2216 {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},
2217 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2218 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2219 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2220 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2221 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2222 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2223 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2224 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2225 {}
2226};
2227static const struct usb_action hv7131r_60HZScale[] = {
2228 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2229 {0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
2230 {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID},
2231 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2232 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2233 {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},
2234 {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},
2235 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2236 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2237 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2238 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2239 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2240 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2241 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2242 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2243 {}
2244};
2245static const struct usb_action hv7131r_NoFliker[] = {
2246 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2247 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
2248 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
2249 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2250 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2251 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},
2252 {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW},
2253 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2254 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2255 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
2256 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
2257 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2258 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2259 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2260 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2261 {}
2262};
2263static const struct usb_action hv7131r_NoFlikerScale[] = {
2264 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2265 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
2266 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
2267 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2268 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2269 {0xa0, 0x04, ZC3XX_R196_ANTIFLICKERMID},
2270 {0xa0, 0xb0, ZC3XX_R197_ANTIFLICKERLOW},
2271 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2272 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2273 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
2274 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
2275 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2276 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2277 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2278 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002279 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002280};
2281
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002282static const struct usb_action icm105a_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002283 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2284 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2285 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2286 {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2287 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2288 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2289 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2290 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2291 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2292 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2293 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2294 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2295 {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2296 {0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
2297 {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2298 {0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
2299 {0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
2300 {0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
2301 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2302 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2303 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2304 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2305 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2306 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2307 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2308 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2309 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002310 {0xaa, 0x01, 0x0010},
2311 {0xaa, 0x03, 0x0000},
2312 {0xaa, 0x04, 0x0001},
2313 {0xaa, 0x05, 0x0020},
2314 {0xaa, 0x06, 0x0001},
2315 {0xaa, 0x08, 0x0000},
2316 {0xaa, 0x03, 0x0001},
2317 {0xaa, 0x04, 0x0011},
2318 {0xaa, 0x05, 0x00a0},
2319 {0xaa, 0x06, 0x0001},
2320 {0xaa, 0x08, 0x0000},
2321 {0xaa, 0x03, 0x0002},
2322 {0xaa, 0x04, 0x0013},
2323 {0xaa, 0x05, 0x0020},
2324 {0xaa, 0x06, 0x0001},
2325 {0xaa, 0x08, 0x0000},
2326 {0xaa, 0x03, 0x0003},
2327 {0xaa, 0x04, 0x0015},
2328 {0xaa, 0x05, 0x0020},
2329 {0xaa, 0x06, 0x0005},
2330 {0xaa, 0x08, 0x0000},
2331 {0xaa, 0x03, 0x0004},
2332 {0xaa, 0x04, 0x0017},
2333 {0xaa, 0x05, 0x0020},
2334 {0xaa, 0x06, 0x000d},
2335 {0xaa, 0x08, 0x0000},
2336 {0xaa, 0x03, 0x0005},
2337 {0xaa, 0x04, 0x0019},
2338 {0xaa, 0x05, 0x0020},
2339 {0xaa, 0x06, 0x0005},
2340 {0xaa, 0x08, 0x0000},
2341 {0xaa, 0x03, 0x0006},
2342 {0xaa, 0x04, 0x0017},
2343 {0xaa, 0x05, 0x0026},
2344 {0xaa, 0x06, 0x0005},
2345 {0xaa, 0x08, 0x0000},
2346 {0xaa, 0x03, 0x0007},
2347 {0xaa, 0x04, 0x0019},
2348 {0xaa, 0x05, 0x0022},
2349 {0xaa, 0x06, 0x0005},
2350 {0xaa, 0x08, 0x0000},
2351 {0xaa, 0x03, 0x0008},
2352 {0xaa, 0x04, 0x0021},
2353 {0xaa, 0x05, 0x00aa},
2354 {0xaa, 0x06, 0x0005},
2355 {0xaa, 0x08, 0x0000},
2356 {0xaa, 0x03, 0x0009},
2357 {0xaa, 0x04, 0x0023},
2358 {0xaa, 0x05, 0x00aa},
2359 {0xaa, 0x06, 0x000d},
2360 {0xaa, 0x08, 0x0000},
2361 {0xaa, 0x03, 0x000a},
2362 {0xaa, 0x04, 0x0025},
2363 {0xaa, 0x05, 0x00aa},
2364 {0xaa, 0x06, 0x0005},
2365 {0xaa, 0x08, 0x0000},
2366 {0xaa, 0x03, 0x000b},
2367 {0xaa, 0x04, 0x00ec},
2368 {0xaa, 0x05, 0x002e},
2369 {0xaa, 0x06, 0x0005},
2370 {0xaa, 0x08, 0x0000},
2371 {0xaa, 0x03, 0x000c},
2372 {0xaa, 0x04, 0x00fa},
2373 {0xaa, 0x05, 0x002a},
2374 {0xaa, 0x06, 0x0005},
2375 {0xaa, 0x08, 0x0000},
2376 {0xaa, 0x07, 0x000d},
2377 {0xaa, 0x01, 0x0005},
2378 {0xaa, 0x94, 0x0002},
2379 {0xaa, 0x90, 0x0000},
2380 {0xaa, 0x91, 0x001f},
2381 {0xaa, 0x10, 0x0064},
2382 {0xaa, 0x9b, 0x00f0},
2383 {0xaa, 0x9c, 0x0002},
2384 {0xaa, 0x14, 0x001a},
2385 {0xaa, 0x20, 0x0080},
2386 {0xaa, 0x22, 0x0080},
2387 {0xaa, 0x24, 0x0080},
2388 {0xaa, 0x26, 0x0080},
2389 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002390 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2391 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002392 {0xaa, 0xa8, 0x00c0},
2393 {0xa1, 0x01, 0x0002},
2394 {0xa1, 0x01, 0x0008},
2395 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002396 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2397 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2398 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2399 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002400 {0xa1, 0x01, 0x0008},
2401
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002402 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2403 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002404 {0xa1, 0x01, 0x01c8},
2405 {0xa1, 0x01, 0x01c9},
2406 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002407 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
2408 {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2409 {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2410 {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2411 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2412 {0xa0, 0x52, ZC3XX_R10E_RGB11},
2413 {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2414 {0xa0, 0xf7, ZC3XX_R110_RGB20},
2415 {0xa0, 0xf7, ZC3XX_R111_RGB21},
2416 {0xa0, 0x52, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002417 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002418 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2419 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002420 {0xaa, 0x0d, 0x0003},
2421 {0xaa, 0x0c, 0x008c},
2422 {0xaa, 0x0e, 0x0095},
2423 {0xaa, 0x0f, 0x0002},
2424 {0xaa, 0x1c, 0x0094},
2425 {0xaa, 0x1d, 0x0002},
2426 {0xaa, 0x20, 0x0080},
2427 {0xaa, 0x22, 0x0080},
2428 {0xaa, 0x24, 0x0080},
2429 {0xaa, 0x26, 0x0080},
2430 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002431 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2432 {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
2433 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2434 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2435 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
2436 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2437 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2438 {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
2439 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2440 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2441 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2442 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2443 {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
2444 {0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
2445 {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
2446 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2447 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2448 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
2449 {0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
2450 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002451 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002452 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2453 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2454 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2455 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002456 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002457};
2458
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002459static const struct usb_action icm105a_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002460 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2461 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2462 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2463 {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2464 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2465 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2466 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2467 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2468 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2469 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2470 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2471 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2472 {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2473 {0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
2474 {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2475 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
2476 {0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
2477 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
2478 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2479 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2480 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2481 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2482 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2483 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2484 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2485 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2486 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002487 {0xaa, 0x01, 0x0010},
2488 {0xaa, 0x03, 0x0000},
2489 {0xaa, 0x04, 0x0001},
2490 {0xaa, 0x05, 0x0020},
2491 {0xaa, 0x06, 0x0001},
2492 {0xaa, 0x08, 0x0000},
2493 {0xaa, 0x03, 0x0001},
2494 {0xaa, 0x04, 0x0011},
2495 {0xaa, 0x05, 0x00a0},
2496 {0xaa, 0x06, 0x0001},
2497 {0xaa, 0x08, 0x0000},
2498 {0xaa, 0x03, 0x0002},
2499 {0xaa, 0x04, 0x0013},
2500 {0xaa, 0x05, 0x0020},
2501 {0xaa, 0x06, 0x0001},
2502 {0xaa, 0x08, 0x0000},
2503 {0xaa, 0x03, 0x0003},
2504 {0xaa, 0x04, 0x0015},
2505 {0xaa, 0x05, 0x0020},
2506 {0xaa, 0x06, 0x0005},
2507 {0xaa, 0x08, 0x0000},
2508 {0xaa, 0x03, 0x0004},
2509 {0xaa, 0x04, 0x0017},
2510 {0xaa, 0x05, 0x0020},
2511 {0xaa, 0x06, 0x000d},
2512 {0xaa, 0x08, 0x0000},
2513 {0xaa, 0x03, 0x0005},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002514 {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
2515 {0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
2516 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002517 {0xa1, 0x01, 0x0091},
2518 {0xaa, 0x05, 0x0020},
2519 {0xaa, 0x06, 0x0005},
2520 {0xaa, 0x08, 0x0000},
2521 {0xaa, 0x03, 0x0006},
2522 {0xaa, 0x04, 0x0017},
2523 {0xaa, 0x05, 0x0026},
2524 {0xaa, 0x06, 0x0005},
2525 {0xaa, 0x08, 0x0000},
2526 {0xaa, 0x03, 0x0007},
2527 {0xaa, 0x04, 0x0019},
2528 {0xaa, 0x05, 0x0022},
2529 {0xaa, 0x06, 0x0005},
2530 {0xaa, 0x08, 0x0000},
2531 {0xaa, 0x03, 0x0008},
2532 {0xaa, 0x04, 0x0021},
2533 {0xaa, 0x05, 0x00aa},
2534 {0xaa, 0x06, 0x0005},
2535 {0xaa, 0x08, 0x0000},
2536 {0xaa, 0x03, 0x0009},
2537 {0xaa, 0x04, 0x0023},
2538 {0xaa, 0x05, 0x00aa},
2539 {0xaa, 0x06, 0x000d},
2540 {0xaa, 0x08, 0x0000},
2541 {0xaa, 0x03, 0x000a},
2542 {0xaa, 0x04, 0x0025},
2543 {0xaa, 0x05, 0x00aa},
2544 {0xaa, 0x06, 0x0005},
2545 {0xaa, 0x08, 0x0000},
2546 {0xaa, 0x03, 0x000b},
2547 {0xaa, 0x04, 0x00ec},
2548 {0xaa, 0x05, 0x002e},
2549 {0xaa, 0x06, 0x0005},
2550 {0xaa, 0x08, 0x0000},
2551 {0xaa, 0x03, 0x000c},
2552 {0xaa, 0x04, 0x00fa},
2553 {0xaa, 0x05, 0x002a},
2554 {0xaa, 0x06, 0x0005},
2555 {0xaa, 0x08, 0x0000},
2556 {0xaa, 0x07, 0x000d},
2557 {0xaa, 0x01, 0x0005},
2558 {0xaa, 0x94, 0x0002},
2559 {0xaa, 0x90, 0x0000},
2560 {0xaa, 0x91, 0x0010},
2561 {0xaa, 0x10, 0x0064},
2562 {0xaa, 0x9b, 0x00f0},
2563 {0xaa, 0x9c, 0x0002},
2564 {0xaa, 0x14, 0x001a},
2565 {0xaa, 0x20, 0x0080},
2566 {0xaa, 0x22, 0x0080},
2567 {0xaa, 0x24, 0x0080},
2568 {0xaa, 0x26, 0x0080},
2569 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002570 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2571 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002572 {0xaa, 0xa8, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002573 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002574 {0xa1, 0x01, 0x0002},
2575 {0xa1, 0x01, 0x0008},
2576 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002577 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2578 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2579 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2580 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002581 {0xa1, 0x01, 0x0008},
2582
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002583 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2584 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002585 {0xa1, 0x01, 0x01c8},
2586 {0xa1, 0x01, 0x01c9},
2587 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002588 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002589
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002590 {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2591 {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2592 {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2593 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2594 {0xa0, 0x52, ZC3XX_R10E_RGB11},
2595 {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2596 {0xa0, 0xf7, ZC3XX_R110_RGB20},
2597 {0xa0, 0xf7, ZC3XX_R111_RGB21},
2598 {0xa0, 0x52, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002599 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002600 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2601 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002602 {0xaa, 0x0d, 0x0003},
2603 {0xaa, 0x0c, 0x0020},
2604 {0xaa, 0x0e, 0x000e},
2605 {0xaa, 0x0f, 0x0002},
2606 {0xaa, 0x1c, 0x000d},
2607 {0xaa, 0x1d, 0x0002},
2608 {0xaa, 0x20, 0x0080},
2609 {0xaa, 0x22, 0x0080},
2610 {0xaa, 0x24, 0x0080},
2611 {0xaa, 0x26, 0x0080},
2612 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002613 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2614 {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
2615 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2616 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2617 {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
2618 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2619 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2620 {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
2621 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2622 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2623 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2624 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2625 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
2626 {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
2627 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
2628 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2629 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2630 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002631 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002632 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2633 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2634 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2635 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002636 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002637};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002638static const struct usb_action icm105a_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002639 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002640 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2641 {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
2642 {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
2643 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2644 {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
2645 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2646 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2647 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2648 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2649 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2650 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002651 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2652 {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
2653 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2654 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2655 {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
2656 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2657 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2658 {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
2659 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2660 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2661 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2662 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2663 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
2664 {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
2665 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2666 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002667 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002668};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002669static const struct usb_action icm105a_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002670 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002671 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2672 {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
2673 {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
2674 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2675 {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
2676 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2677 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2678 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2679 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2680 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2681 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002682 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2683 {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
2684 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2685 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2686 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2687 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2688 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2689 {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
2690 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2691 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2692 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2693 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2694 {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
2695 {0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
2696 {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
2697 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2698 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2699 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002700 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002701};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002702static const struct usb_action icm105a_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002703 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002704 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2705 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2706 {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2707 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2708 {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
2709 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2710 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2711 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2712 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2713 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2714 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002715 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2716 {0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
2717 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2718 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2719 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
2720 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2721 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2722 {0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
2723 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2724 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2725 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2726 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2727 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2728 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2729 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2730 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002731 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002732};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002733static const struct usb_action icm105a_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002734 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002735 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2736 {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
2737 {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
2738 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2739 {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
2740 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2741 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2742 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2743 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2744 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2745 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002746 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2747 {0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
2748 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2749 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2750 {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
2751 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2752 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2753 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
2754 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2755 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2756 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2757 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2758 {0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
2759 {0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
2760 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2761 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2762 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2763 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002764 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002765};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002766static const struct usb_action icm105a_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002767 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002768 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2769 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2770 {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2771 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2772 {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
2773 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2774 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2775 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2776 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2777 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2778 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002779 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2780 {0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
2781 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2782 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2783 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2784 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2785 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2786 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2787 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2788 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2789 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2790 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2791 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2792 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2793 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2794 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002795 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002796};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002797static const struct usb_action icm105a_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002798 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002799 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2800 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2801 {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
2802 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2803 {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
2804 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2805 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2806 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2807 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2808 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2809 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002810 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2811 {0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
2812 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2813 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2814 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2815 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2816 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2817 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2818 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2819 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2820 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2821 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2822 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2823 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2824 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2825 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2826 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2827 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002828 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002829};
2830
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002831static const struct usb_action mc501cb_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002832 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2833 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
2834 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2835 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2836 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2837 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2838 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2839 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2840 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2841 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2842 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
2843 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2844 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2845 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2846 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2847 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2848 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
2849 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2850 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
2851 {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2852 {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2853 {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2854 {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2855 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002856 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2857 {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2858 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2859 {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2860 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2861 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
2862 {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
2863 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
2864 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
2865 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
2866 {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
2867 {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
2868 {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
2869 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
2870 {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
2871 {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
2872 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2873 {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
2874 {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
2875 {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
2876 {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
2877 {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
2878 {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
2879 {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
2880 {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
2881 {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
2882 {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
2883 {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
2884 {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
2885 {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
2886 {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
2887 {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
2888 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2889 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
2890 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002891 {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002892 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
2893 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
2894 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
2895 {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
2896 {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
2897 {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
2898 {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
2899 {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
2900 {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
2901 {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
2902 {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
2903 {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
2904 {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
2905 {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
2906 {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
2907 {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
2908 {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
2909 {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
2910 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2911 {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
2912 {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
2913 {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
2914 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2915 {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
2916 {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
2917 {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
2918 {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
2919 {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
2920 {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
2921 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
2922 {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002923 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2924 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
2925 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
2926 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
2927 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
2928 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
2929 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
2930 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
2931 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002932 {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
2933 {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
2934 {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
2935 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2936 {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
2937 {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
2938 {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
2939 {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
2940 {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
2941 {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
2942
2943 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2944 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2945 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
2946 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
2947 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002948 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002949};
2950
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002951static const struct usb_action mc501cb_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002952 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2953 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
2954 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2955 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2956 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2957 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2958 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2959 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2960 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2961 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2962 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
2963 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2964 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2965 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2966 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2967 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2968 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
2969 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2970 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
2971 {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2972 {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2973 {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2974 {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2975 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002976 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2977 {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2978 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2979 {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2980 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2981 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
2982 {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
2983 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
2984 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
2985 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
2986 {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
2987 {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
2988 {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
2989 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
2990 {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
2991 {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
2992 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2993 {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
2994 {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
2995 {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
2996 {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
2997 {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
2998 {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
2999 {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3000 {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3001 {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3002 {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3003 {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3004 {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3005 {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3006 {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3007 {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3008 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3009 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3010 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003011 {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003012 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3013 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3014 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3015 {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3016 {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3017 {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3018 {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3019 {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3020 {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3021 {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3022 {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3023 {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3024 {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3025 {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3026 {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3027 {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3028 {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3029 {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3030 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3031 {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3032 {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3033 {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3034 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3035 {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
3036 {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3037 {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
3038 {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
3039 {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
3040 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3041 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3042 {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003043 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3044 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3045 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3046 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3047 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3048 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3049 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3050 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3051 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003052 {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3053 {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
3054 {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
3055 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3056 {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3057 {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3058 {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3059 {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3060 {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3061 {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3062 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3063 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3064 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3065 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3066 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003067 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003068};
3069
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003070static const struct usb_action mc501cb_50HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003071 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3072 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3073 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3074 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3075 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3076 {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
3077 {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
3078 {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
3079 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3080 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3081 {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3082 {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3083 {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003084 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003085};
3086
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003087static const struct usb_action mc501cb_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003088 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3089 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3090 {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3091 {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3092 {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3093 {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
3094 {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
3095 {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
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 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003101 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003102};
3103
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003104static const struct usb_action mc501cb_60HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003105 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3106 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3107 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3108 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3109 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3110 {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3111 {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3112 {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3113 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3114 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3115 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3116 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3117 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003118 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003119};
3120
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003121static const struct usb_action mc501cb_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003122 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3123 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3124 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3125 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3126 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3127 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3128 {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3129 {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3130 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3131 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3132 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3133 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3134 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003135 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003136};
3137
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003138static const struct usb_action mc501cb_NoFlikerScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003139 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3140 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3141 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3142 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3143 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3144 {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3145 {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3146 {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3147 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3148 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3149 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3150 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3151 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003152 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003153};
3154
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003155static const struct usb_action mc501cb_NoFliker[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003156 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3157 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3158 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3159 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3160 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3161 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3162 {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3163 {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003164 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003165};
3166
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003167/* from zs211.inf */
3168static const struct usb_action ov7620_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003169 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3170 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
3171 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3172 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3173 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3174 {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3175 {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3176 {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3177 {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3178 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3179 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3180 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3181 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3182 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3183 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3184 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3185 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3186 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3187 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3188 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3189 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3190 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3191 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3192 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003193 {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3194 {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3195 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3196 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3197 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3198 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3199 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3200 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3201 {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3202 {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3203 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3204 {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3205 {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3206 {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3207 {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3208 {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3209 {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3210 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3211 {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3212 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3213 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3214 {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3215 {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3216 {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3217 {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3218 {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3219 {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3220 {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003221 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3222 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3223 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3224 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003225 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003226 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3227 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3228 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3229 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3230 {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3231 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3232 {0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
3233 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3234 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003235 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003236};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003237static const struct usb_action ov7620_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003238 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3239 {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT}, /* 00,02,50,cc */
3240 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3241 /* mx change? */
3242 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3243 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3244 {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3245 {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3246 {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3247 {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3248 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3249 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3250 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3251 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3252 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3253 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3254 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3255 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3256 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3257 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3258 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3259 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3260 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3261 {0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d6,cc */
3262 /* OV7648 00,9c,d8,cc */
3263 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003264 {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3265 {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3266 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3267 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3268 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3269 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3270 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3271 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3272 {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3273 {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3274 {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3275 {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3276 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3277 {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3278 {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3279 {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3280 {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3281 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3282 {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3283 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3284 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3285 {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3286 {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3287 {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3288 {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3289 {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3290 {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3291 {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003292 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3293 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3294 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3295 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3296 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3297 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3298 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3299 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3300 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3301 {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3302 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3303 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,50,cc */
3304 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3305 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003306 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003307};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003308static const struct usb_action ov7620_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003309 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3310 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3311 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3312 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3313 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003314 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3315 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3316 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3317 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3318 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3319 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3320 {0xaa, 0x10, 0x0082}, /* 00,10,82,aa */
3321 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3322/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
3323 if mode0 (640x480) */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003324 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003325};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003326static const struct usb_action ov7620_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003327 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3328 /* (bug in zs211.inf) */
3329 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3330 {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3331 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3332 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3333 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3334 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3335 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3336 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3337 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3338 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3339 {0xaa, 0x10, 0x0020}, /* 00,10,20,aa */
3340 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3341/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
3342 * if mode0 (640x480) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003343/* ?? in gspca v1, it was
3344 {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
3345 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003346 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003347};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003348static const struct usb_action ov7620_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003349 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3350 /* (bug in zs211.inf) */
3351 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3352 {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3353 {0xaa, 0x75, 0x008e}, /* 00,75,8e,aa */
3354 {0xaa, 0x2d, 0x0001}, /* 00,2d,01,aa */
3355 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3356 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3357 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3358 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3359 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3360 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
3361/* {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT}, * 00,02,44,cc
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003362 * if mode1 (320x240) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003363/* ?? was
3364 {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
3365 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003366 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003367};
3368
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003369static const struct usb_action ov7630c_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003370 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3371 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3372 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3373 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3374 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3375 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3376 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3377 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3378 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3379 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3380 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3381 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3382 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3383 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003384 {0xaa, 0x12, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003385 {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3386 {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3387 {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3388 {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3389 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3390 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3391 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3392 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3393 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3394 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
3395 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003396 {0xaa, 0x12, 0x0069},
3397 {0xaa, 0x04, 0x0020},
3398 {0xaa, 0x06, 0x0050},
3399 {0xaa, 0x13, 0x0083},
3400 {0xaa, 0x14, 0x0000},
3401 {0xaa, 0x15, 0x0024},
3402 {0xaa, 0x17, 0x0018},
3403 {0xaa, 0x18, 0x00ba},
3404 {0xaa, 0x19, 0x0002},
3405 {0xaa, 0x1a, 0x00f6},
3406 {0xaa, 0x1b, 0x0002},
3407 {0xaa, 0x20, 0x00c2},
3408 {0xaa, 0x24, 0x0060},
3409 {0xaa, 0x25, 0x0040},
3410 {0xaa, 0x26, 0x0030},
3411 {0xaa, 0x27, 0x00ea},
3412 {0xaa, 0x28, 0x00a0},
3413 {0xaa, 0x21, 0x0000},
3414 {0xaa, 0x2a, 0x0081},
3415 {0xaa, 0x2b, 0x0096},
3416 {0xaa, 0x2d, 0x0094},
3417 {0xaa, 0x2f, 0x003d},
3418 {0xaa, 0x30, 0x0024},
3419 {0xaa, 0x60, 0x0000},
3420 {0xaa, 0x61, 0x0040},
3421 {0xaa, 0x68, 0x007c},
3422 {0xaa, 0x6f, 0x0015},
3423 {0xaa, 0x75, 0x0088},
3424 {0xaa, 0x77, 0x00b5},
3425 {0xaa, 0x01, 0x0060},
3426 {0xaa, 0x02, 0x0060},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003427 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3428 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3429 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3430 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3431 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003432 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003433 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3434 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3435 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3436 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3437 {0xa0, 0x60, ZC3XX_R116_RGAIN},
3438 {0xa0, 0x46, ZC3XX_R118_BGAIN},
3439 {0xa0, 0x04, ZC3XX_R113_RGB03},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003440/* 0x10, */
3441 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003442 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3443 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3444 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3445 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3446 {0xa0, 0x50, ZC3XX_R10E_RGB11},
3447 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3448 {0xa0, 0xf8, ZC3XX_R110_RGB20},
3449 {0xa0, 0xf8, ZC3XX_R111_RGB21},
3450 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003451 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003452 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
3453 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003454 {0xa1, 0x01, 0x01c8},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003455 {0xa1, 0x01, 0x01c9},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003456 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003457 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
3458 {0xa0, 0x01, ZC3XX_R120_GAMMA00}, /* gamma 2 ?*/
3459 {0xa0, 0x0c, ZC3XX_R121_GAMMA01},
3460 {0xa0, 0x1f, ZC3XX_R122_GAMMA02},
3461 {0xa0, 0x3a, ZC3XX_R123_GAMMA03},
3462 {0xa0, 0x53, ZC3XX_R124_GAMMA04},
3463 {0xa0, 0x6d, ZC3XX_R125_GAMMA05},
3464 {0xa0, 0x85, ZC3XX_R126_GAMMA06},
3465 {0xa0, 0x9c, ZC3XX_R127_GAMMA07},
3466 {0xa0, 0xb0, ZC3XX_R128_GAMMA08},
3467 {0xa0, 0xc2, ZC3XX_R129_GAMMA09},
3468 {0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
3469 {0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
3470 {0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
3471 {0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
3472 {0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
3473 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3474 {0xa0, 0x05, ZC3XX_R130_GAMMA10},
3475 {0xa0, 0x0f, ZC3XX_R131_GAMMA11},
3476 {0xa0, 0x16, ZC3XX_R132_GAMMA12},
3477 {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
3478 {0xa0, 0x19, ZC3XX_R134_GAMMA14},
3479 {0xa0, 0x19, ZC3XX_R135_GAMMA15},
3480 {0xa0, 0x17, ZC3XX_R136_GAMMA16},
3481 {0xa0, 0x15, ZC3XX_R137_GAMMA17},
3482 {0xa0, 0x12, ZC3XX_R138_GAMMA18},
3483 {0xa0, 0x10, ZC3XX_R139_GAMMA19},
3484 {0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
3485 {0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
3486 {0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
3487 {0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
3488 {0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
3489 {0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
3490 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3491 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3492 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3493 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3494 {0xa0, 0x50, ZC3XX_R10E_RGB11},
3495 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3496 {0xa0, 0xf8, ZC3XX_R110_RGB20},
3497 {0xa0, 0xf8, ZC3XX_R111_RGB21},
3498 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003499
3500 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003501 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003502 {0xaa, 0x10, 0x001b},
3503 {0xaa, 0x76, 0x0002},
3504 {0xaa, 0x2a, 0x0081},
3505 {0xaa, 0x2b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003506 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3507 {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
3508 {0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
3509 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3510 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3511 {0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
3512 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3513 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3514 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3515 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3516 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3517 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3518 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003519 {0xaa, 0x13, 0x0083}, /* 40 */
3520 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003521 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003522 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003523};
3524
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003525static const struct usb_action ov7630c_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003526 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3527 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
3528 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3529 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3530 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3531 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3532 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3533 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3534 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3535 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3536 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3537 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003538
3539 {0xaa, 0x12, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003540 {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3541 {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3542 {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3543 {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3544 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3545 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3546 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3547 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3548 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3549 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
3550 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003551 {0xaa, 0x12, 0x0069}, /* i2c */
3552 {0xaa, 0x04, 0x0020},
3553 {0xaa, 0x06, 0x0050},
3554 {0xaa, 0x13, 0x00c3},
3555 {0xaa, 0x14, 0x0000},
3556 {0xaa, 0x15, 0x0024},
3557 {0xaa, 0x19, 0x0003},
3558 {0xaa, 0x1a, 0x00f6},
3559 {0xaa, 0x1b, 0x0002},
3560 {0xaa, 0x20, 0x00c2},
3561 {0xaa, 0x24, 0x0060},
3562 {0xaa, 0x25, 0x0040},
3563 {0xaa, 0x26, 0x0030},
3564 {0xaa, 0x27, 0x00ea},
3565 {0xaa, 0x28, 0x00a0},
3566 {0xaa, 0x21, 0x0000},
3567 {0xaa, 0x2a, 0x0081},
3568 {0xaa, 0x2b, 0x0096},
3569 {0xaa, 0x2d, 0x0084},
3570 {0xaa, 0x2f, 0x003d},
3571 {0xaa, 0x30, 0x0024},
3572 {0xaa, 0x60, 0x0000},
3573 {0xaa, 0x61, 0x0040},
3574 {0xaa, 0x68, 0x007c},
3575 {0xaa, 0x6f, 0x0015},
3576 {0xaa, 0x75, 0x0088},
3577 {0xaa, 0x77, 0x00b5},
3578 {0xaa, 0x01, 0x0060},
3579 {0xaa, 0x02, 0x0060},
3580 {0xaa, 0x17, 0x0018},
3581 {0xaa, 0x18, 0x00ba},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003582 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3583 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3584 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3585 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3586 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003587 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003588 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3589 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3590 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3591 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3592 {0xa0, 0x60, ZC3XX_R116_RGAIN},
3593 {0xa0, 0x46, ZC3XX_R118_BGAIN},
3594 {0xa0, 0x04, ZC3XX_R113_RGB03},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003595
3596 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003597 {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3598 {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3599 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3600 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3601 {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3602 {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3603 {0xa0, 0x00, ZC3XX_R110_RGB20},
3604 {0xa0, 0xf6, ZC3XX_R111_RGB21},
3605 {0xa0, 0x4a, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003606
3607 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003608 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
3609 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003610 {0xa1, 0x01, 0x01c8},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003611 {0xa1, 0x01, 0x01c9},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003612 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003613 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
3614 {0xa0, 0x16, ZC3XX_R120_GAMMA00}, /* gamma ~4 */
3615 {0xa0, 0x3a, ZC3XX_R121_GAMMA01},
3616 {0xa0, 0x5b, ZC3XX_R122_GAMMA02},
3617 {0xa0, 0x7c, ZC3XX_R123_GAMMA03},
3618 {0xa0, 0x94, ZC3XX_R124_GAMMA04},
3619 {0xa0, 0xa9, ZC3XX_R125_GAMMA05},
3620 {0xa0, 0xbb, ZC3XX_R126_GAMMA06},
3621 {0xa0, 0xca, ZC3XX_R127_GAMMA07},
3622 {0xa0, 0xd7, ZC3XX_R128_GAMMA08},
3623 {0xa0, 0xe1, ZC3XX_R129_GAMMA09},
3624 {0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
3625 {0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
3626 {0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
3627 {0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
3628 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
3629 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3630 {0xa0, 0x20, ZC3XX_R130_GAMMA10},
3631 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
3632 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
3633 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
3634 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
3635 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
3636 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
3637 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
3638 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
3639 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
3640 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
3641 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
3642 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
3643 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
3644 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
3645 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
3646 {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3647 {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3648 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3649 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3650 {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3651 {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3652 {0xa0, 0x00, ZC3XX_R110_RGB20},
3653 {0xa0, 0xf6, ZC3XX_R111_RGB21},
3654 {0xa0, 0x4a, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003655
3656 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003657 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003658 {0xaa, 0x10, 0x000d},
3659 {0xaa, 0x76, 0x0002},
3660 {0xaa, 0x2a, 0x0081},
3661 {0xaa, 0x2b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003662 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3663 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
3664 {0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
3665 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3666 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3667 {0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
3668 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3669 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3670 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3671 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3672 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3673 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3674 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003675 {0xaa, 0x13, 0x00c3},
3676
3677 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003678 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003679 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003680};
3681
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003682static const struct usb_action pas106b_Initial_com[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003683/* Sream and Sensor specific */
3684 {0xa1, 0x01, 0x0010}, /* CMOSSensorSelect */
3685/* System */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003686 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
3687 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003688/* Picture size */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003689 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* ClockSelect */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003690 {0xa0, 0x03, 0x003a},
3691 {0xa0, 0x0c, 0x003b},
3692 {0xa0, 0x04, 0x0038},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003693 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003694};
3695
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003696static const struct usb_action pas106b_InitialScale[] = { /* 176x144 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003697/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003698 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003699/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003700 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003701/* Picture size */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003702 {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
3703 {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
3704 {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
3705 {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003706/* System */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003707 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003708/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003709 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3710 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003711/* Sensor Interface */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003712 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003713/* Window inside sensor array */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003714 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3715 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3716 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3717 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3718 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003719/* Init the sensor */
3720 {0xaa, 0x02, 0x0004},
3721 {0xaa, 0x08, 0x0000},
3722 {0xaa, 0x09, 0x0005},
3723 {0xaa, 0x0a, 0x0002},
3724 {0xaa, 0x0b, 0x0002},
3725 {0xaa, 0x0c, 0x0005},
3726 {0xaa, 0x0d, 0x0000},
3727 {0xaa, 0x0e, 0x0002},
3728 {0xaa, 0x14, 0x0081},
3729
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003730/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003731 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003732/* Frame retreiving */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003733 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003734/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003735 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003736/* Unknown */
3737 {0xa0, 0x00, 0x01ad},
3738/* Sharpness */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003739 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3740 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003741/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003742 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003743/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003744 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003745/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003746 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003747/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003748 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003749/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003750 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3751 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3752 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003753/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003754 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003755/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003756 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003757/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003758 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003759/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003760 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003761/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003762 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3763 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3764 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003765
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003766 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
3767 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
3768 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3769 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
3770 {0xa0, 0x58, ZC3XX_R10E_RGB11},
3771 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
3772 {0xa0, 0xf4, ZC3XX_R110_RGB20},
3773 {0xa0, 0xf4, ZC3XX_R111_RGB21},
3774 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003775/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003776 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
3777 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3778 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3779 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
3780 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3781 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3782 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003783
3784/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003785 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3786 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3787 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
3788 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3789 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3790 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
3791 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
3792 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003793/* sensor on */
3794 {0xaa, 0x07, 0x00b1},
3795 {0xaa, 0x05, 0x0003},
3796 {0xaa, 0x04, 0x0001},
3797 {0xaa, 0x03, 0x003b},
3798/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003799 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3800 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3801 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
3802 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003803/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003804 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003805 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003806 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003807/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003808 {0xa0, 0x40, ZC3XX_R116_RGAIN},
3809 {0xa0, 0x40, ZC3XX_R117_GGAIN},
3810 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003811 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003812};
3813
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003814static const struct usb_action pas106b_Initial[] = { /* 352x288 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003815/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003816 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003817/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003818 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003819/* Picture size */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003820 {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
3821 {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
3822 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3823 {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003824/* System */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003825 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003826/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003827 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3828 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003829/* Sensor Interface */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003830 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003831/* Window inside sensor array */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003832 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3833 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3834 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3835 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3836 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003837/* Init the sensor */
3838 {0xaa, 0x02, 0x0004},
3839 {0xaa, 0x08, 0x0000},
3840 {0xaa, 0x09, 0x0005},
3841 {0xaa, 0x0a, 0x0002},
3842 {0xaa, 0x0b, 0x0002},
3843 {0xaa, 0x0c, 0x0005},
3844 {0xaa, 0x0d, 0x0000},
3845 {0xaa, 0x0e, 0x0002},
3846 {0xaa, 0x14, 0x0081},
3847
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003848/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003849 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003850/* Frame retreiving */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003851 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003852/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003853 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003854/* Unknown */
3855 {0xa0, 0x00, 0x01ad},
3856/* Sharpness */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003857 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3858 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003859/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003860 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003861/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003862 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3863 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003864/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003865 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003866/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003867 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003868/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003869 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3870 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3871 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003872/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003873 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003874/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003875 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003876/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003877 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003878/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003879 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003880/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003881 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3882 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3883 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003884
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003885 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
3886 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
3887 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3888 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
3889 {0xa0, 0x58, ZC3XX_R10E_RGB11},
3890 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
3891 {0xa0, 0xf4, ZC3XX_R110_RGB20},
3892 {0xa0, 0xf4, ZC3XX_R111_RGB21},
3893 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003894/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003895 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
3896 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3897 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3898 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
3899 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3900 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3901 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003902
3903/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003904 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3905 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3906 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003907
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003908 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3909 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3910 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003911
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003912 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3913 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003914/* sensor on */
3915 {0xaa, 0x07, 0x00b1},
3916 {0xaa, 0x05, 0x0003},
3917 {0xaa, 0x04, 0x0001},
3918 {0xaa, 0x03, 0x003b},
3919/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003920 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3921 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3922 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
3923 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003924/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003925 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003926 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003927 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003928/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003929 {0xa0, 0x40, ZC3XX_R116_RGAIN},
3930 {0xa0, 0x40, ZC3XX_R117_GGAIN},
3931 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003932
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003933 {0xa0, 0x00, 0x0007}, /* AutoCorrectEnable */
3934 {0xa0, 0xff, ZC3XX_R018_FRAMELOST}, /* Frame adjust */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003935 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003936};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003937static const struct usb_action pas106b_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003938 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3939 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3940 {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
3941 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3942 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3943 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
3944 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3945 {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
3946 {0xaa, 0x03, 0x0021}, /* 00,03,21,aa */
3947 {0xaa, 0x04, 0x000c}, /* 00,04,0c,aa */
3948 {0xaa, 0x05, 0x0002}, /* 00,05,02,aa */
3949 {0xaa, 0x07, 0x001c}, /* 00,07,1c,aa */
3950 {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003951 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003952};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003953static const struct usb_action pas106b_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003954 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3955 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3956 {0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
3957 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3958 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3959 {0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
3960 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3961 {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
3962 {0xaa, 0x03, 0x001c}, /* 00,03,1c,aa */
3963 {0xaa, 0x04, 0x0004}, /* 00,04,04,aa */
3964 {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
3965 {0xaa, 0x07, 0x00c4}, /* 00,07,c4,aa */
3966 {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003967 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003968};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003969static const struct usb_action pas106b_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003970 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3971 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3972 {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
3973 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3974 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3975 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
3976 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3977 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3978 {0xaa, 0x03, 0x0013}, /* 00,03,13,aa */
3979 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3980 {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
3981 {0xaa, 0x07, 0x0030}, /* 00,07,30,aa */
3982 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003983 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003984};
3985
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003986/* from lvWIMv.inf 046d:08a2/:08aa 2007/06/03 */
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003987static const struct usb_action pas202b_Initial[] = { /* 640x480 */
3988 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003989 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003990 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
3991 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
3992 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3993 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3994 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3995 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
3996 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3997 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3998 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3999 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
4000 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
4001 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,03,cc */
4002 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
4003 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,03,cc */
4004 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
4005 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
4006 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
4007 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
4008 {0xaa, 0x02, 0x0002}, /* 00,02,04,aa --> 02 */
4009 {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
4010 {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
4011 {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
4012 {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
4013 {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004014 {0xaa, 0x0c, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004015 {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
4016 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
4017 {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
4018 {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
4019 {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
4020 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
4021 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4022 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
4023 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
4024 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4025 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4026 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4027 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4028 {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
4029 {}
4030};
4031static const struct usb_action pas202b_InitialScale[] = { /* 320x240 */
4032 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004033 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004034 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
4035 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
4036 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4037 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4038 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004039 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004040 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4041 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4042 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4043 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
4044 {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,08,cc */
4045 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,02,cc */
4046 {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,08,cc */
4047 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,02,cc */
4048 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004049 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004050 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
4051 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
4052 {0xaa, 0x02, 0x0002}, /* 00,02,02,aa */
4053 {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
4054 {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
4055 {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
4056 {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
4057 {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004058 {0xaa, 0x0c, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004059 {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
4060 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
4061 {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
4062 {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
4063 {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
4064 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
4065 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4066 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
4067 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
4068 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4069 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4070 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4071 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4072 {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004073 {0xa0, 0xff, ZC3XX_R097_WINYSTARTHIGH},
4074 {0xa0, 0xfe, ZC3XX_R098_WINYSTARTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004075 {}
4076};
4077static const struct usb_action pas202b_50HZ[] = {
4078 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4079 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4080 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4081 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004082 {0xaa, 0x21, 0x001b},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004083 {0xaa, 0x03, 0x0044}, /* 00,03,44,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004084 {0xaa, 0x04, 0x0008},
4085 {0xaa, 0x05, 0x001b},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004086 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4087 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004088 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004089 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4090 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004091 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4092 {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004093 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4094 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4095 {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4d,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004096 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4097 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004098 {0xa0, 0x44, ZC3XX_R01D_HSYNC_0}, /* 00,1d,44,cc */
4099 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4100 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
4101 {0xa0, 0xeb, ZC3XX_R020_HSYNC_3}, /* 00,20,eb,cc */
4102 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4103 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4104 {}
4105};
4106static const struct usb_action pas202b_50HZScale[] = {
4107 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4108 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4109 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004110 {0xaa, 0x20, 0x0004},
4111 {0xaa, 0x21, 0x003d},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004112 {0xaa, 0x03, 0x0041}, /* 00,03,41,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004113 {0xaa, 0x04, 0x0010},
4114 {0xaa, 0x05, 0x003d},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004115 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4116 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004117 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004118 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4119 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004120 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4121 {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004122 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4123 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4124 {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,9b,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004125 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4126 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004127 {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
4128 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4129 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
4130 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4131 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4132 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4133 {}
4134};
4135static const struct usb_action pas202b_60HZ[] = {
4136 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4137 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4138 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4139 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4140 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4141 {0xaa, 0x03, 0x0045}, /* 00,03,45,aa */
4142 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
4143 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
4144 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4145 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004146 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004147 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4148 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004149 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4150 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004151 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4152 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4153 {0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,40,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004154 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4155 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004156 {0xa0, 0x45, ZC3XX_R01D_HSYNC_0}, /* 00,1d,45,cc */
4157 {0xa0, 0x8e, ZC3XX_R01E_HSYNC_1}, /* 00,1e,8e,cc */
4158 {0xa0, 0xc1, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c1,cc */
4159 {0xa0, 0xf5, ZC3XX_R020_HSYNC_3}, /* 00,20,f5,cc */
4160 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4161 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4162 {}
4163};
4164static const struct usb_action pas202b_60HZScale[] = {
4165 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4166 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4167 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004168 {0xaa, 0x20, 0x0004},
4169 {0xaa, 0x21, 0x0008},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004170 {0xaa, 0x03, 0x0042}, /* 00,03,42,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004171 {0xaa, 0x04, 0x0010},
4172 {0xaa, 0x05, 0x0008},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004173 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4174 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004175 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004176 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4177 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004178 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4179 {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004180 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4181 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4182 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004183 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4184 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004185 {0xa0, 0x42, ZC3XX_R01D_HSYNC_0}, /* 00,1d,42,cc */
4186 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4187 {0xa0, 0xaf, ZC3XX_R01F_HSYNC_2}, /* 00,1f,af,cc */
4188 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4189 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4190 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4191 {}
4192};
4193static const struct usb_action pas202b_NoFliker[] = {
4194 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4195 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4196 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4197 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004198 {0xaa, 0x21, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004199 {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
4200 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004201 {0xaa, 0x05, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004202 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4203 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4204 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004205 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4206 {0xa0, 0x06, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004207 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4208 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004209 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004210 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4211 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4212 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004213 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004214 {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
4215 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
4216 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4217 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4218 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4219 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4220 {}
4221};
4222static const struct usb_action pas202b_NoFlikerScale[] = {
4223 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4224 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4225 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004226 {0xaa, 0x20, 0x0004},
4227 {0xaa, 0x21, 0x000c},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004228 {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004229 {0xaa, 0x04, 0x0010},
4230 {0xaa, 0x05, 0x000c},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004231 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4232 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4233 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004234 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4235 {0xa0, 0x0c, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004236 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4237 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4238 {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,02,cc */
4239 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4240 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4241 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004242 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004243 {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
4244 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
4245 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4246 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4247 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4248 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4249 {}
4250};
4251
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004252/* mi0360soc and pb0330 from vm30x.inf for 0ac8:301b and 0ac8:303b 07/02/13 */
4253static const struct usb_action mi0360soc_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004254 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4255 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4256 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4257 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4258 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4259 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4260 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4261 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004262 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004263 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004264 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC}, /*jfm: was 03*/
4265/* {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004266 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4267 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4268 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4269 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4270 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004271 {0xdd, 0x00, 0x0200},
4272 {0xaa, 0x01, 0x0001},
4273 {0xaa, 0x06, 0x0000},
4274 {0xaa, 0x08, 0x0483},
4275 {0xaa, 0x01, 0x0004},
4276 {0xaa, 0x08, 0x0006},
4277 {0xaa, 0x02, 0x0011},
4278 {0xaa, 0x03, 0x01e5}, /*jfm: was 01e7*/
4279 {0xaa, 0x04, 0x0285}, /*jfm: was 0287*/
4280 {0xaa, 0x07, 0x3002},
4281 {0xaa, 0x20, 0x5100}, /*jfm: was 1100*/
4282 {0xaa, 0x35, 0x507f}, /*jfm: was 0050*/
4283 {0xaa, 0x30, 0x0005},
4284 {0xaa, 0x31, 0x0000},
4285 {0xaa, 0x58, 0x0078},
4286 {0xaa, 0x62, 0x0411},
4287 {0xaa, 0x2b, 0x0028},
4288 {0xaa, 0x2c, 0x007f}, /*jfm: was 0030*/
4289 {0xaa, 0x2d, 0x007f}, /*jfm: was 0030*/
4290 {0xaa, 0x2e, 0x007f}, /*jfm: was 0030*/
4291 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4292 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /*jfm: was 37*/
4293 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4294 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4295 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4296 {0xa0, 0x09, 0x01ad}, /*jfm: was 00*/
4297 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4298 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4299 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4300 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4301 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4302 {0xa0, 0x6c, ZC3XX_R18D_YTARGET}, /* jfm: was 78 */
4303 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4304 {0xa0, 0x65, ZC3XX_R118_BGAIN},
4305 {}
4306};
4307static const struct usb_action mi0360soc_InitialScale[] = { /* 320x240 */
4308 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4309 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4310 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4311 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4312 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4313 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4314 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4315 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4316 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4317 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4318 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC}, /*jfm: was 03*/
4319/* {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, */
4320 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4321 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4322 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4323 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4324 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4325 {0xdd, 0x00, 0x0200},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004326 {0xaa, 0x01, 0x0001},
4327 {0xaa, 0x06, 0x0000},
4328 {0xaa, 0x08, 0x0483},
4329 {0xaa, 0x01, 0x0004},
4330 {0xaa, 0x08, 0x0006},
4331 {0xaa, 0x02, 0x0011},
4332 {0xaa, 0x03, 0x01e7},
4333 {0xaa, 0x04, 0x0287},
4334 {0xaa, 0x07, 0x3002},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004335 {0xaa, 0x20, 0x5100}, /*jfm: was 1100*/
4336 {0xaa, 0x35, 0x007f}, /*jfm: was 0050*/
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004337 {0xaa, 0x30, 0x0005},
4338 {0xaa, 0x31, 0x0000},
4339 {0xaa, 0x58, 0x0078},
4340 {0xaa, 0x62, 0x0411},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004341 {0xaa, 0x2b, 0x007f}, /*jfm: was 28*/
4342 {0xaa, 0x2c, 0x007f}, /*jfm: was 30*/
4343 {0xaa, 0x2d, 0x007f}, /*jfm: was 30*/
4344 {0xaa, 0x2e, 0x007f}, /*jfm: was 28*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004345 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004346 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /*jfm: was 37*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004347 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4348 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4349 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004350 {0xa0, 0x09, 0x01ad}, /*jfm: was 00*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004351 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4352 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4353 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4354 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4355 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004356 {0xa0, 0x6c, ZC3XX_R18D_YTARGET}, /*jfm: was 78*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004357 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4358 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004359 {}
4360};
4361static const struct usb_action mi360soc_AE50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004362 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4363 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004364 {0xbb, 0x00, 0x0562},
4365 {0xbb, 0x01, 0x09aa},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004366 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004367 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4368 {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004369 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4370 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004371 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
4372 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4373 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4374 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4375 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4376 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
4377 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4378 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4379 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4380 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4381 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4382 {}
4383};
4384static const struct usb_action mi360soc_AE50HZScale[] = {
4385 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4386 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4387 {0xbb, 0x00, 0x0509},
4388 {0xbb, 0x01, 0x0934},
4389 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4390 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4391 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4392 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4393 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4394 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4395 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4396 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4397 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4398 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4399 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4400 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4401 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4402 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4403 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4404 {}
4405};
4406static const struct usb_action mi360soc_AE60HZ[] = {
4407 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4408 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4409 {0xbb, 0x00, 0x053d},
4410 {0xbb, 0x01, 0x096e},
4411 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4412 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4413 {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW},
4414 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4415 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4416 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
4417 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4418 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4419 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4420 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4421 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
4422 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4423 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4424 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4425 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4426 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4427 {}
4428};
4429static const struct usb_action mi360soc_AE60HZScale[] = {
4430 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4431 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4432 {0xbb, 0x00, 0x0509},
4433 {0xbb, 0x01, 0x0983},
4434 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4435 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4436 {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4437 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4438 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4439 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004440 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4441 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4442 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4443 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4444 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4445 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4446 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4447 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4448 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004449 {}
4450};
4451static const struct usb_action mi360soc_AENoFliker[] = {
4452 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4453 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4454 {0xbb, 0x00, 0x0509},
4455 {0xbb, 0x01, 0x0960},
4456 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4457 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4458 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4459 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4460 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4461 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4462 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4463 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4464 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4465 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4466 {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
4467 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
4468 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4469 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4470 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004471 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004472 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004473};
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004474static const struct usb_action mi360soc_AENoFlikerScale[] = {
4475 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4476 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4477 {0xbb, 0x00, 0x0534},
4478 {0xbb, 0x02, 0x0960},
4479 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4480 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4481 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4482 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4483 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4484 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4485 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4486 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4487 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4488 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4489 {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4490 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4491 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4492 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4493 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4494 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4495 {}
4496};
4497
4498static const struct usb_action pb0330_Initial[] = { /* 640x480 */
4499 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4500 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
4501 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4502 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4503 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4504 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4505 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4506 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4507 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4508 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4509 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4510 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4511 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4512 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4513 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4514 {0xdd, 0x00, 0x0200},
4515 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4516 {0xaa, 0x01, 0x0006},
4517 {0xaa, 0x02, 0x0011},
4518 {0xaa, 0x03, 0x01e5}, /*jfm: was 1e7*/
4519 {0xaa, 0x04, 0x0285}, /*jfm: was 0287*/
4520 {0xaa, 0x06, 0x0003},
4521 {0xaa, 0x07, 0x3002},
4522 {0xaa, 0x20, 0x1100},
4523 {0xaa, 0x2f, 0xf7b0},
4524 {0xaa, 0x30, 0x0005},
4525 {0xaa, 0x31, 0x0000},
4526 {0xaa, 0x34, 0x0100},
4527 {0xaa, 0x35, 0x0060},
4528 {0xaa, 0x3d, 0x068f},
4529 {0xaa, 0x40, 0x01e0},
4530 {0xaa, 0x58, 0x0078},
4531 {0xaa, 0x62, 0x0411},
4532 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4533 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4534 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4535 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4536 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4537 {0xa0, 0x09, 0x01ad}, /*jfm: was 00 */
4538 {0xa0, 0x15, 0x01ae},
4539 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4540 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4541 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4542 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4543 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4544 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /*jfm: was 6c*/
4545 {}
4546};
4547static const struct usb_action pb0330_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004548 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4549 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
4550 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4551 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4552 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4553 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4554 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4555 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4556 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4557 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4558 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4559 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4560 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4561 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4562 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004563 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004564 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004565 {0xaa, 0x01, 0x0006},
4566 {0xaa, 0x02, 0x0011},
4567 {0xaa, 0x03, 0x01e7},
4568 {0xaa, 0x04, 0x0287},
4569 {0xaa, 0x06, 0x0003},
4570 {0xaa, 0x07, 0x3002},
4571 {0xaa, 0x20, 0x1100},
4572 {0xaa, 0x2f, 0xf7b0},
4573 {0xaa, 0x30, 0x0005},
4574 {0xaa, 0x31, 0x0000},
4575 {0xaa, 0x34, 0x0100},
4576 {0xaa, 0x35, 0x0060},
4577 {0xaa, 0x3d, 0x068f},
4578 {0xaa, 0x40, 0x01e0},
4579 {0xaa, 0x58, 0x0078},
4580 {0xaa, 0x62, 0x0411},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004581 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4582 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4583 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4584 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4585 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004586 {0xa0, 0x09, 0x01ad},
4587 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004588 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4589 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4590 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4591 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4592 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004593 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /*jfm: was 6c*/
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004594 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004595};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004596static const struct usb_action pb0330_50HZ[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004597 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4598 {0xbb, 0x00, 0x055c},
4599 {0xbb, 0x01, 0x09aa},
4600 {0xbb, 0x00, 0x1001},
4601 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4602 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4603 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4604 {0xa0, 0xc4, ZC3XX_R192_EXPOSURELIMITLOW},
4605 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4606 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4607 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
4608 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4609 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4610 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4611 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4612 {0xa0, 0x5c, ZC3XX_R01D_HSYNC_0},
4613 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4614 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4615 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004616 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004617};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004618static const struct usb_action pb0330_50HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004619 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4620 {0xbb, 0x00, 0x0566},
4621 {0xbb, 0x02, 0x09b2},
4622 {0xbb, 0x00, 0x1002},
4623 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4624 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4625 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4626 {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4627 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4628 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4629 {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4630 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4631 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4632 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4633 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4634 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4635 {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4636 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4637 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004638 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004639};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004640static const struct usb_action pb0330_60HZ[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004641 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4642 {0xbb, 0x00, 0x0535},
4643 {0xbb, 0x01, 0x0974},
4644 {0xbb, 0x00, 0x1001},
4645 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4646 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4647 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4648 {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
4649 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4650 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4651 {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW},
4652 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4653 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4654 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4655 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4656 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4657 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
4658 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4659 {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004660 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004661};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004662static const struct usb_action pb0330_60HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004663 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4664 {0xbb, 0x00, 0x0535},
4665 {0xbb, 0x02, 0x096c},
4666 {0xbb, 0x00, 0x1002},
4667 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4668 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4669 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4670 {0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},
4671 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4672 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4673 {0xa0, 0x7c, ZC3XX_R197_ANTIFLICKERLOW},
4674 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4675 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4676 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4677 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4678 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4679 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
4680 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4681 {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004682 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004683};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004684static const struct usb_action pb0330_NoFliker[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004685 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4686 {0xbb, 0x00, 0x0509},
4687 {0xbb, 0x02, 0x0940},
4688 {0xbb, 0x00, 0x1002},
4689 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4690 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4691 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4692 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4693 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4694 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4695 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4696 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4697 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4698 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4699 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4700 {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
4701 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
4702 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4703 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004704 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004705};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004706static const struct usb_action pb0330_NoFlikerScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004707 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4708 {0xbb, 0x00, 0x0535},
4709 {0xbb, 0x01, 0x0980},
4710 {0xbb, 0x00, 0x1001},
4711 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4712 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4713 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4714 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4715 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4716 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4717 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4718 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4719 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4720 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4721 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4722 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4723 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4724 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4725 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004726 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004727};
4728
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004729/* from oem9.inf */
4730static const struct usb_action po2030_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004731 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4732 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
4733 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
4734 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4735 {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
4736 {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
4737 {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
4738 {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
4739 {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
4740 {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
4741 {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
4742 {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
4743 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
4744 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4745 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4746 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4747 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4748 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4749 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
4750 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
4751 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
4752 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
4753 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
4754 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
4755 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
4756 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
4757 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004758 {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
4759 {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
4760 {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
4761 {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
4762 {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
4763 {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
4764 {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
4765 {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
4766 {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
4767 {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
4768 {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
4769 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
4770 {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
4771 {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
4772 {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
4773 {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
4774 {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
4775 {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
4776 {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
4777 {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
4778 {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
4779 {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
4780 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4781 {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
4782 {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
4783 {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
4784 {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
4785 {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
4786 {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
4787 {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
4788 {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
4789 {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
4790 {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
4791 {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004792 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
4793 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
4794 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4795 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004796 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004797 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4798 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4799 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4800 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4801 {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
4802 {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004803 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004804};
4805
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004806/* from oem9.inf */
4807static const struct usb_action po2030_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004808 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4809 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
4810 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
4811 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4812 {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
4813 {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
4814 {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
4815 {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
4816 {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
4817 {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
4818 {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
4819 {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
4820 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
4821 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4822 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4823 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4824 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4825 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4826 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
4827 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
4828 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
4829 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
4830 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
4831 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
4832 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
4833 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
4834 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004835 {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
4836 {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
4837 {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
4838 {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
4839 {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
4840 {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
4841 {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
4842 {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
4843 {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
4844 {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
4845 {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
4846 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
4847 {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
4848 {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
4849 {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
4850 {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
4851 {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
4852 {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
4853 {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
4854 {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
4855 {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
4856 {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
4857 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4858 {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
4859 {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
4860 {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
4861 {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
4862 {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
4863 {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
4864 {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
4865 {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
4866 {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
4867 {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
4868 {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004869 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
4870 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
4871 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4872 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004873 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004874 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4875 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4876 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4877 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4878 {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
4879 {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004880 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004881};
4882
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004883static const struct usb_action po2030_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004884 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
4885 {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
4886 {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
4887 {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004888 {0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
4889 {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
4890 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
4891 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4892 {0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
4893 {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
4894 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
4895 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
4896 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
4897 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
4898 {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
4899 {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
4900 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
4901 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004902 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004903};
4904
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004905static const struct usb_action po2030_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004906 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
4907 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
4908 {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
4909 {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004910 {0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
4911 {0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
4912 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
4913 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4914 {0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
4915 {0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
4916 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
4917 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
4918 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
4919 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
4920 {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
4921 {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
4922 /* win: 01,8d,80 */
4923 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
4924 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004925 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004926};
4927
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004928static const struct usb_action po2030_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004929 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004930 {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
4931 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
4932 {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
4933 {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
4934 {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
4935 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004936 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004937};
4938
4939/* TEST */
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004940static const struct usb_action tas5130cK_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004941 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004942 {0xa0, 0x01, 0x003b},
4943 {0xa0, 0x0e, 0x003a},
4944 {0xa0, 0x01, 0x0038},
4945 {0xa0, 0x0b, 0x0039},
4946 {0xa0, 0x00, 0x0038},
4947 {0xa0, 0x0b, 0x0039},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004948 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4949 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4950 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4951 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4952 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4953 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4954 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4955 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4956 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4957 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4958 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4959 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4960 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4961 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4962 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4963 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4964 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4965 {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
4966 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
4967 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
4968 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
4969 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
4970 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
4971 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
4972 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
4973 {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
4974 {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
4975 {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
4976 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
4977 {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
4978 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
4979 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
4980 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
4981 {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
4982 {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
4983 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
4984 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
4985 {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
4986 {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
4987 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
4988 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
4989 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
4990 {0xa0, 0xE7, ZC3XX_R093_I2CSETVALUE},
4991 {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
4992 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
4993 {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
4994 {0xa0, 0x87, ZC3XX_R093_I2CSETVALUE},
4995 {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
4996 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
4997 {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
4998 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
4999 {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5000 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5001 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5002 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5003 {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5004 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5005 {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5006 {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5007 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5008 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5009 {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5010 {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5011 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5012 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5013 {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5014 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5015 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5016 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5017 {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5018 {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5019 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5020 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5021 {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5022 {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5023 {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5024 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5025 {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5026 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5027 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5028 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5029 {0xa0, 0x2c, ZC3XX_R092_I2CADDRESSSELECT},
5030 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5031 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5032 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5033 {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5034 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5035 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5036 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5037 {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5038 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5039 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5040 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5041 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5042 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5043 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5044 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5045 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005046 {0xa0, 0x09, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005047 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5048 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5049 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5050 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5051 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5052 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5053 {0xa0, 0x61, ZC3XX_R116_RGAIN},
5054 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005055 {0xa0, 0x09, 0x01ad},
5056 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005057 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5058 {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5059 {0xa0, 0x03, ZC3XX_R10C_RGB02},
5060 {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5061 {0xa0, 0x51, ZC3XX_R10E_RGB11},
5062 {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5063 {0xa0, 0xec, ZC3XX_R110_RGB20},
5064 {0xa0, 0x03, ZC3XX_R111_RGB21},
5065 {0xa0, 0x51, ZC3XX_R112_RGB22},
5066 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5067 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
5068 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
5069 {0xa0, 0x38, ZC3XX_R120_GAMMA00}, /* gamma > 5 */
5070 {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5071 {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5072 {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5073 {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5074 {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5075 {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5076 {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5077 {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5078 {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5079 {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5080 {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5081 {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5082 {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5083 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5084 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5085 {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5086 {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5087 {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5088 {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5089 {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5090 {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5091 {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5092 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5093 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5094 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5095 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5096 {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5097 {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5098 {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5099 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5100 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5101 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5102 {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5103 {0xa0, 0x03, ZC3XX_R10C_RGB02},
5104 {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5105 {0xa0, 0x51, ZC3XX_R10E_RGB11},
5106 {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5107 {0xa0, 0xec, ZC3XX_R110_RGB20},
5108 {0xa0, 0x03, ZC3XX_R111_RGB21},
5109 {0xa0, 0x51, ZC3XX_R112_RGB22},
5110 {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5111 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5112 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5113 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5114 {0xa0, 0x09, ZC3XX_R093_I2CSETVALUE},
5115 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5116 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5117 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5118 {0xa0, 0x34, ZC3XX_R093_I2CSETVALUE},
5119 {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5120 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5121 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5122 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5123 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
5124 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5125 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5126 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
5127 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5128 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5129 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5130 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5131 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
5132 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5133 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
5134 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5135 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005136 {0xa0, 0x09, 0x01ad},
5137 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005138 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5139 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005140 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005141};
5142
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005143static const struct usb_action tas5130cK_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005144 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005145 {0xa0, 0x01, 0x003b},
5146 {0xa0, 0x0e, 0x003a},
5147 {0xa0, 0x01, 0x0038},
5148 {0xa0, 0x0b, 0x0039},
5149 {0xa0, 0x00, 0x0038},
5150 {0xa0, 0x0b, 0x0039},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005151 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5152 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5153 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5154 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
5155 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5156 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5157 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5158 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5159 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5160 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5161 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5162 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5163 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5164 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5165 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5166 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5167 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5168 {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5169 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5170 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5171 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5172 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5173 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5174 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5175 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5176 {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5177 {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5178 {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5179 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5180 {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5181 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5182 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5183 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5184 {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5185 {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5186 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5187 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5188 {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5189 {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5190 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5191 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5192 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5193 {0xa0, 0xe5, ZC3XX_R093_I2CSETVALUE},
5194 {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5195 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5196 {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5197 {0xa0, 0x85, ZC3XX_R093_I2CSETVALUE},
5198 {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5199 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5200 {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5201 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5202 {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5203 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5204 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5205 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5206 {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5207 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5208 {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5209 {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5210 {0xa0, 0x50, ZC3XX_R094_I2CWRITEACK},
5211 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5212 {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5213 {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5214 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5215 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5216 {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5217 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5218 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5219 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5220 {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5221 {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5222 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5223 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5224 {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5225 {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5226 {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5227 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5228 {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5229 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5230 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5231 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5232 {0xa0, 0x2C, ZC3XX_R092_I2CADDRESSSELECT},
5233 {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5234 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5235 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5236 {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5237 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5238 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5239 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5240 {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5241 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5242 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5243 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5244 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5245 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5246 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5247 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5248 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005249 {0xa0, 0x09, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005250 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5251 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5252 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5253 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5254 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5255 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5256 {0xa0, 0x61, ZC3XX_R116_RGAIN},
5257 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005258 {0xa0, 0x09, 0x01ad},
5259 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005260 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5261 {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5262 {0xa0, 0x03, ZC3XX_R10C_RGB02},
5263 {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5264 {0xa0, 0x51, ZC3XX_R10E_RGB11},
5265 {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5266 {0xa0, 0xec, ZC3XX_R110_RGB20},
5267 {0xa0, 0x03, ZC3XX_R111_RGB21},
5268 {0xa0, 0x51, ZC3XX_R112_RGB22},
5269 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5270 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
5271 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
5272 {0xa0, 0x38, ZC3XX_R120_GAMMA00}, /* gamma > 5 */
5273 {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5274 {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5275 {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5276 {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5277 {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5278 {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5279 {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5280 {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5281 {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5282 {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5283 {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5284 {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5285 {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5286 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5287 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5288 {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5289 {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5290 {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5291 {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5292 {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5293 {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5294 {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5295 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5296 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5297 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5298 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5299 {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5300 {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5301 {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5302 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5303 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5304 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5305 {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5306 {0xa0, 0x03, ZC3XX_R10C_RGB02},
5307 {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5308 {0xa0, 0x51, ZC3XX_R10E_RGB11},
5309 {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5310 {0xa0, 0xec, ZC3XX_R110_RGB20},
5311 {0xa0, 0x03, ZC3XX_R111_RGB21},
5312 {0xa0, 0x51, ZC3XX_R112_RGB22},
5313 {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5314 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5315 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5316 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5317 {0xa0, 0x62, ZC3XX_R093_I2CSETVALUE},
5318 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5319 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5320 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5321 {0xa0, 0xaa, ZC3XX_R093_I2CSETVALUE},
5322 {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5323 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5324 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5325 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
5326 {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
5327 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5328 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5329 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5330 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5331 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5332 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5333 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5334 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
5335 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
5336 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
5337 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5338 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
5339 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005340 {0xa0, 0x09, 0x01ad},
5341 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005342 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5343 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005344 {0xa0, 0x30, 0x0007},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005345 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005346 {0xa0, 0x00, 0x0007},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005347 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005348 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005349};
5350
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005351static const struct usb_action tas5130c_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005352 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5353 {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
5354 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5355 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5356 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5357 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5358 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5359 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5360 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005361 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5362 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5363 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5364 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005365
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005366 {0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
5367 {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5368 {0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
5369 {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5370 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
5371 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5372 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
5373 {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5374 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5375 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5376 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03005377 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
Jean-Francois Moine013db752009-10-07 05:24:19 -03005378 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005379 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005380 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5381 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5382 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5383 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03005384 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5385 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005386 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005387};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005388static const struct usb_action tas5130c_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005389 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5390 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03005391 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005392 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5393 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5394 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5395 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5396 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5397 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005398 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5399 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5400 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5401 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5402 {0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
5403 {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5404 {0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
5405 {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5406 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
5407 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5408 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
5409 {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5410 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5411 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5412 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03005413 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
Jean-Francois Moine013db752009-10-07 05:24:19 -03005414 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005415 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005416 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5417 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5418 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5419 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03005420 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5421 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005422 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005423};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005424static const struct usb_action tas5130c_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005425 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005426 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5427 {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005428 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5429 {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
5430 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005431 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
5432 {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005433 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5434 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5435 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005436 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5437 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5438 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5439 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005440 {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
5441 {0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
5442 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
5443 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5444 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005445 {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
5446 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005447 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005448};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005449static const struct usb_action tas5130c_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005450 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005451 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5452 {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005453 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5454 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5455 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005456 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5457 {0xa0, 0xd0, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005458 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5459 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5460 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005461 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5462 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5463 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5464 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005465 {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
5466 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
5467 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
5468 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5469 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005470 {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
5471 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005472 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005473};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005474static const struct usb_action tas5130c_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005475 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005476 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5477 {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005478 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5479 {0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
5480 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005481 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
5482 {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005483 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5484 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5485 {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005486 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5487 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5488 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5489 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005490 {0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
5491 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5492 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5493 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5494 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005495 {0xa0, 0x28, ZC3XX_R0A0_MAXXLOW},
5496 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005497 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005498};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005499static const struct usb_action tas5130c_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005500 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005501 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5502 {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005503 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5504 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5505 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005506 {0xa0, 0x09, ZC3XX_R191_EXPOSURELIMITMID},
5507 {0xa0, 0x47, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005508 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5509 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5510 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005511 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5512 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5513 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5514 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005515 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
5516 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5517 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5518 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5519 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005520 {0xa0, 0x20, ZC3XX_R0A0_MAXXLOW},
5521 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005522 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005523};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005524static const struct usb_action tas5130c_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005525 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005526 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5527 {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005528 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5529 {0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
5530 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005531 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
5532 {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
5533 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5534 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5535 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
5536 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5537 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005538 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5539 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5540 {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5541 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5542 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5543 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5544 {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005545 {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
5546 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005547 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005548};
5549
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005550static const struct usb_action tas5130c_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005551 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005552 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5553 {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005554 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5555 {0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
5556 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005557 {0xa0, 0x0a, ZC3XX_R191_EXPOSURELIMITMID},
5558 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
5559 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5560 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5561 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
5562 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5563 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005564 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5565 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5566 {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5567 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5568 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5569 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5570 {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005571 {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
5572 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005573 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005574};
5575
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005576static const struct usb_action tas5130c_vf0250_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005577 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
5578 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
5579 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
5580 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc,
5581 * 0<->10 */
5582 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
5583 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
5584 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
5585 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
5586 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
5587 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
5588 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
5589 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
5590 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
5591 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
5592 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
5593 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
5594 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc,
5595 * 6<->8 */
5596 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc,
5597 * 6<->8 */
5598 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
5599 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005600 {0xaa, 0x1b, 0x0024}, /* 00,1b,24,aa, */
5601 {0xdd, 0x00, 0x0080}, /* 00,00,80,dd, */
5602 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */
5603 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */
5604 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005605/*?? {0xaa, 0x01, 0x0000}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005606 {0xaa, 0x01, 0x0000},
5607 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
5608 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005609 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
5610 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
5611 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005612 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
5613 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa, */
5614 {0xaa, 0x0b, 0x00a0}, /* 00,0b,a0,aa, */
5615 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa, */
5616 {0xaa, 0x0d, 0x00a0}, /* 00,0d,a0,aa, */
5617 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa, */
5618 {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */
5619 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */
5620 {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005621/*?? {0xa0, 0x00, 0x0039},
5622 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005623 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
5624 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa, (e6 -> e8) */
5625 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
5626 {0xaa, 0x19, 0x0088}, /* 00,19,86,aa, */
5627 {0xaa, 0x20, 0x0020}, /* 00,20,20,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005628 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
5629 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
5630 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
5631 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
5632 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
5633 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
5634 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
5635 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
5636 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
5637 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc, */
5638 {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
5639 {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005640 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005641};
5642
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005643static const struct usb_action tas5130c_vf0250_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005644 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
5645 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
5646 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
5647 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc, */
5648 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
5649 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
5650 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
5651 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
5652 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
5653 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
5654 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
5655 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
5656 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
5657 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
5658 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
5659 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
5660 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc,
5661 * 8<->6 */
5662 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc,
5663 * 8<->6 */
5664 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
5665 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005666 {0xaa, 0x1b, 0x0024}, /* 00,1b,24,aa, */
5667 {0xdd, 0x00, 0x0080}, /* 00,00,80,dd, */
5668 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */
5669 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */
5670 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
Jean-Francois Moine2ed9f812008-11-28 15:31:43 -03005671/*?? {0xaa, 0x01, 0x0000}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005672 {0xaa, 0x01, 0x0000},
5673 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
5674 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005675 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
5676 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
5677 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005678 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
5679 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa, */
5680 {0xaa, 0x0b, 0x00a0}, /* 00,0b,a0,aa, */
5681 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa, */
5682 {0xaa, 0x0d, 0x00a0}, /* 00,0d,a0,aa, */
5683 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa, */
5684 {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */
5685 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */
5686 {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */
Jean-Francois Moine2ed9f812008-11-28 15:31:43 -03005687/*?? {0xa0, 0x00, 0x0039},
5688 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005689 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
5690 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa (e6 -> e8) */
5691 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
5692 {0xaa, 0x19, 0x0088}, /* 00,19,88,aa, */
5693 {0xaa, 0x20, 0x0020}, /* 00,20,20,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005694 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
5695 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
5696 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
5697 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
5698 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
5699 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
5700 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
5701 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
5702 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
5703 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc, */
5704 {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
5705 {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005706 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005707};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005708static const struct usb_action tas5130c_vf0250_50HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005709 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5710 {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */
5711 {0xaa, 0x84, 0x00aa}, /* 00,84,aa,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005712 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5713 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
5714 {0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
5715 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5716 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5717 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc, */
5718 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5719 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5720 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
5721 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
5722 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5723 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5724 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5725 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5726 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5727 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
5728 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005729 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005730};
5731
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005732static const struct usb_action tas5130c_vf0250_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005733 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5734 {0xaa, 0x83, 0x0003}, /* 00,83,03,aa */
5735 {0xaa, 0x84, 0x0054}, /* 00,84,54,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005736 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5737 {0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
5738 {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
5739 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5740 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5741 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc, */
5742 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5743 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5744 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
5745 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
5746 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5747 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5748 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5749 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5750 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5751 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
5752 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005753 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005754};
5755
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005756static const struct usb_action tas5130c_vf0250_60HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005757 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5758 {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */
5759 {0xaa, 0x84, 0x0062}, /* 00,84,62,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005760 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5761 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,05,cc, */
5762 {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,88,cc, */
5763 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5764 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5765 {0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3b,cc, */
5766 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5767 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5768 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
5769 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
5770 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5771 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5772 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5773 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5774 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5775 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
5776 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005777 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005778};
5779
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005780static const struct usb_action tas5130c_vf0250_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005781 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5782 {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */
5783 {0xaa, 0x84, 0x00c4}, /* 00,84,c4,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005784 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5785 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,1,0b,cc, */
5786 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,2,10,cc, */
5787 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,5,00,cc, */
5788 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,6,00,cc, */
5789 {0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,7,76,cc, */
5790 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,c,0e,cc, */
5791 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,f,15,cc, */
5792 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,9,10,cc, */
5793 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,a,24,cc, */
5794 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,d,62,cc, */
5795 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,e,90,cc, */
5796 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,f,c8,cc, */
5797 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,0,ff,cc, */
5798 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,d,58,cc, */
5799 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
5800 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005801 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005802};
5803
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005804static const struct usb_action tas5130c_vf0250_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005805 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005806 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5807 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
5808 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005809 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,0,00,cc, */
5810 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,05,cc, */
5811 {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,88,cc, */
5812 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5813 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5814 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
5815 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5816 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5817 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5818 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5819 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5820 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5821 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5822 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005823 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005824};
5825
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005826static const struct usb_action tas5130c_vf0250_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005827 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005828 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5829 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
5830 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005831 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5832 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc, */
5833 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc, */
5834 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5835 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5836 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
5837 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5838 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5839 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5840 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5841 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5842 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5843 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5844 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005845 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005846};
5847
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03005848static u8 reg_r_i(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005849 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005850{
Jean-François Moine6d314502010-08-04 05:44:13 -03005851 int ret;
5852
5853 if (gspca_dev->usb_err < 0)
5854 return 0;
5855 ret = usb_control_msg(gspca_dev->dev,
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005856 usb_rcvctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005857 0xa1,
5858 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
5859 0x01, /* value */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005860 index, gspca_dev->usb_buf, 1,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005861 500);
Jean-François Moine6d314502010-08-04 05:44:13 -03005862 if (ret < 0) {
5863 PDEBUG(D_ERR, "reg_r_i err %d", ret);
5864 gspca_dev->usb_err = ret;
5865 return 0;
5866 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005867 return gspca_dev->usb_buf[0];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005868}
5869
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03005870static u8 reg_r(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005871 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005872{
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03005873 u8 ret;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005874
5875 ret = reg_r_i(gspca_dev, index);
5876 PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
5877 return ret;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005878}
5879
Jean-François Moine6d314502010-08-04 05:44:13 -03005880static void reg_w_i(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005881 u8 value,
5882 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005883{
Jean-François Moine6d314502010-08-04 05:44:13 -03005884 int ret;
5885
5886 if (gspca_dev->usb_err < 0)
5887 return;
5888 ret = usb_control_msg(gspca_dev->dev,
5889 usb_sndctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005890 0xa0,
5891 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
5892 value, index, NULL, 0,
5893 500);
Jean-François Moine6d314502010-08-04 05:44:13 -03005894 if (ret < 0) {
5895 PDEBUG(D_ERR, "reg_w_i err %d", ret);
5896 gspca_dev->usb_err = ret;
5897 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005898}
5899
Jean-François Moine6d314502010-08-04 05:44:13 -03005900static void reg_w(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005901 u8 value,
5902 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005903{
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005904 PDEBUG(D_USBO, "reg w [%04x] = %02x", index, value);
Jean-François Moine6d314502010-08-04 05:44:13 -03005905 reg_w_i(gspca_dev, value, index);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005906}
5907
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005908static u16 i2c_read(struct gspca_dev *gspca_dev,
5909 u8 reg)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005910{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005911 u8 retbyte;
5912 u16 retval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005913
Jean-François Moine6d314502010-08-04 05:44:13 -03005914 if (gspca_dev->usb_err < 0)
5915 return 0;
5916 reg_w_i(gspca_dev, reg, 0x0092);
5917 reg_w_i(gspca_dev, 0x02, 0x0090); /* <- read command */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005918 msleep(20);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005919 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005920 if (retbyte != 0x00)
5921 err("i2c_r status error %02x", retbyte);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005922 retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */
5923 retval |= reg_r_i(gspca_dev, 0x0096) << 8; /* read Hightbyte */
Jean-Francois Moine0b119b72009-04-07 05:30:31 -03005924 PDEBUG(D_USBI, "i2c r [%02x] -> %04x (%02x)",
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005925 reg, retval, retbyte);
5926 return retval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005927}
5928
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005929static u8 i2c_write(struct gspca_dev *gspca_dev,
5930 u8 reg,
5931 u8 valL,
5932 u8 valH)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005933{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005934 u8 retbyte;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005935
Jean-François Moine6d314502010-08-04 05:44:13 -03005936 if (gspca_dev->usb_err < 0)
5937 return 0;
5938 reg_w_i(gspca_dev, reg, 0x92);
5939 reg_w_i(gspca_dev, valL, 0x93);
5940 reg_w_i(gspca_dev, valH, 0x94);
5941 reg_w_i(gspca_dev, 0x01, 0x90); /* <- write command */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005942 msleep(1);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005943 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005944 if (retbyte != 0x00)
5945 err("i2c_w status error %02x", retbyte);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005946 PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005947 reg, valH, valL, retbyte);
5948 return retbyte;
5949}
5950
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005951static void usb_exchange(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005952 const struct usb_action *action)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005953{
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005954 while (action->req) {
5955 switch (action->req) {
5956 case 0xa0: /* write register */
Jean-François Moine6d314502010-08-04 05:44:13 -03005957 reg_w(gspca_dev, action->val, action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005958 break;
5959 case 0xa1: /* read status */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005960 reg_r(gspca_dev, action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005961 break;
5962 case 0xaa:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005963 i2c_write(gspca_dev,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005964 action->val, /* reg */
5965 action->idx & 0xff, /* valL */
5966 action->idx >> 8); /* valH */
5967 break;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03005968 case 0xbb:
5969 i2c_write(gspca_dev,
5970 action->idx >> 8, /* reg */
5971 action->idx & 0xff, /* valL */
5972 action->val); /* valH */
5973 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005974 default:
5975/* case 0xdd: * delay */
5976 msleep(action->val / 64 + 10);
5977 break;
5978 }
5979 action++;
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005980 msleep(1);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005981 }
5982}
5983
5984static void setmatrix(struct gspca_dev *gspca_dev)
5985{
5986 struct sd *sd = (struct sd *) gspca_dev;
5987 int i;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005988 const u8 *matrix;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03005989 static const u8 adcm2700_matrix[9] =
Jean-Francois Moinec675e792009-01-26 05:29:06 -03005990/* {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; */
5991/*ms-win*/
5992 {0x74, 0xed, 0xed, 0xed, 0x74, 0xed, 0xed, 0xed, 0x74};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005993 static const u8 gc0305_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005994 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005995 static const u8 ov7620_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005996 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005997 static const u8 pas202b_matrix[9] =
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03005998 {0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005999 static const u8 po2030_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006000 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
Jean-Francois Moine013db752009-10-07 05:24:19 -03006001 static const u8 tas5130c_matrix[9] =
6002 {0x68, 0xec, 0xec, 0xec, 0x68, 0xec, 0xec, 0xec, 0x68};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006003 static const u8 vf0250_matrix[9] =
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006004 {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006005 static const u8 *matrix_tb[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006006 [SENSOR_ADCM2700] = adcm2700_matrix,
6007 [SENSOR_CS2102] = ov7620_matrix,
6008 [SENSOR_CS2102K] = NULL,
6009 [SENSOR_GC0305] = gc0305_matrix,
6010 [SENSOR_HDCS2020b] = NULL,
6011 [SENSOR_HV7131B] = NULL,
6012 [SENSOR_HV7131R] = NULL,
6013 [SENSOR_ICM105A] = po2030_matrix,
6014 [SENSOR_MC501CB] = NULL,
6015 [SENSOR_MI0360SOC] = gc0305_matrix,
6016 [SENSOR_OV7620] = ov7620_matrix,
6017 [SENSOR_OV7630C] = NULL,
6018 [SENSOR_PAS106] = NULL,
6019 [SENSOR_PAS202B] = pas202b_matrix,
6020 [SENSOR_PB0330] = gc0305_matrix,
6021 [SENSOR_PO2030] = po2030_matrix,
6022 [SENSOR_TAS5130CK] = NULL,
6023 [SENSOR_TAS5130C] = tas5130c_matrix,
6024 [SENSOR_TAS5130C_VF0250] = vf0250_matrix,
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006025 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006026
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006027 matrix = matrix_tb[sd->sensor];
6028 if (matrix == NULL)
6029 return; /* matrix already loaded */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006030 for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
Jean-François Moine6d314502010-08-04 05:44:13 -03006031 reg_w(gspca_dev, matrix[i], 0x010a + i);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006032}
6033
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006034static void setsharpness(struct gspca_dev *gspca_dev)
6035{
6036 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006037 int sharpness;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006038 static const u8 sharpness_tb[][2] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006039 {0x02, 0x03},
6040 {0x04, 0x07},
6041 {0x08, 0x0f},
6042 {0x10, 0x1e}
6043 };
6044
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006045 sharpness = sd->sharpness;
Jean-François Moine6d314502010-08-04 05:44:13 -03006046 reg_w(gspca_dev, sharpness_tb[sharpness][0], 0x01c6);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006047 reg_r(gspca_dev, 0x01c8);
6048 reg_r(gspca_dev, 0x01c9);
6049 reg_r(gspca_dev, 0x01ca);
Jean-François Moine6d314502010-08-04 05:44:13 -03006050 reg_w(gspca_dev, sharpness_tb[sharpness][1], 0x01cb);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006051}
6052
6053static void setcontrast(struct gspca_dev *gspca_dev)
6054{
6055 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006056 const u8 *Tgamma;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006057 int g, i, brightness, contrast, adj, gp1, gp2;
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006058 u8 gr[16];
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006059 static const u8 delta_b[16] = /* delta for brightness */
6060 {0x50, 0x38, 0x2d, 0x28, 0x24, 0x21, 0x1e, 0x1d,
6061 0x1d, 0x1b, 0x1b, 0x1b, 0x19, 0x18, 0x18, 0x18};
6062 static const u8 delta_c[16] = /* delta for contrast */
Jean-François Moinea8567532010-04-25 15:25:42 -03006063 {0x2c, 0x1a, 0x12, 0x0c, 0x0a, 0x06, 0x06, 0x06,
6064 0x04, 0x06, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02};
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006065 static const u8 gamma_tb[6][16] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006066 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006067 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006068 {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006069 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006070 {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006071 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006072 {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006073 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006074 {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006075 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006076 {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006077 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006078 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006079
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006080 Tgamma = gamma_tb[sd->gamma - 1];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006081
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006082 contrast = ((int) sd->contrast - 128); /* -128 / 127 */
6083 brightness = ((int) sd->brightness - 128); /* -128 / 92 */
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006084 adj = 0;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006085 gp1 = gp2 = 0;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006086 for (i = 0; i < 16; i++) {
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006087 g = Tgamma[i] + delta_b[i] * brightness / 256
6088 - delta_c[i] * contrast / 256 - adj / 2;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006089 if (g > 0xff)
6090 g = 0xff;
Jean-François Moinea8567532010-04-25 15:25:42 -03006091 else if (g < 0)
6092 g = 0;
Jean-François Moine6d314502010-08-04 05:44:13 -03006093 reg_w(gspca_dev, g, 0x0120 + i); /* gamma */
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006094 if (contrast > 0)
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006095 adj--;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006096 else if (contrast < 0)
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006097 adj++;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006098 if (i > 1)
6099 gr[i - 1] = (g - gp2) / 2;
6100 else if (i != 0)
6101 gr[0] = gp1 == 0 ? 0 : (g - gp1);
6102 gp2 = gp1;
6103 gp1 = g;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006104 }
Jean-François Moinea9dfc012010-06-04 06:21:48 -03006105 gr[15] = (0xff - gp2) / 2;
Jean-Francois Moinefd180462010-01-04 15:54:59 -03006106 for (i = 0; i < 16; i++)
Jean-François Moine6d314502010-08-04 05:44:13 -03006107 reg_w(gspca_dev, gr[i], 0x0130 + i); /* gradient */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006108}
6109
6110static void setquality(struct gspca_dev *gspca_dev)
6111{
6112 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006113 u8 frxt;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006114
6115 switch (sd->sensor) {
Jean-Francois Moinec675e792009-01-26 05:29:06 -03006116 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006117 case SENSOR_GC0305:
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03006118 case SENSOR_HV7131B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006119 case SENSOR_OV7620:
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006120 case SENSOR_PAS202B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006121 case SENSOR_PO2030:
6122 return;
6123 }
6124/*fixme: is it really 0008 0007 0018 for all other sensors? */
Jean-François Moine6d314502010-08-04 05:44:13 -03006125 reg_w(gspca_dev, QUANT_VAL, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006126 frxt = 0x30;
Jean-François Moine6d314502010-08-04 05:44:13 -03006127 reg_w(gspca_dev, frxt, 0x0007);
Jean-Francois Moine36e819d2009-01-07 16:49:57 -03006128#if QUANT_VAL == 0 || QUANT_VAL == 1 || QUANT_VAL == 2
6129 frxt = 0xff;
6130#elif QUANT_VAL == 3
6131 frxt = 0xf0;
6132#elif QUANT_VAL == 4
6133 frxt = 0xe0;
6134#else
6135 frxt = 0x20;
6136#endif
Jean-François Moine6d314502010-08-04 05:44:13 -03006137 reg_w(gspca_dev, frxt, 0x0018);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006138}
6139
6140/* Matches the sensor's internal frame rate to the lighting frequency.
6141 * Valid frequencies are:
6142 * 50Hz, for European and Asian lighting (default)
6143 * 60Hz, for American lighting
6144 * 0 = No Fliker (for outdoore usage)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006145 */
Jean-François Moine6d314502010-08-04 05:44:13 -03006146static void setlightfreq(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006147{
6148 struct sd *sd = (struct sd *) gspca_dev;
6149 int i, mode;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006150 const struct usb_action *zc3_freq;
6151 static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006152 [SENSOR_ADCM2700] =
Jean-Francois Moinec314b532009-01-20 10:02:35 -03006153 {adcm2700_NoFliker, adcm2700_NoFliker,
6154 adcm2700_50HZ, adcm2700_50HZ,
6155 adcm2700_60HZ, adcm2700_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006156 [SENSOR_CS2102] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006157 {cs2102_NoFliker, cs2102_NoFlikerScale,
6158 cs2102_50HZ, cs2102_50HZScale,
6159 cs2102_60HZ, cs2102_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006160 [SENSOR_CS2102K] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006161 {cs2102_NoFliker, cs2102_NoFlikerScale,
Costantino Leandro5be8b73e2008-09-09 04:32:46 -03006162 NULL, NULL, /* currently disabled */
6163 NULL, NULL},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006164 [SENSOR_GC0305] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006165 {gc0305_NoFliker, gc0305_NoFliker,
6166 gc0305_50HZ, gc0305_50HZ,
6167 gc0305_60HZ, gc0305_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006168 [SENSOR_HDCS2020b] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006169 {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
6170 hdcs2020b_50HZ, hdcs2020b_50HZ,
6171 hdcs2020b_60HZ, hdcs2020b_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006172 [SENSOR_HV7131B] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006173 {hv7131b_NoFliker, hv7131b_NoFlikerScale,
6174 hv7131b_50HZ, hv7131b_50HZScale,
6175 hv7131b_60HZ, hv7131b_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006176 [SENSOR_HV7131R] =
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03006177 {hv7131r_NoFliker, hv7131r_NoFlikerScale,
6178 hv7131r_50HZ, hv7131r_50HZScale,
6179 hv7131r_60HZ, hv7131r_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006180 [SENSOR_ICM105A] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006181 {icm105a_NoFliker, icm105a_NoFlikerScale,
6182 icm105a_50HZ, icm105a_50HZScale,
6183 icm105a_60HZ, icm105a_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006184 [SENSOR_MC501CB] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006185 {mc501cb_NoFliker, mc501cb_NoFlikerScale,
6186 mc501cb_50HZ, mc501cb_50HZScale,
6187 mc501cb_60HZ, mc501cb_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006188 [SENSOR_MI0360SOC] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006189 {mi360soc_AENoFliker, mi360soc_AENoFlikerScale,
6190 mi360soc_AE50HZ, mi360soc_AE50HZScale,
6191 mi360soc_AE60HZ, mi360soc_AE60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006192 [SENSOR_OV7620] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006193 {ov7620_NoFliker, ov7620_NoFliker,
6194 ov7620_50HZ, ov7620_50HZ,
6195 ov7620_60HZ, ov7620_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006196 [SENSOR_OV7630C] =
Harvey Harrisonefab8212008-07-05 06:12:47 -03006197 {NULL, NULL,
6198 NULL, NULL,
6199 NULL, NULL},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006200 [SENSOR_PAS106] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006201 {pas106b_NoFliker, pas106b_NoFliker,
6202 pas106b_50HZ, pas106b_50HZ,
6203 pas106b_60HZ, pas106b_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006204 [SENSOR_PAS202B] =
Jean-François Moinea6a86f0d2010-04-25 14:57:10 -03006205 {pas202b_NoFliker, pas202b_NoFlikerScale,
6206 pas202b_50HZ, pas202b_50HZScale,
6207 pas202b_60HZ, pas202b_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006208 [SENSOR_PB0330] =
Jean-François Moinea6a86f0d2010-04-25 14:57:10 -03006209 {pb0330_NoFliker, pb0330_NoFlikerScale,
6210 pb0330_50HZ, pb0330_50HZScale,
6211 pb0330_60HZ, pb0330_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006212 [SENSOR_PO2030] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006213 {po2030_NoFliker, po2030_NoFliker,
6214 po2030_50HZ, po2030_50HZ,
6215 po2030_60HZ, po2030_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006216 [SENSOR_TAS5130CK] =
6217 {tas5130c_NoFliker, tas5130c_NoFlikerScale,
6218 tas5130c_50HZ, tas5130c_50HZScale,
6219 tas5130c_60HZ, tas5130c_60HZScale},
6220 [SENSOR_TAS5130C] =
6221 {tas5130c_NoFliker, tas5130c_NoFlikerScale,
6222 tas5130c_50HZ, tas5130c_50HZScale,
6223 tas5130c_60HZ, tas5130c_60HZScale},
6224 [SENSOR_TAS5130C_VF0250] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006225 {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale,
6226 tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale,
6227 tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006228 };
6229
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006230 i = sd->lightfreq * 2;
Jean-Francois Moinec2446b32008-07-05 11:49:20 -03006231 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006232 if (mode)
6233 i++; /* 320x240 */
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006234 zc3_freq = freq_tb[sd->sensor][i];
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006235 if (zc3_freq == NULL)
Jean-François Moine6d314502010-08-04 05:44:13 -03006236 return;
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006237 usb_exchange(gspca_dev, zc3_freq);
6238 switch (sd->sensor) {
6239 case SENSOR_GC0305:
6240 if (mode /* if 320x240 */
6241 && sd->lightfreq == 1) /* and 50Hz */
Jean-François Moine6d314502010-08-04 05:44:13 -03006242 reg_w(gspca_dev, 0x85, 0x018d);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006243 /* win: 0x80, 0x018d */
6244 break;
6245 case SENSOR_OV7620:
6246 if (!mode) { /* if 640x480 */
6247 if (sd->lightfreq != 0) /* and 50 or 60 Hz */
Jean-François Moine6d314502010-08-04 05:44:13 -03006248 reg_w(gspca_dev, 0x40, 0x0002);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006249 else
Jean-François Moine6d314502010-08-04 05:44:13 -03006250 reg_w(gspca_dev, 0x44, 0x0002);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006251 }
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006252 break;
6253 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03006254 reg_w(gspca_dev, 0x00, 0x01a7);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006255 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006256 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006257}
6258
6259static void setautogain(struct gspca_dev *gspca_dev)
6260{
6261 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006262 u8 autoval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006263
6264 if (sd->autogain)
6265 autoval = 0x42;
6266 else
6267 autoval = 0x02;
Jean-François Moine6d314502010-08-04 05:44:13 -03006268 reg_w(gspca_dev, autoval, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006269}
6270
Jean-François Moine6d314502010-08-04 05:44:13 -03006271static void send_unknown(struct gspca_dev *gspca_dev, int sensor)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006272{
Jean-François Moine6d314502010-08-04 05:44:13 -03006273 reg_w(gspca_dev, 0x01, 0x0000); /* led off */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006274 switch (sensor) {
6275 case SENSOR_PAS106:
Jean-François Moine6d314502010-08-04 05:44:13 -03006276 reg_w(gspca_dev, 0x03, 0x003a);
6277 reg_w(gspca_dev, 0x0c, 0x003b);
6278 reg_w(gspca_dev, 0x08, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006279 break;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006280 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006281 case SENSOR_GC0305:
6282 case SENSOR_OV7620:
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03006283 case SENSOR_MI0360SOC:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006284 case SENSOR_PB0330:
6285 case SENSOR_PO2030:
Jean-François Moine6d314502010-08-04 05:44:13 -03006286 reg_w(gspca_dev, 0x0d, 0x003a);
6287 reg_w(gspca_dev, 0x02, 0x003b);
6288 reg_w(gspca_dev, 0x00, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006289 break;
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006290 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03006291 reg_w(gspca_dev, 0x03, 0x003b);
6292 reg_w(gspca_dev, 0x0c, 0x003a);
6293 reg_w(gspca_dev, 0x0b, 0x0039);
6294 reg_w(gspca_dev, 0x0b, 0x0038);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006295 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006296 }
6297}
6298
6299/* start probe 2 wires */
Jean-François Moine6d314502010-08-04 05:44:13 -03006300static void start_2wr_probe(struct gspca_dev *gspca_dev, int sensor)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006301{
Jean-François Moine6d314502010-08-04 05:44:13 -03006302 reg_w(gspca_dev, 0x01, 0x0000);
6303 reg_w(gspca_dev, sensor, 0x0010);
6304 reg_w(gspca_dev, 0x01, 0x0001);
6305 reg_w(gspca_dev, 0x03, 0x0012);
6306 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006307/* msleep(2); */
6308}
6309
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006310static int sif_probe(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006311{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006312 u16 checkword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006313
Jean-François Moine6d314502010-08-04 05:44:13 -03006314 start_2wr_probe(gspca_dev, 0x0f); /* PAS106 */
6315 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006316 msleep(150);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006317 checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
6318 | ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006319 PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
6320 if (checkword == 0x0007) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006321 send_unknown(gspca_dev, SENSOR_PAS106);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006322 return 0x0f; /* PAS106 */
6323 }
6324 return -1;
6325}
6326
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006327static int vga_2wr_probe(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006328{
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006329 u16 retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006330
Jean-François Moine6d314502010-08-04 05:44:13 -03006331 start_2wr_probe(gspca_dev, 0x00); /* HV7131B */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006332 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006333 retword = i2c_read(gspca_dev, 0x01);
6334 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006335 return 0x00; /* HV7131B */
6336
Jean-François Moine6d314502010-08-04 05:44:13 -03006337 start_2wr_probe(gspca_dev, 0x04); /* CS2102 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006338 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006339 retword = i2c_read(gspca_dev, 0x01);
6340 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006341 return 0x04; /* CS2102 */
6342
Jean-François Moine6d314502010-08-04 05:44:13 -03006343 start_2wr_probe(gspca_dev, 0x06); /* OmniVision */
6344 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006345 i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006346 retword = i2c_read(gspca_dev, 0x11);
6347 if (retword != 0) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006348 /* (should have returned 0xaa) --> Omnivision? */
6349 /* reg_r 0x10 -> 0x06 --> */
6350 goto ov_check;
6351 }
6352
Jean-François Moine6d314502010-08-04 05:44:13 -03006353 start_2wr_probe(gspca_dev, 0x08); /* HDCS2020 */
Jean-Francois Moine1eed40a2010-01-08 08:01:43 -03006354 i2c_write(gspca_dev, 0x1c, 0x00, 0x00);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006355 i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006356 retword = i2c_read(gspca_dev, 0x15);
6357 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006358 return 0x08; /* HDCS2020 */
6359
Jean-François Moine6d314502010-08-04 05:44:13 -03006360 start_2wr_probe(gspca_dev, 0x0a); /* PB0330 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006361 i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006362 retword = i2c_read(gspca_dev, 0x07);
6363 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006364 return 0x0a; /* PB0330 */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006365 retword = i2c_read(gspca_dev, 0x03);
6366 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006367 return 0x0a; /* PB0330 ?? */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006368 retword = i2c_read(gspca_dev, 0x04);
6369 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006370 return 0x0a; /* PB0330 ?? */
6371
Jean-François Moine6d314502010-08-04 05:44:13 -03006372 start_2wr_probe(gspca_dev, 0x0c); /* ICM105A */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006373 i2c_write(gspca_dev, 0x01, 0x11, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006374 retword = i2c_read(gspca_dev, 0x01);
6375 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006376 return 0x0c; /* ICM105A */
6377
Jean-François Moine6d314502010-08-04 05:44:13 -03006378 start_2wr_probe(gspca_dev, 0x0e); /* PAS202BCB */
6379 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006380 i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03006381 msleep(50);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006382 retword = i2c_read(gspca_dev, 0x03);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006383 if (retword != 0) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006384 send_unknown(gspca_dev, SENSOR_PAS202B);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006385 return 0x0e; /* PAS202BCB */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006386 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006387
Jean-François Moine6d314502010-08-04 05:44:13 -03006388 start_2wr_probe(gspca_dev, 0x02); /* TAS5130C */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006389 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006390 retword = i2c_read(gspca_dev, 0x01);
6391 if (retword != 0)
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03006392 return 0x02; /* TAS5130C */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006393ov_check:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006394 reg_r(gspca_dev, 0x0010); /* ?? */
6395 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006396
Jean-François Moine6d314502010-08-04 05:44:13 -03006397 reg_w(gspca_dev, 0x01, 0x0000);
6398 reg_w(gspca_dev, 0x01, 0x0001);
6399 reg_w(gspca_dev, 0x06, 0x0010); /* OmniVision */
6400 reg_w(gspca_dev, 0xa1, 0x008b);
6401 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006402 msleep(500);
Jean-François Moine6d314502010-08-04 05:44:13 -03006403 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006404 i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006405 retword = i2c_read(gspca_dev, 0x0a) << 8;
6406 retword |= i2c_read(gspca_dev, 0x0b);
6407 PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", retword);
6408 switch (retword) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006409 case 0x7631: /* OV7630C */
Jean-François Moine6d314502010-08-04 05:44:13 -03006410 reg_w(gspca_dev, 0x06, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006411 break;
6412 case 0x7620: /* OV7620 */
6413 case 0x7648: /* OV7648 */
6414 break;
6415 default:
6416 return -1; /* not OmniVision */
6417 }
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006418 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006419}
6420
6421struct sensor_by_chipset_revision {
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006422 u16 revision;
6423 u8 internal_sensor_id;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006424};
6425static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
Jean-Francois Moine013db752009-10-07 05:24:19 -03006426 {0xc000, 0x12}, /* TAS5130C */
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03006427 {0xc001, 0x13}, /* MI0360SOC */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006428 {0xe001, 0x13},
6429 {0x8001, 0x13},
6430 {0x8000, 0x14}, /* CS2102K */
6431 {0x8400, 0x15}, /* TAS5130K */
Luis Maia658604e2009-12-15 13:40:44 -03006432 {0xe400, 0x15},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006433};
6434
6435static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6436{
6437 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006438 int i;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006439 u8 retbyte;
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006440 u16 retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006441
6442/*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
Jean-François Moine6d314502010-08-04 05:44:13 -03006443 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006444 reg_r(gspca_dev, 0x0010);
Jean-François Moine6d314502010-08-04 05:44:13 -03006445 reg_w(gspca_dev, 0x01, 0x0000);
6446 reg_w(gspca_dev, 0x00, 0x0010);
6447 reg_w(gspca_dev, 0x01, 0x0001);
6448 reg_w(gspca_dev, 0x91, 0x008b);
6449 reg_w(gspca_dev, 0x03, 0x0012);
6450 reg_w(gspca_dev, 0x01, 0x0012);
6451 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006452 retword = i2c_read(gspca_dev, 0x14);
6453 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006454 return 0x11; /* HV7131R */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006455 retword = i2c_read(gspca_dev, 0x15);
6456 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006457 return 0x11; /* HV7131R */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006458 retword = i2c_read(gspca_dev, 0x16);
6459 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006460 return 0x11; /* HV7131R */
6461
Jean-François Moine6d314502010-08-04 05:44:13 -03006462 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006463 retword = reg_r(gspca_dev, 0x000b) << 8;
6464 retword |= reg_r(gspca_dev, 0x000a);
6465 PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006466 reg_r(gspca_dev, 0x0010);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006467 if ((retword & 0xff00) == 0x6400)
6468 return 0x02; /* TAS5130C */
6469 for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6470 if (chipset_revision_sensor[i].revision == retword) {
6471 sd->chip_revision = retword;
Jean-François Moine6d314502010-08-04 05:44:13 -03006472 send_unknown(gspca_dev, SENSOR_PB0330);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006473 return chipset_revision_sensor[i]
6474 .internal_sensor_id;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006475 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006476 }
6477
Jean-François Moine6d314502010-08-04 05:44:13 -03006478 reg_w(gspca_dev, 0x01, 0x0000); /* check PB0330 */
6479 reg_w(gspca_dev, 0x01, 0x0001);
6480 reg_w(gspca_dev, 0xdd, 0x008b);
6481 reg_w(gspca_dev, 0x0a, 0x0010);
6482 reg_w(gspca_dev, 0x03, 0x0012);
6483 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006484 retword = i2c_read(gspca_dev, 0x00);
6485 if (retword != 0) {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006486 PDEBUG(D_PROBE, "probe 3wr vga type 0a");
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03006487 return 0x0a; /* PB0330 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006488 }
6489
Jean-François Moine6d314502010-08-04 05:44:13 -03006490 reg_w(gspca_dev, 0x01, 0x0000);
6491 reg_w(gspca_dev, 0x01, 0x0001);
6492 reg_w(gspca_dev, 0x98, 0x008b);
6493 reg_w(gspca_dev, 0x01, 0x0010);
6494 reg_w(gspca_dev, 0x03, 0x0012);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006495 msleep(2);
Jean-François Moine6d314502010-08-04 05:44:13 -03006496 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006497 retword = i2c_read(gspca_dev, 0x00);
6498 if (retword != 0) {
6499 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retword);
6500 if (retword == 0x0011) /* VF0250 */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006501 return 0x0250;
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006502 if (retword == 0x0029) /* gc0305 */
Jean-François Moine6d314502010-08-04 05:44:13 -03006503 send_unknown(gspca_dev, SENSOR_GC0305);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006504 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006505 }
6506
Jean-François Moine6d314502010-08-04 05:44:13 -03006507 reg_w(gspca_dev, 0x01, 0x0000); /* check OmniVision */
6508 reg_w(gspca_dev, 0x01, 0x0001);
6509 reg_w(gspca_dev, 0xa1, 0x008b);
6510 reg_w(gspca_dev, 0x08, 0x008d);
6511 reg_w(gspca_dev, 0x06, 0x0010);
6512 reg_w(gspca_dev, 0x01, 0x0012);
6513 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006514 if (i2c_read(gspca_dev, 0x1c) == 0x007f /* OV7610 - manufacturer ID */
6515 && i2c_read(gspca_dev, 0x1d) == 0x00a2) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006516 send_unknown(gspca_dev, SENSOR_OV7620);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006517 return 0x06; /* OmniVision confirm ? */
6518 }
6519
Jean-François Moine6d314502010-08-04 05:44:13 -03006520 reg_w(gspca_dev, 0x01, 0x0000);
6521 reg_w(gspca_dev, 0x00, 0x0002);
6522 reg_w(gspca_dev, 0x01, 0x0010);
6523 reg_w(gspca_dev, 0x01, 0x0001);
6524 reg_w(gspca_dev, 0xee, 0x008b);
6525 reg_w(gspca_dev, 0x03, 0x0012);
6526 reg_w(gspca_dev, 0x01, 0x0012);
6527 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006528 retword = i2c_read(gspca_dev, 0x00) << 8; /* ID 0 */
6529 retword |= i2c_read(gspca_dev, 0x01); /* ID 1 */
6530 PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", retword);
6531 if (retword == 0x2030) {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006532 retbyte = i2c_read(gspca_dev, 0x02); /* revision number */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006533 PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
Jean-François Moine6d314502010-08-04 05:44:13 -03006534 send_unknown(gspca_dev, SENSOR_PO2030);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006535 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006536 }
6537
Jean-François Moine6d314502010-08-04 05:44:13 -03006538 reg_w(gspca_dev, 0x01, 0x0000);
6539 reg_w(gspca_dev, 0x0a, 0x0010);
6540 reg_w(gspca_dev, 0xd3, 0x008b);
6541 reg_w(gspca_dev, 0x01, 0x0001);
6542 reg_w(gspca_dev, 0x03, 0x0012);
6543 reg_w(gspca_dev, 0x01, 0x0012);
6544 reg_w(gspca_dev, 0x05, 0x0012);
6545 reg_w(gspca_dev, 0xd3, 0x008b);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006546 retword = i2c_read(gspca_dev, 0x01);
6547 if (retword != 0) {
6548 PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword);
Jean-Francois Moine881cd412009-04-05 04:01:13 -03006549 return 0x16; /* adcm2700 (6100/6200) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006550 }
6551 return -1;
6552}
6553
6554static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6555{
6556 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006557 int sensor;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006558
6559 switch (sd->sensor) {
6560 case SENSOR_MC501CB:
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006561 return -1; /* don't probe */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006562 case SENSOR_TAS5130C_VF0250:
Hans de Goede346623422008-09-03 16:47:28 -03006563 /* may probe but with no write in reg 0x0010 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006564 return -1; /* don't probe */
Hans de Goede346623422008-09-03 16:47:28 -03006565 case SENSOR_PAS106:
6566 sensor = sif_probe(gspca_dev);
6567 if (sensor >= 0)
6568 return sensor;
6569 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006570 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006571 sensor = vga_2wr_probe(gspca_dev);
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006572 if (sensor >= 0)
Hans de Goede346623422008-09-03 16:47:28 -03006573 return sensor;
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006574 return vga_3wr_probe(gspca_dev);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006575}
6576
6577/* this function is called at probe time */
6578static int sd_config(struct gspca_dev *gspca_dev,
6579 const struct usb_device_id *id)
6580{
6581 struct sd *sd = (struct sd *) gspca_dev;
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006582
6583 /* define some sensors from the vendor/product */
6584 sd->sensor = id->driver_info;
6585
6586 sd->sharpness = SHARPNESS_DEF;
6587 sd->brightness = BRIGHTNESS_DEF;
6588 sd->contrast = CONTRAST_DEF;
6589 sd->autogain = AUTOGAIN_DEF;
6590 sd->lightfreq = FREQ_DEF;
6591 sd->quality = QUALITY_DEF;
6592
6593 return 0;
6594}
6595
6596/* this function is called at probe and resume time */
6597static int sd_init(struct gspca_dev *gspca_dev)
6598{
6599 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006600 struct cam *cam;
6601 int sensor;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006602 static const u8 gamma[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006603 [SENSOR_ADCM2700] = 4,
6604 [SENSOR_CS2102] = 4,
6605 [SENSOR_CS2102K] = 5,
6606 [SENSOR_GC0305] = 4,
6607 [SENSOR_HDCS2020b] = 4,
6608 [SENSOR_HV7131B] = 4,
6609 [SENSOR_HV7131R] = 4,
6610 [SENSOR_ICM105A] = 4,
6611 [SENSOR_MC501CB] = 4,
6612 [SENSOR_MI0360SOC] = 4,
6613 [SENSOR_OV7620] = 3,
6614 [SENSOR_OV7630C] = 4,
6615 [SENSOR_PAS106] = 4,
6616 [SENSOR_PAS202B] = 4,
6617 [SENSOR_PB0330] = 4,
6618 [SENSOR_PO2030] = 4,
6619 [SENSOR_TAS5130CK] = 4,
6620 [SENSOR_TAS5130C] = 3,
6621 [SENSOR_TAS5130C_VF0250] = 3,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006622 };
Hans de Goede9919fe82010-01-13 07:12:28 -03006623 static const u8 mode_tb[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006624 [SENSOR_ADCM2700] = 2,
6625 [SENSOR_CS2102] = 1,
6626 [SENSOR_CS2102K] = 1,
6627 [SENSOR_GC0305] = 1,
6628 [SENSOR_HDCS2020b] = 1,
6629 [SENSOR_HV7131B] = 1,
6630 [SENSOR_HV7131R] = 1,
6631 [SENSOR_ICM105A] = 1,
6632 [SENSOR_MC501CB] = 2,
6633 [SENSOR_MI0360SOC] = 1,
6634 [SENSOR_OV7620] = 2,
6635 [SENSOR_OV7630C] = 1,
6636 [SENSOR_PAS106] = 0,
6637 [SENSOR_PAS202B] = 1,
6638 [SENSOR_PB0330] = 1,
6639 [SENSOR_PO2030] = 1,
6640 [SENSOR_TAS5130CK] = 1,
6641 [SENSOR_TAS5130C] = 1,
6642 [SENSOR_TAS5130C_VF0250] = 1,
Hans de Goede9919fe82010-01-13 07:12:28 -03006643 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006644
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006645 sensor = zcxx_probeSensor(gspca_dev);
6646 if (sensor >= 0)
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006647 PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006648 if ((unsigned) force_sensor < SENSOR_MAX) {
6649 sd->sensor = force_sensor;
6650 PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
6651 } else {
6652 switch (sensor) {
6653 case -1:
6654 switch (sd->sensor) {
6655 case SENSOR_MC501CB:
6656 PDEBUG(D_PROBE, "Sensor MC501CB");
6657 break;
6658 case SENSOR_TAS5130C_VF0250:
6659 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
6660 break;
6661 default:
6662 PDEBUG(D_PROBE,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006663 "Unknown sensor - set to TAS5130C");
6664 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006665 }
6666 break;
6667 case 0:
Jean-Francois Moined754a6c2009-12-20 05:07:10 -03006668 /* check the sensor type */
6669 sensor = i2c_read(gspca_dev, 0x00);
6670 PDEBUG(D_PROBE, "Sensor hv7131 type %d", sensor);
6671 switch (sensor) {
6672 case 0: /* hv7131b */
6673 case 1: /* hv7131e */
6674 PDEBUG(D_PROBE, "Find Sensor HV7131B");
6675 sd->sensor = SENSOR_HV7131B;
6676 break;
6677 default:
6678/* case 2: * hv7131r */
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006679 PDEBUG(D_PROBE, "Find Sensor HV7131R");
6680 sd->sensor = SENSOR_HV7131R;
Jean-Francois Moined754a6c2009-12-20 05:07:10 -03006681 break;
6682 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006683 break;
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03006684 case 0x02:
6685 PDEBUG(D_PROBE, "Sensor TAS5130C");
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006686 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03006687 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006688 case 0x04:
6689 PDEBUG(D_PROBE, "Find Sensor CS2102");
6690 sd->sensor = SENSOR_CS2102;
6691 break;
6692 case 0x08:
6693 PDEBUG(D_PROBE, "Find Sensor HDCS2020(b)");
6694 sd->sensor = SENSOR_HDCS2020b;
6695 break;
6696 case 0x0a:
6697 PDEBUG(D_PROBE,
6698 "Find Sensor PB0330. Chip revision %x",
6699 sd->chip_revision);
6700 sd->sensor = SENSOR_PB0330;
6701 break;
6702 case 0x0c:
6703 PDEBUG(D_PROBE, "Find Sensor ICM105A");
6704 sd->sensor = SENSOR_ICM105A;
6705 break;
6706 case 0x0e:
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006707 PDEBUG(D_PROBE, "Find Sensor PAS202B");
6708 sd->sensor = SENSOR_PAS202B;
Jean-Francois Moine56af5ef2010-01-08 08:02:42 -03006709/* sd->sharpness = 1; */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006710 break;
6711 case 0x0f:
6712 PDEBUG(D_PROBE, "Find Sensor PAS106");
6713 sd->sensor = SENSOR_PAS106;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006714 break;
6715 case 0x10:
6716 case 0x12:
Jean-Francois Moine013db752009-10-07 05:24:19 -03006717 PDEBUG(D_PROBE, "Find Sensor TAS5130C");
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006718 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006719 break;
6720 case 0x11:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006721 PDEBUG(D_PROBE, "Find Sensor HV7131R");
6722 sd->sensor = SENSOR_HV7131R;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006723 break;
6724 case 0x13:
6725 PDEBUG(D_PROBE,
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03006726 "Find Sensor MI0360SOC. Chip revision %x",
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006727 sd->chip_revision);
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03006728 sd->sensor = SENSOR_MI0360SOC;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006729 break;
6730 case 0x14:
6731 PDEBUG(D_PROBE,
6732 "Find Sensor CS2102K?. Chip revision %x",
6733 sd->chip_revision);
6734 sd->sensor = SENSOR_CS2102K;
6735 break;
6736 case 0x15:
6737 PDEBUG(D_PROBE,
6738 "Find Sensor TAS5130CK?. Chip revision %x",
6739 sd->chip_revision);
6740 sd->sensor = SENSOR_TAS5130CK;
6741 break;
Jean-Francois Moine5be2b092009-01-20 05:12:34 -03006742 case 0x16:
6743 PDEBUG(D_PROBE, "Find Sensor ADCM2700");
6744 sd->sensor = SENSOR_ADCM2700;
6745 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006746 case 0x29:
6747 PDEBUG(D_PROBE, "Find Sensor GC0305");
6748 sd->sensor = SENSOR_GC0305;
6749 break;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006750 case 0x0250:
6751 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
6752 sd->sensor = SENSOR_TAS5130C_VF0250;
6753 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006754 case 0x2030:
6755 PDEBUG(D_PROBE, "Find Sensor PO2030");
6756 sd->sensor = SENSOR_PO2030;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006757 sd->sharpness = 0; /* from win traces */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006758 break;
6759 case 0x7620:
6760 PDEBUG(D_PROBE, "Find Sensor OV7620");
6761 sd->sensor = SENSOR_OV7620;
6762 break;
Jean-Francois Moinee2d750f2009-02-19 15:41:28 -03006763 case 0x7631:
6764 PDEBUG(D_PROBE, "Find Sensor OV7630C");
6765 sd->sensor = SENSOR_OV7630C;
6766 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006767 case 0x7648:
6768 PDEBUG(D_PROBE, "Find Sensor OV7648");
6769 sd->sensor = SENSOR_OV7620; /* same sensor (?) */
6770 break;
6771 default:
Jean-Francois Moine5be2b092009-01-20 05:12:34 -03006772 PDEBUG(D_ERR|D_PROBE, "Unknown sensor %04x", sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006773 return -EINVAL;
6774 }
6775 }
6776 if (sensor < 0x20) {
6777 if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
Jean-François Moine6d314502010-08-04 05:44:13 -03006778 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006779 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006780 }
6781
6782 cam = &gspca_dev->cam;
Hans de Goede9919fe82010-01-13 07:12:28 -03006783 switch (mode_tb[sd->sensor]) {
6784 case 0:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006785 cam->cam_mode = sif_mode;
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03006786 cam->nmodes = ARRAY_SIZE(sif_mode);
Hans de Goede9919fe82010-01-13 07:12:28 -03006787 break;
6788 case 1:
6789 cam->cam_mode = vga_mode;
6790 cam->nmodes = ARRAY_SIZE(vga_mode);
6791 break;
6792 default:
6793/* case 2: */
6794 cam->cam_mode = broken_vga_mode;
6795 cam->nmodes = ARRAY_SIZE(broken_vga_mode);
6796 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006797 }
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006798 sd->gamma = gamma[sd->sensor];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006799
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03006800 switch (sd->sensor) {
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03006801 case SENSOR_OV7630C:
6802 gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
6803 break;
6804 }
6805
Jean-Francois Moine77880ba32010-01-08 08:04:21 -03006806 /* switch off the led */
Jean-François Moine6d314502010-08-04 05:44:13 -03006807 reg_w(gspca_dev, 0x01, 0x0000);
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006808 return gspca_dev->usb_err;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006809}
6810
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03006811static int sd_start(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006812{
6813 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006814 int mode;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006815 static const struct usb_action *init_tb[SENSOR_MAX][2] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006816 [SENSOR_ADCM2700] =
6817 {adcm2700_Initial, adcm2700_InitialScale},
6818 [SENSOR_CS2102] =
6819 {cs2102_Initial, cs2102_InitialScale},
6820 [SENSOR_CS2102K] =
6821 {cs2102K_Initial, cs2102K_InitialScale},
6822 [SENSOR_GC0305] =
6823 {gc0305_Initial, gc0305_InitialScale},
6824 [SENSOR_HDCS2020b] =
6825 {hdcs2020b_Initial, hdcs2020b_InitialScale},
6826 [SENSOR_HV7131B] =
6827 {hv7131b_Initial, hv7131b_InitialScale},
6828 [SENSOR_HV7131R] =
6829 {hv7131r_Initial, hv7131r_InitialScale},
6830 [SENSOR_ICM105A] =
6831 {icm105a_Initial, icm105a_InitialScale},
6832 [SENSOR_MC501CB] =
6833 {mc501cb_Initial, mc501cb_InitialScale},
6834 [SENSOR_MI0360SOC] =
6835 {mi0360soc_Initial, mi0360soc_InitialScale},
6836 [SENSOR_OV7620] =
6837 {ov7620_Initial, ov7620_InitialScale},
6838 [SENSOR_OV7630C] =
6839 {ov7630c_Initial, ov7630c_InitialScale},
6840 [SENSOR_PAS106] =
6841 {pas106b_Initial, pas106b_InitialScale},
6842 [SENSOR_PAS202B] =
6843 {pas202b_Initial, pas202b_InitialScale},
6844 [SENSOR_PB0330] =
6845 {pb0330_Initial, pb0330_InitialScale},
6846 [SENSOR_PO2030] =
6847 {po2030_Initial, po2030_InitialScale},
6848 [SENSOR_TAS5130CK] =
6849 {tas5130cK_Initial, tas5130cK_InitialScale},
6850 [SENSOR_TAS5130C] =
6851 {tas5130c_Initial, tas5130c_InitialScale},
6852 [SENSOR_TAS5130C_VF0250] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006853 {tas5130c_vf0250_Initial, tas5130c_vf0250_InitialScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006854 };
6855
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006856 /* create the JPEG header */
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006857 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
6858 0x21); /* JPEG 422 */
6859 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
6860
Jean-Francois Moine50924512010-01-08 08:08:12 -03006861 mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006862 switch (sd->sensor) {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006863 case SENSOR_HV7131R:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006864 zcxx_probeSensor(gspca_dev);
6865 break;
6866 case SENSOR_PAS106:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006867 usb_exchange(gspca_dev, pas106b_Initial_com);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006868 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006869 }
Jean-Francois Moine50924512010-01-08 08:08:12 -03006870 usb_exchange(gspca_dev, init_tb[sd->sensor][mode]);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006871
6872 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006873 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006874 case SENSOR_GC0305:
6875 case SENSOR_OV7620:
6876 case SENSOR_PO2030:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006877 case SENSOR_TAS5130C:
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006878 case SENSOR_TAS5130C_VF0250:
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006879/* msleep(100); * ?? */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006880 reg_r(gspca_dev, 0x0002); /* --> 0x40 */
Jean-François Moine6d314502010-08-04 05:44:13 -03006881 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6882 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006883 if (sd->sensor == SENSOR_TAS5130C)
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03006884 break;
Jean-François Moine6d314502010-08-04 05:44:13 -03006885 reg_w(gspca_dev, 0x0d, 0x003a);
6886 reg_w(gspca_dev, 0x02, 0x003b);
6887 reg_w(gspca_dev, 0x00, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006888 break;
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006889 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03006890 reg_w(gspca_dev, 0x03, 0x003b);
6891 reg_w(gspca_dev, 0x0c, 0x003a);
6892 reg_w(gspca_dev, 0x0b, 0x0039);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006893 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006894 }
6895
6896 setmatrix(gspca_dev);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006897 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006898 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006899 case SENSOR_OV7620:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006900 reg_r(gspca_dev, 0x0008);
Jean-François Moine6d314502010-08-04 05:44:13 -03006901 reg_w(gspca_dev, 0x00, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006902 break;
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006903 case SENSOR_PAS202B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006904 case SENSOR_GC0305:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006905 case SENSOR_TAS5130C:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006906 reg_r(gspca_dev, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006907 /* fall thru */
6908 case SENSOR_PO2030:
Jean-François Moine6d314502010-08-04 05:44:13 -03006909 reg_w(gspca_dev, 0x03, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006910 break;
6911 }
6912 setsharpness(gspca_dev);
6913
6914 /* set the gamma tables when not set */
6915 switch (sd->sensor) {
Jean-Francois Moine1d763312009-09-18 05:36:24 -03006916 case SENSOR_CS2102K: /* gamma set in xxx_Initial */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006917 case SENSOR_HDCS2020b:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006918 case SENSOR_OV7630C:
6919 case SENSOR_TAS5130CK:
6920 break;
6921 default:
6922 setcontrast(gspca_dev);
6923 break;
6924 }
6925 setmatrix(gspca_dev); /* one more time? */
6926 switch (sd->sensor) {
6927 case SENSOR_OV7620:
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006928 case SENSOR_PAS202B:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006929 reg_r(gspca_dev, 0x0180); /* from win */
Jean-François Moine6d314502010-08-04 05:44:13 -03006930 reg_w(gspca_dev, 0x00, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006931 break;
6932 default:
6933 setquality(gspca_dev);
6934 break;
6935 }
6936 setlightfreq(gspca_dev);
6937
6938 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006939 case SENSOR_ADCM2700:
Jean-François Moine6d314502010-08-04 05:44:13 -03006940 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6941 reg_w(gspca_dev, 0x15, 0x01ae);
6942 reg_w(gspca_dev, 0x02, 0x0180);
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006943 /* ms-win + */
Jean-François Moine6d314502010-08-04 05:44:13 -03006944 reg_w(gspca_dev, 0x40, 0x0117);
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006945 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006946 case SENSOR_GC0305:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006947 case SENSOR_TAS5130C:
Jean-François Moine6d314502010-08-04 05:44:13 -03006948 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6949 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006950 /* fall thru */
6951 case SENSOR_PAS202B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006952 case SENSOR_PO2030:
Jean-François Moine6d314502010-08-04 05:44:13 -03006953/* reg_w(gspca_dev, 0x40, ZC3XX_R117_GGAIN); * (from win traces) */
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006954 reg_r(gspca_dev, 0x0180);
6955 break;
6956 case SENSOR_OV7620:
Jean-François Moine6d314502010-08-04 05:44:13 -03006957 reg_w(gspca_dev, 0x09, 0x01ad);
6958 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006959 i2c_read(gspca_dev, 0x13); /*fixme: returns 0xa3 */
6960 i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
6961 /*fixme: returned value to send? */
Jean-François Moine6d314502010-08-04 05:44:13 -03006962 reg_w(gspca_dev, 0x40, 0x0117);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006963 reg_r(gspca_dev, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006964 break;
6965 }
6966
6967 setautogain(gspca_dev);
6968 switch (sd->sensor) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006969 case SENSOR_PO2030:
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03006970 msleep(50);
Jean-François Moine6d314502010-08-04 05:44:13 -03006971 reg_w(gspca_dev, 0x00, 0x0007); /* (from win traces) */
6972 reg_w(gspca_dev, 0x02, ZC3XX_R008_CLOCKSETTING);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006973 break;
6974 }
Jean-François Moine6d314502010-08-04 05:44:13 -03006975 return gspca_dev->usb_err;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006976}
6977
Jean-Francois Moine98522a72008-11-18 06:33:08 -03006978/* called on streamoff with alt 0 and on disconnect */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006979static void sd_stop0(struct gspca_dev *gspca_dev)
6980{
6981 struct sd *sd = (struct sd *) gspca_dev;
6982
Jean-Francois Moine98522a72008-11-18 06:33:08 -03006983 if (!gspca_dev->present)
6984 return;
Jean-François Moine6d314502010-08-04 05:44:13 -03006985 send_unknown(gspca_dev, sd->sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006986}
6987
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006988static void sd_pkt_scan(struct gspca_dev *gspca_dev,
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006989 u8 *data,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006990 int len)
6991{
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006992 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006993
6994 if (data[0] == 0xff && data[1] == 0xd8) { /* start of frame */
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006995 gspca_frame_add(gspca_dev, LAST_PACKET,
6996 NULL, 0);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006997 /* put the JPEG header in the new frame */
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006998 gspca_frame_add(gspca_dev, FIRST_PACKET,
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006999 sd->jpeg_hdr, JPEG_HDR_SZ);
7000
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007001 /* remove the webcam's header:
7002 * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
7003 * - 'ss ss' is the frame sequence number (BE)
7004 * - 'ww ww' and 'hh hh' are the window dimensions (BE)
7005 * - 'pp pp' is the packet sequence number (BE)
7006 */
7007 data += 18;
7008 len -= 18;
7009 }
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03007010 gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007011}
7012
Jean-François Moinea9dfc012010-06-04 06:21:48 -03007013static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
7014{
7015 struct sd *sd = (struct sd *) gspca_dev;
7016
7017 sd->brightness = val;
7018 if (gspca_dev->streaming)
7019 setcontrast(gspca_dev);
Jean-François Moine6d314502010-08-04 05:44:13 -03007020 return gspca_dev->usb_err;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03007021}
7022
7023static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
7024{
7025 struct sd *sd = (struct sd *) gspca_dev;
7026
7027 *val = sd->brightness;
7028 return 0;
7029}
7030
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007031static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
7032{
7033 struct sd *sd = (struct sd *) gspca_dev;
7034
7035 sd->contrast = val;
7036 if (gspca_dev->streaming)
7037 setcontrast(gspca_dev);
Jean-François Moine6d314502010-08-04 05:44:13 -03007038 return gspca_dev->usb_err;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007039}
7040
7041static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
7042{
7043 struct sd *sd = (struct sd *) gspca_dev;
7044
7045 *val = sd->contrast;
7046 return 0;
7047}
7048
7049static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
7050{
7051 struct sd *sd = (struct sd *) gspca_dev;
7052
7053 sd->autogain = val;
7054 if (gspca_dev->streaming)
7055 setautogain(gspca_dev);
Jean-François Moine6d314502010-08-04 05:44:13 -03007056 return gspca_dev->usb_err;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007057}
7058
7059static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val)
7060{
7061 struct sd *sd = (struct sd *) gspca_dev;
7062
7063 *val = sd->autogain;
7064 return 0;
7065}
7066
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007067static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val)
7068{
7069 struct sd *sd = (struct sd *) gspca_dev;
7070
7071 sd->gamma = val;
7072 if (gspca_dev->streaming)
7073 setcontrast(gspca_dev);
Jean-François Moine6d314502010-08-04 05:44:13 -03007074 return gspca_dev->usb_err;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007075}
7076
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007077static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val)
7078{
7079 struct sd *sd = (struct sd *) gspca_dev;
7080
7081 *val = sd->gamma;
7082 return 0;
7083}
7084
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007085static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
7086{
7087 struct sd *sd = (struct sd *) gspca_dev;
7088
7089 sd->lightfreq = val;
7090 if (gspca_dev->streaming)
7091 setlightfreq(gspca_dev);
Jean-François Moine6d314502010-08-04 05:44:13 -03007092 return gspca_dev->usb_err;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007093}
7094
7095static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
7096{
7097 struct sd *sd = (struct sd *) gspca_dev;
7098
7099 *val = sd->lightfreq;
7100 return 0;
7101}
7102
7103static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
7104{
7105 struct sd *sd = (struct sd *) gspca_dev;
7106
7107 sd->sharpness = val;
7108 if (gspca_dev->streaming)
7109 setsharpness(gspca_dev);
Jean-François Moine6d314502010-08-04 05:44:13 -03007110 return gspca_dev->usb_err;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007111}
7112
7113static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
7114{
7115 struct sd *sd = (struct sd *) gspca_dev;
7116
7117 *val = sd->sharpness;
7118 return 0;
7119}
7120
7121static int sd_querymenu(struct gspca_dev *gspca_dev,
7122 struct v4l2_querymenu *menu)
7123{
7124 switch (menu->id) {
7125 case V4L2_CID_POWER_LINE_FREQUENCY:
7126 switch (menu->index) {
7127 case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007128 strcpy((char *) menu->name, "NoFliker");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007129 return 0;
7130 case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007131 strcpy((char *) menu->name, "50 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007132 return 0;
7133 case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007134 strcpy((char *) menu->name, "60 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007135 return 0;
7136 }
7137 break;
7138 }
7139 return -EINVAL;
7140}
7141
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03007142static int sd_set_jcomp(struct gspca_dev *gspca_dev,
7143 struct v4l2_jpegcompression *jcomp)
7144{
7145 struct sd *sd = (struct sd *) gspca_dev;
7146
7147 if (jcomp->quality < QUALITY_MIN)
7148 sd->quality = QUALITY_MIN;
7149 else if (jcomp->quality > QUALITY_MAX)
7150 sd->quality = QUALITY_MAX;
7151 else
7152 sd->quality = jcomp->quality;
7153 if (gspca_dev->streaming)
7154 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
Jean-François Moine6d314502010-08-04 05:44:13 -03007155 return gspca_dev->usb_err;
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03007156}
7157
7158static int sd_get_jcomp(struct gspca_dev *gspca_dev,
7159 struct v4l2_jpegcompression *jcomp)
7160{
7161 struct sd *sd = (struct sd *) gspca_dev;
7162
7163 memset(jcomp, 0, sizeof *jcomp);
7164 jcomp->quality = sd->quality;
7165 jcomp->jpeg_markers = V4L2_JPEG_MARKER_DHT
7166 | V4L2_JPEG_MARKER_DQT;
7167 return 0;
7168}
7169
Hans de Goede1a3510262010-01-29 11:05:25 -03007170#ifdef CONFIG_INPUT
7171static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
7172 u8 *data, /* interrupt packet data */
7173 int len) /* interrput packet length */
7174{
7175 if (len == 8 && data[4] == 1) {
7176 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
7177 input_sync(gspca_dev->input_dev);
7178 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
7179 input_sync(gspca_dev->input_dev);
7180 }
7181
7182 return 0;
7183}
7184#endif
7185
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007186static const struct sd_desc sd_desc = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007187 .name = MODULE_NAME,
7188 .ctrls = sd_ctrls,
Mauro Carvalho Chehabd6f76b92009-07-22 00:02:29 -03007189 .nctrls = ARRAY_SIZE(sd_ctrls),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007190 .config = sd_config,
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03007191 .init = sd_init,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007192 .start = sd_start,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007193 .stop0 = sd_stop0,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007194 .pkt_scan = sd_pkt_scan,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007195 .querymenu = sd_querymenu,
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03007196 .get_jcomp = sd_get_jcomp,
7197 .set_jcomp = sd_set_jcomp,
Hans de Goede1a3510262010-01-29 11:05:25 -03007198#ifdef CONFIG_INPUT
7199 .int_pkt_scan = sd_int_pkt_scan,
7200#endif
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007201};
7202
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007203static const __devinitdata struct usb_device_id device_table[] = {
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007204 {USB_DEVICE(0x041e, 0x041e)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007205 {USB_DEVICE(0x041e, 0x4017)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03007206 {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007207 {USB_DEVICE(0x041e, 0x401e)},
7208 {USB_DEVICE(0x041e, 0x401f)},
Hans de Goede222a07f2008-09-03 17:12:20 -03007209 {USB_DEVICE(0x041e, 0x4022)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007210 {USB_DEVICE(0x041e, 0x4029)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03007211 {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
7212 {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007213 {USB_DEVICE(0x041e, 0x4036)},
7214 {USB_DEVICE(0x041e, 0x403a)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03007215 {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250},
7216 {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007217 {USB_DEVICE(0x0458, 0x7007)},
7218 {USB_DEVICE(0x0458, 0x700c)},
7219 {USB_DEVICE(0x0458, 0x700f)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007220 {USB_DEVICE(0x0461, 0x0a00)},
Fabio Rossi88a40cf2008-12-26 14:41:48 -03007221 {USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007222 {USB_DEVICE(0x046d, 0x08a0)},
7223 {USB_DEVICE(0x046d, 0x08a1)},
7224 {USB_DEVICE(0x046d, 0x08a2)},
7225 {USB_DEVICE(0x046d, 0x08a3)},
7226 {USB_DEVICE(0x046d, 0x08a6)},
7227 {USB_DEVICE(0x046d, 0x08a7)},
7228 {USB_DEVICE(0x046d, 0x08a9)},
7229 {USB_DEVICE(0x046d, 0x08aa)},
7230 {USB_DEVICE(0x046d, 0x08ac)},
7231 {USB_DEVICE(0x046d, 0x08ad)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007232 {USB_DEVICE(0x046d, 0x08ae)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007233 {USB_DEVICE(0x046d, 0x08af)},
7234 {USB_DEVICE(0x046d, 0x08b9)},
7235 {USB_DEVICE(0x046d, 0x08d7)},
7236 {USB_DEVICE(0x046d, 0x08d9)},
7237 {USB_DEVICE(0x046d, 0x08d8)},
7238 {USB_DEVICE(0x046d, 0x08da)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03007239 {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
7240 {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
7241 {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
7242 {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
7243 {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007244 {USB_DEVICE(0x055f, 0xc005)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007245 {USB_DEVICE(0x055f, 0xd003)},
7246 {USB_DEVICE(0x055f, 0xd004)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007247 {USB_DEVICE(0x0698, 0x2003)},
Hans de Goede222a07f2008-09-03 17:12:20 -03007248 {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
Douglas Schilling Landgrafd99819d2009-03-26 05:10:55 -03007249 {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007250 {USB_DEVICE(0x0ac8, 0x301b)},
7251 {USB_DEVICE(0x0ac8, 0x303b)},
Jean-Francois Moine7bd330b42009-12-02 06:06:03 -03007252 {USB_DEVICE(0x0ac8, 0x305b)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007253 {USB_DEVICE(0x0ac8, 0x307b)},
7254 {USB_DEVICE(0x10fd, 0x0128)},
Hans de Goede222a07f2008-09-03 17:12:20 -03007255 {USB_DEVICE(0x10fd, 0x804d)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007256 {USB_DEVICE(0x10fd, 0x8050)},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007257 {} /* end of entry */
7258};
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007259MODULE_DEVICE_TABLE(usb, device_table);
7260
7261/* -- device connect -- */
7262static int sd_probe(struct usb_interface *intf,
7263 const struct usb_device_id *id)
7264{
7265 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7266 THIS_MODULE);
7267}
7268
7269/* USB driver */
7270static struct usb_driver sd_driver = {
7271 .name = MODULE_NAME,
7272 .id_table = device_table,
7273 .probe = sd_probe,
7274 .disconnect = gspca_disconnect,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03007275#ifdef CONFIG_PM
7276 .suspend = gspca_suspend,
7277 .resume = gspca_resume,
7278#endif
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007279};
7280
7281static int __init sd_mod_init(void)
7282{
Alexey Klimovf69e9522009-01-01 13:02:07 -03007283 int ret;
7284 ret = usb_register(&sd_driver);
7285 if (ret < 0)
Alexey Klimove6b14842009-01-01 13:04:58 -03007286 return ret;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03007287 PDEBUG(D_PROBE, "registered");
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007288 return 0;
7289}
7290
7291static void __exit sd_mod_exit(void)
7292{
7293 usb_deregister(&sd_driver);
7294 PDEBUG(D_PROBE, "deregistered");
7295}
7296
7297module_init(sd_mod_init);
7298module_exit(sd_mod_exit);
7299
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007300module_param(force_sensor, int, 0644);
7301MODULE_PARM_DESC(force_sensor,
7302 "Force sensor. Only for experts!!!");