blob: 4f95ab8f3752c8ab4f0db72d14c3b2896cecb046 [file] [log] [blame]
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001/*
2 * Z-Star/Vimicro zc301/zc302p/vc30x library
3 * Copyright (C) 2004 2005 2006 Michel Xhaard
4 * mxhaard@magic.fr
5 *
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006 * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#define MODULE_NAME "zc3xx"
24
25#include "gspca.h"
26
Jean-Francois Moined43fa322008-06-12 10:58:58 -030027MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, "
28 "Serge A. Suchkov <Serge.A.S@tochka.ru>");
29MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
30MODULE_LICENSE("GPL");
31
Jean-Francois Moined43fa322008-06-12 10:58:58 -030032static int force_sensor = -1;
33
34#include "jpeg.h"
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -030035#include "zc3xx-reg.h"
Jean-Francois Moined43fa322008-06-12 10:58:58 -030036
37/* specific webcam descriptor */
38struct sd {
39 struct gspca_dev gspca_dev; /* !! must be the first item */
40
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030041 __u8 brightness;
42 __u8 contrast;
43 __u8 gamma;
44 __u8 autogain;
45 __u8 lightfreq;
46 __u8 sharpness;
Jean-Francois Moined43fa322008-06-12 10:58:58 -030047
48 char qindex;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -030049 signed char sensor; /* Type of image sensor chip */
Jean-Francois Moined43fa322008-06-12 10:58:58 -030050/* !! values used in different tables */
51#define SENSOR_CS2102 0
52#define SENSOR_CS2102K 1
53#define SENSOR_GC0305 2
54#define SENSOR_HDCS2020 3
55#define SENSOR_HDCS2020b 4
56#define SENSOR_HV7131B 5
57#define SENSOR_HV7131C 6
58#define SENSOR_ICM105A 7
59#define SENSOR_MC501CB 8
60#define SENSOR_OV7620 9
61/*#define SENSOR_OV7648 9 - same values */
62#define SENSOR_OV7630C 10
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030063#define SENSOR_PAS106 11
64#define SENSOR_PB0330 12
65#define SENSOR_PO2030 13
66#define SENSOR_TAS5130CK 14
67#define SENSOR_TAS5130CXX 15
68#define SENSOR_TAS5130C_VF0250 16
69#define SENSOR_MAX 17
Jean-Francois Moined43fa322008-06-12 10:58:58 -030070 unsigned short chip_revision;
71};
72
73/* V4L2 controls supported by the driver */
74static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
75static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
76static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
77static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
78static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
79static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030080static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val);
Jean-Francois Moined43fa322008-06-12 10:58:58 -030081static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030082static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
83static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
84static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
85static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moined43fa322008-06-12 10:58:58 -030086
87static struct ctrl sd_ctrls[] = {
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -030088#define BRIGHTNESS_IDX 0
Jean-Francois Moined43fa322008-06-12 10:58:58 -030089#define SD_BRIGHTNESS 0
90 {
91 {
92 .id = V4L2_CID_BRIGHTNESS,
93 .type = V4L2_CTRL_TYPE_INTEGER,
94 .name = "Brightness",
95 .minimum = 0,
96 .maximum = 255,
97 .step = 1,
98 .default_value = 128,
99 },
100 .set = sd_setbrightness,
101 .get = sd_getbrightness,
102 },
103#define SD_CONTRAST 1
104 {
105 {
106 .id = V4L2_CID_CONTRAST,
107 .type = V4L2_CTRL_TYPE_INTEGER,
108 .name = "Contrast",
109 .minimum = 0,
110 .maximum = 256,
111 .step = 1,
112 .default_value = 128,
113 },
114 .set = sd_setcontrast,
115 .get = sd_getcontrast,
116 },
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300117#define SD_GAMMA 2
118 {
119 {
120 .id = V4L2_CID_GAMMA,
121 .type = V4L2_CTRL_TYPE_INTEGER,
122 .name = "Gamma",
123 .minimum = 1,
124 .maximum = 6,
125 .step = 1,
126 .default_value = 4,
127 },
128 .set = sd_setgamma,
129 .get = sd_getgamma,
130 },
131#define SD_AUTOGAIN 3
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300132 {
133 {
134 .id = V4L2_CID_AUTOGAIN,
135 .type = V4L2_CTRL_TYPE_BOOLEAN,
136 .name = "Auto Gain",
137 .minimum = 0,
138 .maximum = 1,
139 .step = 1,
140 .default_value = 1,
141 },
142 .set = sd_setautogain,
143 .get = sd_getautogain,
144 },
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -0300145#define LIGHTFREQ_IDX 4
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300146#define SD_FREQ 4
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300147 {
148 {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300149 .id = V4L2_CID_POWER_LINE_FREQUENCY,
150 .type = V4L2_CTRL_TYPE_MENU,
151 .name = "Light frequency filter",
152 .minimum = 0,
153 .maximum = 2, /* 0: 0, 1: 50Hz, 2:60Hz */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300154 .step = 1,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300155 .default_value = 1,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300156 },
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300157 .set = sd_setfreq,
158 .get = sd_getfreq,
159 },
160#define SD_SHARPNESS 5
161 {
162 {
163 .id = V4L2_CID_SHARPNESS,
164 .type = V4L2_CTRL_TYPE_INTEGER,
165 .name = "Sharpness",
166 .minimum = 0,
167 .maximum = 3,
168 .step = 1,
169 .default_value = 2,
170 },
171 .set = sd_setsharpness,
172 .get = sd_getsharpness,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300173 },
174};
175
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300176static struct v4l2_pix_format vga_mode[] = {
177 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
178 .bytesperline = 320,
179 .sizeimage = 320 * 240 * 3 / 8 + 590,
180 .colorspace = V4L2_COLORSPACE_JPEG,
181 .priv = 1},
182 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
183 .bytesperline = 640,
184 .sizeimage = 640 * 480 * 3 / 8 + 590,
185 .colorspace = V4L2_COLORSPACE_JPEG,
186 .priv = 0},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300187};
188
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300189static struct v4l2_pix_format sif_mode[] = {
190 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
191 .bytesperline = 176,
192 .sizeimage = 176 * 144 * 3 / 8 + 590,
193 .colorspace = V4L2_COLORSPACE_JPEG,
194 .priv = 1},
195 {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
196 .bytesperline = 352,
197 .sizeimage = 352 * 288 * 3 / 8 + 590,
198 .colorspace = V4L2_COLORSPACE_JPEG,
199 .priv = 0},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300200};
201
202/* usb exchanges */
203struct usb_action {
204 __u8 req;
205 __u8 val;
206 __u16 idx;
207};
208
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300209static const struct usb_action cs2102_Initial[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300210 {0xa1, 0x01, 0x0008},
211 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300212 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
213 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
214 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
215 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
216 {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
217 {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
218 {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
219 {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
220 {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
221 {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
222 {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
223 {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
224 {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
225 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
226 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
227 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
228 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
229 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
230 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
231 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
232 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
233 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
234 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
235 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300236 {0xaa, 0x02, 0x0008},
237 {0xaa, 0x03, 0x0000},
238 {0xaa, 0x11, 0x0000},
239 {0xaa, 0x12, 0x0089},
240 {0xaa, 0x13, 0x0000},
241 {0xaa, 0x14, 0x00e9},
242 {0xaa, 0x20, 0x0000},
243 {0xaa, 0x22, 0x0000},
244 {0xaa, 0x0b, 0x0004},
245 {0xaa, 0x30, 0x0030},
246 {0xaa, 0x31, 0x0030},
247 {0xaa, 0x32, 0x0030},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300248 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
249 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
250 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
251 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
252 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
253 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
254 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300255 {0xa0, 0x10, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300256 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
257 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
258 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300259 {0xa0, 0x00, 0x01ad},
260 {0xa1, 0x01, 0x0002},
261 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300262 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
263 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300264 {0xa1, 0x01, 0x01c8},
265 {0xa1, 0x01, 0x01c9},
266 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300267 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
268 {0xa0, 0x24, ZC3XX_R120_GAMMA00}, /* gamma 5 */
269 {0xa0, 0x44, ZC3XX_R121_GAMMA01},
270 {0xa0, 0x64, ZC3XX_R122_GAMMA02},
271 {0xa0, 0x84, ZC3XX_R123_GAMMA03},
272 {0xa0, 0x9d, ZC3XX_R124_GAMMA04},
273 {0xa0, 0xb2, ZC3XX_R125_GAMMA05},
274 {0xa0, 0xc4, ZC3XX_R126_GAMMA06},
275 {0xa0, 0xd3, ZC3XX_R127_GAMMA07},
276 {0xa0, 0xe0, ZC3XX_R128_GAMMA08},
277 {0xa0, 0xeb, ZC3XX_R129_GAMMA09},
278 {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
279 {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
280 {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
281 {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
282 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
283 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
284 {0xa0, 0x18, ZC3XX_R130_GAMMA10},
285 {0xa0, 0x20, ZC3XX_R131_GAMMA11},
286 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
287 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
288 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
289 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
290 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
291 {0xa0, 0x0e, ZC3XX_R137_GAMMA17},
292 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
293 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
294 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
295 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
296 {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
297 {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
298 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
299 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
300 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
301 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
302 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
303 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
304 {0xa0, 0x58, ZC3XX_R10E_RGB11},
305 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
306 {0xa0, 0xf4, ZC3XX_R110_RGB20},
307 {0xa0, 0xf4, ZC3XX_R111_RGB21},
308 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300309 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300310 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
311 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300312 {0xaa, 0x23, 0x0001},
313 {0xaa, 0x24, 0x0055},
314 {0xaa, 0x25, 0x00cc},
315 {0xaa, 0x21, 0x003f},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300316 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
317 {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
318 {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
319 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
320 {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
321 {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
322 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
323 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
324 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
325 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
326 {0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
327 {0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
328 {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
329 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
330 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300331 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300332 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
333 {0xa0, 0x40, ZC3XX_R116_RGAIN},
334 {0xa0, 0x40, ZC3XX_R117_GGAIN},
335 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300336 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300337};
338
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300339static const struct usb_action cs2102_InitialScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300340 {0xa1, 0x01, 0x0008},
341 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300342 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
343 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
344 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
345 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
346 {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
347 {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
348 {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
349 {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
350 {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
351 {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
352 {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
353 {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
354 {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
355 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
356 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
357 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
358 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
359 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
360 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
361 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
362 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
363 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
364 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
365 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300366 {0xaa, 0x02, 0x0008},
367 {0xaa, 0x03, 0x0000},
368 {0xaa, 0x11, 0x0001},
369 {0xaa, 0x12, 0x0087},
370 {0xaa, 0x13, 0x0001},
371 {0xaa, 0x14, 0x00e7},
372 {0xaa, 0x20, 0x0000},
373 {0xaa, 0x22, 0x0000},
374 {0xaa, 0x0b, 0x0004},
375 {0xaa, 0x30, 0x0030},
376 {0xaa, 0x31, 0x0030},
377 {0xaa, 0x32, 0x0030},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300378 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
379 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
380 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
381 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
382 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
383 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
384 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300385 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300386 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
387 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
388 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300389 {0xa0, 0x00, 0x01ad},
390 {0xa1, 0x01, 0x0002},
391 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300392 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
393 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300394 {0xa1, 0x01, 0x01c8},
395 {0xa1, 0x01, 0x01c9},
396 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300397 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
398 {0xa0, 0x24, ZC3XX_R120_GAMMA00}, /* gamma 5 */
399 {0xa0, 0x44, ZC3XX_R121_GAMMA01},
400 {0xa0, 0x64, ZC3XX_R122_GAMMA02},
401 {0xa0, 0x84, ZC3XX_R123_GAMMA03},
402 {0xa0, 0x9d, ZC3XX_R124_GAMMA04},
403 {0xa0, 0xb2, ZC3XX_R125_GAMMA05},
404 {0xa0, 0xc4, ZC3XX_R126_GAMMA06},
405 {0xa0, 0xd3, ZC3XX_R127_GAMMA07},
406 {0xa0, 0xe0, ZC3XX_R128_GAMMA08},
407 {0xa0, 0xeb, ZC3XX_R129_GAMMA09},
408 {0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
409 {0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
410 {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
411 {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
412 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
413 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
414 {0xa0, 0x18, ZC3XX_R130_GAMMA10},
415 {0xa0, 0x20, ZC3XX_R131_GAMMA11},
416 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
417 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
418 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
419 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
420 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
421 {0xa0, 0x0e, ZC3XX_R137_GAMMA17},
422 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
423 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
424 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
425 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
426 {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
427 {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
428 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
429 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
430 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
431 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
432 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
433 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
434 {0xa0, 0x58, ZC3XX_R10E_RGB11},
435 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
436 {0xa0, 0xf4, ZC3XX_R110_RGB20},
437 {0xa0, 0xf4, ZC3XX_R111_RGB21},
438 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300439 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300440 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
441 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300442 {0xaa, 0x23, 0x0000},
443 {0xaa, 0x24, 0x00aa},
444 {0xaa, 0x25, 0x00e6},
445 {0xaa, 0x21, 0x003f},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300446 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
447 {0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
448 {0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
449 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
450 {0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
451 {0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
452 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
453 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
454 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
455 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
456 {0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
457 {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
458 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
459 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
460 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300461 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300462 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
463 {0xa0, 0x40, ZC3XX_R116_RGAIN},
464 {0xa0, 0x40, ZC3XX_R117_GGAIN},
465 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300466 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300467};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300468static const struct usb_action cs2102_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300469 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300470 {0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */
471 {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
472 {0xaa, 0x04, 0x00ac}, /* 00,04,ac,aa */
473 {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
474 {0xaa, 0x11, 0x00ac}, /* 00,11,ac,aa */
475 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
476 {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
477 {0xaa, 0x1d, 0x00ac}, /* 00,1d,ac,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300478 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
479 {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
480 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
481 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
482 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
483 {0xa0, 0x42, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,42,cc */
484 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
485 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
486 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
487 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
488 {0xa0, 0x8c, ZC3XX_R01D_HSYNC_0}, /* 00,1d,8c,cc */
489 {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
490 {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300491 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300492};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300493static const struct usb_action cs2102_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300494 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300495 {0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */
496 {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
497 {0xaa, 0x04, 0x00a1}, /* 00,04,a1,aa */
498 {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
499 {0xaa, 0x11, 0x00a1}, /* 00,11,a1,aa */
500 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
501 {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
502 {0xaa, 0x1d, 0x00a1}, /* 00,1d,a1,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300503 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
504 {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
505 {0xa0, 0xf7, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f7,cc */
506 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
507 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
508 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
509 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
510 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
511 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
512 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
513 {0xa0, 0x93, ZC3XX_R01D_HSYNC_0}, /* 00,1d,93,cc */
514 {0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
515 {0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300516 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300517};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300518static const struct usb_action cs2102_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300519 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300520 {0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */
521 {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
522 {0xaa, 0x04, 0x00aa}, /* 00,04,aa,aa */
523 {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
524 {0xaa, 0x11, 0x00aa}, /* 00,11,aa,aa */
525 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
526 {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
527 {0xaa, 0x1d, 0x00aa}, /* 00,1d,aa,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300528 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
529 {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
530 {0xa0, 0xe4, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e4,cc */
531 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
532 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
533 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3a,cc */
534 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
535 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
536 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
537 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
538 {0xa0, 0x5d, ZC3XX_R01D_HSYNC_0}, /* 00,1d,5d,cc */
539 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300540 {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300541 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300542};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300543static const struct usb_action cs2102_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300544 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300545 {0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */
546 {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
547 {0xaa, 0x04, 0x00be}, /* 00,04,be,aa */
548 {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
549 {0xaa, 0x11, 0x00be}, /* 00,11,be,aa */
550 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
551 {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
552 {0xaa, 0x1d, 0x00be}, /* 00,1d,be,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300553 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
554 {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
555 {0xa0, 0xfc, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,fc,cc */
556 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
557 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
558 {0xa0, 0x69, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,69,cc */
559 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
560 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
561 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
562 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
563 {0xa0, 0xb7, ZC3XX_R01D_HSYNC_0}, /* 00,1d,b7,cc */
564 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
565 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300566 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300567};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300568static const struct usb_action cs2102_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300569 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300570 {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
571 {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
572 {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
573 {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
574 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
575 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
576 {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
577 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300578 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
579 {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
580 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
581 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
582 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
583 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
584 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
585 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
586 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
587 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
588 {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
589 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
590 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300591 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300592};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300593static const struct usb_action cs2102_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300594 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300595 {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
596 {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
597 {0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
598 {0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
599 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
600 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
601 {0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
602 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300603 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
604 {0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
605 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
606 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
607 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
608 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
609 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
610 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
611 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
612 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
613 {0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
614 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
615 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300616 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300617};
618
619/* CS2102_KOCOM */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300620static const struct usb_action cs2102K_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300621 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
622 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
623 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
624 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
625 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
626 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
627 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
628 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
629 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
630 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
631 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
632 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
633 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
634 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
635 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
636 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
637 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
638 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
639 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
640 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
641 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
642 {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
643 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
644 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
645 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
646 {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
647 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
648 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
649 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
650 {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
651 {0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
652 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
653 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
654 {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
655 {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
656 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
657 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
658 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
659 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
660 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
661 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
662 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
663 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
664 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
665 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
666 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
667 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
668 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
669 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
670 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
671 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
672 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
673 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
674 {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
675 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
676 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
677 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
678 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
679 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
680 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
681 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
682 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
683 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
684 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
685 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
686 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
687 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
688 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
689 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
690 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
691 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
692 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
693 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
694 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
695 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
696 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
697 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
698 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
699 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
700 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
701 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
702 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
703 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
704 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
705 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
706 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
707 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
708 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
709 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
710 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
711 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
712 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
713 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
714 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
715 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
716 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
717 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
718 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
719 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
720 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300721 {0xa0, 0x00, 0x01ad},
722 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300723 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
724 {0xa0, 0x60, ZC3XX_R116_RGAIN},
725 {0xa0, 0x40, ZC3XX_R117_GGAIN},
726 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
727 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
728 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
729 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
730 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
731 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
732 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
733 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
734 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
735 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
736 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
737 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
738 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
739 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
740 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
741 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
742 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
743 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
744 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
745 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
746 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
747 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
748 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
749 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
750 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
751 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
752 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
753 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
754 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
755 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
756 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
757 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
758 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
759 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
760 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
761 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
762 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
763 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
764 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
765 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
766 {0xa0, 0x58, ZC3XX_R10E_RGB11},
767 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
768 {0xa0, 0xf4, ZC3XX_R110_RGB20},
769 {0xa0, 0xf4, ZC3XX_R111_RGB21},
770 {0xa0, 0x58, ZC3XX_R112_RGB22},
771 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
772 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
773 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
774 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
775 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
776 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
777 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
778 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
779 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
780 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
781 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
782 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
783 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
784 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
785 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
786 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
787 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
788 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
789 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
790 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
791 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
792 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
793 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
794 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
795 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
796 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
797 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
798 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
799 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
800 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
801 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
802 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
803 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
804 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
805 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
806 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
807 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
808 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
809 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
810 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
811 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
812 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
813 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
814 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
815 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
816 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
817 {0xa0, 0x60, ZC3XX_R116_RGAIN},
818 {0xa0, 0x40, ZC3XX_R117_GGAIN},
819 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
820 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
821 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
822 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
823 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
824 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
825 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
826 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
827 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
828 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
829 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
830 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
831 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
832 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
833 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
834 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
835 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
836 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
837 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
838 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
839 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
840 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
841 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
842 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
843 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
844 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
845 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
846 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
847 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
848 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
849 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
850 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
851 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
852 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
853 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
854 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
855 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
856 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
857 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
858 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
859 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
860 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
861 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
862 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
863 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
864 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
865 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
866 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
867 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
868 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
869 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
870 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
871 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
872 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
873 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
874 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
875 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300876 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300877};
878
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300879static const struct usb_action cs2102K_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300880 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
881 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
882 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
883 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
884 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
885 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
886 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
887 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
888 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
889 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
890 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
891 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
892 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
893 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
894 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
895 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
896 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
897 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
898 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
899 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
900 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
901 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
902 {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
903 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
904 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
905 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
906 {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
907 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
908 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
909 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
910 {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
911 {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
912 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
913 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
914 {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
915 {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
916 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
917 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
918 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
919 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
920 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
921 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
922 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
923 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
924 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
925 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
926 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
927 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
928 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
929 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
930 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
931 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
932 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
933 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
934 {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
935 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
936 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
937 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
938 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
939 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
940 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
941 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
942 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
943 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
944 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
945 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
946 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
947 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
948 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
949 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
950 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
951 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
952 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
953 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
954 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
955 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
956 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
957 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
958 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
959 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
960 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
961 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
962 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
963 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
964 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
965 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
966 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
967 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
968 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
969 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
970 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
971 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
972 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
973 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
974 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
975 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
976 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
977 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
978 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
979 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
980 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300981 {0xa0, 0x00, 0x01ad},
982 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300983 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
984 {0xa0, 0x60, ZC3XX_R116_RGAIN},
985 {0xa0, 0x40, ZC3XX_R117_GGAIN},
986 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
987 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
988 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
989 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
990 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
991 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
992 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
993 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
994 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
995 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
996 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
997 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
998 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
999 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1000 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1001 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1002 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1003 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1004 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1005 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1006 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1007 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1008 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1009 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1010 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1011 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1012 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1013 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1014 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1015 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1016 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1017 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1018 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1019 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1020 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1021 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1022 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1023 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1024 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1025 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1026 {0xa0, 0x58, ZC3XX_R10E_RGB11},
1027 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1028 {0xa0, 0xf4, ZC3XX_R110_RGB20},
1029 {0xa0, 0xf4, ZC3XX_R111_RGB21},
1030 {0xa0, 0x58, ZC3XX_R112_RGB22},
1031 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1032 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1033 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1034 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1035 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1036 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1037 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1038 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1039 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1040 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1041 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1042 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1043 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1044 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1045 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1046 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1047 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1048 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1049 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1050 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1051 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1052 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1053 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1054 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1055 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1056 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1057 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1058 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1059 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1060 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1061 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1062 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1063 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1064 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1065 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1066 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1067 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1068 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1069 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1070 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1071 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1072 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1073 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1074 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1075 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1076 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1077 {0xa0, 0x60, ZC3XX_R116_RGAIN},
1078 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1079 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1080 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1081 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1082 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1083 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1084 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1085 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1086 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1087 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1088 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1089 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1090 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1091 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1092 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1093 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1094 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1095 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1096 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1097 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1098 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
1099 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1100 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1101 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1102 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1103 {0xa0, 0x0A, ZC3XX_R092_I2CADDRESSSELECT},
1104 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1105 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1106 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1107 {0xa0, 0x0B, ZC3XX_R092_I2CADDRESSSELECT},
1108 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1109 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1110 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1111 {0xa0, 0x0C, ZC3XX_R092_I2CADDRESSSELECT},
1112 {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
1113 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1114 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1115 {0xa0, 0x0D, ZC3XX_R092_I2CADDRESSSELECT},
1116 {0xa0, 0xA3, ZC3XX_R093_I2CSETVALUE},
1117 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1118 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1119 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
1120 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
1121 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1122 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1123 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
1124 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1125 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1126 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1127 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
1128 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
1129 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1130 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1131 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
1132 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
1133 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1134 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1135 {0xa0, 0x0E, ZC3XX_R092_I2CADDRESSSELECT},
1136 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1137 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1138 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1139 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
1140 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1141 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1142 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1143 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
1144 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1145 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1146 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1147 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
1148 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1149 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1150 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1151 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
1152 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
1153 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1154 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1155 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
1156 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1157 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1158 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1159 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
1160 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1161 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1162 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1163 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
1164 {0xa0, 0x0C, ZC3XX_R093_I2CSETVALUE},
1165 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1166 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1167 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1168 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1169 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1170 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1171 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1172 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1173 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
1174 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1175 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1176 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1177 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1178 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1179 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1180 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1181 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001182 {0xa0, 0x00, 0x01ad},
1183 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001184 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1185 {0xa0, 0x60, ZC3XX_R116_RGAIN},
1186 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1187 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1188 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1189 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
1190 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1191 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1192 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1193 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1194 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1195 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1196 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1197 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1198 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1199 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1200 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1201 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1202 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1203 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1204 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1205 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1206 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1207 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1208 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1209 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1210 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1211 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1212 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1213 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1214 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1215 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1216 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1217 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1218 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1219 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1220 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1221 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1222 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1223 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1224 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1225 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1226 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1227 {0xa0, 0x58, ZC3XX_R10E_RGB11},
1228 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1229 {0xa0, 0xf4, ZC3XX_R110_RGB20},
1230 {0xa0, 0xf4, ZC3XX_R111_RGB21},
1231 {0xa0, 0x58, ZC3XX_R112_RGB22},
1232 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1233 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1234 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1235 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1236 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1237 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1238 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1239 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1240 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1241 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1242 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1243 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1244 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1245 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1246 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1247 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1248 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1249 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1250 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1251 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1252 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1253 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1254 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1255 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1256 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1257 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1258 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1259 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1260 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1261 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1262 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1263 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1264 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1265 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1266 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1267 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1268 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1269 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1270 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1271 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1272 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1273 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1274 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1275 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1276 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1277 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1278 {0xa0, 0x60, ZC3XX_R116_RGAIN},
1279 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1280 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1281 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1282 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1283 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1284 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1285 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1286 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1287 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1288 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1289 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1290 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1291 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1292 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1293 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1294 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1295 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1296 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1297 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1298 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1299 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1300 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1301 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1302 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1303 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1304 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1305 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1306 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1307 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1308 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1309 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1310 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1311 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1312 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1313 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1314 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1315 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1316 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1317 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1318 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1319 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1320 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1321 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1322 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1323 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1324 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1325 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1326 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1327 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1328 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1329 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1330 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1331 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1332 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1333 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1334 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1335 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1336 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1337 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1338 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1339 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1340 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1341 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1342 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1343 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1344 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1345 {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1346 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1347 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1348 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1349 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1350 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1351 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1352 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1353 {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1354 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1355 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1356 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1357 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1358 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1359 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1360 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1361 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1362 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1363 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1364 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1365 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
1366 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1367 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1368 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1369 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1370 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1371 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1372 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1373 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1374 {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1375 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1376 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1377 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1378 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1379 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1380 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1381 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1382 {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1383 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1384 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1385 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1386 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1387 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1388 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1389 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1390 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1391 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1392 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1393 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1394 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1395 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1396 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1397 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1398 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1399 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1400 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1401 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1402 {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1403 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1404 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1405 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1406 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1407 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1408 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1409 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1410 {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1411 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1412 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1413 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1414 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1415 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1416 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1417 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1418 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1419 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1420 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1421 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1422 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1423 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1424 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1425 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1426 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1427 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1428 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1429 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1430 {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1431 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1432 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1433 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1434 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1435 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1436 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1437 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1438 {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1439 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1440 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1441 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1442 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1443 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1444 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1445 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1446 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1447 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1448 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1449 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1450 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1451 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1452 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001453 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001454};
1455
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001456static const struct usb_action gc0305_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001457 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1458 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
1459 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
1460 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
1461 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
1462 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1463 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
1464 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
1465 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
1466 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
1467 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
1468 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
1469 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
1470 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
1471 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
1472 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
1473 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
1474 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001475 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa */
1476 {0xaa, 0x15, 0x0003}, /* 00,15,03,aa */
1477 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
1478 {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
1479 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
1480 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
1481 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
1482 {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
1483 {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001484 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
1485 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
1486 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001487 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
1488 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
1489 {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
1490 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
1491 {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
1492 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
1493 {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
1494 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
1495 {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
1496 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
1497 {0xaa, 0x17, 0x00e6}, /* 00,17,e6,aa */
1498 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
1499 {0xaa, 0x19, 0x0086}, /* 00,19,86,aa */
1500 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1501 {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001502 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
1503 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
1504 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1505 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001506 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001507 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1508 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
1509 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
1510 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
1511 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
1512 {0xa0, 0x85, ZC3XX_R18D_YTARGET}, /* 01,8d,85,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001513 {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001514 {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1515 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1516 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1517 {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001518 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001519};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001520static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001521 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1522 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
1523 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
1524 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
1525 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
1526 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1527 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
1528 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
1529 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
1530 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
1531 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
1532 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
1533 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
1534 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
1535 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
1536 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
1537 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
1538 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001539 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
1540 {0xaa, 0x15, 0x0001}, /* 00,15,01,aa */
1541 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
1542 {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
1543 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
1544 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
1545 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
1546 {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
1547 {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001548 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
1549 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
1550 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001551 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
1552 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
1553 {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
1554 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
1555 {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
1556 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
1557 {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
1558 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
1559 {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
1560 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
1561 {0xaa, 0x17, 0x00e8}, /* 00,17,e8,aa */
1562 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
1563 {0xaa, 0x19, 0x0088}, /* 00,19,88,aa */
1564 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1565 {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001566 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
1567 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
1568 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1569 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001570 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001571 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1572 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
1573 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
1574 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
1575 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001576 {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001577 {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1578 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1579 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1580 {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001581 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001582};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001583static const struct usb_action gc0305_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001584 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1585 {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */
1586 {0xaa, 0x84, 0x0038}, /* 00,84,38,aa */ /* win: 00,84,ec */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001587 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1588 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
1589 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
1590 /* win: 01,92,10 */
1591 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1592 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1593 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc */
1594 /* win: 01,97,ec */
1595 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1596 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1597 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
1598 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1599 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1600 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1601 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1602 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1603 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1604 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
1605/* {0xa0, 0x85, ZC3XX_R18D_YTARGET}, * 01,8d,85,cc *
1606 * if 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001607 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001608};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001609static const struct usb_action gc0305_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001610 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1611 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
1612 {0xaa, 0x84, 0x00ec}, /* 00,84,ec,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001613 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1614 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
1615 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
1616 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1617 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1618 {0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,ec,cc */
1619 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1620 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1621 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
1622 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1623 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1624 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1625 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1626 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1627 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1628 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
1629 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001630 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001631};
1632
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001633static const struct usb_action gc0305_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001634 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001635 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1636 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
1637 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001638 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1639 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,00,cc */
1640 {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,48,cc */
1641 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1642 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1643 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1644 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1645 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1646 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1647 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1648 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1649 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1650 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1651 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
1652 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001653 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001654};
1655
1656/* play poker with registers at your own risk !! */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001657static const struct usb_action hdcs2020xx_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001658 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1659 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1660 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},
1661 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1662 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1663 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1664 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1665 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},
1666 /* D0 ?? E0 did not start */
1667 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1668 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1669 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1670 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
1671 {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW},
1672 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
1673 {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW},
1674 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
1675 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
1676 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
1677 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
1678 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001679 {0xaa, 0x02, 0x0002},
1680 {0xaa, 0x07, 0x0006},
1681 {0xaa, 0x08, 0x0002},
1682 {0xaa, 0x09, 0x0006},
1683 {0xaa, 0x0a, 0x0001},
1684 {0xaa, 0x0b, 0x0001},
1685 {0xaa, 0x0c, 0x0008},
1686 {0xaa, 0x0d, 0x0000},
1687 {0xaa, 0x10, 0x0000},
1688 {0xaa, 0x12, 0x0005},
1689 {0xaa, 0x13, 0x0063},
1690 {0xaa, 0x15, 0x0070},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001691 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
1692 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1693 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001694 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001695 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1696 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1697 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1698 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1699 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001700 {0xa1, 0x01, 0x0002},
1701 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001702 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1703 {0xa0, 0x04, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001704 {0xa1, 0x01, 0x01c8},
1705 {0xa1, 0x01, 0x01c9},
1706 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001707 {0xa0, 0x07, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1708 {0xa0, 0x11, ZC3XX_R120_GAMMA00}, /* gamma ~4 */
1709 {0xa0, 0x37, ZC3XX_R121_GAMMA01},
1710 {0xa0, 0x58, ZC3XX_R122_GAMMA02},
1711 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1712 {0xa0, 0x91, ZC3XX_R124_GAMMA04},
1713 {0xa0, 0xa6, ZC3XX_R125_GAMMA05},
1714 {0xa0, 0xb8, ZC3XX_R126_GAMMA06},
1715 {0xa0, 0xc7, ZC3XX_R127_GAMMA07},
1716 {0xa0, 0xd3, ZC3XX_R128_GAMMA08},
1717 {0xa0, 0xde, ZC3XX_R129_GAMMA09},
1718 {0xa0, 0xe6, ZC3XX_R12A_GAMMA0A},
1719 {0xa0, 0xed, ZC3XX_R12B_GAMMA0B},
1720 {0xa0, 0xf3, ZC3XX_R12C_GAMMA0C},
1721 {0xa0, 0xf8, ZC3XX_R12D_GAMMA0D},
1722 {0xa0, 0xfb, ZC3XX_R12E_GAMMA0E},
1723 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1724 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1725 {0xa0, 0x23, ZC3XX_R131_GAMMA11},
1726 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1727 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1728 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1729 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1730 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1731 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1732 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1733 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1734 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1735 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1736 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1737 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1738 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1739 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001740
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001741 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
1742 {0xa0, 0xf5, ZC3XX_R10B_RGB01},
1743 {0xa0, 0xff, ZC3XX_R10C_RGB02},
1744 {0xa0, 0xf9, ZC3XX_R10D_RGB10},
1745 {0xa0, 0x51, ZC3XX_R10E_RGB11},
1746 {0xa0, 0xf5, ZC3XX_R10F_RGB12},
1747 {0xa0, 0xfb, ZC3XX_R110_RGB20},
1748 {0xa0, 0xed, ZC3XX_R111_RGB21},
1749 {0xa0, 0x5f, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001750
1751 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001752 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1753 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1754 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1755 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001756 {0xaa, 0x20, 0x0004},
1757 {0xaa, 0x21, 0x003d},
1758 {0xaa, 0x03, 0x0041},
1759 {0xaa, 0x04, 0x0010},
1760 {0xaa, 0x05, 0x003d},
1761 {0xaa, 0x0e, 0x0001},
1762 {0xaa, 0x0f, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001763 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
1764 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
1765 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1766 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
1767 {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
1768 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1769 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1770 {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW},
1771 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1772 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1773 {0xa0, 0x41, ZC3XX_R01D_HSYNC_0},
1774 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},
1775 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},
1776 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
1777 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},
1778 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},
1779 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001780 {0xa1, 0x01, 0x0195},
1781 {0xa1, 0x01, 0x0196},
1782 {0xa1, 0x01, 0x0197},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001783 {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
1784 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
1785 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1786 {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1787 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1788 {0xa0, 0x85, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001789 {0xa1, 0x01, 0x0116},
1790 {0xa1, 0x01, 0x0118},
1791 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001792 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1793 {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1794 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1795 {0xa0, 0x85, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001796 {0xa1, 0x01, 0x0116},
1797 {0xa1, 0x01, 0x0118},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001798/* {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001799 {0xa0, 0x00, 0x0007},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001800 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001801};
1802
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001803static const struct usb_action hdcs2020xx_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001804 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1805 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1806 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},
1807 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1808 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1809 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1810 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1811 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1812 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1813 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1814 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1815 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
1816 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1817 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
1818 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1819 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
1820 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
1821 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
1822 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
1823 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001824 {0xaa, 0x02, 0x0002},
1825 {0xaa, 0x07, 0x0006},
1826 {0xaa, 0x08, 0x0002},
1827 {0xaa, 0x09, 0x0006},
1828 {0xaa, 0x0a, 0x0001},
1829 {0xaa, 0x0b, 0x0001},
1830 {0xaa, 0x0c, 0x0008},
1831 {0xaa, 0x0d, 0x0000},
1832 {0xaa, 0x10, 0x0000},
1833 {0xaa, 0x12, 0x0005},
1834 {0xaa, 0x13, 0x0063},
1835 {0xaa, 0x15, 0x0070},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001836 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1837 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1838 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001839 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001840 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1841 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1842 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1843 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1844 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001845 {0xa1, 0x01, 0x0002},
1846 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001847 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1848 {0xa0, 0x04, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001849 {0xa1, 0x01, 0x01c8},
1850 {0xa1, 0x01, 0x01c9},
1851 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001852 {0xa0, 0x07, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1853 {0xa0, 0x11, ZC3XX_R120_GAMMA00}, /* gamma ~4*/
1854 {0xa0, 0x37, ZC3XX_R121_GAMMA01},
1855 {0xa0, 0x58, ZC3XX_R122_GAMMA02},
1856 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1857 {0xa0, 0x91, ZC3XX_R124_GAMMA04},
1858 {0xa0, 0xa6, ZC3XX_R125_GAMMA05},
1859 {0xa0, 0xb8, ZC3XX_R126_GAMMA06},
1860 {0xa0, 0xc7, ZC3XX_R127_GAMMA07},
1861 {0xa0, 0xd3, ZC3XX_R128_GAMMA08},
1862 {0xa0, 0xde, ZC3XX_R129_GAMMA09},
1863 {0xa0, 0xe6, ZC3XX_R12A_GAMMA0A},
1864 {0xa0, 0xed, ZC3XX_R12B_GAMMA0B},
1865 {0xa0, 0xf3, ZC3XX_R12C_GAMMA0C},
1866 {0xa0, 0xf8, ZC3XX_R12D_GAMMA0D},
1867 {0xa0, 0xfb, ZC3XX_R12E_GAMMA0E},
1868 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1869 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1870 {0xa0, 0x23, ZC3XX_R131_GAMMA11},
1871 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1872 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1873 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1874 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1875 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1876 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1877 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1878 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1879 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1880 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1881 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1882 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1883 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1884 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1885 {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
1886 {0xa0, 0xff, ZC3XX_R10B_RGB01},
1887 {0xa0, 0xff, ZC3XX_R10C_RGB02},
1888 {0xa0, 0xff, ZC3XX_R10D_RGB10},
1889 {0xa0, 0x60, ZC3XX_R10E_RGB11},
1890 {0xa0, 0xff, ZC3XX_R10F_RGB12},
1891 {0xa0, 0xff, ZC3XX_R110_RGB20},
1892 {0xa0, 0xff, ZC3XX_R111_RGB21},
1893 {0xa0, 0x60, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001894
1895 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001896 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1897 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1898 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1899 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001900 {0xaa, 0x20, 0x0002},
1901 {0xaa, 0x21, 0x001b},
1902 {0xaa, 0x03, 0x0044},
1903 {0xaa, 0x04, 0x0008},
1904 {0xaa, 0x05, 0x001b},
1905 {0xaa, 0x0e, 0x0001},
1906 {0xaa, 0x0f, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001907 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
1908 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
1909 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1910 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1911 {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
1912 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1913 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1914 {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW},
1915 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1916 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1917 {0xa0, 0x44, ZC3XX_R01D_HSYNC_0},
1918 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},
1919 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},
1920 {0xa0, 0xeb, ZC3XX_R020_HSYNC_3},
1921 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},
1922 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},
1923 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001924 {0xa1, 0x01, 0x0195},
1925 {0xa1, 0x01, 0x0196},
1926 {0xa1, 0x01, 0x0197},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001927 {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
1928 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1929 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1930 {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1931 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1932 {0xa0, 0x99, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001933 {0xa1, 0x01, 0x0116},
1934 {0xa1, 0x01, 0x0118},
1935 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001936 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1937 {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1938 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1939 {0xa0, 0x99, ZC3XX_R118_BGAIN},
1940/* {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001941 {0xa0, 0x00, 0x0007},
1942/* {0xa0, 0x18, 0x00fe}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001943 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001944};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001945static const struct usb_action hdcs2020xb_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001946 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1947 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1948 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* qtable 0x05 */
1949 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1950 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1951 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1952 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1953 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1954 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1955 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1956 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1957 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1958 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1959 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1960 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1961 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1962 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001963 {0xaa, 0x1c, 0x0000},
1964 {0xaa, 0x0a, 0x0001},
1965 {0xaa, 0x0b, 0x0006},
1966 {0xaa, 0x0c, 0x007b},
1967 {0xaa, 0x0d, 0x00a7},
1968 {0xaa, 0x03, 0x00fb},
1969 {0xaa, 0x05, 0x0000},
1970 {0xaa, 0x06, 0x0003},
1971 {0xaa, 0x09, 0x0008},
1972
1973 {0xaa, 0x0f, 0x0018}, /* set sensor gain */
1974 {0xaa, 0x10, 0x0018},
1975 {0xaa, 0x11, 0x0018},
1976 {0xaa, 0x12, 0x0018},
1977
1978 {0xaa, 0x15, 0x004e},
1979 {0xaa, 0x1c, 0x0004},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001980 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1981 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1982 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1983 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1984 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1985 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1986 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1987 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1988 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001989 {0xa1, 0x01, 0x0002},
1990 {0xa1, 0x01, 0x0008},
1991 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001992 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1993 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1994 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1995 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001996 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001997 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1998 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001999 {0xa1, 0x01, 0x01c8},
2000 {0xa1, 0x01, 0x01c9},
2001 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002002 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
2003 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
2004 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
2005 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
2006 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
2007 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
2008 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
2009 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
2010 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
2011 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
2012 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
2013 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
2014 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
2015 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
2016 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
2017 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
2018 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
2019 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
2020 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
2021 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
2022 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
2023 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
2024 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
2025 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
2026 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
2027 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
2028 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
2029 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
2030 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
2031 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
2032 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
2033 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
2034 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002035
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002036 {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
2037 {0xa0, 0xed, ZC3XX_R10B_RGB01},
2038 {0xa0, 0xed, ZC3XX_R10C_RGB02},
2039 {0xa0, 0xed, ZC3XX_R10D_RGB10},
2040 {0xa0, 0x66, ZC3XX_R10E_RGB11},
2041 {0xa0, 0xed, ZC3XX_R10F_RGB12},
2042 {0xa0, 0xed, ZC3XX_R110_RGB20},
2043 {0xa0, 0xed, ZC3XX_R111_RGB21},
2044 {0xa0, 0x66, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002045
2046 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002047 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2048 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002049 {0xaa, 0x13, 0x0031},
2050 {0xaa, 0x14, 0x0001},
2051 {0xaa, 0x0e, 0x0004},
2052 {0xaa, 0x19, 0x00cd},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002053 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2054 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
2055 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
2056 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2057 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2058 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
2059 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2060 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002061
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002062 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 0x14 */
2063 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
2064 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
2065 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
2066 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
2067 {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
2068 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
2069 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002070 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002071 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2072 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2073 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2074 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002075 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002076};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002077static const struct usb_action hdcs2020xb_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002078 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2079 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2080 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2081 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
2082 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2083 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2084 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2085 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2086 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2087 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2088 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2089 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2090 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2091 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2092 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2093 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2094 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002095 {0xaa, 0x1c, 0x0000},
2096 {0xaa, 0x0a, 0x0001},
2097 {0xaa, 0x0b, 0x0006},
2098 {0xaa, 0x0c, 0x007a},
2099 {0xaa, 0x0d, 0x00a7},
2100 {0xaa, 0x03, 0x00fb},
2101 {0xaa, 0x05, 0x0000},
2102 {0xaa, 0x06, 0x0003},
2103 {0xaa, 0x09, 0x0008},
2104 {0xaa, 0x0f, 0x0018}, /* original setting */
2105 {0xaa, 0x10, 0x0018},
2106 {0xaa, 0x11, 0x0018},
2107 {0xaa, 0x12, 0x0018},
2108 {0xaa, 0x15, 0x004e},
2109 {0xaa, 0x1c, 0x0004},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002110 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
2111 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2112 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
2113 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2114 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2115 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2116 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2117 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2118 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002119 {0xa1, 0x01, 0x0002},
2120 {0xa1, 0x01, 0x0008},
2121 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002122 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2123 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2124 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2125 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002126 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002127 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2128 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002129 {0xa1, 0x01, 0x01c8},
2130 {0xa1, 0x01, 0x01c9},
2131 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002132 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
2133 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
2134 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
2135 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
2136 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
2137 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
2138 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
2139 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
2140 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
2141 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
2142 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
2143 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
2144 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
2145 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
2146 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
2147 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
2148 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
2149 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
2150 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
2151 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
2152 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
2153 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
2154 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
2155 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
2156 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
2157 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
2158 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
2159 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
2160 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
2161 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
2162 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
2163 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
2164 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
2165 {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
2166 {0xa0, 0xed, ZC3XX_R10B_RGB01},
2167 {0xa0, 0xed, ZC3XX_R10C_RGB02},
2168 {0xa0, 0xed, ZC3XX_R10D_RGB10},
2169 {0xa0, 0x66, ZC3XX_R10E_RGB11},
2170 {0xa0, 0xed, ZC3XX_R10F_RGB12},
2171 {0xa0, 0xed, ZC3XX_R110_RGB20},
2172 {0xa0, 0xed, ZC3XX_R111_RGB21},
2173 {0xa0, 0x66, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002174 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002175 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2176 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002177 /**** set exposure ***/
2178 {0xaa, 0x13, 0x0031},
2179 {0xaa, 0x14, 0x0001},
2180 {0xaa, 0x0e, 0x0004},
2181 {0xaa, 0x19, 0x00cd},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002182 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2183 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
2184 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
2185 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2186 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2187 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
2188 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2189 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2190 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
2191 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
2192 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
2193 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
2194 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
2195 {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
2196 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
2197 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002198 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002199 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2200 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2201 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2202 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002203 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002204};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002205static const struct usb_action hdcs2020b_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002206 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03002207 {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
2208 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2209 {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */
2210 {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002211 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2212 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2213 {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
2214 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2215 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2216 {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
2217 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2218 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2219 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
2220 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
2221 {0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
2222 {0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
2223 {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002224 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002225};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002226static const struct usb_action hdcs2020b_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002227 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03002228 {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
2229 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2230 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
2231 {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002232 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2233 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2234 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
2235 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2236 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2237 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
2238 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2239 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2240 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
2241 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
2242 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
2243 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
2244 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002245 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002246};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002247static const struct usb_action hdcs2020b_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002248 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03002249 {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
2250 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2251 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
2252 {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002253 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2254 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2255 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
2256 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2257 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2258 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2259 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2260 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2261 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2262 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2263 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
2264 {0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
2265 {0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002266 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002267};
2268
Jean-Francois Moine03bf7562008-11-06 14:47:13 -03002269static const struct usb_action hv7131bxx_Initial[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002270 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2271 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2272 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
2273 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2274 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2275 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
2276 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2277 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2278 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2279 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2280 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2281 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2282 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2283 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2284 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2285 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002286 {0xaa, 0x30, 0x002d},
2287 {0xaa, 0x01, 0x0005},
2288 {0xaa, 0x11, 0x0000},
2289 {0xaa, 0x13, 0x0001}, /* {0xaa, 0x13, 0x0000}, */
2290 {0xaa, 0x14, 0x0001},
2291 {0xaa, 0x15, 0x00e8},
2292 {0xaa, 0x16, 0x0002},
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03002293 {0xaa, 0x17, 0x0086}, /* 00,17,88,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002294 {0xaa, 0x31, 0x0038},
2295 {0xaa, 0x32, 0x0038},
2296 {0xaa, 0x33, 0x0038},
2297 {0xaa, 0x5b, 0x0001},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002298 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2299 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2300 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2301 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
2302 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002303 {0xa0, 0x00, 0x01ad},
2304 {0xa0, 0xc0, 0x019b},
2305 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002306 {0xa0, 0x02, ZC3XX_R188_MINGAIN},
2307 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2308 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2309 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2310 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2311 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03002312 {0xaa, 0x02, 0x0090}, /* 00,02,80,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002313 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002314};
2315
Jean-Francois Moine03bf7562008-11-06 14:47:13 -03002316static const struct usb_action hv7131bxx_InitialScale[] = { /* 640x480*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002317 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2318 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2319 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
2320 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2321 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2322 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
2323 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2324 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2325 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2326 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2327 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2328 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2329 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2330 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2331 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2332 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002333 {0xaa, 0x30, 0x002d},
2334 {0xaa, 0x01, 0x0005},
2335 {0xaa, 0x11, 0x0001},
2336 {0xaa, 0x13, 0x0000}, /* {0xaa, 0x13, 0x0001}; */
2337 {0xaa, 0x14, 0x0001},
2338 {0xaa, 0x15, 0x00e6},
2339 {0xaa, 0x16, 0x0002},
2340 {0xaa, 0x17, 0x0086},
2341 {0xaa, 0x31, 0x0038},
2342 {0xaa, 0x32, 0x0038},
2343 {0xaa, 0x33, 0x0038},
2344 {0xaa, 0x5b, 0x0001},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002345 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2346 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2347 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2348 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
2349 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002350 {0xa0, 0x00, 0x01ad},
2351 {0xa0, 0xc0, 0x019b},
2352 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002353 {0xa0, 0x02, ZC3XX_R188_MINGAIN},
2354 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2355 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2356 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2357 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2358 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002359 {0xaa, 0x02, 0x0090}, /* {0xaa, 0x02, 0x0080}, */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002360 {}
2361};
2362static const struct usb_action hv7131b_50HZ[] = { /* 640x480*/
2363 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2364 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
2365 {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
2366 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
2367 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2368 {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
2369 {0xaa, 0x22, 0x001b}, /* 00,22,1b,aa */
2370 {0xaa, 0x23, 0x00fc}, /* 00,23,fc,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002371 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2372 {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
2373 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
2374 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2375 {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,ea,cc */
2376 {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,60,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002377 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
2378 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
2379 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
2380 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
2381 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2382 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
2383 {0xa0, 0x1b, ZC3XX_R01F_HSYNC_2}, /* 00,1f,1b,cc */
2384 {0xa0, 0xfc, ZC3XX_R020_HSYNC_3}, /* 00,20,fc,cc */
2385 {}
2386};
2387static const struct usb_action hv7131b_50HZScale[] = { /* 320x240 */
2388 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2389 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
2390 {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
2391 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
2392 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2393 {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
2394 {0xaa, 0x22, 0x0012}, /* 00,22,12,aa */
2395 {0xaa, 0x23, 0x0080}, /* 00,23,80,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002396 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2397 {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
2398 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
2399 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
2400 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,d4,cc */
2401 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,c0,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002402 {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
2403 {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
2404 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
2405 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
2406 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2407 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
2408 {0xa0, 0x12, ZC3XX_R01F_HSYNC_2}, /* 00,1f,12,cc */
2409 {0xa0, 0x80, ZC3XX_R020_HSYNC_3}, /* 00,20,80,cc */
2410 {}
2411};
2412static const struct usb_action hv7131b_60HZ[] = { /* 640x480*/
2413 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2414 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
2415 {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
2416 {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
2417 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2418 {0xaa, 0x21, 0x0040}, /* 00,21,40,aa */
2419 {0xaa, 0x22, 0x0013}, /* 00,22,13,aa */
2420 {0xaa, 0x23, 0x004c}, /* 00,23,4c,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002421 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2422 {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
2423 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
2424 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2425 {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,c3,cc */
2426 {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,50,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002427 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
2428 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
2429 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
2430 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
2431 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2432 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
2433 {0xa0, 0x13, ZC3XX_R01F_HSYNC_2}, /* 00,1f,13,cc */
2434 {0xa0, 0x4c, ZC3XX_R020_HSYNC_3}, /* 00,20,4c,cc */
2435 {}
2436};
2437static const struct usb_action hv7131b_60HZScale[] = { /* 320x240 */
2438 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2439 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
2440 {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
2441 {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
2442 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2443 {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
2444 {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
2445 {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002446 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2447 {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
2448 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
2449 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
2450 {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,86,cc */
2451 {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,a0,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002452 {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
2453 {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
2454 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
2455 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
2456 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2457 {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
2458 {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
2459 {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
2460 {}
2461};
2462static const struct usb_action hv7131b_NoFliker[] = { /* 640x480*/
2463 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2464 {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
2465 {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
2466 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
2467 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2468 {0xaa, 0x21, 0x0010}, /* 00,21,10,aa */
2469 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2470 {0xaa, 0x23, 0x0003}, /* 00,23,03,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002471 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2472 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
2473 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
2474 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2475 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
2476 {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002477 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2478 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2479 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2480 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2481 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2482 {0xa0, 0x10, ZC3XX_R01E_HSYNC_1}, /* 00,1e,10,cc */
2483 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2}, /* 00,1f,00,cc */
2484 {0xa0, 0x03, ZC3XX_R020_HSYNC_3}, /* 00,20,03,cc */
2485 {}
2486};
2487static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
2488 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2489 {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
2490 {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
2491 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
2492 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2493 {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
2494 {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
2495 {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002496 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2497 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
2498 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
2499 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2500 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
2501 {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002502 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2503 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2504 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2505 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2506 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2507 {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
2508 {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
2509 {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002510 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002511};
2512
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002513static const struct usb_action hv7131cxx_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002514 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2515 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2516 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2517 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2518 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2519 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2520 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2521 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2522 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2523 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2524 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2525 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2526 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2527 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2528 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2529 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2530 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2531 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2532 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2533 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2534 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002535 {0xaa, 0x01, 0x000c},
2536 {0xaa, 0x11, 0x0000},
2537 {0xaa, 0x13, 0x0000},
2538 {0xaa, 0x14, 0x0001},
2539 {0xaa, 0x15, 0x00e8},
2540 {0xaa, 0x16, 0x0002},
2541 {0xaa, 0x17, 0x0088},
2542
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002543 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2544 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2545 {0xa0, 0x89, ZC3XX_R18D_YTARGET},
2546 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002547 {0xa0, 0x00, 0x01ad},
2548 {0xa0, 0xc0, 0x019b},
2549 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002550 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2551 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2552 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2553 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2554 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002555 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002556 {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2557 {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002558 {0xa1, 0x01, 0x0091},
2559 {0xa1, 0x01, 0x0095},
2560 {0xa1, 0x01, 0x0096},
2561
2562 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002563 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2564 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002565 {0xa1, 0x01, 0x01c8},
2566 {0xa1, 0x01, 0x01c9},
2567 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002568 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002569
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002570 {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
2571 {0xa0, 0xf0, ZC3XX_R10B_RGB01},
2572 {0xa0, 0xf0, ZC3XX_R10C_RGB02},
2573 {0xa0, 0xf0, ZC3XX_R10D_RGB10},
2574 {0xa0, 0x60, ZC3XX_R10E_RGB11},
2575 {0xa0, 0xf0, ZC3XX_R10F_RGB12},
2576 {0xa0, 0xf0, ZC3XX_R110_RGB20},
2577 {0xa0, 0xf0, ZC3XX_R111_RGB21},
2578 {0xa0, 0x60, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002579 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002580 {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2581 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002582 {0xaa, 0x25, 0x0007},
2583 {0xaa, 0x26, 0x0053},
2584 {0xaa, 0x27, 0x0000},
2585
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002586 {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 2f */
2587 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 9b */
2588 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 80 */
2589 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2590 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2591 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2592 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2593 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2594 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2595 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2596 {0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002597 {0xa1, 0x01, 0x001d},
2598 {0xa1, 0x01, 0x001e},
2599 {0xa1, 0x01, 0x001f},
2600 {0xa1, 0x01, 0x0020},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002601 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002602 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002603 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002604 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002605};
2606
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002607static const struct usb_action hv7131cxx_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002608 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002609
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002610 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* diff */
2611 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2612 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2613 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2614 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002615
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002616 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2617 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002618
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002619 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2620 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2621 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2622 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 1e0 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002623
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002624 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2625 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2626 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2627 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2628 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2629 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2630 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2631 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2632 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002633 {0xaa, 0x01, 0x000c},
2634 {0xaa, 0x11, 0x0000},
2635 {0xaa, 0x13, 0x0000},
2636 {0xaa, 0x14, 0x0001},
2637 {0xaa, 0x15, 0x00e8},
2638 {0xaa, 0x16, 0x0002},
2639 {0xaa, 0x17, 0x0088},
2640
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002641 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002642
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002643 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2644 {0xa0, 0x89, ZC3XX_R18D_YTARGET},
2645 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002646 {0xa0, 0x00, 0x01ad},
2647 {0xa0, 0xc0, 0x019b},
2648 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002649 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2650 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2651 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2652 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2653 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002654 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002655 {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
2656 /* read the i2c chips ident */
2657 {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002658 {0xa1, 0x01, 0x0091},
2659 {0xa1, 0x01, 0x0095},
2660 {0xa1, 0x01, 0x0096},
2661
2662 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002663 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2664 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002665 {0xa1, 0x01, 0x01c8},
2666 {0xa1, 0x01, 0x01c9},
2667 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002668 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002669
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002670 {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
2671 {0xa0, 0xf0, ZC3XX_R10B_RGB01},
2672 {0xa0, 0xf0, ZC3XX_R10C_RGB02},
2673 {0xa0, 0xf0, ZC3XX_R10D_RGB10},
2674 {0xa0, 0x60, ZC3XX_R10E_RGB11},
2675 {0xa0, 0xf0, ZC3XX_R10F_RGB12},
2676 {0xa0, 0xf0, ZC3XX_R110_RGB20},
2677 {0xa0, 0xf0, ZC3XX_R111_RGB21},
2678 {0xa0, 0x60, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002679 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002680 {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
2681 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002682 {0xaa, 0x25, 0x0007},
2683 {0xaa, 0x26, 0x0053},
2684 {0xaa, 0x27, 0x0000},
2685
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002686 {0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 2f */
2687 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 9b */
2688 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 80 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002689
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002690 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2691 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2692 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002693
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002694 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2695 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2696 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2697 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2698 {0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002699 {0xa1, 0x01, 0x001d},
2700 {0xa1, 0x01, 0x001e},
2701 {0xa1, 0x01, 0x001f},
2702 {0xa1, 0x01, 0x0020},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002703 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002704 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002705 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002706 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002707};
2708
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002709static const struct usb_action icm105axx_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002710 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2711 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2712 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2713 {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2714 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2715 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2716 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2717 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2718 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2719 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2720 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2721 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2722 {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2723 {0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
2724 {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2725 {0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
2726 {0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
2727 {0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
2728 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2729 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2730 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2731 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2732 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2733 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2734 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2735 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2736 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002737 {0xaa, 0x01, 0x0010},
2738 {0xaa, 0x03, 0x0000},
2739 {0xaa, 0x04, 0x0001},
2740 {0xaa, 0x05, 0x0020},
2741 {0xaa, 0x06, 0x0001},
2742 {0xaa, 0x08, 0x0000},
2743 {0xaa, 0x03, 0x0001},
2744 {0xaa, 0x04, 0x0011},
2745 {0xaa, 0x05, 0x00a0},
2746 {0xaa, 0x06, 0x0001},
2747 {0xaa, 0x08, 0x0000},
2748 {0xaa, 0x03, 0x0002},
2749 {0xaa, 0x04, 0x0013},
2750 {0xaa, 0x05, 0x0020},
2751 {0xaa, 0x06, 0x0001},
2752 {0xaa, 0x08, 0x0000},
2753 {0xaa, 0x03, 0x0003},
2754 {0xaa, 0x04, 0x0015},
2755 {0xaa, 0x05, 0x0020},
2756 {0xaa, 0x06, 0x0005},
2757 {0xaa, 0x08, 0x0000},
2758 {0xaa, 0x03, 0x0004},
2759 {0xaa, 0x04, 0x0017},
2760 {0xaa, 0x05, 0x0020},
2761 {0xaa, 0x06, 0x000d},
2762 {0xaa, 0x08, 0x0000},
2763 {0xaa, 0x03, 0x0005},
2764 {0xaa, 0x04, 0x0019},
2765 {0xaa, 0x05, 0x0020},
2766 {0xaa, 0x06, 0x0005},
2767 {0xaa, 0x08, 0x0000},
2768 {0xaa, 0x03, 0x0006},
2769 {0xaa, 0x04, 0x0017},
2770 {0xaa, 0x05, 0x0026},
2771 {0xaa, 0x06, 0x0005},
2772 {0xaa, 0x08, 0x0000},
2773 {0xaa, 0x03, 0x0007},
2774 {0xaa, 0x04, 0x0019},
2775 {0xaa, 0x05, 0x0022},
2776 {0xaa, 0x06, 0x0005},
2777 {0xaa, 0x08, 0x0000},
2778 {0xaa, 0x03, 0x0008},
2779 {0xaa, 0x04, 0x0021},
2780 {0xaa, 0x05, 0x00aa},
2781 {0xaa, 0x06, 0x0005},
2782 {0xaa, 0x08, 0x0000},
2783 {0xaa, 0x03, 0x0009},
2784 {0xaa, 0x04, 0x0023},
2785 {0xaa, 0x05, 0x00aa},
2786 {0xaa, 0x06, 0x000d},
2787 {0xaa, 0x08, 0x0000},
2788 {0xaa, 0x03, 0x000a},
2789 {0xaa, 0x04, 0x0025},
2790 {0xaa, 0x05, 0x00aa},
2791 {0xaa, 0x06, 0x0005},
2792 {0xaa, 0x08, 0x0000},
2793 {0xaa, 0x03, 0x000b},
2794 {0xaa, 0x04, 0x00ec},
2795 {0xaa, 0x05, 0x002e},
2796 {0xaa, 0x06, 0x0005},
2797 {0xaa, 0x08, 0x0000},
2798 {0xaa, 0x03, 0x000c},
2799 {0xaa, 0x04, 0x00fa},
2800 {0xaa, 0x05, 0x002a},
2801 {0xaa, 0x06, 0x0005},
2802 {0xaa, 0x08, 0x0000},
2803 {0xaa, 0x07, 0x000d},
2804 {0xaa, 0x01, 0x0005},
2805 {0xaa, 0x94, 0x0002},
2806 {0xaa, 0x90, 0x0000},
2807 {0xaa, 0x91, 0x001f},
2808 {0xaa, 0x10, 0x0064},
2809 {0xaa, 0x9b, 0x00f0},
2810 {0xaa, 0x9c, 0x0002},
2811 {0xaa, 0x14, 0x001a},
2812 {0xaa, 0x20, 0x0080},
2813 {0xaa, 0x22, 0x0080},
2814 {0xaa, 0x24, 0x0080},
2815 {0xaa, 0x26, 0x0080},
2816 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002817 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2818 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002819 {0xaa, 0xa8, 0x00c0},
2820 {0xa1, 0x01, 0x0002},
2821 {0xa1, 0x01, 0x0008},
2822 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002823 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2824 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2825 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2826 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002827 {0xa1, 0x01, 0x0008},
2828
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002829 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2830 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002831 {0xa1, 0x01, 0x01c8},
2832 {0xa1, 0x01, 0x01c9},
2833 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002834 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
2835 {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2836 {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2837 {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2838 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2839 {0xa0, 0x52, ZC3XX_R10E_RGB11},
2840 {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2841 {0xa0, 0xf7, ZC3XX_R110_RGB20},
2842 {0xa0, 0xf7, ZC3XX_R111_RGB21},
2843 {0xa0, 0x52, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002844 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002845 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2846 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002847 {0xaa, 0x0d, 0x0003},
2848 {0xaa, 0x0c, 0x008c},
2849 {0xaa, 0x0e, 0x0095},
2850 {0xaa, 0x0f, 0x0002},
2851 {0xaa, 0x1c, 0x0094},
2852 {0xaa, 0x1d, 0x0002},
2853 {0xaa, 0x20, 0x0080},
2854 {0xaa, 0x22, 0x0080},
2855 {0xaa, 0x24, 0x0080},
2856 {0xaa, 0x26, 0x0080},
2857 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002858 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2859 {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
2860 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2861 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2862 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
2863 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2864 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2865 {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
2866 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2867 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2868 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2869 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2870 {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
2871 {0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
2872 {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
2873 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2874 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2875 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
2876 {0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
2877 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002878 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002879 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2880 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2881 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2882 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002883 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002884};
2885
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002886static const struct usb_action icm105axx_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002887 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2888 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2889 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2890 {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2891 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2892 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2893 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2894 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2895 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2896 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2897 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2898 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2899 {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2900 {0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
2901 {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2902 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
2903 {0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
2904 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
2905 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2906 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2907 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2908 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2909 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2910 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2911 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2912 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2913 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002914 {0xaa, 0x01, 0x0010},
2915 {0xaa, 0x03, 0x0000},
2916 {0xaa, 0x04, 0x0001},
2917 {0xaa, 0x05, 0x0020},
2918 {0xaa, 0x06, 0x0001},
2919 {0xaa, 0x08, 0x0000},
2920 {0xaa, 0x03, 0x0001},
2921 {0xaa, 0x04, 0x0011},
2922 {0xaa, 0x05, 0x00a0},
2923 {0xaa, 0x06, 0x0001},
2924 {0xaa, 0x08, 0x0000},
2925 {0xaa, 0x03, 0x0002},
2926 {0xaa, 0x04, 0x0013},
2927 {0xaa, 0x05, 0x0020},
2928 {0xaa, 0x06, 0x0001},
2929 {0xaa, 0x08, 0x0000},
2930 {0xaa, 0x03, 0x0003},
2931 {0xaa, 0x04, 0x0015},
2932 {0xaa, 0x05, 0x0020},
2933 {0xaa, 0x06, 0x0005},
2934 {0xaa, 0x08, 0x0000},
2935 {0xaa, 0x03, 0x0004},
2936 {0xaa, 0x04, 0x0017},
2937 {0xaa, 0x05, 0x0020},
2938 {0xaa, 0x06, 0x000d},
2939 {0xaa, 0x08, 0x0000},
2940 {0xaa, 0x03, 0x0005},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002941 {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
2942 {0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
2943 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002944 {0xa1, 0x01, 0x0091},
2945 {0xaa, 0x05, 0x0020},
2946 {0xaa, 0x06, 0x0005},
2947 {0xaa, 0x08, 0x0000},
2948 {0xaa, 0x03, 0x0006},
2949 {0xaa, 0x04, 0x0017},
2950 {0xaa, 0x05, 0x0026},
2951 {0xaa, 0x06, 0x0005},
2952 {0xaa, 0x08, 0x0000},
2953 {0xaa, 0x03, 0x0007},
2954 {0xaa, 0x04, 0x0019},
2955 {0xaa, 0x05, 0x0022},
2956 {0xaa, 0x06, 0x0005},
2957 {0xaa, 0x08, 0x0000},
2958 {0xaa, 0x03, 0x0008},
2959 {0xaa, 0x04, 0x0021},
2960 {0xaa, 0x05, 0x00aa},
2961 {0xaa, 0x06, 0x0005},
2962 {0xaa, 0x08, 0x0000},
2963 {0xaa, 0x03, 0x0009},
2964 {0xaa, 0x04, 0x0023},
2965 {0xaa, 0x05, 0x00aa},
2966 {0xaa, 0x06, 0x000d},
2967 {0xaa, 0x08, 0x0000},
2968 {0xaa, 0x03, 0x000a},
2969 {0xaa, 0x04, 0x0025},
2970 {0xaa, 0x05, 0x00aa},
2971 {0xaa, 0x06, 0x0005},
2972 {0xaa, 0x08, 0x0000},
2973 {0xaa, 0x03, 0x000b},
2974 {0xaa, 0x04, 0x00ec},
2975 {0xaa, 0x05, 0x002e},
2976 {0xaa, 0x06, 0x0005},
2977 {0xaa, 0x08, 0x0000},
2978 {0xaa, 0x03, 0x000c},
2979 {0xaa, 0x04, 0x00fa},
2980 {0xaa, 0x05, 0x002a},
2981 {0xaa, 0x06, 0x0005},
2982 {0xaa, 0x08, 0x0000},
2983 {0xaa, 0x07, 0x000d},
2984 {0xaa, 0x01, 0x0005},
2985 {0xaa, 0x94, 0x0002},
2986 {0xaa, 0x90, 0x0000},
2987 {0xaa, 0x91, 0x0010},
2988 {0xaa, 0x10, 0x0064},
2989 {0xaa, 0x9b, 0x00f0},
2990 {0xaa, 0x9c, 0x0002},
2991 {0xaa, 0x14, 0x001a},
2992 {0xaa, 0x20, 0x0080},
2993 {0xaa, 0x22, 0x0080},
2994 {0xaa, 0x24, 0x0080},
2995 {0xaa, 0x26, 0x0080},
2996 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002997 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2998 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002999 {0xaa, 0xa8, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003000 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003001 {0xa1, 0x01, 0x0002},
3002 {0xa1, 0x01, 0x0008},
3003 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003004 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3005 {0xa0, 0x40, ZC3XX_R116_RGAIN},
3006 {0xa0, 0x40, ZC3XX_R117_GGAIN},
3007 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003008 {0xa1, 0x01, 0x0008},
3009
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003010 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
3011 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003012 {0xa1, 0x01, 0x01c8},
3013 {0xa1, 0x01, 0x01c9},
3014 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003015 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003016
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003017 {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
3018 {0xa0, 0xf7, ZC3XX_R10B_RGB01},
3019 {0xa0, 0xf7, ZC3XX_R10C_RGB02},
3020 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3021 {0xa0, 0x52, ZC3XX_R10E_RGB11},
3022 {0xa0, 0xf7, ZC3XX_R10F_RGB12},
3023 {0xa0, 0xf7, ZC3XX_R110_RGB20},
3024 {0xa0, 0xf7, ZC3XX_R111_RGB21},
3025 {0xa0, 0x52, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003026 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003027 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3028 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003029 {0xaa, 0x0d, 0x0003},
3030 {0xaa, 0x0c, 0x0020},
3031 {0xaa, 0x0e, 0x000e},
3032 {0xaa, 0x0f, 0x0002},
3033 {0xaa, 0x1c, 0x000d},
3034 {0xaa, 0x1d, 0x0002},
3035 {0xaa, 0x20, 0x0080},
3036 {0xaa, 0x22, 0x0080},
3037 {0xaa, 0x24, 0x0080},
3038 {0xaa, 0x26, 0x0080},
3039 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003040 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
3041 {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
3042 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3043 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
3044 {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
3045 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3046 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3047 {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
3048 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3049 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3050 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3051 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
3052 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
3053 {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
3054 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
3055 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
3056 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
3057 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003058 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003059 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3060 {0xa0, 0x40, ZC3XX_R116_RGAIN},
3061 {0xa0, 0x40, ZC3XX_R117_GGAIN},
3062 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003063 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003064};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003065static const struct usb_action icm105a_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003066 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003067 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3068 {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
3069 {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
3070 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3071 {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
3072 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3073 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3074 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3075 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3076 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3077 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003078 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3079 {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
3080 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3081 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3082 {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
3083 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3084 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3085 {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
3086 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3087 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3088 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
3089 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
3090 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
3091 {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
3092 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
3093 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003094 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003095};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003096static const struct usb_action icm105a_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003097 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003098 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3099 {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
3100 {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
3101 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3102 {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
3103 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3104 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3105 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3106 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3107 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3108 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003109 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3110 {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
3111 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3112 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3113 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
3114 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3115 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3116 {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
3117 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3118 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3119 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
3120 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
3121 {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
3122 {0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
3123 {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
3124 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3125 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
3126 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003127 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003128};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003129static const struct usb_action icm105a_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003130 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003131 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3132 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3133 {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
3134 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3135 {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
3136 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3137 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3138 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3139 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3140 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3141 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003142 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3143 {0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
3144 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3145 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3146 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
3147 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3148 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3149 {0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
3150 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3151 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3152 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
3153 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
3154 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
3155 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
3156 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
3157 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003158 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003159};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003160static const struct usb_action icm105a_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003161 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003162 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3163 {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
3164 {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
3165 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3166 {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
3167 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3168 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3169 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3170 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3171 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3172 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003173 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3174 {0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
3175 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3176 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3177 {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
3178 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3179 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3180 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
3181 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3182 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3183 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
3184 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
3185 {0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
3186 {0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
3187 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
3188 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3189 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
3190 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003191 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003192};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003193static const struct usb_action icm105a_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003194 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003195 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3196 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3197 {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
3198 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3199 {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
3200 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3201 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3202 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3203 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3204 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3205 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003206 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3207 {0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
3208 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3209 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3210 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
3211 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3212 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3213 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
3214 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3215 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3216 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
3217 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
3218 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
3219 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
3220 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
3221 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003222 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003223};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003224static const struct usb_action icm105a_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003225 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003226 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
3227 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
3228 {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
3229 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
3230 {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
3231 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
3232 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
3233 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
3234 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
3235 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
3236 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003237 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
3238 {0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
3239 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3240 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3241 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
3242 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3243 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3244 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
3245 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3246 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3247 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
3248 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
3249 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
3250 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
3251 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
3252 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
3253 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
3254 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003255 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003256};
3257
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003258static const struct usb_action MC501CB_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003259 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3260 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
3261 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
3262 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3263 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
3264 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3265 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3266 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3267 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3268 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3269 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3270 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3271 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3272 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3273 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3274 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3275 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3276 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3277 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3278 {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
3279 {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
3280 {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
3281 {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
3282 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003283 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3284 {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3285 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3286 {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3287 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3288 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3289 {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3290 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3291 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3292 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3293 {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3294 {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3295 {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
3296 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3297 {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
3298 {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3299 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3300 {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3301 {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3302 {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3303 {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3304 {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3305 {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3306 {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3307 {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3308 {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3309 {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3310 {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3311 {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3312 {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3313 {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3314 {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3315 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3316 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3317 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003318 {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003319 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3320 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3321 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3322 {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3323 {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3324 {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3325 {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3326 {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3327 {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3328 {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3329 {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3330 {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3331 {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3332 {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3333 {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3334 {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3335 {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3336 {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3337 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3338 {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3339 {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3340 {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3341 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3342 {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
3343 {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3344 {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
3345 {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
3346 {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
3347 {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
3348 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3349 {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003350 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3351 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3352 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3353 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3354 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3355 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3356 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3357 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3358 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003359 {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3360 {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
3361 {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
3362 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3363 {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3364 {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3365 {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3366 {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3367 {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3368 {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3369
3370 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3371 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3372 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3373 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3374 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003375 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003376};
3377
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003378static const struct usb_action MC501CB_Initial[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003379 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3380 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
3381 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
3382 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3383 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
3384 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3385 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3386 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3387 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3388 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3389 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3390 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3391 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3392 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3393 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3394 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3395 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
3396 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3397 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
3398 {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
3399 {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
3400 {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
3401 {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
3402 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003403 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3404 {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
3405 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
3406 {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
3407 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3408 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
3409 {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
3410 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
3411 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3412 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
3413 {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
3414 {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
3415 {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
3416 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3417 {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
3418 {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
3419 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
3420 {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
3421 {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
3422 {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
3423 {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
3424 {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
3425 {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
3426 {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
3427 {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
3428 {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
3429 {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
3430 {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
3431 {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
3432 {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
3433 {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
3434 {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
3435 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
3436 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3437 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003438 {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003439 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3440 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3441 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3442 {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3443 {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3444 {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3445 {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3446 {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3447 {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3448 {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3449 {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3450 {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3451 {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3452 {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3453 {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3454 {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3455 {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3456 {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3457 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3458 {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3459 {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3460 {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3461 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3462 {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
3463 {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3464 {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
3465 {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
3466 {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
3467 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3468 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3469 {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003470 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3471 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3472 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3473 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3474 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3475 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3476 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3477 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3478 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003479 {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3480 {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
3481 {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
3482 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3483 {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3484 {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3485 {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3486 {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3487 {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3488 {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3489 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3490 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3491 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3492 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3493 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003494 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003495};
3496
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003497static const struct usb_action MC501CB_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003498 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3499 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3500 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3501 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3502 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3503 {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
3504 {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
3505 {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
3506 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3507 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3508 {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3509 {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3510 {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003511 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003512};
3513
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003514static const struct usb_action MC501CB_50HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003515 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3516 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3517 {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3518 {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3519 {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3520 {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
3521 {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
3522 {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
3523 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3524 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3525 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3526 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3527 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003528 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003529};
3530
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003531static const struct usb_action MC501CB_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003532 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3533 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3534 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3535 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3536 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3537 {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3538 {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3539 {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3540 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3541 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3542 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3543 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3544 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003545 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003546};
3547
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003548static const struct usb_action MC501CB_60HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003549 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3550 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3551 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3552 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3553 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3554 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3555 {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3556 {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3557 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3558 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3559 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3560 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3561 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003562 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003563};
3564
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003565static const struct usb_action MC501CB_NoFliker[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003566 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3567 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3568 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3569 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3570 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3571 {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3572 {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3573 {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3574 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3575 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3576 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3577 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3578 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003579 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003580};
3581
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003582static const struct usb_action MC501CB_NoFlikerScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003583 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3584 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3585 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3586 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3587 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3588 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3589 {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3590 {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003591 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003592};
3593
3594/* from zs211.inf - HKR,%OV7620%,Initial - 640x480 */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003595static const struct usb_action OV7620_mode0[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003596 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3597 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
3598 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3599 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3600 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3601 {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3602 {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3603 {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3604 {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3605 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3606 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3607 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3608 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3609 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3610 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3611 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3612 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3613 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3614 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3615 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3616 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3617 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3618 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3619 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003620 {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3621 {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3622 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3623 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3624 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3625 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3626 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3627 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3628 {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3629 {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3630 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3631 {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3632 {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3633 {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3634 {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3635 {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3636 {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3637 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3638 {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3639 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3640 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3641 {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3642 {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3643 {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3644 {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3645 {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3646 {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3647 {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003648 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3649 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3650 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3651 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003652 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003653 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3654 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3655 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3656 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3657 {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3658 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3659 {0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
3660 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3661 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003662 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003663};
3664
3665/* from zs211.inf - HKR,%OV7620%,InitialScale - 320x240 */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003666static const struct usb_action OV7620_mode1[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003667 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3668 {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT}, /* 00,02,50,cc */
3669 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3670 /* mx change? */
3671 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3672 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3673 {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3674 {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3675 {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3676 {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3677 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3678 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3679 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3680 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3681 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3682 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3683 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3684 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3685 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3686 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3687 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3688 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3689 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3690 {0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d6,cc */
3691 /* OV7648 00,9c,d8,cc */
3692 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003693 {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3694 {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3695 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3696 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3697 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3698 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3699 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3700 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3701 {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3702 {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3703 {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3704 {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3705 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3706 {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3707 {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3708 {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3709 {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3710 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3711 {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3712 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3713 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3714 {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3715 {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3716 {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3717 {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3718 {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3719 {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3720 {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003721 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3722 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3723 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3724 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3725 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3726 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3727 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3728 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3729 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3730 {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3731 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3732 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,50,cc */
3733 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3734 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003735 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003736};
3737
3738/* from zs211.inf - HKR,%OV7620%\AE,50HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003739static const struct usb_action OV7620_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003740 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3741 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3742 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3743 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3744 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003745 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3746 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3747 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3748 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3749 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3750 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3751 {0xaa, 0x10, 0x0082}, /* 00,10,82,aa */
3752 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3753/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
3754 if mode0 (640x480) */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003755 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003756};
3757
3758/* from zs211.inf - HKR,%OV7620%\AE,60HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003759static const struct usb_action OV7620_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003760 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3761 /* (bug in zs211.inf) */
3762 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3763 {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3764 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3765 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3766 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3767 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3768 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3769 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3770 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3771 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3772 {0xaa, 0x10, 0x0020}, /* 00,10,20,aa */
3773 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3774/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
3775 * if mode0 (640x480) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003776/* ?? in gspca v1, it was
3777 {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
3778 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003779 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003780};
3781
3782/* from zs211.inf - HKR,%OV7620%\AE,NoFliker */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003783static const struct usb_action OV7620_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003784 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3785 /* (bug in zs211.inf) */
3786 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3787 {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3788 {0xaa, 0x75, 0x008e}, /* 00,75,8e,aa */
3789 {0xaa, 0x2d, 0x0001}, /* 00,2d,01,aa */
3790 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3791 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3792 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3793 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3794 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3795 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
3796/* {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT}, * 00,02,44,cc
3797 - if mode1 (320x240) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003798/* ?? was
3799 {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
3800 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003801 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003802};
3803
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003804static const struct usb_action ov7630c_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003805 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3806 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3807 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3808 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3809 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3810 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3811 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3812 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3813 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3814 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3815 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3816 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3817 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3818 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003819 {0xaa, 0x12, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003820 {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3821 {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3822 {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3823 {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3824 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3825 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3826 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3827 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3828 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3829 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
3830 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003831 {0xaa, 0x12, 0x0069},
3832 {0xaa, 0x04, 0x0020},
3833 {0xaa, 0x06, 0x0050},
3834 {0xaa, 0x13, 0x0083},
3835 {0xaa, 0x14, 0x0000},
3836 {0xaa, 0x15, 0x0024},
3837 {0xaa, 0x17, 0x0018},
3838 {0xaa, 0x18, 0x00ba},
3839 {0xaa, 0x19, 0x0002},
3840 {0xaa, 0x1a, 0x00f6},
3841 {0xaa, 0x1b, 0x0002},
3842 {0xaa, 0x20, 0x00c2},
3843 {0xaa, 0x24, 0x0060},
3844 {0xaa, 0x25, 0x0040},
3845 {0xaa, 0x26, 0x0030},
3846 {0xaa, 0x27, 0x00ea},
3847 {0xaa, 0x28, 0x00a0},
3848 {0xaa, 0x21, 0x0000},
3849 {0xaa, 0x2a, 0x0081},
3850 {0xaa, 0x2b, 0x0096},
3851 {0xaa, 0x2d, 0x0094},
3852 {0xaa, 0x2f, 0x003d},
3853 {0xaa, 0x30, 0x0024},
3854 {0xaa, 0x60, 0x0000},
3855 {0xaa, 0x61, 0x0040},
3856 {0xaa, 0x68, 0x007c},
3857 {0xaa, 0x6f, 0x0015},
3858 {0xaa, 0x75, 0x0088},
3859 {0xaa, 0x77, 0x00b5},
3860 {0xaa, 0x01, 0x0060},
3861 {0xaa, 0x02, 0x0060},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003862 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3863 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3864 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3865 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3866 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003867 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003868 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3869 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3870 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3871 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3872 {0xa0, 0x60, ZC3XX_R116_RGAIN},
3873 {0xa0, 0x46, ZC3XX_R118_BGAIN},
3874 {0xa0, 0x04, ZC3XX_R113_RGB03},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003875/* 0x10, */
3876 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003877 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3878 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3879 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3880 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3881 {0xa0, 0x50, ZC3XX_R10E_RGB11},
3882 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3883 {0xa0, 0xf8, ZC3XX_R110_RGB20},
3884 {0xa0, 0xf8, ZC3XX_R111_RGB21},
3885 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003886/* 0x03, */
3887 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003888 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
3889 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003890 {0xa1, 0x01, 0x01c8},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003891 {0xa1, 0x01, 0x01c9},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003892 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003893 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
3894 {0xa0, 0x01, ZC3XX_R120_GAMMA00}, /* gamma 2 ?*/
3895 {0xa0, 0x0c, ZC3XX_R121_GAMMA01},
3896 {0xa0, 0x1f, ZC3XX_R122_GAMMA02},
3897 {0xa0, 0x3a, ZC3XX_R123_GAMMA03},
3898 {0xa0, 0x53, ZC3XX_R124_GAMMA04},
3899 {0xa0, 0x6d, ZC3XX_R125_GAMMA05},
3900 {0xa0, 0x85, ZC3XX_R126_GAMMA06},
3901 {0xa0, 0x9c, ZC3XX_R127_GAMMA07},
3902 {0xa0, 0xb0, ZC3XX_R128_GAMMA08},
3903 {0xa0, 0xc2, ZC3XX_R129_GAMMA09},
3904 {0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
3905 {0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
3906 {0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
3907 {0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
3908 {0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
3909 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3910 {0xa0, 0x05, ZC3XX_R130_GAMMA10},
3911 {0xa0, 0x0f, ZC3XX_R131_GAMMA11},
3912 {0xa0, 0x16, ZC3XX_R132_GAMMA12},
3913 {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
3914 {0xa0, 0x19, ZC3XX_R134_GAMMA14},
3915 {0xa0, 0x19, ZC3XX_R135_GAMMA15},
3916 {0xa0, 0x17, ZC3XX_R136_GAMMA16},
3917 {0xa0, 0x15, ZC3XX_R137_GAMMA17},
3918 {0xa0, 0x12, ZC3XX_R138_GAMMA18},
3919 {0xa0, 0x10, ZC3XX_R139_GAMMA19},
3920 {0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
3921 {0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
3922 {0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
3923 {0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
3924 {0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
3925 {0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
3926 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3927 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3928 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3929 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3930 {0xa0, 0x50, ZC3XX_R10E_RGB11},
3931 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3932 {0xa0, 0xf8, ZC3XX_R110_RGB20},
3933 {0xa0, 0xf8, ZC3XX_R111_RGB21},
3934 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003935
3936 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003937 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003938 {0xaa, 0x10, 0x001b},
3939 {0xaa, 0x76, 0x0002},
3940 {0xaa, 0x2a, 0x0081},
3941 {0xaa, 0x2b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003942 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3943 {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
3944 {0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
3945 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3946 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3947 {0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
3948 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3949 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3950 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3951 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3952 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3953 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3954 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003955 {0xaa, 0x13, 0x0083}, /* 40 */
3956 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003957 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003958 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003959};
3960
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003961static const struct usb_action ov7630c_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003962 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3963 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
3964 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3965 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3966 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3967 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3968 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3969 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3970 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3971 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3972 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3973 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003974
3975 {0xaa, 0x12, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003976 {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3977 {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3978 {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3979 {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3980 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3981 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3982 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3983 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3984 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3985 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
3986 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003987 {0xaa, 0x12, 0x0069}, /* i2c */
3988 {0xaa, 0x04, 0x0020},
3989 {0xaa, 0x06, 0x0050},
3990 {0xaa, 0x13, 0x00c3},
3991 {0xaa, 0x14, 0x0000},
3992 {0xaa, 0x15, 0x0024},
3993 {0xaa, 0x19, 0x0003},
3994 {0xaa, 0x1a, 0x00f6},
3995 {0xaa, 0x1b, 0x0002},
3996 {0xaa, 0x20, 0x00c2},
3997 {0xaa, 0x24, 0x0060},
3998 {0xaa, 0x25, 0x0040},
3999 {0xaa, 0x26, 0x0030},
4000 {0xaa, 0x27, 0x00ea},
4001 {0xaa, 0x28, 0x00a0},
4002 {0xaa, 0x21, 0x0000},
4003 {0xaa, 0x2a, 0x0081},
4004 {0xaa, 0x2b, 0x0096},
4005 {0xaa, 0x2d, 0x0084},
4006 {0xaa, 0x2f, 0x003d},
4007 {0xaa, 0x30, 0x0024},
4008 {0xaa, 0x60, 0x0000},
4009 {0xaa, 0x61, 0x0040},
4010 {0xaa, 0x68, 0x007c},
4011 {0xaa, 0x6f, 0x0015},
4012 {0xaa, 0x75, 0x0088},
4013 {0xaa, 0x77, 0x00b5},
4014 {0xaa, 0x01, 0x0060},
4015 {0xaa, 0x02, 0x0060},
4016 {0xaa, 0x17, 0x0018},
4017 {0xaa, 0x18, 0x00ba},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004018 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4019 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
4020 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4021 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4022 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004023 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004024 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4025 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4026 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4027 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4028 {0xa0, 0x60, ZC3XX_R116_RGAIN},
4029 {0xa0, 0x46, ZC3XX_R118_BGAIN},
4030 {0xa0, 0x04, ZC3XX_R113_RGB03},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004031
4032 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004033 {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
4034 {0xa0, 0xfe, ZC3XX_R10B_RGB01},
4035 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4036 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
4037 {0xa0, 0x4d, ZC3XX_R10E_RGB11},
4038 {0xa0, 0xfc, ZC3XX_R10F_RGB12},
4039 {0xa0, 0x00, ZC3XX_R110_RGB20},
4040 {0xa0, 0xf6, ZC3XX_R111_RGB21},
4041 {0xa0, 0x4a, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004042
4043 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004044 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
4045 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004046 {0xa1, 0x01, 0x01c8},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004047 {0xa1, 0x01, 0x01c9},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004048 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004049 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
4050 {0xa0, 0x16, ZC3XX_R120_GAMMA00}, /* gamma ~4 */
4051 {0xa0, 0x3a, ZC3XX_R121_GAMMA01},
4052 {0xa0, 0x5b, ZC3XX_R122_GAMMA02},
4053 {0xa0, 0x7c, ZC3XX_R123_GAMMA03},
4054 {0xa0, 0x94, ZC3XX_R124_GAMMA04},
4055 {0xa0, 0xa9, ZC3XX_R125_GAMMA05},
4056 {0xa0, 0xbb, ZC3XX_R126_GAMMA06},
4057 {0xa0, 0xca, ZC3XX_R127_GAMMA07},
4058 {0xa0, 0xd7, ZC3XX_R128_GAMMA08},
4059 {0xa0, 0xe1, ZC3XX_R129_GAMMA09},
4060 {0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
4061 {0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
4062 {0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
4063 {0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
4064 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
4065 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4066 {0xa0, 0x20, ZC3XX_R130_GAMMA10},
4067 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4068 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4069 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4070 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4071 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4072 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4073 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4074 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4075 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4076 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4077 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4078 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4079 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4080 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
4081 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
4082 {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
4083 {0xa0, 0xfe, ZC3XX_R10B_RGB01},
4084 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4085 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
4086 {0xa0, 0x4d, ZC3XX_R10E_RGB11},
4087 {0xa0, 0xfc, ZC3XX_R10F_RGB12},
4088 {0xa0, 0x00, ZC3XX_R110_RGB20},
4089 {0xa0, 0xf6, ZC3XX_R111_RGB21},
4090 {0xa0, 0x4a, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004091
4092 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004093 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004094 {0xaa, 0x10, 0x000d},
4095 {0xaa, 0x76, 0x0002},
4096 {0xaa, 0x2a, 0x0081},
4097 {0xaa, 0x2b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004098 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4099 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
4100 {0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
4101 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4102 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4103 {0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
4104 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4105 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4106 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
4107 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
4108 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
4109 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
4110 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004111 {0xaa, 0x13, 0x00c3},
4112
4113 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004114 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004115 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004116};
4117
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004118static const struct usb_action pas106b_Initial_com[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004119/* Sream and Sensor specific */
4120 {0xa1, 0x01, 0x0010}, /* CMOSSensorSelect */
4121/* System */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004122 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
4123 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004124/* Picture size */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004125 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* ClockSelect */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004126 {0xa0, 0x03, 0x003a},
4127 {0xa0, 0x0c, 0x003b},
4128 {0xa0, 0x04, 0x0038},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004129 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004130};
4131
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004132static const struct usb_action pas106b_Initial[] = { /* 176x144 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004133/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004134 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004135/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004136 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004137/* Picture size */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004138 {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
4139 {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
4140 {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
4141 {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004142/* System */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004143 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004144/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004145 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4146 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004147/* Sensor Interface */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004148 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004149/* Window inside sensor array */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004150 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
4151 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4152 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
4153 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
4154 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004155/* Init the sensor */
4156 {0xaa, 0x02, 0x0004},
4157 {0xaa, 0x08, 0x0000},
4158 {0xaa, 0x09, 0x0005},
4159 {0xaa, 0x0a, 0x0002},
4160 {0xaa, 0x0b, 0x0002},
4161 {0xaa, 0x0c, 0x0005},
4162 {0xaa, 0x0d, 0x0000},
4163 {0xaa, 0x0e, 0x0002},
4164 {0xaa, 0x14, 0x0081},
4165
4166/* Other registors */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004167 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004168/* Frame retreiving */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004169 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004170/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004171 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004172/* Unknown */
4173 {0xa0, 0x00, 0x01ad},
4174/* Sharpness */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004175 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4176 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004177/* Other registors */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004178 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004179/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004180 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004181/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004182 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004183/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004184 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004185/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004186 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4187 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4188 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004189/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004190 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004191/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004192 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004193/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004194 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004195/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004196 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004197/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004198 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4199 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4200 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004201
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004202 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
4203 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
4204 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4205 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
4206 {0xa0, 0x58, ZC3XX_R10E_RGB11},
4207 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
4208 {0xa0, 0xf4, ZC3XX_R110_RGB20},
4209 {0xa0, 0xf4, ZC3XX_R111_RGB21},
4210 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004211/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004212 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
4213 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
4214 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
4215 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
4216 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
4217 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
4218 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004219
4220/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004221 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4222 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4223 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
4224 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4225 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4226 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
4227 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
4228 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004229/* sensor on */
4230 {0xaa, 0x07, 0x00b1},
4231 {0xaa, 0x05, 0x0003},
4232 {0xaa, 0x04, 0x0001},
4233 {0xaa, 0x03, 0x003b},
4234/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004235 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
4236 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
4237 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
4238 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004239/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004240 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004241 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004242 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004243/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004244 {0xa0, 0x40, ZC3XX_R116_RGAIN},
4245 {0xa0, 0x40, ZC3XX_R117_GGAIN},
4246 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004247 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004248};
4249
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004250static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004251/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004252 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004253/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004254 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004255/* Picture size */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004256 {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
4257 {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
4258 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4259 {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004260/* System */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004261 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004262/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004263 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4264 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004265/* Sensor Interface */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004266 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004267/* Window inside sensor array */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004268 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
4269 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4270 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
4271 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
4272 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004273/* Init the sensor */
4274 {0xaa, 0x02, 0x0004},
4275 {0xaa, 0x08, 0x0000},
4276 {0xaa, 0x09, 0x0005},
4277 {0xaa, 0x0a, 0x0002},
4278 {0xaa, 0x0b, 0x0002},
4279 {0xaa, 0x0c, 0x0005},
4280 {0xaa, 0x0d, 0x0000},
4281 {0xaa, 0x0e, 0x0002},
4282 {0xaa, 0x14, 0x0081},
4283
4284/* Other registors */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004285 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004286/* Frame retreiving */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004287 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004288/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004289 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004290/* Unknown */
4291 {0xa0, 0x00, 0x01ad},
4292/* Sharpness */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004293 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4294 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004295/* Other registors */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004296 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004297/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004298 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4299 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004300/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004301 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004302/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004303 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004304/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004305 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4306 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4307 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004308/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004309 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004310/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004311 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004312/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004313 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004314/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004315 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004316/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004317 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4318 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4319 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004320
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004321 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
4322 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
4323 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
4324 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
4325 {0xa0, 0x58, ZC3XX_R10E_RGB11},
4326 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
4327 {0xa0, 0xf4, ZC3XX_R110_RGB20},
4328 {0xa0, 0xf4, ZC3XX_R111_RGB21},
4329 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004330/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004331 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
4332 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
4333 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
4334 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
4335 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
4336 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
4337 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004338
4339/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004340 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4341 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4342 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004343
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004344 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4345 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4346 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004347
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004348 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4349 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004350/* sensor on */
4351 {0xaa, 0x07, 0x00b1},
4352 {0xaa, 0x05, 0x0003},
4353 {0xaa, 0x04, 0x0001},
4354 {0xaa, 0x03, 0x003b},
4355/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004356 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
4357 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
4358 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
4359 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004360/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004361 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004362 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004363 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004364/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004365 {0xa0, 0x40, ZC3XX_R116_RGAIN},
4366 {0xa0, 0x40, ZC3XX_R117_GGAIN},
4367 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004368
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004369 {0xa0, 0x00, 0x0007}, /* AutoCorrectEnable */
4370 {0xa0, 0xff, ZC3XX_R018_FRAMELOST}, /* Frame adjust */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004371 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004372};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004373static const struct usb_action pas106b_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004374 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4375 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4376 {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
4377 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4378 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4379 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
4380 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4381 {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
4382 {0xaa, 0x03, 0x0021}, /* 00,03,21,aa */
4383 {0xaa, 0x04, 0x000c}, /* 00,04,0c,aa */
4384 {0xaa, 0x05, 0x0002}, /* 00,05,02,aa */
4385 {0xaa, 0x07, 0x001c}, /* 00,07,1c,aa */
4386 {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004387 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004388};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004389static const struct usb_action pas106b_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004390 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4391 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4392 {0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
4393 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4394 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4395 {0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
4396 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4397 {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
4398 {0xaa, 0x03, 0x001c}, /* 00,03,1c,aa */
4399 {0xaa, 0x04, 0x0004}, /* 00,04,04,aa */
4400 {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
4401 {0xaa, 0x07, 0x00c4}, /* 00,07,c4,aa */
4402 {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004403 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004404};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004405static const struct usb_action pas106b_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004406 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4407 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
4408 {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
4409 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4410 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4411 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
4412 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4413 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4414 {0xaa, 0x03, 0x0013}, /* 00,03,13,aa */
4415 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
4416 {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
4417 {0xaa, 0x07, 0x0030}, /* 00,07,30,aa */
4418 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004419 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004420};
4421
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004422static const struct usb_action pb03303x_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004423 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4424 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4425 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4426 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4427 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4428 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4429 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4430 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4431 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR}, /* 8b -> dc */
4432 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4433 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4434 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4435 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4436 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4437 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4438 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4439 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004440 {0xaa, 0x01, 0x0001},
4441 {0xaa, 0x06, 0x0000},
4442 {0xaa, 0x08, 0x0483},
4443 {0xaa, 0x01, 0x0004},
4444 {0xaa, 0x08, 0x0006},
4445 {0xaa, 0x02, 0x0011},
4446 {0xaa, 0x03, 0x01e7},
4447 {0xaa, 0x04, 0x0287},
4448 {0xaa, 0x07, 0x3002},
4449 {0xaa, 0x20, 0x1100},
4450 {0xaa, 0x35, 0x0050},
4451 {0xaa, 0x30, 0x0005},
4452 {0xaa, 0x31, 0x0000},
4453 {0xaa, 0x58, 0x0078},
4454 {0xaa, 0x62, 0x0411},
4455 {0xaa, 0x2b, 0x0028},
4456 {0xaa, 0x2c, 0x0030},
4457 {0xaa, 0x2d, 0x0030},
4458 {0xaa, 0x2e, 0x0028},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004459 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4460 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4461 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4462 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4463 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004464 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004465 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4466 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4467 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4468 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4469 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4470 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
4471 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4472 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004473
4474 {0xa1, 0x01, 0x0002},
4475 {0xa0, 0x09, 0x01ad},
4476 {0xa0, 0x15, 0x01ae},
4477 {0xa0, 0x0d, 0x003a},
4478 {0xa0, 0x02, 0x003b},
4479 {0xa0, 0x00, 0x0038},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004480 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4481 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4482 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4483 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4484 {0xa0, 0x50, ZC3XX_R10E_RGB11},
4485 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4486 {0xa0, 0xf8, ZC3XX_R110_RGB20},
4487 {0xa0, 0xf8, ZC3XX_R111_RGB21},
4488 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004489
4490 {0xa1, 0x01, 0x0008},
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03004491 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4492 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004493 {0xa1, 0x01, 0x01c8},
4494 {0xa1, 0x01, 0x01c9},
4495 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004496 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
4497 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
4498 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
4499 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
4500 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
4501 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
4502 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
4503 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
4504 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
4505 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
4506 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
4507 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
4508 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
4509 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
4510 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
4511 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
4512 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4513 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
4514 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4515 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4516 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4517 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4518 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4519 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4520 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4521 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4522 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4523 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4524 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4525 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4526 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4527 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
4528 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
4529 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4530 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4531 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4532 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4533 {0xa0, 0x50, ZC3XX_R10E_RGB11},
4534 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4535 {0xa0, 0xf8, ZC3XX_R110_RGB20},
4536 {0xa0, 0xf8, ZC3XX_R111_RGB21},
4537 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004538
4539 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004540 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4541 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4542 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004543 {0xaa, 0x05, 0x0009},
4544 {0xaa, 0x09, 0x0134},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004545 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4546 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4547 {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
4548 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4549 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4550 {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
4551 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4552 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4553 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4554 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4555 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4556 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4557 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4558 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4559 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004560 {0xa0, 0x09, 0x01ad},
4561 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004562 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004563 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004564 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004565 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004566};
4567
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004568static const struct usb_action pb03303x_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004569 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4570 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4571 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4572 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4573 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4574 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4575 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4576 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4577 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR}, /* 8b -> dc */
4578 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4579 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4580 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4581 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4582 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4583 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4584 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4585 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004586 {0xaa, 0x01, 0x0001},
4587 {0xaa, 0x06, 0x0000},
4588 {0xaa, 0x08, 0x0483},
4589 {0xaa, 0x01, 0x0004},
4590 {0xaa, 0x08, 0x0006},
4591 {0xaa, 0x02, 0x0011},
4592 {0xaa, 0x03, 0x01e7},
4593 {0xaa, 0x04, 0x0287},
4594 {0xaa, 0x07, 0x3002},
4595 {0xaa, 0x20, 0x1100},
4596 {0xaa, 0x35, 0x0050},
4597 {0xaa, 0x30, 0x0005},
4598 {0xaa, 0x31, 0x0000},
4599 {0xaa, 0x58, 0x0078},
4600 {0xaa, 0x62, 0x0411},
4601 {0xaa, 0x2b, 0x0028},
4602 {0xaa, 0x2c, 0x0030},
4603 {0xaa, 0x2d, 0x0030},
4604 {0xaa, 0x2e, 0x0028},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004605 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4606 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4607 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4608 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4609 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004610 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004611 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4612 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4613 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4614 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4615 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4616 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
4617 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4618 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004619
4620 {0xa1, 0x01, 0x0002},
4621
4622 {0xa0, 0x09, 0x01ad},
4623 {0xa0, 0x15, 0x01ae},
4624
4625 {0xa0, 0x0d, 0x003a},
4626 {0xa0, 0x02, 0x003b},
4627 {0xa0, 0x00, 0x0038},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004628 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4629 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4630 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4631 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4632 {0xa0, 0x50, ZC3XX_R10E_RGB11},
4633 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4634 {0xa0, 0xf8, ZC3XX_R110_RGB20},
4635 {0xa0, 0xf8, ZC3XX_R111_RGB21},
4636 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004637
4638 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004639 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
4640 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004641 {0xa1, 0x01, 0x01c8},
4642 {0xa1, 0x01, 0x01c9},
4643 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004644 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004645
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004646 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
4647 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
4648 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
4649 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
4650 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
4651 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
4652 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
4653 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
4654 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
4655 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
4656 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
4657 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
4658 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
4659 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
4660 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
4661 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
4662 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
4663 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
4664 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
4665 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
4666 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
4667 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
4668 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
4669 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
4670 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
4671 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
4672 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
4673 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
4674 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
4675 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
4676 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
4677 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
4678 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4679 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4680 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4681 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4682 {0xa0, 0x50, ZC3XX_R10E_RGB11},
4683 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4684 {0xa0, 0xf8, ZC3XX_R110_RGB20},
4685 {0xa0, 0xf8, ZC3XX_R111_RGB21},
4686 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004687
4688 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004689 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4690 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4691 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004692 {0xaa, 0x05, 0x0009},
4693 {0xaa, 0x09, 0x0134},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004694 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4695 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4696 {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
4697 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4698 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4699 {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
4700 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4701 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4702 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4703 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4704 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4705 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4706 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4707 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4708 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004709 {0xa0, 0x09, 0x01ad},
4710 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004711 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004712 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004713 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004714 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004715};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004716static const struct usb_action pb0330xx_Initial[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004717 {0xa1, 0x01, 0x0008},
4718 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004719 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4720 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
4721 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4722 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4723 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4724 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4725 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4726 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4727 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4728 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4729 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4730 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4731 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4732 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4733 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4734 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004735 {0xaa, 0x01, 0x0006},
4736 {0xaa, 0x02, 0x0011},
4737 {0xaa, 0x03, 0x01e7},
4738 {0xaa, 0x04, 0x0287},
4739 {0xaa, 0x06, 0x0003},
4740 {0xaa, 0x07, 0x3002},
4741 {0xaa, 0x20, 0x1100},
4742 {0xaa, 0x2f, 0xf7b0},
4743 {0xaa, 0x30, 0x0005},
4744 {0xaa, 0x31, 0x0000},
4745 {0xaa, 0x34, 0x0100},
4746 {0xaa, 0x35, 0x0060},
4747 {0xaa, 0x3d, 0x068f},
4748 {0xaa, 0x40, 0x01e0},
4749 {0xaa, 0x58, 0x0078},
4750 {0xaa, 0x62, 0x0411},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004751 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4752 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4753 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4754 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4755 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004756 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004757 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4758 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4759 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4760 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4761 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4762 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004763 {0xa1, 0x01, 0x0002},
4764 {0xa0, 0x09, 0x01ad},
4765 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004766 {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
4767 {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004768 {0xa1, 0x01, 0x0091},
4769 {0xa1, 0x01, 0x0095},
4770 {0xa1, 0x01, 0x0096},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004771 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4772 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4773 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4774 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4775 {0xa0, 0x50, ZC3XX_R10E_RGB11},
4776 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4777 {0xa0, 0xf8, ZC3XX_R110_RGB20},
4778 {0xa0, 0xf8, ZC3XX_R111_RGB21},
4779 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004780 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004781 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
4782 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004783 {0xa1, 0x01, 0x01c8},
4784 {0xa1, 0x01, 0x01c9},
4785 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004786 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004787
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004788 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4789 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4790 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4791 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4792 {0xa0, 0x50, ZC3XX_R10E_RGB11},
4793 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4794 {0xa0, 0xf8, ZC3XX_R110_RGB20},
4795 {0xa0, 0xf8, ZC3XX_R111_RGB21},
4796 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004797 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004798 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4799 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004800 {0xaa, 0x05, 0x0066},
4801 {0xaa, 0x09, 0x02b2},
4802 {0xaa, 0x10, 0x0002},
4803
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004804 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4805 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4806 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4807 {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4808 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4809 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4810 {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4811 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4812 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4813 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4814 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4815 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4816 {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4817 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4818 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004819 {0xa0, 0x09, 0x01ad},
4820 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004821 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004822 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004823 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004824 {0xa1, 0x01, 0x0008},
4825 {0xa1, 0x01, 0x0007},
4826/* {0xa0, 0x30, 0x0007}, */
4827/* {0xa0, 0x00, 0x0007}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004828 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004829};
4830
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004831static const struct usb_action pb0330xx_InitialScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004832 {0xa1, 0x01, 0x0008},
4833 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004834 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4835 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
4836 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4837 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 10 */
4838 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4839 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4840 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4841 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4842 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4843 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4844 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4845 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4846 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4847 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4848 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4849 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004850 {0xaa, 0x01, 0x0006},
4851 {0xaa, 0x02, 0x0011},
4852 {0xaa, 0x03, 0x01e7},
4853 {0xaa, 0x04, 0x0287},
4854 {0xaa, 0x06, 0x0003},
4855 {0xaa, 0x07, 0x3002},
4856 {0xaa, 0x20, 0x1100},
4857 {0xaa, 0x2f, 0xf7b0},
4858 {0xaa, 0x30, 0x0005},
4859 {0xaa, 0x31, 0x0000},
4860 {0xaa, 0x34, 0x0100},
4861 {0xaa, 0x35, 0x0060},
4862 {0xaa, 0x3d, 0x068f},
4863 {0xaa, 0x40, 0x01e0},
4864 {0xaa, 0x58, 0x0078},
4865 {0xaa, 0x62, 0x0411},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004866 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4867 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4868 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4869 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4870 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004871 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004872 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4873 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4874 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4875 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4876 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4877 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004878 {0xa1, 0x01, 0x0002},
4879 {0xa0, 0x09, 0x01ad},
4880 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004881 {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
4882 {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004883 {0xa1, 0x01, 0x0091},
4884 {0xa1, 0x01, 0x0095},
4885 {0xa1, 0x01, 0x0096},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004886 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4887 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4888 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4889 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4890 {0xa0, 0x50, ZC3XX_R10E_RGB11},
4891 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4892 {0xa0, 0xf8, ZC3XX_R110_RGB20},
4893 {0xa0, 0xf8, ZC3XX_R111_RGB21},
4894 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004895 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004896 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
4897 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004898 {0xa1, 0x01, 0x01c8},
4899 {0xa1, 0x01, 0x01c9},
4900 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004901 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004902
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004903 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
4904 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
4905 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
4906 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
4907 {0xa0, 0x50, ZC3XX_R10E_RGB11},
4908 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
4909 {0xa0, 0xf8, ZC3XX_R110_RGB20},
4910 {0xa0, 0xf8, ZC3XX_R111_RGB21},
4911 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004912 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004913 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4914 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004915 {0xaa, 0x05, 0x0066},
4916 {0xaa, 0x09, 0x02b2},
4917 {0xaa, 0x10, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004918 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4919 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4920 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4921 {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4922 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4923 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4924 {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4925 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4926 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4927 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4928 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4929 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4930 {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4931 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4932 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004933 {0xa0, 0x09, 0x01ad},
4934 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004935 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004936 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004937 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004938 {0xa1, 0x01, 0x0008},
4939 {0xa1, 0x01, 0x0007},
4940/* {0xa0, 0x30, 0x0007}, */
4941/* {0xa0, 0x00, 0x0007}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004942 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004943};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004944static const struct usb_action pb0330_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004945 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4946 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4947 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,ee,cc */
4948 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4949 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4950 {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
4951 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4952 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4953 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4954 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4955 {0xa0, 0x68, ZC3XX_R01D_HSYNC_0}, /* 00,1d,68,cc */
4956 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
4957 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004958 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004959};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004960static const struct usb_action pb0330_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004961 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4962 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4963 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4964 {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
4965 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4966 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4967 {0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
4968 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4969 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4970 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4971 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4972 {0xa0, 0xe5, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e5,cc */
4973 {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f0,cc */
4974 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004975 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004976};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004977static const struct usb_action pb0330_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004978 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4979 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4980 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4981 {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,dd,cc */
4982 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4983 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4984 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
4985 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4986 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4987 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
4988 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
4989 {0xa0, 0x43, ZC3XX_R01D_HSYNC_0}, /* 00,1d,43,cc */
4990 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
4991 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004992 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004993};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004994static const struct usb_action pb0330_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004995 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4996 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4997 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4998 {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
4999 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5000 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5001 {0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
5002 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5003 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5004 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5005 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5006 {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
5007 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
5008 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005009 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005010};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005011static const struct usb_action pb0330_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005012 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5013 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5014 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
5015 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5016 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5017 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5018 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5019 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5020 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5021 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5022 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5023 {0xa0, 0x09, ZC3XX_R01D_HSYNC_0}, /* 00,1d,09,cc */
5024 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
5025 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005026 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005027};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005028static const struct usb_action pb0330_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005029 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5030 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5031 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
5032 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5033 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5034 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5035 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5036 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5037 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5038 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5039 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5040 {0xa0, 0x09, ZC3XX_R01D_HSYNC_0}, /* 00,1d,09,cc */
5041 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
5042 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005043 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005044};
5045
5046/* from oem9.inf - HKR,%PO2030%,Initial - 640x480 - (close to CS2102) */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005047static const struct usb_action PO2030_mode0[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005048 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5049 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
5050 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5051 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5052 {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5053 {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5054 {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5055 {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5056 {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5057 {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5058 {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5059 {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5060 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5061 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5062 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5063 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5064 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5065 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5066 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5067 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5068 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5069 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
5070 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
5071 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
5072 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
5073 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
5074 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005075 {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
5076 {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5077 {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
5078 {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
5079 {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5080 {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5081 {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5082 {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5083 {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5084 {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5085 {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5086 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5087 {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5088 {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5089 {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5090 {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5091 {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5092 {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5093 {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5094 {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5095 {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5096 {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5097 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5098 {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5099 {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5100 {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5101 {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5102 {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5103 {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5104 {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5105 {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5106 {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5107 {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5108 {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005109 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5110 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5111 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5112 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005113 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005114 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5115 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5116 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5117 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5118 {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5119 {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005120 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005121};
5122
5123/* from oem9.inf - HKR,%PO2030%,InitialScale - 320x240 */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005124static const struct usb_action PO2030_mode1[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005125 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5126 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
5127 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5128 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5129 {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5130 {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5131 {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5132 {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5133 {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5134 {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5135 {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5136 {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5137 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5138 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5139 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5140 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5141 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5142 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5143 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5144 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5145 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5146 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
5147 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
5148 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
5149 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
5150 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
5151 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005152 {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
5153 {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5154 {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
5155 {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
5156 {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5157 {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5158 {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5159 {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5160 {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5161 {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5162 {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5163 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5164 {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5165 {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5166 {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5167 {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5168 {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5169 {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5170 {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5171 {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5172 {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5173 {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5174 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5175 {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5176 {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5177 {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5178 {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5179 {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5180 {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5181 {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5182 {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5183 {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5184 {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5185 {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005186 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5187 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5188 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5189 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005190 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005191 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5192 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5193 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5194 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5195 {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5196 {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005197 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005198};
5199
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005200static const struct usb_action PO2030_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005201 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5202 {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
5203 {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
5204 {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005205 {0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
5206 {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
5207 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
5208 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5209 {0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
5210 {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
5211 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5212 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5213 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5214 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5215 {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5216 {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5217 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5218 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005219 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005220};
5221
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005222static const struct usb_action PO2030_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005223 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5224 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5225 {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
5226 {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005227 {0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
5228 {0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
5229 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
5230 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5231 {0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
5232 {0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
5233 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5234 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5235 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5236 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5237 {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5238 {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5239 /* win: 01,8d,80 */
5240 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5241 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005242 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005243};
5244
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005245static const struct usb_action PO2030_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005246 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005247 {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
5248 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5249 {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
5250 {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
5251 {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
5252 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005253 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005254};
5255
5256/* TEST */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005257static const struct usb_action tas5130CK_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005258 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005259 {0xa0, 0x01, 0x003b},
5260 {0xa0, 0x0e, 0x003a},
5261 {0xa0, 0x01, 0x0038},
5262 {0xa0, 0x0b, 0x0039},
5263 {0xa0, 0x00, 0x0038},
5264 {0xa0, 0x0b, 0x0039},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005265 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5266 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5267 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5268 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
5269 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5270 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5271 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5272 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5273 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5274 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5275 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5276 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5277 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5278 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5279 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5280 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5281 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5282 {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5283 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5284 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5285 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5286 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5287 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5288 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5289 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5290 {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5291 {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5292 {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5293 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5294 {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5295 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5296 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5297 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5298 {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5299 {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5300 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5301 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5302 {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5303 {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5304 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5305 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5306 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5307 {0xa0, 0xE7, ZC3XX_R093_I2CSETVALUE},
5308 {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5309 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5310 {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5311 {0xa0, 0x87, ZC3XX_R093_I2CSETVALUE},
5312 {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5313 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5314 {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5315 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5316 {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5317 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5318 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5319 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5320 {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5321 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5322 {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5323 {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5324 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5325 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5326 {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5327 {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5328 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5329 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5330 {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5331 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5332 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5333 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5334 {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5335 {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5336 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5337 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5338 {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5339 {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5340 {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5341 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5342 {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5343 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5344 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5345 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5346 {0xa0, 0x2c, ZC3XX_R092_I2CADDRESSSELECT},
5347 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5348 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5349 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5350 {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5351 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5352 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5353 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5354 {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5355 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5356 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5357 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5358 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5359 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5360 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5361 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5362 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005363 {0xa0, 0x09, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005364 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5365 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5366 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5367 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5368 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5369 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5370 {0xa0, 0x61, ZC3XX_R116_RGAIN},
5371 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005372 {0xa0, 0x09, 0x01ad},
5373 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005374 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5375 {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5376 {0xa0, 0x03, ZC3XX_R10C_RGB02},
5377 {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5378 {0xa0, 0x51, ZC3XX_R10E_RGB11},
5379 {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5380 {0xa0, 0xec, ZC3XX_R110_RGB20},
5381 {0xa0, 0x03, ZC3XX_R111_RGB21},
5382 {0xa0, 0x51, ZC3XX_R112_RGB22},
5383 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5384 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
5385 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
5386 {0xa0, 0x38, ZC3XX_R120_GAMMA00}, /* gamma > 5 */
5387 {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5388 {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5389 {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5390 {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5391 {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5392 {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5393 {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5394 {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5395 {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5396 {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5397 {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5398 {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5399 {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5400 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5401 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5402 {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5403 {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5404 {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5405 {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5406 {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5407 {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5408 {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5409 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5410 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5411 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5412 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5413 {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5414 {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5415 {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5416 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5417 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5418 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5419 {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5420 {0xa0, 0x03, ZC3XX_R10C_RGB02},
5421 {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5422 {0xa0, 0x51, ZC3XX_R10E_RGB11},
5423 {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5424 {0xa0, 0xec, ZC3XX_R110_RGB20},
5425 {0xa0, 0x03, ZC3XX_R111_RGB21},
5426 {0xa0, 0x51, ZC3XX_R112_RGB22},
5427 {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5428 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5429 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5430 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5431 {0xa0, 0x09, ZC3XX_R093_I2CSETVALUE},
5432 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5433 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5434 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5435 {0xa0, 0x34, ZC3XX_R093_I2CSETVALUE},
5436 {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5437 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5438 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5439 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5440 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
5441 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5442 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5443 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
5444 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5445 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5446 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5447 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5448 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
5449 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5450 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
5451 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5452 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005453 {0xa0, 0x09, 0x01ad},
5454 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005455 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5456 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005457 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005458};
5459
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005460static const struct usb_action tas5130CK_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005461 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005462 {0xa0, 0x01, 0x003b},
5463 {0xa0, 0x0e, 0x003a},
5464 {0xa0, 0x01, 0x0038},
5465 {0xa0, 0x0b, 0x0039},
5466 {0xa0, 0x00, 0x0038},
5467 {0xa0, 0x0b, 0x0039},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005468 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5469 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5470 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
5471 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
5472 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5473 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5474 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5475 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5476 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5477 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5478 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
5479 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
5480 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
5481 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
5482 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
5483 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
5484 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5485 {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5486 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
5487 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5488 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5489 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
5490 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5491 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5492 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5493 {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5494 {0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
5495 {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5496 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5497 {0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
5498 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
5499 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5500 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5501 {0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
5502 {0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
5503 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5504 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5505 {0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
5506 {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5507 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5508 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5509 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
5510 {0xa0, 0xe5, ZC3XX_R093_I2CSETVALUE},
5511 {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5512 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5513 {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
5514 {0xa0, 0x85, ZC3XX_R093_I2CSETVALUE},
5515 {0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
5516 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5517 {0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
5518 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
5519 {0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
5520 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5521 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
5522 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5523 {0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
5524 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5525 {0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
5526 {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5527 {0xa0, 0x50, ZC3XX_R094_I2CWRITEACK},
5528 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5529 {0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
5530 {0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
5531 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5532 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5533 {0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
5534 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
5535 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5536 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5537 {0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
5538 {0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
5539 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5540 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5541 {0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
5542 {0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
5543 {0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
5544 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5545 {0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
5546 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5547 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5548 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5549 {0xa0, 0x2C, ZC3XX_R092_I2CADDRESSSELECT},
5550 {0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
5551 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5552 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5553 {0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
5554 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5555 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5556 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5557 {0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
5558 {0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
5559 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5560 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5561 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
5562 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
5563 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5564 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5565 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005566 {0xa0, 0x09, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005567 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5568 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5569 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5570 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5571 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5572 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
5573 {0xa0, 0x61, ZC3XX_R116_RGAIN},
5574 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005575 {0xa0, 0x09, 0x01ad},
5576 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005577 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5578 {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5579 {0xa0, 0x03, ZC3XX_R10C_RGB02},
5580 {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5581 {0xa0, 0x51, ZC3XX_R10E_RGB11},
5582 {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5583 {0xa0, 0xec, ZC3XX_R110_RGB20},
5584 {0xa0, 0x03, ZC3XX_R111_RGB21},
5585 {0xa0, 0x51, ZC3XX_R112_RGB22},
5586 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5587 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
5588 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
5589 {0xa0, 0x38, ZC3XX_R120_GAMMA00}, /* gamma > 5 */
5590 {0xa0, 0x51, ZC3XX_R121_GAMMA01},
5591 {0xa0, 0x6e, ZC3XX_R122_GAMMA02},
5592 {0xa0, 0x8c, ZC3XX_R123_GAMMA03},
5593 {0xa0, 0xa2, ZC3XX_R124_GAMMA04},
5594 {0xa0, 0xb6, ZC3XX_R125_GAMMA05},
5595 {0xa0, 0xc8, ZC3XX_R126_GAMMA06},
5596 {0xa0, 0xd6, ZC3XX_R127_GAMMA07},
5597 {0xa0, 0xe2, ZC3XX_R128_GAMMA08},
5598 {0xa0, 0xed, ZC3XX_R129_GAMMA09},
5599 {0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
5600 {0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
5601 {0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
5602 {0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
5603 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
5604 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
5605 {0xa0, 0x12, ZC3XX_R130_GAMMA10},
5606 {0xa0, 0x1b, ZC3XX_R131_GAMMA11},
5607 {0xa0, 0x1d, ZC3XX_R132_GAMMA12},
5608 {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
5609 {0xa0, 0x15, ZC3XX_R134_GAMMA14},
5610 {0xa0, 0x12, ZC3XX_R135_GAMMA15},
5611 {0xa0, 0x0f, ZC3XX_R136_GAMMA16},
5612 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
5613 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
5614 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
5615 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
5616 {0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
5617 {0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
5618 {0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
5619 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
5620 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
5621 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
5622 {0xa0, 0xf1, ZC3XX_R10B_RGB01},
5623 {0xa0, 0x03, ZC3XX_R10C_RGB02},
5624 {0xa0, 0xfe, ZC3XX_R10D_RGB10},
5625 {0xa0, 0x51, ZC3XX_R10E_RGB11},
5626 {0xa0, 0xf1, ZC3XX_R10F_RGB12},
5627 {0xa0, 0xec, ZC3XX_R110_RGB20},
5628 {0xa0, 0x03, ZC3XX_R111_RGB21},
5629 {0xa0, 0x51, ZC3XX_R112_RGB22},
5630 {0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
5631 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5632 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5633 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
5634 {0xa0, 0x62, ZC3XX_R093_I2CSETVALUE},
5635 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
5636 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5637 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
5638 {0xa0, 0xaa, ZC3XX_R093_I2CSETVALUE},
5639 {0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
5640 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
5641 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5642 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
5643 {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
5644 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5645 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5646 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5647 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
5648 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
5649 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
5650 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
5651 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
5652 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
5653 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
5654 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5655 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
5656 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005657 {0xa0, 0x09, 0x01ad},
5658 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005659 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5660 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005661 {0xa0, 0x30, 0x0007},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005662 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005663 {0xa0, 0x00, 0x0007},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005664 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005665 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005666};
5667
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005668static const struct usb_action tas5130cxx_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005669 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5670 {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
5671 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5672 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5673 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5674 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5675 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5676 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5677 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5678 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5679 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005680
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005681 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5682 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5683 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5684 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005685
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005686 {0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
5687 {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5688 {0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
5689 {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5690 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
5691 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5692 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
5693 {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5694 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5695 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5696 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5697 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
5698 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005699 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005700 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5701 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5702 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5703 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005704 {0xa1, 0x01, 0x0002},
5705 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005706 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
5707 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005708 {0xa1, 0x01, 0x01c8},
5709 {0xa1, 0x01, 0x01c9},
5710 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005711 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005712
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005713 {0xa0, 0x68, ZC3XX_R10A_RGB00}, /* matrix */
5714 {0xa0, 0xec, ZC3XX_R10B_RGB01},
5715 {0xa0, 0xec, ZC3XX_R10C_RGB02},
5716 {0xa0, 0xec, ZC3XX_R10D_RGB10},
5717 {0xa0, 0x68, ZC3XX_R10E_RGB11},
5718 {0xa0, 0xec, ZC3XX_R10F_RGB12},
5719 {0xa0, 0xec, ZC3XX_R110_RGB20},
5720 {0xa0, 0xec, ZC3XX_R111_RGB21},
5721 {0xa0, 0x68, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005722
5723 {0xa1, 0x01, 0x018d},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005724 {0xa0, 0x90, ZC3XX_R18D_YTARGET}, /* 90 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005725 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005726 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5727 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005728
5729 {0xaa, 0xa3, 0x0001},
5730 {0xaa, 0xa4, 0x0077},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005731 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
5732 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005733
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005734 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 00 */
5735 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 03 */
5736 {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* e8 */
5737 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 0 */
5738 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 0 */
5739 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 7d */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005740
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005741 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5742 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5743 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 08 */
5744 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 24 */
5745 {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0},
5746 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
5747 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
5748 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5749 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
5750 {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
5751 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, /* 50 */
5752 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005753 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005754 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005755 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005756};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005757static const struct usb_action tas5130cxx_InitialScale[] = {
Jean-Francois Moine2ed9f812008-11-28 15:31:43 -03005758/*?? {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005759 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5760 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005761
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005762 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005763 {0xa1, 0x01, 0x0008},
5764
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005765 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5766 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5767 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5768 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5769 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5770 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5771 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5772 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5773 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5774 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5775 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5776 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5777 {0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
5778 {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5779 {0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
5780 {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5781 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
5782 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5783 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
5784 {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5785 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5786 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5787 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5788 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
5789 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005790 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005791 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5792 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5793 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5794 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005795 {0xa1, 0x01, 0x0002},
5796 {0xa1, 0x01, 0x0008},
5797
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005798 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005799 {0xa1, 0x01, 0x0008}, /* clock ? */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005800 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005801 {0xa1, 0x01, 0x01c8},
5802 {0xa1, 0x01, 0x01c9},
5803 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005804 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005805
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005806 {0xa0, 0x68, ZC3XX_R10A_RGB00}, /* matrix */
5807 {0xa0, 0xec, ZC3XX_R10B_RGB01},
5808 {0xa0, 0xec, ZC3XX_R10C_RGB02},
5809 {0xa0, 0xec, ZC3XX_R10D_RGB10},
5810 {0xa0, 0x68, ZC3XX_R10E_RGB11},
5811 {0xa0, 0xec, ZC3XX_R10F_RGB12},
5812 {0xa0, 0xec, ZC3XX_R110_RGB20},
5813 {0xa0, 0xec, ZC3XX_R111_RGB21},
5814 {0xa0, 0x68, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005815
5816 {0xa1, 0x01, 0x018d},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005817 {0xa0, 0x90, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005818 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005819 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
5820 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005821 {0xaa, 0xa3, 0x0001},
5822 {0xaa, 0xa4, 0x0063},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005823 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
5824 {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW},
5825 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
5826 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
5827 {0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW},
5828 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5829 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5830 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
5831 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5832 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5833 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5834 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
5835 {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0},
5836 {0xa0, 0xda, ZC3XX_R01E_HSYNC_1},
5837 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
5838 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
5839 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
5840 {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
5841 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5842 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005843 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005844 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005845 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005846};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005847static const struct usb_action tas5130cxx_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005848 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005849 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5850 {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005851 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5852 {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
5853 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5854 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
5855 {0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,38,cc */
5856 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5857 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5858 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
5859 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5860 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5861 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5862 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5863 {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
5864 {0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
5865 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
5866 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5867 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005868 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005869};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005870static const struct usb_action tas5130cxx_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005871 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005872 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5873 {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005874 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5875 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5876 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5877 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5878 {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
5879 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5880 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5881 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5882 {0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
5883 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5884 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5885 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5886 {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
5887 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
5888 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
5889 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5890 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005891 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005892};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005893static const struct usb_action tas5130cxx_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005894 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005895 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5896 {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005897 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5898 {0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
5899 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5900 {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
5901 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5902 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5903 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5904 {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
5905 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5906 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5907 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5908 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5909 {0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
5910 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5911 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5912 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5913 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005914 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005915};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005916static const struct usb_action tas5130cxx_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005917 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005918 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5919 {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005920 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5921 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5922 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5923 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5924 {0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
5925 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5926 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5927 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5928 {0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
5929 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5930 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
5931 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
5932 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
5933 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5934 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5935 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5936 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005937 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005938};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005939static const struct usb_action tas5130cxx_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005940 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005941 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5942 {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005943 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5944 {0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
5945 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5946 {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
5947 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5948 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5949 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5950 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5951 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5952 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5953 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5954 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5955 {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5956 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5957 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5958 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5959 {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005960 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005961};
5962
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005963static const struct usb_action tas5130cxx_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005964 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005965 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5966 {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005967 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5968 {0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
5969 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5970 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
5971 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
5972 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5973 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5974 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
5975 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
5976 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
5977 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5978 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5979 {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5980 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5981 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5982 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5983 {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005984 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005985};
5986
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005987static const struct usb_action tas5130c_vf0250_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005988 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
5989 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
5990 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
5991 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc,
5992 * 0<->10 */
5993 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
5994 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
5995 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
5996 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
5997 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
5998 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
5999 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
6000 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
6001 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
6002 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
6003 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
6004 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
6005 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc,
6006 * 6<->8 */
6007 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc,
6008 * 6<->8 */
6009 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
6010 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006011 {0xaa, 0x1b, 0x0024}, /* 00,1b,24,aa, */
6012 {0xdd, 0x00, 0x0080}, /* 00,00,80,dd, */
6013 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */
6014 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */
6015 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006016/*?? {0xaa, 0x01, 0x0000}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006017 {0xaa, 0x01, 0x0000},
6018 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
6019 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006020 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
6021 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
6022 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006023 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
6024 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa, */
6025 {0xaa, 0x0b, 0x00a0}, /* 00,0b,a0,aa, */
6026 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa, */
6027 {0xaa, 0x0d, 0x00a0}, /* 00,0d,a0,aa, */
6028 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa, */
6029 {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */
6030 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */
6031 {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006032/*?? {0xa0, 0x00, 0x0039},
6033 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006034 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
6035 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa, (e6 -> e8) */
6036 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
6037 {0xaa, 0x19, 0x0088}, /* 00,19,86,aa, */
6038 {0xaa, 0x20, 0x0020}, /* 00,20,20,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006039 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
6040 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
6041 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
6042 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
6043 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
6044 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
6045 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
6046 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
6047 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
6048 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc, */
6049 {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
6050 {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006051 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006052};
6053
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006054static const struct usb_action tas5130c_vf0250_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006055 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
6056 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
6057 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
6058 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc, */
6059 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
6060 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
6061 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
6062 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
6063 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
6064 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
6065 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
6066 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
6067 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
6068 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
6069 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
6070 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
6071 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc,
6072 * 8<->6 */
6073 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc,
6074 * 8<->6 */
6075 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
6076 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006077 {0xaa, 0x1b, 0x0024}, /* 00,1b,24,aa, */
6078 {0xdd, 0x00, 0x0080}, /* 00,00,80,dd, */
6079 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */
6080 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */
6081 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
Jean-Francois Moine2ed9f812008-11-28 15:31:43 -03006082/*?? {0xaa, 0x01, 0x0000}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006083 {0xaa, 0x01, 0x0000},
6084 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
6085 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006086 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
6087 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
6088 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006089 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
6090 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa, */
6091 {0xaa, 0x0b, 0x00a0}, /* 00,0b,a0,aa, */
6092 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa, */
6093 {0xaa, 0x0d, 0x00a0}, /* 00,0d,a0,aa, */
6094 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa, */
6095 {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */
6096 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */
6097 {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */
Jean-Francois Moine2ed9f812008-11-28 15:31:43 -03006098/*?? {0xa0, 0x00, 0x0039},
6099 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006100 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
6101 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa (e6 -> e8) */
6102 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
6103 {0xaa, 0x19, 0x0088}, /* 00,19,88,aa, */
6104 {0xaa, 0x20, 0x0020}, /* 00,20,20,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006105 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
6106 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
6107 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
6108 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
6109 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
6110 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
6111 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
6112 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
6113 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
6114 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc, */
6115 {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
6116 {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006117 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006118};
6119/* "50HZ" light frequency banding filter */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006120static const struct usb_action tas5130c_vf0250_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006121 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
6122 {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */
6123 {0xaa, 0x84, 0x00aa}, /* 00,84,aa,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006124 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
6125 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
6126 {0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
6127 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
6128 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
6129 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc, */
6130 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
6131 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
6132 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
6133 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
6134 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
6135 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
6136 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
6137 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
6138 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
6139 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
6140 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006141 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006142};
6143
6144/* "50HZScale" light frequency banding filter */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006145static const struct usb_action tas5130c_vf0250_50HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006146 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
6147 {0xaa, 0x83, 0x0003}, /* 00,83,03,aa */
6148 {0xaa, 0x84, 0x0054}, /* 00,84,54,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006149 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
6150 {0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
6151 {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
6152 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
6153 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
6154 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc, */
6155 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
6156 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
6157 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
6158 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
6159 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
6160 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
6161 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
6162 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
6163 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
6164 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
6165 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006166 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006167};
6168
6169/* "60HZ" light frequency banding filter */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006170static const struct usb_action tas5130c_vf0250_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006171 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
6172 {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */
6173 {0xaa, 0x84, 0x0062}, /* 00,84,62,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006174 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
6175 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,05,cc, */
6176 {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,88,cc, */
6177 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
6178 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
6179 {0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3b,cc, */
6180 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
6181 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
6182 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
6183 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
6184 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
6185 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
6186 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
6187 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
6188 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
6189 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
6190 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006191 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006192};
6193
6194/* "60HZScale" light frequency banding ilter */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006195static const struct usb_action tas5130c_vf0250_60HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006196 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
6197 {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */
6198 {0xaa, 0x84, 0x00c4}, /* 00,84,c4,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006199 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
6200 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,1,0b,cc, */
6201 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,2,10,cc, */
6202 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,5,00,cc, */
6203 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,6,00,cc, */
6204 {0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,7,76,cc, */
6205 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,c,0e,cc, */
6206 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,f,15,cc, */
6207 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,9,10,cc, */
6208 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,a,24,cc, */
6209 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,d,62,cc, */
6210 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,e,90,cc, */
6211 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,f,c8,cc, */
6212 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,0,ff,cc, */
6213 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,d,58,cc, */
6214 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
6215 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006216 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006217};
6218
6219/* "NoFliker" light frequency banding flter */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006220static const struct usb_action tas5130c_vf0250_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006221 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006222 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
6223 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
6224 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006225 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,0,00,cc, */
6226 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,05,cc, */
6227 {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,88,cc, */
6228 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
6229 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
6230 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
6231 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
6232 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
6233 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
6234 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
6235 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
6236 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
6237 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
6238 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006239 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006240};
6241
6242/* "NoFlikerScale" light frequency banding filter */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006243static const struct usb_action tas5130c_vf0250_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006244 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006245 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
6246 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
6247 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03006248 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
6249 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc, */
6250 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc, */
6251 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
6252 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
6253 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
6254 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
6255 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
6256 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
6257 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
6258 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
6259 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
6260 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
6261 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006262 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006263};
6264
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006265static int reg_r_i(struct gspca_dev *gspca_dev,
6266 __u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006267{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006268 usb_control_msg(gspca_dev->dev,
6269 usb_rcvctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006270 0xa1,
6271 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6272 0x01, /* value */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006273 index, gspca_dev->usb_buf, 1,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006274 500);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006275 return gspca_dev->usb_buf[0];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006276}
6277
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006278static int reg_r(struct gspca_dev *gspca_dev,
6279 __u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006280{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006281 int ret;
6282
6283 ret = reg_r_i(gspca_dev, index);
6284 PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
6285 return ret;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006286}
6287
6288static void reg_w_i(struct usb_device *dev,
6289 __u8 value,
6290 __u16 index)
6291{
6292 usb_control_msg(dev,
6293 usb_sndctrlpipe(dev, 0),
6294 0xa0,
6295 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
6296 value, index, NULL, 0,
6297 500);
6298}
6299
6300static void reg_w(struct usb_device *dev,
6301 __u8 value,
6302 __u16 index)
6303{
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006304 PDEBUG(D_USBO, "reg w [%04x] = %02x", index, value);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006305 reg_w_i(dev, value, index);
6306}
6307
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006308static __u16 i2c_read(struct gspca_dev *gspca_dev,
6309 __u8 reg)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006310{
6311 __u8 retbyte;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006312 __u16 retval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006313
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006314 reg_w_i(gspca_dev->dev, reg, 0x92);
6315 reg_w_i(gspca_dev->dev, 0x02, 0x90); /* <- read command */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006316 msleep(25);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006317 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006318 retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */
6319 retval |= reg_r_i(gspca_dev, 0x0096) << 8; /* read Hightbyte */
6320 PDEBUG(D_USBO, "i2c r [%02x] -> %04x (%02x)",
6321 reg, retval, retbyte);
6322 return retval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006323}
6324
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006325static __u8 i2c_write(struct gspca_dev *gspca_dev,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006326 __u8 reg,
6327 __u8 valL,
6328 __u8 valH)
6329{
6330 __u8 retbyte;
6331
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006332 reg_w_i(gspca_dev->dev, reg, 0x92);
6333 reg_w_i(gspca_dev->dev, valL, 0x93);
6334 reg_w_i(gspca_dev->dev, valH, 0x94);
6335 reg_w_i(gspca_dev->dev, 0x01, 0x90); /* <- write command */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006336 msleep(5);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006337 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006338 PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006339 reg, valH, valL, retbyte);
6340 return retbyte;
6341}
6342
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006343static void usb_exchange(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006344 const struct usb_action *action)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006345{
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006346 while (action->req) {
6347 switch (action->req) {
6348 case 0xa0: /* write register */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006349 reg_w(gspca_dev->dev, action->val, action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006350 break;
6351 case 0xa1: /* read status */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006352 reg_r(gspca_dev, action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006353 break;
6354 case 0xaa:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006355 i2c_write(gspca_dev,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006356 action->val, /* reg */
6357 action->idx & 0xff, /* valL */
6358 action->idx >> 8); /* valH */
6359 break;
6360 default:
6361/* case 0xdd: * delay */
6362 msleep(action->val / 64 + 10);
6363 break;
6364 }
6365 action++;
6366/* msleep(1); */
6367 }
6368}
6369
6370static void setmatrix(struct gspca_dev *gspca_dev)
6371{
6372 struct sd *sd = (struct sd *) gspca_dev;
6373 int i;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006374 const __u8 *matrix;
6375 static const __u8 gc0305_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006376 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006377 static const __u8 ov7620_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006378 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006379 static const __u8 po2030_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006380 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006381 static const __u8 vf0250_matrix[9] =
6382 {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006383
6384 switch (sd->sensor) {
6385 case SENSOR_GC0305:
Jean-Francois Moine13563f42008-11-06 15:35:21 -03006386 case SENSOR_HV7131B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006387 matrix = gc0305_matrix;
6388 break;
6389 case SENSOR_MC501CB:
6390 return; /* no matrix? */
6391 case SENSOR_OV7620:
6392/* case SENSOR_OV7648: */
6393 matrix = ov7620_matrix;
6394 break;
6395 case SENSOR_PO2030:
6396 matrix = po2030_matrix;
6397 break;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006398 case SENSOR_TAS5130C_VF0250:
6399 matrix = vf0250_matrix;
6400 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006401 default: /* matrix already loaded */
6402 return;
6403 }
6404 for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
6405 reg_w(gspca_dev->dev, matrix[i], 0x010a + i);
6406}
6407
6408static void setbrightness(struct gspca_dev *gspca_dev)
6409{
6410 struct sd *sd = (struct sd *) gspca_dev;
6411 __u8 brightness;
6412
6413 switch (sd->sensor) {
6414 case SENSOR_GC0305:
6415 case SENSOR_OV7620:
6416 case SENSOR_PO2030:
6417 return;
6418 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006419/*fixme: is it really write to 011d and 018d for all other sensors? */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006420 brightness = sd->brightness;
6421 reg_w(gspca_dev->dev, brightness, 0x011d);
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03006422 if (sd->sensor == SENSOR_HV7131B)
6423 return;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006424 if (brightness < 0x70)
6425 brightness += 0x10;
6426 else
6427 brightness = 0x80;
6428 reg_w(gspca_dev->dev, brightness, 0x018d);
6429}
6430
6431static void setsharpness(struct gspca_dev *gspca_dev)
6432{
6433 struct sd *sd = (struct sd *) gspca_dev;
6434 struct usb_device *dev = gspca_dev->dev;
6435 int sharpness;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006436 static const __u8 sharpness_tb[][2] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006437 {0x02, 0x03},
6438 {0x04, 0x07},
6439 {0x08, 0x0f},
6440 {0x10, 0x1e}
6441 };
6442
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006443 sharpness = sd->sharpness;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006444 reg_w(dev, sharpness_tb[sharpness][0], 0x01c6);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006445 reg_r(gspca_dev, 0x01c8);
6446 reg_r(gspca_dev, 0x01c9);
6447 reg_r(gspca_dev, 0x01ca);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006448 reg_w(dev, sharpness_tb[sharpness][1], 0x01cb);
6449}
6450
6451static void setcontrast(struct gspca_dev *gspca_dev)
6452{
6453 struct sd *sd = (struct sd *) gspca_dev;
6454 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006455 const __u8 *Tgamma, *Tgradient;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006456 int g, i, k;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006457 static const __u8 kgamma_tb[16] = /* delta for contrast */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006458 {0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08,
6459 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006460 static const __u8 kgrad_tb[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006461 {0x1b, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00,
6462 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x04};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006463 static const __u8 Tgamma_1[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006464 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
6465 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006466 static const __u8 Tgradient_1[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006467 {0x00, 0x01, 0x05, 0x0b, 0x10, 0x15, 0x18, 0x1a,
6468 0x1a, 0x18, 0x16, 0x14, 0x12, 0x0f, 0x0d, 0x06};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006469 static const __u8 Tgamma_2[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006470 {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
6471 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006472 static const __u8 Tgradient_2[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006473 {0x05, 0x0f, 0x16, 0x1a, 0x19, 0x19, 0x17, 0x15,
6474 0x12, 0x10, 0x0e, 0x0b, 0x09, 0x08, 0x06, 0x03};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006475 static const __u8 Tgamma_3[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006476 {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
6477 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006478 static const __u8 Tgradient_3[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006479 {0x0c, 0x16, 0x1b, 0x1c, 0x19, 0x18, 0x15, 0x12,
6480 0x10, 0x0d, 0x0b, 0x09, 0x08, 0x06, 0x05, 0x03};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006481 static const __u8 Tgamma_4[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006482 {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
6483 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006484 static const __u8 Tgradient_4[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006485 {0x26, 0x22, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0d,
6486 0x0b, 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006487 static const __u8 Tgamma_5[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006488 {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
6489 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006490 static const __u8 Tgradient_5[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006491 {0x37, 0x26, 0x20, 0x1a, 0x14, 0x10, 0x0e, 0x0b,
6492 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x02};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006493 static const __u8 Tgamma_6[16] = /* ?? was gamma 5 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006494 {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
6495 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006496 static const __u8 Tgradient_6[16] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006497 {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
6498 0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006499 static const __u8 *gamma_tb[] = {
Harvey Harrisonefab8212008-07-05 06:12:47 -03006500 NULL, Tgamma_1, Tgamma_2,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006501 Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
6502 };
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006503 static const __u8 *gradient_tb[] = {
Harvey Harrisonefab8212008-07-05 06:12:47 -03006504 NULL, Tgradient_1, Tgradient_2,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006505 Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
6506 };
Jean-Francois Moine335b3f82008-07-30 04:53:02 -03006507#ifdef GSPCA_DEBUG
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006508 __u8 v[16];
6509#endif
6510
6511 Tgamma = gamma_tb[sd->gamma];
6512 Tgradient = gradient_tb[sd->gamma];
6513
6514 k = (sd->contrast - 128) /* -128 / 128 */
6515 * Tgamma[0];
6516 PDEBUG(D_CONF, "gamma:%d contrast:%d gamma coeff: %d/128",
6517 sd->gamma, sd->contrast, k);
6518 for (i = 0; i < 16; i++) {
6519 g = Tgamma[i] + kgamma_tb[i] * k / 128;
6520 if (g > 0xff)
6521 g = 0xff;
6522 else if (g <= 0)
6523 g = 1;
6524 reg_w(dev, g, 0x0120 + i); /* gamma */
Jean-Francois Moine335b3f82008-07-30 04:53:02 -03006525#ifdef GSPCA_DEBUG
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006526 if (gspca_debug & D_CONF)
6527 v[i] = g;
6528#endif
6529 }
6530 PDEBUG(D_CONF, "tb: %02x %02x %02x %02x %02x %02x %02x %02x",
6531 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6532 PDEBUG(D_CONF, " %02x %02x %02x %02x %02x %02x %02x %02x",
6533 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6534 for (i = 0; i < 16; i++) {
6535 g = Tgradient[i] - kgrad_tb[i] * k / 128;
6536 if (g > 0xff)
6537 g = 0xff;
6538 else if (g <= 0) {
6539 if (i != 15)
6540 g = 0;
6541 else
6542 g = 1;
6543 }
6544 reg_w(dev, g, 0x0130 + i); /* gradient */
Jean-Francois Moine335b3f82008-07-30 04:53:02 -03006545#ifdef GSPCA_DEBUG
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006546 if (gspca_debug & D_CONF)
6547 v[i] = g;
6548#endif
6549 }
6550 PDEBUG(D_CONF, " %02x %02x %02x %02x %02x %02x %02x %02x",
6551 v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
6552 PDEBUG(D_CONF, " %02x %02x %02x %02x %02x %02x %02x %02x",
6553 v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
6554}
6555
6556static void setquality(struct gspca_dev *gspca_dev)
6557{
6558 struct sd *sd = (struct sd *) gspca_dev;
6559 struct usb_device *dev = gspca_dev->dev;
6560 __u8 quality;
6561 __u8 frxt;
6562
6563 switch (sd->sensor) {
6564 case SENSOR_GC0305:
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03006565 case SENSOR_HV7131B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006566 case SENSOR_OV7620:
6567 case SENSOR_PO2030:
6568 return;
6569 }
6570/*fixme: is it really 0008 0007 0018 for all other sensors? */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006571 quality = sd->qindex;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006572 reg_w(dev, quality, 0x0008);
6573 frxt = 0x30;
6574 reg_w(dev, frxt, 0x0007);
6575 switch (quality) {
6576 case 0:
6577 case 1:
6578 case 2:
6579 frxt = 0xff;
6580 break;
6581 case 3:
6582 frxt = 0xf0;
6583 break;
6584 case 4:
6585 frxt = 0xe0;
6586 break;
6587 case 5:
6588 frxt = 0x20;
6589 break;
6590 }
6591 reg_w(dev, frxt, 0x0018);
6592}
6593
6594/* Matches the sensor's internal frame rate to the lighting frequency.
6595 * Valid frequencies are:
6596 * 50Hz, for European and Asian lighting (default)
6597 * 60Hz, for American lighting
6598 * 0 = No Fliker (for outdoore usage)
6599 * Returns: 0 for success
6600 */
6601static int setlightfreq(struct gspca_dev *gspca_dev)
6602{
6603 struct sd *sd = (struct sd *) gspca_dev;
6604 int i, mode;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006605 const struct usb_action *zc3_freq;
6606 static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006607/* SENSOR_CS2102 0 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006608 {cs2102_NoFliker, cs2102_NoFlikerScale,
6609 cs2102_50HZ, cs2102_50HZScale,
6610 cs2102_60HZ, cs2102_60HZScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006611/* SENSOR_CS2102K 1 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006612 {cs2102_NoFliker, cs2102_NoFlikerScale,
Costantino Leandro5be8b73e2008-09-09 04:32:46 -03006613 NULL, NULL, /* currently disabled */
6614 NULL, NULL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006615/* SENSOR_GC0305 2 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006616 {gc0305_NoFliker, gc0305_NoFliker,
6617 gc0305_50HZ, gc0305_50HZ,
6618 gc0305_60HZ, gc0305_60HZ},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006619/* SENSOR_HDCS2020 3 */
Harvey Harrisonefab8212008-07-05 06:12:47 -03006620 {NULL, NULL,
6621 NULL, NULL,
6622 NULL, NULL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006623/* SENSOR_HDCS2020b 4 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006624 {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
6625 hdcs2020b_50HZ, hdcs2020b_50HZ,
6626 hdcs2020b_60HZ, hdcs2020b_60HZ},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006627/* SENSOR_HV7131B 5 */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03006628 {hv7131b_NoFlikerScale, hv7131b_NoFliker,
6629 hv7131b_50HZScale, hv7131b_50HZ,
6630 hv7131b_60HZScale, hv7131b_60HZ},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006631/* SENSOR_HV7131C 6 */
Harvey Harrisonefab8212008-07-05 06:12:47 -03006632 {NULL, NULL,
6633 NULL, NULL,
6634 NULL, NULL},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006635/* SENSOR_ICM105A 7 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006636 {icm105a_NoFliker, icm105a_NoFlikerScale,
6637 icm105a_50HZ, icm105a_50HZScale,
6638 icm105a_60HZ, icm105a_60HZScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006639/* SENSOR_MC501CB 8 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006640 {MC501CB_NoFliker, MC501CB_NoFlikerScale,
6641 MC501CB_50HZ, MC501CB_50HZScale,
6642 MC501CB_60HZ, MC501CB_60HZScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006643/* SENSOR_OV7620 9 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006644 {OV7620_NoFliker, OV7620_NoFliker,
6645 OV7620_50HZ, OV7620_50HZ,
6646 OV7620_60HZ, OV7620_60HZ},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006647/* SENSOR_OV7630C 10 */
Harvey Harrisonefab8212008-07-05 06:12:47 -03006648 {NULL, NULL,
6649 NULL, NULL,
6650 NULL, NULL},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006651/* SENSOR_PAS106 11 */
6652 {pas106b_NoFliker, pas106b_NoFliker,
6653 pas106b_50HZ, pas106b_50HZ,
6654 pas106b_60HZ, pas106b_60HZ},
6655/* SENSOR_PB0330 12 */
6656 {pb0330_NoFliker, pb0330_NoFlikerScale,
6657 pb0330_50HZ, pb0330_50HZScale,
6658 pb0330_60HZ, pb0330_60HZScale},
6659/* SENSOR_PO2030 13 */
6660 {PO2030_NoFliker, PO2030_NoFliker,
6661 PO2030_50HZ, PO2030_50HZ,
6662 PO2030_60HZ, PO2030_60HZ},
6663/* SENSOR_TAS5130CK 14 */
6664 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6665 tas5130cxx_50HZ, tas5130cxx_50HZScale,
6666 tas5130cxx_60HZ, tas5130cxx_60HZScale},
6667/* SENSOR_TAS5130CXX 15 */
6668 {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
6669 tas5130cxx_50HZ, tas5130cxx_50HZScale,
6670 tas5130cxx_60HZ, tas5130cxx_60HZScale},
6671/* SENSOR_TAS5130C_VF0250 16 */
6672 {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale,
6673 tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale,
6674 tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006675 };
6676
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006677 i = sd->lightfreq * 2;
Jean-Francois Moinec2446b32008-07-05 11:49:20 -03006678 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006679 if (!mode)
6680 i++; /* 640x480 */
6681 zc3_freq = freq_tb[(int) sd->sensor][i];
Harvey Harrisonefab8212008-07-05 06:12:47 -03006682 if (zc3_freq != NULL) {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006683 usb_exchange(gspca_dev, zc3_freq);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006684 switch (sd->sensor) {
6685 case SENSOR_GC0305:
6686 if (mode /* if 320x240 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006687 && sd->lightfreq == 1) /* and 50Hz */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006688 reg_w(gspca_dev->dev, 0x85, 0x018d);
6689 /* win: 0x80, 0x018d */
6690 break;
6691 case SENSOR_OV7620:
6692 if (!mode) { /* if 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006693 if (sd->lightfreq != 0) /* and 50 or 60 Hz */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006694 reg_w(gspca_dev->dev, 0x40, 0x0002);
6695 else
6696 reg_w(gspca_dev->dev, 0x44, 0x0002);
6697 }
6698 break;
6699 }
6700 }
6701 return 0;
6702}
6703
6704static void setautogain(struct gspca_dev *gspca_dev)
6705{
6706 struct sd *sd = (struct sd *) gspca_dev;
6707 __u8 autoval;
6708
6709 if (sd->autogain)
6710 autoval = 0x42;
6711 else
6712 autoval = 0x02;
6713 reg_w(gspca_dev->dev, autoval, 0x0180);
6714}
6715
6716static void send_unknown(struct usb_device *dev, int sensor)
6717{
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006718 reg_w(dev, 0x01, 0x0000); /* led off */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006719 switch (sensor) {
6720 case SENSOR_PAS106:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006721 reg_w(dev, 0x03, 0x003a);
6722 reg_w(dev, 0x0c, 0x003b);
6723 reg_w(dev, 0x08, 0x0038);
6724 break;
6725 case SENSOR_GC0305:
6726 case SENSOR_OV7620:
6727 case SENSOR_PB0330:
6728 case SENSOR_PO2030:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006729 reg_w(dev, 0x0d, 0x003a);
6730 reg_w(dev, 0x02, 0x003b);
6731 reg_w(dev, 0x00, 0x0038);
6732 break;
6733 }
6734}
6735
6736/* start probe 2 wires */
6737static void start_2wr_probe(struct usb_device *dev, int sensor)
6738{
6739 reg_w(dev, 0x01, 0x0000);
6740 reg_w(dev, sensor, 0x0010);
6741 reg_w(dev, 0x01, 0x0001);
6742 reg_w(dev, 0x03, 0x0012);
6743 reg_w(dev, 0x01, 0x0012);
6744/* msleep(2); */
6745}
6746
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006747static int sif_probe(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006748{
6749 __u16 checkword;
6750
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006751 start_2wr_probe(gspca_dev->dev, 0x0f); /* PAS106 */
6752 reg_w(gspca_dev->dev, 0x08, 0x008d);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006753 msleep(150);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006754 checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
6755 | ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006756 PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
6757 if (checkword == 0x0007) {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006758 send_unknown(gspca_dev->dev, SENSOR_PAS106);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006759 return 0x0f; /* PAS106 */
6760 }
6761 return -1;
6762}
6763
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006764static int vga_2wr_probe(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006765{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006766 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006767 __u8 retbyte;
6768 __u16 checkword;
6769
6770 start_2wr_probe(dev, 0x00); /* HV7131B */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006771 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6772 retbyte = i2c_read(gspca_dev, 0x01);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006773 if (retbyte != 0)
6774 return 0x00; /* HV7131B */
6775
6776 start_2wr_probe(dev, 0x04); /* CS2102 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006777 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6778 retbyte = i2c_read(gspca_dev, 0x01);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006779 if (retbyte != 0)
6780 return 0x04; /* CS2102 */
6781
6782 start_2wr_probe(dev, 0x06); /* OmniVision */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006783 reg_w(dev, 0x08, 0x008d);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006784 i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
6785 retbyte = i2c_read(gspca_dev, 0x11);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006786 if (retbyte != 0) {
6787 /* (should have returned 0xaa) --> Omnivision? */
6788 /* reg_r 0x10 -> 0x06 --> */
6789 goto ov_check;
6790 }
6791
6792 start_2wr_probe(dev, 0x08); /* HDCS2020 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006793 i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
6794 retbyte = i2c_read(gspca_dev, 0x15);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006795 if (retbyte != 0)
6796 return 0x08; /* HDCS2020 */
6797
6798 start_2wr_probe(dev, 0x0a); /* PB0330 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006799 i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
6800 retbyte = i2c_read(gspca_dev, 0x07);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006801 if (retbyte != 0)
6802 return 0x0a; /* PB0330 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006803 retbyte = i2c_read(gspca_dev, 0x03);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006804 if (retbyte != 0)
6805 return 0x0a; /* PB0330 ?? */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006806 retbyte = i2c_read(gspca_dev, 0x04);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006807 if (retbyte != 0)
6808 return 0x0a; /* PB0330 ?? */
6809
6810 start_2wr_probe(dev, 0x0c); /* ICM105A */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006811 i2c_write(gspca_dev, 0x01, 0x11, 0x00);
6812 retbyte = i2c_read(gspca_dev, 0x01);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006813 if (retbyte != 0)
6814 return 0x0c; /* ICM105A */
6815
6816 start_2wr_probe(dev, 0x0e); /* PAS202BCB */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006817 reg_w(dev, 0x08, 0x008d);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006818 i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006819 msleep(500);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006820 retbyte = i2c_read(gspca_dev, 0x03);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006821 if (retbyte != 0)
6822 return 0x0e; /* PAS202BCB */
6823
6824 start_2wr_probe(dev, 0x02); /* ?? */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006825 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6826 retbyte = i2c_read(gspca_dev, 0x01);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006827 if (retbyte != 0)
6828 return 0x02; /* ?? */
6829ov_check:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006830 reg_r(gspca_dev, 0x0010); /* ?? */
6831 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006832
6833 reg_w(dev, 0x01, 0x0000);
6834 reg_w(dev, 0x01, 0x0001);
6835 reg_w(dev, 0x06, 0x0010); /* OmniVision */
6836 reg_w(dev, 0xa1, 0x008b);
6837 reg_w(dev, 0x08, 0x008d);
6838 msleep(500);
6839 reg_w(dev, 0x01, 0x0012);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006840 i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
6841 retbyte = i2c_read(gspca_dev, 0x0a);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006842 checkword = retbyte << 8;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006843 retbyte = i2c_read(gspca_dev, 0x0b);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006844 checkword |= retbyte;
6845 PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", checkword);
6846 switch (checkword) {
6847 case 0x7631: /* OV7630C */
6848 reg_w(dev, 0x06, 0x0010);
6849 break;
6850 case 0x7620: /* OV7620 */
6851 case 0x7648: /* OV7648 */
6852 break;
6853 default:
6854 return -1; /* not OmniVision */
6855 }
6856 return checkword;
6857}
6858
6859struct sensor_by_chipset_revision {
6860 __u16 revision;
6861 __u8 internal_sensor_id;
6862};
6863static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
6864 {0xc001, 0x13}, /* MI0360 */
6865 {0xe001, 0x13},
6866 {0x8001, 0x13},
6867 {0x8000, 0x14}, /* CS2102K */
6868 {0x8400, 0x15}, /* TAS5130K */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006869};
6870
6871static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6872{
6873 struct sd *sd = (struct sd *) gspca_dev;
6874 struct usb_device *dev = gspca_dev->dev;
6875 int i;
6876 __u8 retbyte;
6877 __u16 checkword;
6878
6879/*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
6880 reg_w(dev, 0x02, 0x0010);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006881 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006882 reg_w(dev, 0x01, 0x0000);
6883 reg_w(dev, 0x00, 0x0010);
6884 reg_w(dev, 0x01, 0x0001);
6885 reg_w(dev, 0x91, 0x008b);
6886 reg_w(dev, 0x03, 0x0012);
6887 reg_w(dev, 0x01, 0x0012);
6888 reg_w(dev, 0x05, 0x0012);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006889 retbyte = i2c_read(gspca_dev, 0x14);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006890 if (retbyte != 0)
6891 return 0x11; /* HV7131R */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006892 retbyte = i2c_read(gspca_dev, 0x15);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006893 if (retbyte != 0)
6894 return 0x11; /* HV7131R */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006895 retbyte = i2c_read(gspca_dev, 0x16);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006896 if (retbyte != 0)
6897 return 0x11; /* HV7131R */
6898
6899 reg_w(dev, 0x02, 0x0010);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006900 retbyte = reg_r(gspca_dev, 0x000b);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006901 checkword = retbyte << 8;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006902 retbyte = reg_r(gspca_dev, 0x000a);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006903 checkword |= retbyte;
6904 PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006905 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006906 /* this is tested only once anyway */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006907 for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006908 if (chipset_revision_sensor[i].revision == checkword) {
6909 sd->chip_revision = checkword;
6910 send_unknown(dev, SENSOR_PB0330);
6911 return chipset_revision_sensor[i].internal_sensor_id;
6912 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006913 }
6914
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006915 reg_w(dev, 0x01, 0x0000); /* check ?? */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006916 reg_w(dev, 0x01, 0x0001);
6917 reg_w(dev, 0xdd, 0x008b);
6918 reg_w(dev, 0x0a, 0x0010);
6919 reg_w(dev, 0x03, 0x0012);
6920 reg_w(dev, 0x01, 0x0012);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006921 retbyte = i2c_read(gspca_dev, 0x00);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006922 if (retbyte != 0) {
6923 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6924 return 0x0a; /* ?? */
6925 }
6926
6927 reg_w(dev, 0x01, 0x0000);
6928 reg_w(dev, 0x01, 0x0001);
6929 reg_w(dev, 0x98, 0x008b);
6930 reg_w(dev, 0x01, 0x0010);
6931 reg_w(dev, 0x03, 0x0012);
6932 msleep(2);
6933 reg_w(dev, 0x01, 0x0012);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006934 retbyte = i2c_read(gspca_dev, 0x00);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006935 if (retbyte != 0) {
6936 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006937 if (retbyte == 0x11) /* VF0250 */
6938 return 0x0250;
6939 if (retbyte == 0x29) /* gc0305 */
6940 send_unknown(dev, SENSOR_GC0305);
6941 return retbyte;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006942 }
6943
6944 reg_w(dev, 0x01, 0x0000); /* check OmniVision */
6945 reg_w(dev, 0x01, 0x0001);
6946 reg_w(dev, 0xa1, 0x008b);
6947 reg_w(dev, 0x08, 0x008d);
6948 reg_w(dev, 0x06, 0x0010);
6949 reg_w(dev, 0x01, 0x0012);
6950 reg_w(dev, 0x05, 0x0012);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006951 if (i2c_read(gspca_dev, 0x1c) == 0x7f /* OV7610 - manufacturer ID */
6952 && i2c_read(gspca_dev, 0x1d) == 0xa2) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006953 send_unknown(dev, SENSOR_OV7620);
6954 return 0x06; /* OmniVision confirm ? */
6955 }
6956
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006957 reg_w(dev, 0x01, 0x0000);
6958 reg_w(dev, 0x00, 0x0002);
6959 reg_w(dev, 0x01, 0x0010);
6960 reg_w(dev, 0x01, 0x0001);
6961 reg_w(dev, 0xee, 0x008b);
6962 reg_w(dev, 0x03, 0x0012);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006963/* msleep(150); */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006964 reg_w(dev, 0x01, 0x0012);
6965 reg_w(dev, 0x05, 0x0012);
6966 retbyte = i2c_read(gspca_dev, 0x0000); /* ID 0 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006967 checkword = retbyte << 8;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006968 retbyte = i2c_read(gspca_dev, 0x0001); /* ID 1 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006969 checkword |= retbyte;
6970 PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword);
6971 if (checkword == 0x2030) {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006972 retbyte = i2c_read(gspca_dev, 0x02); /* revision number */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006973 PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
6974 send_unknown(dev, SENSOR_PO2030);
6975 return checkword;
6976 }
6977
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006978 reg_w(dev, 0x01, 0x0000);
6979 reg_w(dev, 0x0a, 0x0010);
6980 reg_w(dev, 0xd3, 0x008b);
6981 reg_w(dev, 0x01, 0x0001);
6982 reg_w(dev, 0x03, 0x0012);
6983 reg_w(dev, 0x01, 0x0012);
6984 reg_w(dev, 0x05, 0x0001);
6985 reg_w(dev, 0xd3, 0x008b);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006986 retbyte = i2c_read(gspca_dev, 0x01);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006987 if (retbyte != 0) {
6988 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
6989 return 0x0a; /* ?? */
6990 }
6991 return -1;
6992}
6993
6994static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6995{
6996 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006997 int sensor, sensor2;
6998
6999 switch (sd->sensor) {
7000 case SENSOR_MC501CB:
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03007001 return -1; /* don't probe */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007002 case SENSOR_TAS5130C_VF0250:
Hans de Goede34662342008-09-03 16:47:28 -03007003 /* may probe but with no write in reg 0x0010 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007004 return -1; /* don't probe */
Hans de Goede34662342008-09-03 16:47:28 -03007005 case SENSOR_PAS106:
7006 sensor = sif_probe(gspca_dev);
7007 if (sensor >= 0)
7008 return sensor;
7009 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007010 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007011 sensor = vga_2wr_probe(gspca_dev);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007012 if (sensor >= 0) {
7013 if (sensor < 0x7600)
7014 return sensor;
7015 /* next probe is needed for OmniVision ? */
7016 }
7017 sensor2 = vga_3wr_probe(gspca_dev);
Hans de Goede34662342008-09-03 16:47:28 -03007018 if (sensor2 >= 0
7019 && sensor >= 0)
7020 return sensor;
7021 return sensor2;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007022}
7023
7024/* this function is called at probe time */
7025static int sd_config(struct gspca_dev *gspca_dev,
7026 const struct usb_device_id *id)
7027{
7028 struct sd *sd = (struct sd *) gspca_dev;
7029 struct cam *cam;
7030 int sensor;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007031 int vga = 1; /* 1: vga, 0: sif */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007032 static const __u8 gamma[SENSOR_MAX] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007033 5, /* SENSOR_CS2102 0 */
7034 5, /* SENSOR_CS2102K 1 */
7035 4, /* SENSOR_GC0305 2 */
7036 4, /* SENSOR_HDCS2020 3 */
7037 4, /* SENSOR_HDCS2020b 4 */
7038 4, /* SENSOR_HV7131B 5 */
7039 4, /* SENSOR_HV7131C 6 */
7040 4, /* SENSOR_ICM105A 7 */
7041 4, /* SENSOR_MC501CB 8 */
7042 3, /* SENSOR_OV7620 9 */
7043 4, /* SENSOR_OV7630C 10 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007044 4, /* SENSOR_PAS106 11 */
7045 4, /* SENSOR_PB0330 12 */
7046 4, /* SENSOR_PO2030 13 */
7047 4, /* SENSOR_TAS5130CK 14 */
7048 4, /* SENSOR_TAS5130CXX 15 */
7049 3, /* SENSOR_TAS5130C_VF0250 16 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007050 };
7051
7052 /* define some sensors from the vendor/product */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007053 sd->sharpness = 2;
Hans de Goeded6db35e2008-09-03 17:12:13 -03007054 sd->sensor = id->driver_info;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007055 sensor = zcxx_probeSensor(gspca_dev);
7056 if (sensor >= 0)
7057 PDEBUG(D_PROBE, "probe sensor -> %02x", sensor);
7058 if ((unsigned) force_sensor < SENSOR_MAX) {
7059 sd->sensor = force_sensor;
7060 PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
7061 } else {
7062 switch (sensor) {
7063 case -1:
7064 switch (sd->sensor) {
7065 case SENSOR_MC501CB:
7066 PDEBUG(D_PROBE, "Sensor MC501CB");
7067 break;
7068 case SENSOR_TAS5130C_VF0250:
7069 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7070 break;
7071 default:
7072 PDEBUG(D_PROBE,
7073 "Sensor UNKNOW_0 force Tas5130");
7074 sd->sensor = SENSOR_TAS5130CXX;
7075 }
7076 break;
7077 case 0:
7078 PDEBUG(D_PROBE, "Find Sensor HV7131B");
7079 sd->sensor = SENSOR_HV7131B;
7080 break;
7081 case 0x04:
7082 PDEBUG(D_PROBE, "Find Sensor CS2102");
7083 sd->sensor = SENSOR_CS2102;
7084 break;
7085 case 0x08:
7086 PDEBUG(D_PROBE, "Find Sensor HDCS2020(b)");
7087 sd->sensor = SENSOR_HDCS2020b;
7088 break;
7089 case 0x0a:
7090 PDEBUG(D_PROBE,
7091 "Find Sensor PB0330. Chip revision %x",
7092 sd->chip_revision);
7093 sd->sensor = SENSOR_PB0330;
7094 break;
7095 case 0x0c:
7096 PDEBUG(D_PROBE, "Find Sensor ICM105A");
7097 sd->sensor = SENSOR_ICM105A;
7098 break;
7099 case 0x0e:
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007100 PDEBUG(D_PROBE, "Find Sensor HDCS2020");
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007101 sd->sensor = SENSOR_HDCS2020;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007102 sd->sharpness = 1;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007103 break;
7104 case 0x0f:
7105 PDEBUG(D_PROBE, "Find Sensor PAS106");
7106 sd->sensor = SENSOR_PAS106;
7107 vga = 0; /* SIF */
7108 break;
7109 case 0x10:
7110 case 0x12:
7111 PDEBUG(D_PROBE, "Find Sensor TAS5130");
7112 sd->sensor = SENSOR_TAS5130CXX;
7113 break;
7114 case 0x11:
7115 PDEBUG(D_PROBE, "Find Sensor HV7131R(c)");
7116 sd->sensor = SENSOR_HV7131C;
7117 break;
7118 case 0x13:
7119 PDEBUG(D_PROBE,
7120 "Find Sensor MI0360. Chip revision %x",
7121 sd->chip_revision);
7122 sd->sensor = SENSOR_PB0330;
7123 break;
7124 case 0x14:
7125 PDEBUG(D_PROBE,
7126 "Find Sensor CS2102K?. Chip revision %x",
7127 sd->chip_revision);
7128 sd->sensor = SENSOR_CS2102K;
7129 break;
7130 case 0x15:
7131 PDEBUG(D_PROBE,
7132 "Find Sensor TAS5130CK?. Chip revision %x",
7133 sd->chip_revision);
7134 sd->sensor = SENSOR_TAS5130CK;
7135 break;
7136 case 0x29:
7137 PDEBUG(D_PROBE, "Find Sensor GC0305");
7138 sd->sensor = SENSOR_GC0305;
7139 break;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03007140 case 0x0250:
7141 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7142 sd->sensor = SENSOR_TAS5130C_VF0250;
7143 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007144 case 0x2030:
7145 PDEBUG(D_PROBE, "Find Sensor PO2030");
7146 sd->sensor = SENSOR_PO2030;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007147 sd->sharpness = 0; /* from win traces */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007148 break;
7149 case 0x7620:
7150 PDEBUG(D_PROBE, "Find Sensor OV7620");
7151 sd->sensor = SENSOR_OV7620;
7152 break;
7153 case 0x7648:
7154 PDEBUG(D_PROBE, "Find Sensor OV7648");
7155 sd->sensor = SENSOR_OV7620; /* same sensor (?) */
7156 break;
7157 default:
7158 PDEBUG(D_ERR|D_PROBE, "Unknown sensor %02x", sensor);
7159 return -EINVAL;
7160 }
7161 }
7162 if (sensor < 0x20) {
7163 if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
7164 reg_w(gspca_dev->dev, 0x02, 0x0010);
7165 else
7166 reg_w(gspca_dev->dev, sensor & 0x0f, 0x0010);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007167 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007168 }
7169
7170 cam = &gspca_dev->cam;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007171 cam->epaddr = 0x01;
7172/*fixme:test*/
7173 gspca_dev->nbalt--;
7174 if (vga) {
7175 cam->cam_mode = vga_mode;
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03007176 cam->nmodes = ARRAY_SIZE(vga_mode);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007177 } else {
7178 cam->cam_mode = sif_mode;
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03007179 cam->nmodes = ARRAY_SIZE(sif_mode);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007180 }
7181 sd->qindex = 1;
7182 sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
7183 sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007184 sd->gamma = gamma[(int) sd->sensor];
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007185 sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value;
7186 sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007187
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03007188 switch (sd->sensor) {
7189 case SENSOR_GC0305:
7190 case SENSOR_OV7620:
7191 case SENSOR_PO2030:
7192 gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX);
7193 break;
7194 case SENSOR_HDCS2020:
7195 case SENSOR_HV7131B:
7196 case SENSOR_HV7131C:
7197 case SENSOR_OV7630C:
7198 gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
7199 break;
7200 }
7201
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007202 /* switch the led off */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007203 reg_w(gspca_dev->dev, 0x01, 0x0000);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007204 return 0;
7205}
7206
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03007207/* this function is called at probe and resume time */
7208static int sd_init(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007209{
7210 reg_w(gspca_dev->dev, 0x01, 0x0000);
7211 return 0;
7212}
7213
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03007214static int sd_start(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007215{
7216 struct sd *sd = (struct sd *) gspca_dev;
7217 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007218 const struct usb_action *zc3_init;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007219 int mode;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007220 static const struct usb_action *init_tb[SENSOR_MAX][2] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007221 {cs2102_InitialScale, cs2102_Initial}, /* 0 */
7222 {cs2102K_InitialScale, cs2102K_Initial}, /* 1 */
7223 {gc0305_Initial, gc0305_InitialScale}, /* 2 */
7224 {hdcs2020xx_InitialScale, hdcs2020xx_Initial}, /* 3 */
7225 {hdcs2020xb_InitialScale, hdcs2020xb_Initial}, /* 4 */
7226 {hv7131bxx_InitialScale, hv7131bxx_Initial}, /* 5 */
7227 {hv7131cxx_InitialScale, hv7131cxx_Initial}, /* 6 */
7228 {icm105axx_InitialScale, icm105axx_Initial}, /* 7 */
7229 {MC501CB_InitialScale, MC501CB_Initial}, /* 9 */
7230 {OV7620_mode0, OV7620_mode1}, /* 9 */
7231 {ov7630c_InitialScale, ov7630c_Initial}, /* 10 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007232 {pas106b_InitialScale, pas106b_Initial}, /* 11 */
7233 {pb0330xx_InitialScale, pb0330xx_Initial}, /* 12 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007234/* or {pb03303x_InitialScale, pb03303x_Initial}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007235 {PO2030_mode0, PO2030_mode1}, /* 13 */
7236 {tas5130CK_InitialScale, tas5130CK_Initial}, /* 14 */
7237 {tas5130cxx_InitialScale, tas5130cxx_Initial}, /* 15 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007238 {tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007239 /* 16 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007240 };
7241
Jean-Francois Moinec2446b32008-07-05 11:49:20 -03007242 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007243 zc3_init = init_tb[(int) sd->sensor][mode];
7244 switch (sd->sensor) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007245 case SENSOR_HV7131C:
7246 zcxx_probeSensor(gspca_dev);
7247 break;
7248 case SENSOR_PAS106:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007249 usb_exchange(gspca_dev, pas106b_Initial_com);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007250 break;
7251 case SENSOR_PB0330:
7252 if (mode) {
7253 if (sd->chip_revision == 0xc001
7254 || sd->chip_revision == 0xe001
7255 || sd->chip_revision == 0x8001)
7256 zc3_init = pb03303x_Initial;
7257 } else {
7258 if (sd->chip_revision == 0xc001
7259 || sd->chip_revision == 0xe001
7260 || sd->chip_revision == 0x8001)
7261 zc3_init = pb03303x_InitialScale;
7262 }
7263 break;
7264 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007265 usb_exchange(gspca_dev, zc3_init);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007266
7267 switch (sd->sensor) {
7268 case SENSOR_GC0305:
7269 case SENSOR_OV7620:
7270 case SENSOR_PO2030:
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03007271 case SENSOR_TAS5130C_VF0250:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007272 msleep(100); /* ?? */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007273 reg_r(gspca_dev, 0x0002); /* --> 0x40 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007274 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */
7275 reg_w(dev, 0x15, 0x01ae);
7276 reg_w(dev, 0x0d, 0x003a);
7277 reg_w(dev, 0x02, 0x003b);
7278 reg_w(dev, 0x00, 0x0038);
7279 break;
7280 }
7281
7282 setmatrix(gspca_dev);
7283 setbrightness(gspca_dev);
7284 switch (sd->sensor) {
7285 case SENSOR_OV7620:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007286 reg_r(gspca_dev, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007287 reg_w(dev, 0x00, 0x0008);
7288 break;
7289 case SENSOR_GC0305:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007290 reg_r(gspca_dev, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007291 /* fall thru */
7292 case SENSOR_PO2030:
7293 reg_w(dev, 0x03, 0x0008);
7294 break;
7295 }
7296 setsharpness(gspca_dev);
7297
7298 /* set the gamma tables when not set */
7299 switch (sd->sensor) {
7300 case SENSOR_CS2102: /* gamma set in xxx_Initial */
7301 case SENSOR_CS2102K:
7302 case SENSOR_HDCS2020:
7303 case SENSOR_HDCS2020b:
7304 case SENSOR_PB0330: /* pb with chip_revision - see above */
7305 case SENSOR_OV7630C:
7306 case SENSOR_TAS5130CK:
7307 break;
7308 default:
7309 setcontrast(gspca_dev);
7310 break;
7311 }
7312 setmatrix(gspca_dev); /* one more time? */
7313 switch (sd->sensor) {
7314 case SENSOR_OV7620:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007315 reg_r(gspca_dev, 0x0180); /* from win */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007316 reg_w(dev, 0x00, 0x0180);
7317 break;
7318 default:
7319 setquality(gspca_dev);
7320 break;
7321 }
7322 setlightfreq(gspca_dev);
7323
7324 switch (sd->sensor) {
7325 case SENSOR_GC0305:
7326 case SENSOR_OV7620:
7327 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */
7328 reg_w(dev, 0x15, 0x01ae);
7329 sd->autogain = 0;
7330 break;
7331 case SENSOR_PO2030:
7332 reg_w(dev, 0x40, 0x0117); /* (from win traces) */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007333 reg_r(gspca_dev, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007334 break;
7335 }
7336
7337 setautogain(gspca_dev);
7338 switch (sd->sensor) {
7339 case SENSOR_GC0305:
7340/* setlightfreq(gspca_dev); ?? (end: 80 -> [18d]) */
7341 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */
7342 reg_w(dev, 0x15, 0x01ae);
7343 reg_w(dev, 0x40, 0x0180);
7344 reg_w(dev, 0x40, 0x0117);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007345 reg_r(gspca_dev, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007346 sd->autogain = 1;
7347 setautogain(gspca_dev);
7348 break;
7349 case SENSOR_OV7620:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007350 i2c_read(gspca_dev, 0x13); /*fixme: returns 0xa3 */
7351 i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
7352 /*fixme: returned value to send? */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007353 reg_w(dev, 0x40, 0x0117); /* (from win traces) */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007354 reg_r(gspca_dev, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007355 setautogain(gspca_dev);
7356 msleep(500);
7357 break;
7358 case SENSOR_PO2030:
7359 msleep(500);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03007360 reg_r(gspca_dev, 0x0008);
7361 reg_r(gspca_dev, 0x0007);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007362 reg_w(dev, 0x00, 0x0007); /* (from win traces) */
7363 reg_w(dev, 0x02, 0x0008);
7364 break;
7365 }
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03007366 return 0;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007367}
7368
Jean-Francois Moine98522a72008-11-18 06:33:08 -03007369/* called on streamoff with alt 0 and on disconnect */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007370static void sd_stop0(struct gspca_dev *gspca_dev)
7371{
7372 struct sd *sd = (struct sd *) gspca_dev;
7373
Jean-Francois Moine98522a72008-11-18 06:33:08 -03007374 if (!gspca_dev->present)
7375 return;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007376 send_unknown(gspca_dev->dev, sd->sensor);
7377}
7378
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007379static void sd_pkt_scan(struct gspca_dev *gspca_dev,
7380 struct gspca_frame *frame,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007381 __u8 *data,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007382 int len)
7383{
7384
7385 if (data[0] == 0xff && data[1] == 0xd8) { /* start of frame */
7386 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
7387 data, 0);
7388 /* put the JPEG header in the new frame */
7389 jpeg_put_header(gspca_dev, frame,
7390 ((struct sd *) gspca_dev)->qindex,
7391 0x21);
7392 /* remove the webcam's header:
7393 * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
7394 * - 'ss ss' is the frame sequence number (BE)
7395 * - 'ww ww' and 'hh hh' are the window dimensions (BE)
7396 * - 'pp pp' is the packet sequence number (BE)
7397 */
7398 data += 18;
7399 len -= 18;
7400 }
7401 gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
7402}
7403
7404static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
7405{
7406 struct sd *sd = (struct sd *) gspca_dev;
7407
7408 sd->brightness = val;
7409 if (gspca_dev->streaming)
7410 setbrightness(gspca_dev);
7411 return 0;
7412}
7413
7414static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
7415{
7416 struct sd *sd = (struct sd *) gspca_dev;
7417
7418 *val = sd->brightness;
7419 return 0;
7420}
7421
7422static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
7423{
7424 struct sd *sd = (struct sd *) gspca_dev;
7425
7426 sd->contrast = val;
7427 if (gspca_dev->streaming)
7428 setcontrast(gspca_dev);
7429 return 0;
7430}
7431
7432static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
7433{
7434 struct sd *sd = (struct sd *) gspca_dev;
7435
7436 *val = sd->contrast;
7437 return 0;
7438}
7439
7440static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
7441{
7442 struct sd *sd = (struct sd *) gspca_dev;
7443
7444 sd->autogain = val;
7445 if (gspca_dev->streaming)
7446 setautogain(gspca_dev);
7447 return 0;
7448}
7449
7450static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val)
7451{
7452 struct sd *sd = (struct sd *) gspca_dev;
7453
7454 *val = sd->autogain;
7455 return 0;
7456}
7457
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007458static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val)
7459{
7460 struct sd *sd = (struct sd *) gspca_dev;
7461
7462 sd->gamma = val;
7463 if (gspca_dev->streaming)
7464 setcontrast(gspca_dev);
7465 return 0;
7466}
7467
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007468static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val)
7469{
7470 struct sd *sd = (struct sd *) gspca_dev;
7471
7472 *val = sd->gamma;
7473 return 0;
7474}
7475
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007476static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
7477{
7478 struct sd *sd = (struct sd *) gspca_dev;
7479
7480 sd->lightfreq = val;
7481 if (gspca_dev->streaming)
7482 setlightfreq(gspca_dev);
7483 return 0;
7484}
7485
7486static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
7487{
7488 struct sd *sd = (struct sd *) gspca_dev;
7489
7490 *val = sd->lightfreq;
7491 return 0;
7492}
7493
7494static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
7495{
7496 struct sd *sd = (struct sd *) gspca_dev;
7497
7498 sd->sharpness = val;
7499 if (gspca_dev->streaming)
7500 setsharpness(gspca_dev);
7501 return 0;
7502}
7503
7504static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
7505{
7506 struct sd *sd = (struct sd *) gspca_dev;
7507
7508 *val = sd->sharpness;
7509 return 0;
7510}
7511
7512static int sd_querymenu(struct gspca_dev *gspca_dev,
7513 struct v4l2_querymenu *menu)
7514{
7515 switch (menu->id) {
7516 case V4L2_CID_POWER_LINE_FREQUENCY:
7517 switch (menu->index) {
7518 case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007519 strcpy((char *) menu->name, "NoFliker");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007520 return 0;
7521 case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007522 strcpy((char *) menu->name, "50 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007523 return 0;
7524 case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007525 strcpy((char *) menu->name, "60 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007526 return 0;
7527 }
7528 break;
7529 }
7530 return -EINVAL;
7531}
7532
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007533static const struct sd_desc sd_desc = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007534 .name = MODULE_NAME,
7535 .ctrls = sd_ctrls,
7536 .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
7537 .config = sd_config,
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03007538 .init = sd_init,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007539 .start = sd_start,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007540 .stop0 = sd_stop0,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007541 .pkt_scan = sd_pkt_scan,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03007542 .querymenu = sd_querymenu,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007543};
7544
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03007545static const __devinitdata struct usb_device_id device_table[] = {
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007546 {USB_DEVICE(0x041e, 0x041e)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007547 {USB_DEVICE(0x041e, 0x4017)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03007548 {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007549 {USB_DEVICE(0x041e, 0x401e)},
7550 {USB_DEVICE(0x041e, 0x401f)},
Hans de Goede222a07f2008-09-03 17:12:20 -03007551 {USB_DEVICE(0x041e, 0x4022)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007552 {USB_DEVICE(0x041e, 0x4029)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03007553 {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
7554 {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007555 {USB_DEVICE(0x041e, 0x4036)},
7556 {USB_DEVICE(0x041e, 0x403a)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03007557 {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250},
7558 {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007559 {USB_DEVICE(0x0458, 0x7007)},
7560 {USB_DEVICE(0x0458, 0x700c)},
7561 {USB_DEVICE(0x0458, 0x700f)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007562 {USB_DEVICE(0x0461, 0x0a00)},
7563 {USB_DEVICE(0x046d, 0x08a0)},
7564 {USB_DEVICE(0x046d, 0x08a1)},
7565 {USB_DEVICE(0x046d, 0x08a2)},
7566 {USB_DEVICE(0x046d, 0x08a3)},
7567 {USB_DEVICE(0x046d, 0x08a6)},
7568 {USB_DEVICE(0x046d, 0x08a7)},
7569 {USB_DEVICE(0x046d, 0x08a9)},
7570 {USB_DEVICE(0x046d, 0x08aa)},
7571 {USB_DEVICE(0x046d, 0x08ac)},
7572 {USB_DEVICE(0x046d, 0x08ad)},
Hans de Goede222a07f2008-09-03 17:12:20 -03007573#if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007574 {USB_DEVICE(0x046d, 0x08ae)},
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03007575#endif
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007576 {USB_DEVICE(0x046d, 0x08af)},
7577 {USB_DEVICE(0x046d, 0x08b9)},
7578 {USB_DEVICE(0x046d, 0x08d7)},
7579 {USB_DEVICE(0x046d, 0x08d9)},
7580 {USB_DEVICE(0x046d, 0x08d8)},
7581 {USB_DEVICE(0x046d, 0x08da)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03007582 {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
7583 {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
7584 {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
7585 {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
7586 {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007587 {USB_DEVICE(0x055f, 0xc005)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007588 {USB_DEVICE(0x055f, 0xd003)},
7589 {USB_DEVICE(0x055f, 0xd004)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007590 {USB_DEVICE(0x0698, 0x2003)},
Hans de Goede222a07f2008-09-03 17:12:20 -03007591 {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007592 {USB_DEVICE(0x0ac8, 0x0302)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007593 {USB_DEVICE(0x0ac8, 0x301b)},
Hans de Goede222a07f2008-09-03 17:12:20 -03007594#if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007595 {USB_DEVICE(0x0ac8, 0x303b)},
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03007596#endif
Hans de Goeded6db35e2008-09-03 17:12:13 -03007597 {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007598 {USB_DEVICE(0x0ac8, 0x307b)},
7599 {USB_DEVICE(0x10fd, 0x0128)},
Hans de Goede222a07f2008-09-03 17:12:20 -03007600 {USB_DEVICE(0x10fd, 0x804d)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03007601 {USB_DEVICE(0x10fd, 0x8050)},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007602 {} /* end of entry */
7603};
7604#undef DVNAME
7605MODULE_DEVICE_TABLE(usb, device_table);
7606
7607/* -- device connect -- */
7608static int sd_probe(struct usb_interface *intf,
7609 const struct usb_device_id *id)
7610{
7611 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7612 THIS_MODULE);
7613}
7614
7615/* USB driver */
7616static struct usb_driver sd_driver = {
7617 .name = MODULE_NAME,
7618 .id_table = device_table,
7619 .probe = sd_probe,
7620 .disconnect = gspca_disconnect,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03007621#ifdef CONFIG_PM
7622 .suspend = gspca_suspend,
7623 .resume = gspca_resume,
7624#endif
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007625};
7626
7627static int __init sd_mod_init(void)
7628{
7629 if (usb_register(&sd_driver) < 0)
7630 return -1;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03007631 PDEBUG(D_PROBE, "registered");
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007632 return 0;
7633}
7634
7635static void __exit sd_mod_exit(void)
7636{
7637 usb_deregister(&sd_driver);
7638 PDEBUG(D_PROBE, "deregistered");
7639}
7640
7641module_init(sd_mod_init);
7642module_exit(sd_mod_exit);
7643
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007644module_param(force_sensor, int, 0644);
7645MODULE_PARM_DESC(force_sensor,
7646 "Force sensor. Only for experts!!!");