blob: 6dcb1cf11b5cf3b644f100f8bc325c769cc14832 [file] [log] [blame]
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001/*
Jean-Francois Moine47c833922010-01-07 15:59:12 -03002 * Z-Star/Vimicro zc301/zc302p/vc30x library
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003 *
Jean-François Moine4e5144e2011-02-26 13:56:20 -03004 * Copyright (C) 2009-2011 Jean-Francois Moine <http://moinejf.free.fr>
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005 * Copyright (C) 2004 2005 2006 Michel Xhaard mxhaard@magic.fr
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#define MODULE_NAME "zc3xx"
23
Hans de Goede1a351022010-01-29 11:05:25 -030024#include <linux/input.h>
Jean-Francois Moined43fa322008-06-12 10:58:58 -030025#include "gspca.h"
Jean-Francois Moine71cb2762009-03-03 05:33:41 -030026#include "jpeg.h"
Jean-Francois Moined43fa322008-06-12 10:58:58 -030027
Jean-Francois Moine47c833922010-01-07 15:59:12 -030028MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>, "
Jean-Francois Moined43fa322008-06-12 10:58:58 -030029 "Serge A. Suchkov <Serge.A.S@tochka.ru>");
30MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
31MODULE_LICENSE("GPL");
32
Jean-Francois Moined43fa322008-06-12 10:58:58 -030033static int force_sensor = -1;
34
Jean-Francois Moine36e819d2009-01-07 16:49:57 -030035#define QUANT_VAL 1 /* quantization table */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -030036#include "zc3xx-reg.h"
Jean-Francois Moined43fa322008-06-12 10:58:58 -030037
Jean-François Moine49fb5e62010-12-28 07:09:34 -030038/* controls */
39enum e_ctrl {
40 BRIGHTNESS,
41 CONTRAST,
42 GAMMA,
43 AUTOGAIN,
44 LIGHTFREQ,
45 SHARPNESS,
46 NCTRLS /* number of controls */
47};
48
Jean-Francois Moined43fa322008-06-12 10:58:58 -030049/* specific webcam descriptor */
50struct sd {
51 struct gspca_dev gspca_dev; /* !! must be the first item */
52
Jean-François Moine49fb5e62010-12-28 07:09:34 -030053 struct gspca_ctrl ctrls[NCTRLS];
54
Jean-Francois Moine71cb2762009-03-03 05:33:41 -030055 u8 quality; /* image quality */
Jean-François Moinedb6cf422010-06-04 05:48:52 -030056#define QUALITY_MIN 50
57#define QUALITY_MAX 80
58#define QUALITY_DEF 70
Jean-Francois Moined43fa322008-06-12 10:58:58 -030059
Jean-François Moinea484dd92010-08-04 07:25:12 -030060 u8 bridge;
Jean-Francois Moine47c833922010-01-07 15:59:12 -030061 u8 sensor; /* Type of image sensor chip */
Jean-François Moine83d1aa32010-08-04 05:11:23 -030062 u16 chip_revision;
Jean-Francois Moine71cb2762009-03-03 05:33:41 -030063
Jean-François Moine9a731a32010-06-04 05:26:42 -030064 u8 jpeg_hdr[JPEG_HDR_SZ];
Jean-Francois Moined43fa322008-06-12 10:58:58 -030065};
Jean-François Moinea484dd92010-08-04 07:25:12 -030066enum bridges {
67 BRIDGE_ZC301,
68 BRIDGE_ZC303,
69};
Jean-François Moine83d1aa32010-08-04 05:11:23 -030070enum sensors {
71 SENSOR_ADCM2700,
72 SENSOR_CS2102,
73 SENSOR_CS2102K,
Jean-François Moine7fbee992010-12-28 07:17:40 -030074 SENSOR_GC0303,
Jean-François Moine83d1aa32010-08-04 05:11:23 -030075 SENSOR_GC0305,
Jean-François Moine4e5144e2011-02-26 13:56:20 -030076 SENSOR_HDCS2020,
Jean-François Moine83d1aa32010-08-04 05:11:23 -030077 SENSOR_HV7131B,
78 SENSOR_HV7131R,
79 SENSOR_ICM105A,
80 SENSOR_MC501CB,
Jean-François Moinea484dd92010-08-04 07:25:12 -030081 SENSOR_MT9V111_1, /* (mi360soc) zc301 */
82 SENSOR_MT9V111_3, /* (mi360soc) zc303 */
Jean-François Moine83d1aa32010-08-04 05:11:23 -030083 SENSOR_OV7620, /* OV7648 - same values */
84 SENSOR_OV7630C,
85 SENSOR_PAS106,
86 SENSOR_PAS202B,
87 SENSOR_PB0330,
88 SENSOR_PO2030,
Jean-François Moine83d1aa32010-08-04 05:11:23 -030089 SENSOR_TAS5130C,
Jean-François Moine83d1aa32010-08-04 05:11:23 -030090 SENSOR_MAX
91};
Jean-Francois Moined43fa322008-06-12 10:58:58 -030092
93/* V4L2 controls supported by the driver */
Jean-François Moine49fb5e62010-12-28 07:09:34 -030094static void setcontrast(struct gspca_dev *gspca_dev);
95static void setautogain(struct gspca_dev *gspca_dev);
96static void setlightfreq(struct gspca_dev *gspca_dev);
97static void setsharpness(struct gspca_dev *gspca_dev);
Jean-Francois Moined43fa322008-06-12 10:58:58 -030098
Jean-François Moine49fb5e62010-12-28 07:09:34 -030099static const struct ctrl sd_ctrls[NCTRLS] = {
100[BRIGHTNESS] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300101 {
Jean-François Moinea9dfc012010-06-04 06:21:48 -0300102 .id = V4L2_CID_BRIGHTNESS,
103 .type = V4L2_CTRL_TYPE_INTEGER,
104 .name = "Brightness",
105 .minimum = 0,
106 .maximum = 255,
107 .step = 1,
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300108 .default_value = 128,
Jean-François Moinea9dfc012010-06-04 06:21:48 -0300109 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300110 .set_control = setcontrast
Jean-François Moinea9dfc012010-06-04 06:21:48 -0300111 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300112[CONTRAST] = {
Jean-François Moinea9dfc012010-06-04 06:21:48 -0300113 {
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300114 .id = V4L2_CID_CONTRAST,
115 .type = V4L2_CTRL_TYPE_INTEGER,
116 .name = "Contrast",
117 .minimum = 0,
Jean-Francois Moinefd180462010-01-04 15:54:59 -0300118 .maximum = 255,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300119 .step = 1,
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300120 .default_value = 128,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300121 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300122 .set_control = setcontrast
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300123 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300124[GAMMA] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300125 {
126 .id = V4L2_CID_GAMMA,
127 .type = V4L2_CTRL_TYPE_INTEGER,
128 .name = "Gamma",
129 .minimum = 1,
130 .maximum = 6,
131 .step = 1,
132 .default_value = 4,
133 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300134 .set_control = setcontrast
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300135 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300136[AUTOGAIN] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300137 {
138 .id = V4L2_CID_AUTOGAIN,
139 .type = V4L2_CTRL_TYPE_BOOLEAN,
140 .name = "Auto Gain",
141 .minimum = 0,
142 .maximum = 1,
143 .step = 1,
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300144 .default_value = 1,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300145 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300146 .set_control = setautogain
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300147 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300148[LIGHTFREQ] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300149 {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300150 .id = V4L2_CID_POWER_LINE_FREQUENCY,
151 .type = V4L2_CTRL_TYPE_MENU,
152 .name = "Light frequency filter",
153 .minimum = 0,
154 .maximum = 2, /* 0: 0, 1: 50Hz, 2:60Hz */
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300155 .step = 1,
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300156 .default_value = 0,
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300157 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300158 .set_control = setlightfreq
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300159 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300160[SHARPNESS] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300161 {
162 .id = V4L2_CID_SHARPNESS,
163 .type = V4L2_CTRL_TYPE_INTEGER,
164 .name = "Sharpness",
165 .minimum = 0,
166 .maximum = 3,
167 .step = 1,
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300168 .default_value = 2,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300169 },
Jean-François Moine49fb5e62010-12-28 07:09:34 -0300170 .set_control = setsharpness
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300171 },
172};
173
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300174static const struct v4l2_pix_format vga_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300175 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
176 .bytesperline = 320,
177 .sizeimage = 320 * 240 * 3 / 8 + 590,
178 .colorspace = V4L2_COLORSPACE_JPEG,
179 .priv = 1},
180 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
181 .bytesperline = 640,
182 .sizeimage = 640 * 480 * 3 / 8 + 590,
183 .colorspace = V4L2_COLORSPACE_JPEG,
184 .priv = 0},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300185};
186
Hans de Goede9919fe82010-01-13 07:12:28 -0300187static const struct v4l2_pix_format broken_vga_mode[] = {
188 {320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
189 .bytesperline = 320,
190 .sizeimage = 320 * 232 * 4 / 8 + 590,
191 .colorspace = V4L2_COLORSPACE_JPEG,
192 .priv = 1},
193 {640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
194 .bytesperline = 640,
195 .sizeimage = 640 * 472 * 3 / 8 + 590,
196 .colorspace = V4L2_COLORSPACE_JPEG,
197 .priv = 0},
198};
199
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300200static const struct v4l2_pix_format sif_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300201 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
202 .bytesperline = 176,
203 .sizeimage = 176 * 144 * 3 / 8 + 590,
204 .colorspace = V4L2_COLORSPACE_JPEG,
205 .priv = 1},
206 {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
207 .bytesperline = 352,
208 .sizeimage = 352 * 288 * 3 / 8 + 590,
209 .colorspace = V4L2_COLORSPACE_JPEG,
210 .priv = 0},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300211};
212
213/* usb exchanges */
214struct usb_action {
Jean-Francois Moine47c833922010-01-07 15:59:12 -0300215 u8 req;
216 u8 val;
217 u16 idx;
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300218};
219
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300220static const struct usb_action adcm2700_Initial[] = {
221 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
222 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300223 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300224 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
225 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
226 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
227 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
228 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
229 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
230 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
231 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
232 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
233 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
234 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
235 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
236 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
237 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
238 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
239 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
240 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
241 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
242 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300243 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300244 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
245 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
246 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
247 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
248 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
249 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
250 {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */
251 {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */
252 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
253 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
254 {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */
255 {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */
256 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
257 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
258 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
259 {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */
260 {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */
261 {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */
262 {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */
263 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
264 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
265 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
266 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
267 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
268 {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */
269 {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */
270 {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */
271 {0xbb, 0x86, 0x0002}, /* 00,86,02,bb */
272 {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
273 {0xbb, 0x86, 0x0802}, /* 08,86,02,bb */
274 {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */
275 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
276 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
277 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
278 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
279 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
280 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
281 {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300282/*mswin+*/
283 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
284 {0xaa, 0xfe, 0x0002},
285 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
286 {0xaa, 0xb4, 0xcd37},
287 {0xaa, 0xa4, 0x0004},
288 {0xaa, 0xa8, 0x0007},
289 {0xaa, 0xac, 0x0004},
290/*mswin-*/
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300291 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
292 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
293 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
294 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
295 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
296 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
297 {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */
298 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
299 {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */
300 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
301 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
302 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
303 {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */
304 {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */
305 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
306 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
307 {}
308};
309static const struct usb_action adcm2700_InitialScale[] = {
310 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
311 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300312 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300313 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
314 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
315 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
316 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
317 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
318 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
319 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
320 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
321 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
322 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
323 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
324 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
325 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
326 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
327 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
328 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
329 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
330 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
331 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300332 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300333 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
334 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
335 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
336 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
337 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
338 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
339 {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */
340 {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */
341 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
342 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
343 {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */
344 {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */
345 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
346 {0xdd, 0x00, 0x0050}, /* 00,00,50,dd */
347 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
348 {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */
349 {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */
350 {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */
351 {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */
352 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
353 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
354 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
355 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
356 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
357 {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */
358 {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */
359 {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300360 {0xbb, 0x86, 0x0002}, /* 00,88,02,bb */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300361 {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300362 {0xbb, 0x86, 0x0802}, /* 08,88,02,bb */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300363 {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */
364 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
365 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
366 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
367 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
368 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
369 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
370 {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */
371 /*******/
372 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
373 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
374 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
375 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
376 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
377 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
378 {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */
379 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
380 {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */
381 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
382 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
383 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
384 {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */
385 {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */
386 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
387 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
388 {}
389};
390static const struct usb_action adcm2700_50HZ[] = {
391 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
392 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
393 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
394 {0xbb, 0x05, 0x8400}, /* 84,05,00,bb */
395 {0xbb, 0xd0, 0xb007}, /* b0,d0,07,bb */
396 {0xbb, 0xa0, 0xb80f}, /* b8,a0,0f,bb */
397 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
398 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
399 {0xaa, 0x26, 0x00d0}, /* 00,26,d0,aa */
400 {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */
401 {}
402};
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300403static const struct usb_action adcm2700_60HZ[] = {
404 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
405 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
406 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
407 {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */
408 {0xbb, 0x82, 0xb006}, /* b0,82,06,bb */
409 {0xbb, 0x04, 0xb80d}, /* b8,04,0d,bb */
410 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
411 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
412 {0xaa, 0x26, 0x0057}, /* 00,26,57,aa */
413 {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */
414 {}
415};
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300416static const struct usb_action adcm2700_NoFliker[] = {
417 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
418 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
419 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
420 {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */
421 {0xbb, 0x05, 0xb000}, /* b0,05,00,bb */
422 {0xbb, 0xa0, 0xb801}, /* b8,a0,01,bb */
423 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
424 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
425 {}
426};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300427static const struct usb_action cs2102_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300428 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
429 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
430 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
431 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
432 {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
433 {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
434 {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
435 {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
436 {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
437 {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
438 {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
439 {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
440 {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
441 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
442 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
443 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
444 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
445 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
446 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
447 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
448 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
449 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
450 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
451 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300452 {0xaa, 0x02, 0x0008},
453 {0xaa, 0x03, 0x0000},
454 {0xaa, 0x11, 0x0000},
455 {0xaa, 0x12, 0x0089},
456 {0xaa, 0x13, 0x0000},
457 {0xaa, 0x14, 0x00e9},
458 {0xaa, 0x20, 0x0000},
459 {0xaa, 0x22, 0x0000},
460 {0xaa, 0x0b, 0x0004},
461 {0xaa, 0x30, 0x0030},
462 {0xaa, 0x31, 0x0030},
463 {0xaa, 0x32, 0x0030},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300464 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
465 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
466 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
467 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
468 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
469 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
470 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300471 {0xa0, 0x10, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300472 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
473 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
474 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300475 {0xa0, 0x00, 0x01ad},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300476 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300477};
478
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300479static const struct usb_action cs2102_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300480 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
481 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
482 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
483 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
484 {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
485 {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
486 {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
487 {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
488 {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
489 {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
490 {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
491 {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
492 {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
493 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
494 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
495 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
496 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
497 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
498 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
499 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
500 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
501 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
502 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
503 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300504 {0xaa, 0x02, 0x0008},
505 {0xaa, 0x03, 0x0000},
506 {0xaa, 0x11, 0x0001},
507 {0xaa, 0x12, 0x0087},
508 {0xaa, 0x13, 0x0001},
509 {0xaa, 0x14, 0x00e7},
510 {0xaa, 0x20, 0x0000},
511 {0xaa, 0x22, 0x0000},
512 {0xaa, 0x0b, 0x0004},
513 {0xaa, 0x30, 0x0030},
514 {0xaa, 0x31, 0x0030},
515 {0xaa, 0x32, 0x0030},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300516 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
517 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
518 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
519 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
520 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
521 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
522 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300523 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300524 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
525 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
526 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300527 {0xa0, 0x00, 0x01ad},
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300528 {}
529};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300530static const struct usb_action cs2102_50HZScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300531 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
532 {0xaa, 0x23, 0x0001},
533 {0xaa, 0x24, 0x005f},
534 {0xaa, 0x25, 0x0090},
535 {0xaa, 0x21, 0x00dd},
536 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
537 {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
538 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
539 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
540 {0xa0, 0x3a, ZC3XX_R196_ANTIFLICKERMID},
541 {0xa0, 0x98, ZC3XX_R197_ANTIFLICKERLOW},
542 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
543 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
544 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
545 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
546 {0xa0, 0xdd, ZC3XX_R01D_HSYNC_0},
547 {0xa0, 0xe4, ZC3XX_R01E_HSYNC_1},
548 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
549 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
550 {}
551};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300552static const struct usb_action cs2102_50HZ[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300553 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
554 {0xaa, 0x23, 0x0000},
555 {0xaa, 0x24, 0x00af},
556 {0xaa, 0x25, 0x00c8},
557 {0xaa, 0x21, 0x0068},
558 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
559 {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
560 {0xa0, 0x90, ZC3XX_R192_EXPOSURELIMITLOW},
561 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
562 {0xa0, 0x1d, ZC3XX_R196_ANTIFLICKERMID},
563 {0xa0, 0x4c, ZC3XX_R197_ANTIFLICKERLOW},
564 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
565 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
566 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
567 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
568 {0xa0, 0x68, ZC3XX_R01D_HSYNC_0},
569 {0xa0, 0xe3, ZC3XX_R01E_HSYNC_1},
570 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
571 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
572 {}
573};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300574static const struct usb_action cs2102_60HZScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300575 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
576 {0xaa, 0x23, 0x0001},
577 {0xaa, 0x24, 0x0055},
578 {0xaa, 0x25, 0x00cc},
579 {0xaa, 0x21, 0x003f},
580 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
581 {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
582 {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
583 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
584 {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
585 {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
586 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
587 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
588 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
589 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
590 {0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
591 {0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
592 {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
593 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
594 {}
595};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300596static const struct usb_action cs2102_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300597 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300598 {0xaa, 0x23, 0x0000},
599 {0xaa, 0x24, 0x00aa},
600 {0xaa, 0x25, 0x00e6},
601 {0xaa, 0x21, 0x003f},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300602 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
603 {0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
604 {0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
605 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
606 {0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
607 {0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
608 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
609 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
610 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
611 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
612 {0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
613 {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
614 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
615 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300616 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300617};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300618static const struct usb_action cs2102_NoFlikerScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300619 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
620 {0xaa, 0x23, 0x0001},
621 {0xaa, 0x24, 0x005f},
622 {0xaa, 0x25, 0x0000},
623 {0xaa, 0x21, 0x0001},
624 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
625 {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
626 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
627 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
628 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
629 {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
630 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
631 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
632 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
633 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
634 {0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
635 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
636 {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
637 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300638 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300639};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300640static const struct usb_action cs2102_NoFliker[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300641 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
642 {0xaa, 0x23, 0x0000},
643 {0xaa, 0x24, 0x00af},
644 {0xaa, 0x25, 0x0080},
645 {0xaa, 0x21, 0x0001},
646 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
647 {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
648 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
649 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
650 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
651 {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
652 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
653 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
654 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
655 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
656 {0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
657 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
658 {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
659 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300660 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300661};
662
663/* CS2102_KOCOM */
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300664static const struct usb_action cs2102K_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300665 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
666 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
667 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
668 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
669 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
670 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
671 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
672 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
673 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
674 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
675 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
676 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
677 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
678 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
679 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
680 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
681 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
682 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
683 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
684 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
685 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
686 {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
687 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
688 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
689 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
690 {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
691 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
692 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
693 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
694 {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
695 {0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
696 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
697 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
698 {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
699 {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
700 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
701 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
702 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
703 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
704 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
705 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
706 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
707 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
708 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
709 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
710 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
711 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
712 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
713 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
714 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
715 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
716 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
717 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
718 {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
719 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
720 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
721 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
722 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
723 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
724 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
725 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
726 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
727 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
728 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
729 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
730 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
731 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
732 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
733 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
734 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
735 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
736 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
737 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
738 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
739 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
740 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
741 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
742 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
743 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
744 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
745 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
746 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
747 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
748 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
749 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
750 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
751 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
752 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
753 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
754 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
755 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
756 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
757 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
758 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
759 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
760 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
761 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
762 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
763 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
764 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300765 {0xa0, 0x00, 0x01ad},
766 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300767 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
768 {0xa0, 0x60, ZC3XX_R116_RGAIN},
769 {0xa0, 0x40, ZC3XX_R117_GGAIN},
770 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
771 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
772 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
773 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
774 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
775 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
776 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
777 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
778 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
779 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
780 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
781 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
782 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
783 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
784 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
785 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
786 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
787 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
788 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
789 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
790 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
791 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
792 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
793 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
794 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
795 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
796 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
797 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
798 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
799 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
800 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
801 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
802 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
803 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
804 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
805 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
806 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
807 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
808 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
809 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
810 {0xa0, 0x58, ZC3XX_R10E_RGB11},
811 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
812 {0xa0, 0xf4, ZC3XX_R110_RGB20},
813 {0xa0, 0xf4, ZC3XX_R111_RGB21},
814 {0xa0, 0x58, ZC3XX_R112_RGB22},
815 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
816 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
817 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
818 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
819 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
820 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
821 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
822 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
823 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
824 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
825 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
826 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
827 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
828 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
829 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
830 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
831 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
832 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
833 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
834 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
835 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
836 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
837 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
838 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
839 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
840 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
841 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
842 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
843 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
844 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
845 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
846 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
847 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
848 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
849 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
850 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
851 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
852 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
853 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
854 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
855 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
856 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
857 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
858 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
859 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
860 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
861 {0xa0, 0x60, ZC3XX_R116_RGAIN},
862 {0xa0, 0x40, ZC3XX_R117_GGAIN},
863 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
864 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
865 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
866 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
867 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
868 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
869 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
870 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
871 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
872 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
873 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
874 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
875 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
876 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
877 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
878 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
879 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
880 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
881 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
882 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
883 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
884 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
885 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
886 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
887 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
888 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
889 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
890 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
891 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
892 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
893 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
894 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
895 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
896 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
897 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
898 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
899 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
900 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
901 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
902 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
903 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
904 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
905 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
906 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
907 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
908 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
909 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
910 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
911 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
912 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
913 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
914 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
915 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
916 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
917 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
918 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
919 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300920 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300921};
922
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300923static const struct usb_action cs2102K_Initial[] = {
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -0300924 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300925 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
926 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
927 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
928 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
929 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
930 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
931 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
932 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
933 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
934 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
935 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
936 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
937 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
938 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
939 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
940 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -0300941/*fixme: next sequence = i2c exchanges*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300942 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
943 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
944 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
945 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
946 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
947 {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
948 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
949 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
950 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
951 {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
952 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
953 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
954 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
955 {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
956 {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
957 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
958 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
959 {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
960 {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
961 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
962 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
963 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
964 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
965 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
966 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
967 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
968 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
969 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
970 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
971 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
972 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
973 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
974 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
975 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
976 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
977 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
978 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
979 {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
980 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
981 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
982 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
983 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
984 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
985 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
986 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
987 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
988 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
989 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
990 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
991 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
992 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
993 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
994 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
995 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
996 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
997 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
998 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
999 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
1000 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1001 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1002 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1003 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
1004 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1005 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1006 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1007 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
1008 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
1009 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1010 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1011 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1012 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1013 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1014 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1015 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1016 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1017 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
1018 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1019 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1020 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1021 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1022 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1023 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1024 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1025 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001026 {0xa0, 0x00, 0x01ad},
1027 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001028 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1029 {0xa0, 0x60, ZC3XX_R116_RGAIN},
1030 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1031 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
1032 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1033 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
1034 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1035 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1036 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1037 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1038 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1039 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1040 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1041 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1042 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1043 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1044 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1045 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1046 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1047 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1048 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1049 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1050 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1051 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1052 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1053 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1054 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1055 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1056 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1057 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1058 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1059 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1060 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1061 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1062 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1063 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1064 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1065 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1066 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1067 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
1068 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
1069 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
1070 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
1071 {0xa0, 0x58, ZC3XX_R10E_RGB11},
1072 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
1073 {0xa0, 0xf4, ZC3XX_R110_RGB20},
1074 {0xa0, 0xf4, ZC3XX_R111_RGB21},
1075 {0xa0, 0x58, ZC3XX_R112_RGB22},
1076 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1077 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1078 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1079 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1080 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1081 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1082 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1083 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1084 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1085 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1086 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1087 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1088 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1089 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1090 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1091 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1092 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1093 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1094 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1095 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1096 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1097 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1098 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1099 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1100 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1101 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1102 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1103 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1104 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1105 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1106 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1107 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1108 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1109 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1110 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1111 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1112 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1113 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1114 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1115 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1116 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1117 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1118 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1119 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1120 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1121 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1122 {0xa0, 0x60, ZC3XX_R116_RGAIN},
1123 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1124 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001125 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1126 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1127 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1128 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1129 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1130 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1131 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1132 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1133 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1134 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1135 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1136 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1137 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1138 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1139 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1140 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1141 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1142 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1143 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1144 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1145 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1146 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1147 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1148 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1149 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1150 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1151 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1152 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1153 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1154 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1155 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1156 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1157 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1158 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1159 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1160 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1161 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1162 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1163 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1164 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1165 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1166 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1167 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1168 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1169 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1170 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1171 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1172 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1173 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1174 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1175 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1176 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1177 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1178 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1179 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1180 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -03001181/*fixme:what does the next sequence?*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001182 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1183 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1184 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1185 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1186 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1187 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1188 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1189 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1190 {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1191 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1192 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1193 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1194 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1195 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1196 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1197 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1198 {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1199 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1200 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1201 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1202 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1203 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1204 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1205 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1206 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1207 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1208 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1209 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1210 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
1211 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1212 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1213 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1214 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1215 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1216 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1217 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1218 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1219 {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1220 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1221 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1222 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1223 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1224 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1225 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1226 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1227 {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1228 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1229 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1230 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1231 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1232 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1233 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1234 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1235 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1236 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1237 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1238 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1239 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1240 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1241 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1242 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1243 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1244 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1245 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1246 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1247 {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1248 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1249 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1250 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1251 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1252 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1253 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1254 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1255 {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1256 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1257 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1258 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1259 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1260 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1261 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1262 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1263 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1264 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1265 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1266 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1267 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1268 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1269 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1270 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1271 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1272 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1273 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1274 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1275 {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1276 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1277 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1278 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1279 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1280 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1281 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1282 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1283 {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1284 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1285 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1286 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1287 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1288 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1289 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1290 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1291 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1292 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1293 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1294 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1295 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1296 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1297 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001298 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001299};
1300
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001301static const struct usb_action gc0305_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001302 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1303 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
1304 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
1305 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
1306 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
1307 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1308 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
1309 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
1310 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
1311 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
1312 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
1313 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
1314 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
1315 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
1316 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
1317 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
1318 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
1319 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001320 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa */
1321 {0xaa, 0x15, 0x0003}, /* 00,15,03,aa */
1322 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
1323 {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
1324 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
1325 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
1326 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
1327 {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
1328 {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001329 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
1330 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
1331 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001332 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
1333 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
1334 {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
1335 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
1336 {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
1337 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
1338 {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
1339 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
1340 {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
1341 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
1342 {0xaa, 0x17, 0x00e6}, /* 00,17,e6,aa */
1343 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
1344 {0xaa, 0x19, 0x0086}, /* 00,19,86,aa */
1345 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1346 {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001347 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
1348 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
1349 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1350 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001351 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001352 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1353 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
1354 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
1355 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
1356 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
1357 {0xa0, 0x85, ZC3XX_R18D_YTARGET}, /* 01,8d,85,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001358 {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001359 {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1360 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1361 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1362 {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001363 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001364};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001365static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001366 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1367 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
1368 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
1369 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
1370 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
1371 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1372 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
1373 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
1374 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
1375 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
1376 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
1377 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
1378 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
1379 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
1380 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
1381 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
1382 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
1383 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001384 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
1385 {0xaa, 0x15, 0x0001}, /* 00,15,01,aa */
1386 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
1387 {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
1388 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
1389 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
1390 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
1391 {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
1392 {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001393 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
1394 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
1395 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001396 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
1397 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
1398 {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
1399 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
1400 {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
1401 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
1402 {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
1403 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
1404 {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
1405 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
1406 {0xaa, 0x17, 0x00e8}, /* 00,17,e8,aa */
1407 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
1408 {0xaa, 0x19, 0x0088}, /* 00,19,88,aa */
1409 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1410 {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001411 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
1412 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
1413 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1414 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001415 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001416 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1417 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
1418 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
1419 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
1420 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001421 {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001422 {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1423 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1424 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1425 {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001426 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001427};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001428static const struct usb_action gc0305_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001429 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1430 {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */
1431 {0xaa, 0x84, 0x0038}, /* 00,84,38,aa */ /* win: 00,84,ec */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001432 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1433 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
1434 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
1435 /* win: 01,92,10 */
1436 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1437 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1438 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc */
1439 /* win: 01,97,ec */
1440 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1441 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1442 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
1443 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1444 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1445 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1446 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1447 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1448 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1449 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
1450/* {0xa0, 0x85, ZC3XX_R18D_YTARGET}, * 01,8d,85,cc *
1451 * if 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001452 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001453};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001454static const struct usb_action gc0305_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001455 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1456 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
1457 {0xaa, 0x84, 0x00ec}, /* 00,84,ec,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001458 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1459 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
1460 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
1461 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1462 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1463 {0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,ec,cc */
1464 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1465 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1466 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
1467 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1468 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1469 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1470 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1471 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1472 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1473 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
1474 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001475 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001476};
1477
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001478static const struct usb_action gc0305_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001479 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001480 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1481 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
1482 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001483 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1484 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,00,cc */
1485 {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,48,cc */
1486 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1487 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1488 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1489 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1490 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1491 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1492 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1493 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1494 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1495 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1496 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
1497 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001498 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001499};
1500
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001501static const struct usb_action hdcs2020_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001502 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1503 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1504 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* qtable 0x05 */
1505 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1506 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1507 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1508 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1509 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1510 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1511 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1512 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1513 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1514 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1515 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1516 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1517 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1518 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001519 {0xaa, 0x1c, 0x0000},
1520 {0xaa, 0x0a, 0x0001},
1521 {0xaa, 0x0b, 0x0006},
1522 {0xaa, 0x0c, 0x007b},
1523 {0xaa, 0x0d, 0x00a7},
1524 {0xaa, 0x03, 0x00fb},
1525 {0xaa, 0x05, 0x0000},
1526 {0xaa, 0x06, 0x0003},
1527 {0xaa, 0x09, 0x0008},
1528
1529 {0xaa, 0x0f, 0x0018}, /* set sensor gain */
1530 {0xaa, 0x10, 0x0018},
1531 {0xaa, 0x11, 0x0018},
1532 {0xaa, 0x12, 0x0018},
1533
1534 {0xaa, 0x15, 0x004e},
1535 {0xaa, 0x1c, 0x0004},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001536 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1537 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1538 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1539 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1540 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1541 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1542 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1543 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1544 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001545 {0xa1, 0x01, 0x0002},
1546 {0xa1, 0x01, 0x0008},
1547 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001548 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1549 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1550 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1551 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001552 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001553 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1554 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001555 {0xa1, 0x01, 0x01c8},
1556 {0xa1, 0x01, 0x01c9},
1557 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001558 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1559 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1560 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1561 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1562 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1563 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1564 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1565 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1566 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1567 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1568 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1569 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1570 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1571 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1572 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1573 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1574 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1575 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1576 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1577 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1578 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1579 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1580 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1581 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1582 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1583 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1584 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1585 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1586 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1587 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1588 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1589 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1590 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001591
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001592 {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1593 {0xa0, 0xed, ZC3XX_R10B_RGB01},
1594 {0xa0, 0xed, ZC3XX_R10C_RGB02},
1595 {0xa0, 0xed, ZC3XX_R10D_RGB10},
1596 {0xa0, 0x66, ZC3XX_R10E_RGB11},
1597 {0xa0, 0xed, ZC3XX_R10F_RGB12},
1598 {0xa0, 0xed, ZC3XX_R110_RGB20},
1599 {0xa0, 0xed, ZC3XX_R111_RGB21},
1600 {0xa0, 0x66, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001601
1602 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001603 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1604 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001605 {0xaa, 0x13, 0x0031},
1606 {0xaa, 0x14, 0x0001},
1607 {0xaa, 0x0e, 0x0004},
1608 {0xaa, 0x19, 0x00cd},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001609 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1610 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1611 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1612 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1613 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1614 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1615 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1616 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001617
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001618 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 0x14 */
1619 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1620 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1621 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1622 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1623 {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1624 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1625 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001626 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001627 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1628 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1629 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1630 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001631 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001632};
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001633static const struct usb_action hdcs2020_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001634 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1635 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1636 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1637 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1638 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1639 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1640 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1641 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1642 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1643 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1644 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1645 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1646 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1647 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1648 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1649 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1650 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001651 {0xaa, 0x1c, 0x0000},
1652 {0xaa, 0x0a, 0x0001},
1653 {0xaa, 0x0b, 0x0006},
1654 {0xaa, 0x0c, 0x007a},
1655 {0xaa, 0x0d, 0x00a7},
1656 {0xaa, 0x03, 0x00fb},
1657 {0xaa, 0x05, 0x0000},
1658 {0xaa, 0x06, 0x0003},
1659 {0xaa, 0x09, 0x0008},
1660 {0xaa, 0x0f, 0x0018}, /* original setting */
1661 {0xaa, 0x10, 0x0018},
1662 {0xaa, 0x11, 0x0018},
1663 {0xaa, 0x12, 0x0018},
1664 {0xaa, 0x15, 0x004e},
1665 {0xaa, 0x1c, 0x0004},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001666 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1667 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1668 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1669 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1670 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1671 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1672 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1673 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1674 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001675 {0xa1, 0x01, 0x0002},
1676 {0xa1, 0x01, 0x0008},
1677 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001678 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1679 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1680 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1681 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001682 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001683 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1684 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001685 {0xa1, 0x01, 0x01c8},
1686 {0xa1, 0x01, 0x01c9},
1687 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001688 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1689 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1690 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1691 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1692 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1693 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1694 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1695 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1696 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1697 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1698 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1699 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1700 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1701 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1702 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1703 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1704 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1705 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1706 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1707 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1708 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1709 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1710 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1711 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1712 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1713 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1714 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1715 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1716 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1717 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1718 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1719 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1720 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1721 {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1722 {0xa0, 0xed, ZC3XX_R10B_RGB01},
1723 {0xa0, 0xed, ZC3XX_R10C_RGB02},
1724 {0xa0, 0xed, ZC3XX_R10D_RGB10},
1725 {0xa0, 0x66, ZC3XX_R10E_RGB11},
1726 {0xa0, 0xed, ZC3XX_R10F_RGB12},
1727 {0xa0, 0xed, ZC3XX_R110_RGB20},
1728 {0xa0, 0xed, ZC3XX_R111_RGB21},
1729 {0xa0, 0x66, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001730 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001731 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1732 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001733 /**** set exposure ***/
1734 {0xaa, 0x13, 0x0031},
1735 {0xaa, 0x14, 0x0001},
1736 {0xaa, 0x0e, 0x0004},
1737 {0xaa, 0x19, 0x00cd},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001738 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1739 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1740 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1741 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1742 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1743 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1744 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1745 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1746 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1747 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1748 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1749 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1750 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1751 {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1752 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1753 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001754 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001755 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1756 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1757 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1758 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001759 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001760};
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001761static const struct usb_action hdcs2020_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001762 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001763 {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
1764 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1765 {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */
1766 {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001767 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1768 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1769 {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
1770 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1771 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1772 {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
1773 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1774 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1775 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1776 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1777 {0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
1778 {0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
1779 {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001780 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001781};
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001782static const struct usb_action hdcs2020_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001783 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001784 {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
1785 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1786 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
1787 {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001788 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1789 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1790 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
1791 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1792 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1793 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
1794 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1795 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1796 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1797 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1798 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1799 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
1800 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001801 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001802};
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001803static const struct usb_action hdcs2020_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001804 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001805 {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
1806 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1807 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
1808 {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001809 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1810 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1811 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
1812 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1813 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1814 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1815 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1816 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1817 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
1818 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
1819 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1820 {0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
1821 {0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001822 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001823};
1824
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001825static const struct usb_action hv7131b_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001826 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1827 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1828 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1829 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1830 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
1831 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
1832 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1833 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1834 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1835 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1836 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1837 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1838 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1839 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1840 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1841 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001842 {0xaa, 0x30, 0x002d},
1843 {0xaa, 0x01, 0x0005},
1844 {0xaa, 0x11, 0x0000},
1845 {0xaa, 0x13, 0x0001}, /* {0xaa, 0x13, 0x0000}, */
1846 {0xaa, 0x14, 0x0001},
1847 {0xaa, 0x15, 0x00e8},
1848 {0xaa, 0x16, 0x0002},
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03001849 {0xaa, 0x17, 0x0086}, /* 00,17,88,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001850 {0xaa, 0x31, 0x0038},
1851 {0xaa, 0x32, 0x0038},
1852 {0xaa, 0x33, 0x0038},
1853 {0xaa, 0x5b, 0x0001},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001854 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1855 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1856 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1857 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
1858 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001859 {0xa0, 0x00, 0x01ad},
1860 {0xa0, 0xc0, 0x019b},
1861 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001862 {0xa0, 0x02, ZC3XX_R188_MINGAIN},
1863 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1864 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1865 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1866 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1867 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03001868 {0xaa, 0x02, 0x0090}, /* 00,02,80,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001869 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001870};
1871
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001872static const struct usb_action hv7131b_Initial[] = { /* 640x480*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001873 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1874 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1875 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1876 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1877 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
1878 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
1879 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1880 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1881 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1882 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1883 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1884 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1885 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1886 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1887 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1888 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001889 {0xaa, 0x30, 0x002d},
1890 {0xaa, 0x01, 0x0005},
1891 {0xaa, 0x11, 0x0001},
1892 {0xaa, 0x13, 0x0000}, /* {0xaa, 0x13, 0x0001}; */
1893 {0xaa, 0x14, 0x0001},
1894 {0xaa, 0x15, 0x00e6},
1895 {0xaa, 0x16, 0x0002},
1896 {0xaa, 0x17, 0x0086},
1897 {0xaa, 0x31, 0x0038},
1898 {0xaa, 0x32, 0x0038},
1899 {0xaa, 0x33, 0x0038},
1900 {0xaa, 0x5b, 0x0001},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001901 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1902 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1903 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1904 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1905 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001906 {0xa0, 0x00, 0x01ad},
1907 {0xa0, 0xc0, 0x019b},
1908 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001909 {0xa0, 0x02, ZC3XX_R188_MINGAIN},
1910 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1911 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1912 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1913 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1914 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001915 {0xaa, 0x02, 0x0090}, /* {0xaa, 0x02, 0x0080}, */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001916 {}
1917};
1918static const struct usb_action hv7131b_50HZ[] = { /* 640x480*/
1919 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1920 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1921 {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
1922 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
1923 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1924 {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
1925 {0xaa, 0x22, 0x001b}, /* 00,22,1b,aa */
1926 {0xaa, 0x23, 0x00fc}, /* 00,23,fc,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001927 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1928 {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
1929 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
1930 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1931 {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,ea,cc */
1932 {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,60,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001933 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
1934 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
1935 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1936 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1937 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1938 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
1939 {0xa0, 0x1b, ZC3XX_R01F_HSYNC_2}, /* 00,1f,1b,cc */
1940 {0xa0, 0xfc, ZC3XX_R020_HSYNC_3}, /* 00,20,fc,cc */
1941 {}
1942};
1943static const struct usb_action hv7131b_50HZScale[] = { /* 320x240 */
1944 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1945 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1946 {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
1947 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
1948 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1949 {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
1950 {0xaa, 0x22, 0x0012}, /* 00,22,12,aa */
1951 {0xaa, 0x23, 0x0080}, /* 00,23,80,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001952 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1953 {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
1954 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
1955 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
1956 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,d4,cc */
1957 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,c0,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001958 {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
1959 {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
1960 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1961 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1962 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1963 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
1964 {0xa0, 0x12, ZC3XX_R01F_HSYNC_2}, /* 00,1f,12,cc */
1965 {0xa0, 0x80, ZC3XX_R020_HSYNC_3}, /* 00,20,80,cc */
1966 {}
1967};
1968static const struct usb_action hv7131b_60HZ[] = { /* 640x480*/
1969 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1970 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1971 {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
1972 {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
1973 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1974 {0xaa, 0x21, 0x0040}, /* 00,21,40,aa */
1975 {0xaa, 0x22, 0x0013}, /* 00,22,13,aa */
1976 {0xaa, 0x23, 0x004c}, /* 00,23,4c,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001977 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1978 {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
1979 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
1980 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1981 {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,c3,cc */
1982 {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,50,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001983 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
1984 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
1985 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1986 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1987 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1988 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
1989 {0xa0, 0x13, ZC3XX_R01F_HSYNC_2}, /* 00,1f,13,cc */
1990 {0xa0, 0x4c, ZC3XX_R020_HSYNC_3}, /* 00,20,4c,cc */
1991 {}
1992};
1993static const struct usb_action hv7131b_60HZScale[] = { /* 320x240 */
1994 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1995 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1996 {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
1997 {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
1998 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1999 {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
2000 {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
2001 {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002002 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2003 {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
2004 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
2005 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
2006 {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,86,cc */
2007 {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,a0,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002008 {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
2009 {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
2010 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
2011 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
2012 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2013 {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
2014 {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
2015 {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
2016 {}
2017};
2018static const struct usb_action hv7131b_NoFliker[] = { /* 640x480*/
2019 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2020 {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
2021 {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
2022 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
2023 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2024 {0xaa, 0x21, 0x0010}, /* 00,21,10,aa */
2025 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2026 {0xaa, 0x23, 0x0003}, /* 00,23,03,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002027 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2028 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
2029 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
2030 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2031 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
2032 {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002033 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2034 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2035 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2036 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2037 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2038 {0xa0, 0x10, ZC3XX_R01E_HSYNC_1}, /* 00,1e,10,cc */
2039 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2}, /* 00,1f,00,cc */
2040 {0xa0, 0x03, ZC3XX_R020_HSYNC_3}, /* 00,20,03,cc */
2041 {}
2042};
2043static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
2044 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2045 {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
2046 {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
2047 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
2048 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
2049 {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
2050 {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
2051 {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03002052 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
2053 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
2054 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
2055 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2056 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
2057 {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03002058 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2059 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2060 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2061 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2062 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
2063 {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
2064 {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
2065 {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002066 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002067};
2068
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002069/* from lPEPI264v.inf (hv7131b!) */
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002070static const struct usb_action hv7131r_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002071 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2072 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2073 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2074 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2075 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2076 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002077 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002078 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002079 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2080 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2081 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2082 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2083 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2084 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2085 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2086 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2087 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2088 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2089 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2090 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002091 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2092 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002093 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002094 {0xaa, 0x01, 0x000c},
2095 {0xaa, 0x11, 0x0000},
2096 {0xaa, 0x13, 0x0000},
2097 {0xaa, 0x14, 0x0001},
2098 {0xaa, 0x15, 0x00e8},
2099 {0xaa, 0x16, 0x0002},
2100 {0xaa, 0x17, 0x0088},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002101 {0xaa, 0x30, 0x000b},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002102 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2103 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002104 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002105 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002106 {0xa0, 0x00, 0x01ad},
2107 {0xa0, 0xc0, 0x019b},
2108 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002109 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2110 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2111 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2112 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2113 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002114 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002115};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002116static const struct usb_action hv7131r_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002117 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002118 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002119 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2120 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2121 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2122 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002123 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002124 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002125 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2126 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2127 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002128 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002129 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2130 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2131 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002132 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002133 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002134 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002135 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2136 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002137 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2138 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002139 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002140 {0xaa, 0x01, 0x000c},
2141 {0xaa, 0x11, 0x0000},
2142 {0xaa, 0x13, 0x0000},
2143 {0xaa, 0x14, 0x0001},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002144 {0xaa, 0x15, 0x00e6},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002145 {0xaa, 0x16, 0x0002},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002146 {0xaa, 0x17, 0x0086},
2147 {0xaa, 0x30, 0x000b},
2148 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002149 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002150 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002151 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002152 {0xa0, 0x00, 0x01ad},
2153 {0xa0, 0xc0, 0x019b},
2154 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002155 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2156 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2157 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2158 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2159 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002160 {}
2161};
2162static const struct usb_action hv7131r_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002163 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002164 {0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
2165 {0xa0, 0x68, ZC3XX_R191_EXPOSURELIMITMID},
2166 {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
2167 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2168 {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},
2169 {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},
2170 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2171 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2172 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2173 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2174 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2175 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2176 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2177 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2178 {}
2179};
2180static const struct usb_action hv7131r_50HZScale[] = {
2181 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2182 {0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
2183 {0xa0, 0xd1, ZC3XX_R191_EXPOSURELIMITMID},
2184 {0xa0, 0x40, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002185 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2186 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2187 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002188 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002189 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002190 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002191 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2192 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2193 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2194 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2195 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2196 {}
2197};
2198static const struct usb_action hv7131r_60HZ[] = {
2199 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2200 {0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
2201 {0xa0, 0x1a, ZC3XX_R191_EXPOSURELIMITMID},
2202 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
2203 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2204 {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},
2205 {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},
2206 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2207 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2208 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2209 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2210 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2211 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2212 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2213 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2214 {}
2215};
2216static const struct usb_action hv7131r_60HZScale[] = {
2217 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2218 {0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
2219 {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID},
2220 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2221 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2222 {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},
2223 {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},
2224 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2225 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2226 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2227 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2228 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2229 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2230 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2231 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2232 {}
2233};
2234static const struct usb_action hv7131r_NoFliker[] = {
2235 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2236 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
2237 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
2238 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2239 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2240 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},
2241 {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW},
2242 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2243 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2244 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
2245 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
2246 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2247 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2248 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2249 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2250 {}
2251};
2252static const struct usb_action hv7131r_NoFlikerScale[] = {
2253 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2254 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
2255 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
2256 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2257 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2258 {0xa0, 0x04, ZC3XX_R196_ANTIFLICKERMID},
2259 {0xa0, 0xb0, ZC3XX_R197_ANTIFLICKERLOW},
2260 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2261 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2262 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
2263 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
2264 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2265 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2266 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2267 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002268 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002269};
2270
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002271static const struct usb_action icm105a_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002272 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2273 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2274 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2275 {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2276 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2277 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2278 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2279 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2280 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2281 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2282 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2283 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2284 {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2285 {0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
2286 {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2287 {0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
2288 {0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
2289 {0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
2290 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2291 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2292 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2293 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2294 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2295 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2296 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2297 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2298 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002299 {0xaa, 0x01, 0x0010},
2300 {0xaa, 0x03, 0x0000},
2301 {0xaa, 0x04, 0x0001},
2302 {0xaa, 0x05, 0x0020},
2303 {0xaa, 0x06, 0x0001},
2304 {0xaa, 0x08, 0x0000},
2305 {0xaa, 0x03, 0x0001},
2306 {0xaa, 0x04, 0x0011},
2307 {0xaa, 0x05, 0x00a0},
2308 {0xaa, 0x06, 0x0001},
2309 {0xaa, 0x08, 0x0000},
2310 {0xaa, 0x03, 0x0002},
2311 {0xaa, 0x04, 0x0013},
2312 {0xaa, 0x05, 0x0020},
2313 {0xaa, 0x06, 0x0001},
2314 {0xaa, 0x08, 0x0000},
2315 {0xaa, 0x03, 0x0003},
2316 {0xaa, 0x04, 0x0015},
2317 {0xaa, 0x05, 0x0020},
2318 {0xaa, 0x06, 0x0005},
2319 {0xaa, 0x08, 0x0000},
2320 {0xaa, 0x03, 0x0004},
2321 {0xaa, 0x04, 0x0017},
2322 {0xaa, 0x05, 0x0020},
2323 {0xaa, 0x06, 0x000d},
2324 {0xaa, 0x08, 0x0000},
2325 {0xaa, 0x03, 0x0005},
2326 {0xaa, 0x04, 0x0019},
2327 {0xaa, 0x05, 0x0020},
2328 {0xaa, 0x06, 0x0005},
2329 {0xaa, 0x08, 0x0000},
2330 {0xaa, 0x03, 0x0006},
2331 {0xaa, 0x04, 0x0017},
2332 {0xaa, 0x05, 0x0026},
2333 {0xaa, 0x06, 0x0005},
2334 {0xaa, 0x08, 0x0000},
2335 {0xaa, 0x03, 0x0007},
2336 {0xaa, 0x04, 0x0019},
2337 {0xaa, 0x05, 0x0022},
2338 {0xaa, 0x06, 0x0005},
2339 {0xaa, 0x08, 0x0000},
2340 {0xaa, 0x03, 0x0008},
2341 {0xaa, 0x04, 0x0021},
2342 {0xaa, 0x05, 0x00aa},
2343 {0xaa, 0x06, 0x0005},
2344 {0xaa, 0x08, 0x0000},
2345 {0xaa, 0x03, 0x0009},
2346 {0xaa, 0x04, 0x0023},
2347 {0xaa, 0x05, 0x00aa},
2348 {0xaa, 0x06, 0x000d},
2349 {0xaa, 0x08, 0x0000},
2350 {0xaa, 0x03, 0x000a},
2351 {0xaa, 0x04, 0x0025},
2352 {0xaa, 0x05, 0x00aa},
2353 {0xaa, 0x06, 0x0005},
2354 {0xaa, 0x08, 0x0000},
2355 {0xaa, 0x03, 0x000b},
2356 {0xaa, 0x04, 0x00ec},
2357 {0xaa, 0x05, 0x002e},
2358 {0xaa, 0x06, 0x0005},
2359 {0xaa, 0x08, 0x0000},
2360 {0xaa, 0x03, 0x000c},
2361 {0xaa, 0x04, 0x00fa},
2362 {0xaa, 0x05, 0x002a},
2363 {0xaa, 0x06, 0x0005},
2364 {0xaa, 0x08, 0x0000},
2365 {0xaa, 0x07, 0x000d},
2366 {0xaa, 0x01, 0x0005},
2367 {0xaa, 0x94, 0x0002},
2368 {0xaa, 0x90, 0x0000},
2369 {0xaa, 0x91, 0x001f},
2370 {0xaa, 0x10, 0x0064},
2371 {0xaa, 0x9b, 0x00f0},
2372 {0xaa, 0x9c, 0x0002},
2373 {0xaa, 0x14, 0x001a},
2374 {0xaa, 0x20, 0x0080},
2375 {0xaa, 0x22, 0x0080},
2376 {0xaa, 0x24, 0x0080},
2377 {0xaa, 0x26, 0x0080},
2378 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002379 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2380 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002381 {0xaa, 0xa8, 0x00c0},
2382 {0xa1, 0x01, 0x0002},
2383 {0xa1, 0x01, 0x0008},
2384 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002385 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2386 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2387 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2388 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002389 {0xa1, 0x01, 0x0008},
2390
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002391 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2392 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002393 {0xa1, 0x01, 0x01c8},
2394 {0xa1, 0x01, 0x01c9},
2395 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002396 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
2397 {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2398 {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2399 {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2400 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2401 {0xa0, 0x52, ZC3XX_R10E_RGB11},
2402 {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2403 {0xa0, 0xf7, ZC3XX_R110_RGB20},
2404 {0xa0, 0xf7, ZC3XX_R111_RGB21},
2405 {0xa0, 0x52, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002406 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002407 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2408 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002409 {0xaa, 0x0d, 0x0003},
2410 {0xaa, 0x0c, 0x008c},
2411 {0xaa, 0x0e, 0x0095},
2412 {0xaa, 0x0f, 0x0002},
2413 {0xaa, 0x1c, 0x0094},
2414 {0xaa, 0x1d, 0x0002},
2415 {0xaa, 0x20, 0x0080},
2416 {0xaa, 0x22, 0x0080},
2417 {0xaa, 0x24, 0x0080},
2418 {0xaa, 0x26, 0x0080},
2419 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002420 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2421 {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
2422 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2423 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2424 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
2425 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2426 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2427 {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
2428 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2429 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2430 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2431 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2432 {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
2433 {0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
2434 {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
2435 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2436 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2437 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
2438 {0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
2439 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002440 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002441 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2442 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2443 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2444 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002445 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002446};
2447
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002448static const struct usb_action icm105a_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002449 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2450 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2451 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2452 {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2453 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2454 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2455 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2456 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2457 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2458 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2459 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2460 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2461 {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2462 {0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
2463 {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2464 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
2465 {0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
2466 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
2467 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2468 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2469 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2470 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2471 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2472 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2473 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2474 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2475 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002476 {0xaa, 0x01, 0x0010},
2477 {0xaa, 0x03, 0x0000},
2478 {0xaa, 0x04, 0x0001},
2479 {0xaa, 0x05, 0x0020},
2480 {0xaa, 0x06, 0x0001},
2481 {0xaa, 0x08, 0x0000},
2482 {0xaa, 0x03, 0x0001},
2483 {0xaa, 0x04, 0x0011},
2484 {0xaa, 0x05, 0x00a0},
2485 {0xaa, 0x06, 0x0001},
2486 {0xaa, 0x08, 0x0000},
2487 {0xaa, 0x03, 0x0002},
2488 {0xaa, 0x04, 0x0013},
2489 {0xaa, 0x05, 0x0020},
2490 {0xaa, 0x06, 0x0001},
2491 {0xaa, 0x08, 0x0000},
2492 {0xaa, 0x03, 0x0003},
2493 {0xaa, 0x04, 0x0015},
2494 {0xaa, 0x05, 0x0020},
2495 {0xaa, 0x06, 0x0005},
2496 {0xaa, 0x08, 0x0000},
2497 {0xaa, 0x03, 0x0004},
2498 {0xaa, 0x04, 0x0017},
2499 {0xaa, 0x05, 0x0020},
2500 {0xaa, 0x06, 0x000d},
2501 {0xaa, 0x08, 0x0000},
2502 {0xaa, 0x03, 0x0005},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002503 {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
2504 {0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
2505 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002506 {0xa1, 0x01, 0x0091},
2507 {0xaa, 0x05, 0x0020},
2508 {0xaa, 0x06, 0x0005},
2509 {0xaa, 0x08, 0x0000},
2510 {0xaa, 0x03, 0x0006},
2511 {0xaa, 0x04, 0x0017},
2512 {0xaa, 0x05, 0x0026},
2513 {0xaa, 0x06, 0x0005},
2514 {0xaa, 0x08, 0x0000},
2515 {0xaa, 0x03, 0x0007},
2516 {0xaa, 0x04, 0x0019},
2517 {0xaa, 0x05, 0x0022},
2518 {0xaa, 0x06, 0x0005},
2519 {0xaa, 0x08, 0x0000},
2520 {0xaa, 0x03, 0x0008},
2521 {0xaa, 0x04, 0x0021},
2522 {0xaa, 0x05, 0x00aa},
2523 {0xaa, 0x06, 0x0005},
2524 {0xaa, 0x08, 0x0000},
2525 {0xaa, 0x03, 0x0009},
2526 {0xaa, 0x04, 0x0023},
2527 {0xaa, 0x05, 0x00aa},
2528 {0xaa, 0x06, 0x000d},
2529 {0xaa, 0x08, 0x0000},
2530 {0xaa, 0x03, 0x000a},
2531 {0xaa, 0x04, 0x0025},
2532 {0xaa, 0x05, 0x00aa},
2533 {0xaa, 0x06, 0x0005},
2534 {0xaa, 0x08, 0x0000},
2535 {0xaa, 0x03, 0x000b},
2536 {0xaa, 0x04, 0x00ec},
2537 {0xaa, 0x05, 0x002e},
2538 {0xaa, 0x06, 0x0005},
2539 {0xaa, 0x08, 0x0000},
2540 {0xaa, 0x03, 0x000c},
2541 {0xaa, 0x04, 0x00fa},
2542 {0xaa, 0x05, 0x002a},
2543 {0xaa, 0x06, 0x0005},
2544 {0xaa, 0x08, 0x0000},
2545 {0xaa, 0x07, 0x000d},
2546 {0xaa, 0x01, 0x0005},
2547 {0xaa, 0x94, 0x0002},
2548 {0xaa, 0x90, 0x0000},
2549 {0xaa, 0x91, 0x0010},
2550 {0xaa, 0x10, 0x0064},
2551 {0xaa, 0x9b, 0x00f0},
2552 {0xaa, 0x9c, 0x0002},
2553 {0xaa, 0x14, 0x001a},
2554 {0xaa, 0x20, 0x0080},
2555 {0xaa, 0x22, 0x0080},
2556 {0xaa, 0x24, 0x0080},
2557 {0xaa, 0x26, 0x0080},
2558 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002559 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2560 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002561 {0xaa, 0xa8, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002562 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002563 {0xa1, 0x01, 0x0002},
2564 {0xa1, 0x01, 0x0008},
2565 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002566 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2567 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2568 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2569 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002570 {0xa1, 0x01, 0x0008},
2571
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002572 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2573 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002574 {0xa1, 0x01, 0x01c8},
2575 {0xa1, 0x01, 0x01c9},
2576 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002577 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002578
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002579 {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2580 {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2581 {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2582 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2583 {0xa0, 0x52, ZC3XX_R10E_RGB11},
2584 {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2585 {0xa0, 0xf7, ZC3XX_R110_RGB20},
2586 {0xa0, 0xf7, ZC3XX_R111_RGB21},
2587 {0xa0, 0x52, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002588 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002589 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2590 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002591 {0xaa, 0x0d, 0x0003},
2592 {0xaa, 0x0c, 0x0020},
2593 {0xaa, 0x0e, 0x000e},
2594 {0xaa, 0x0f, 0x0002},
2595 {0xaa, 0x1c, 0x000d},
2596 {0xaa, 0x1d, 0x0002},
2597 {0xaa, 0x20, 0x0080},
2598 {0xaa, 0x22, 0x0080},
2599 {0xaa, 0x24, 0x0080},
2600 {0xaa, 0x26, 0x0080},
2601 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002602 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2603 {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
2604 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2605 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2606 {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
2607 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2608 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2609 {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
2610 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2611 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2612 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2613 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2614 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
2615 {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
2616 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
2617 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2618 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2619 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002620 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002621 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2622 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2623 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2624 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002625 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002626};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002627static const struct usb_action icm105a_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002628 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002629 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2630 {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
2631 {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
2632 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2633 {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
2634 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2635 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2636 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2637 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2638 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2639 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002640 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2641 {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
2642 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2643 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2644 {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
2645 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2646 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2647 {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
2648 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2649 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2650 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2651 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2652 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
2653 {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
2654 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2655 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002656 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002657};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002658static const struct usb_action icm105a_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002659 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002660 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2661 {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
2662 {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
2663 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2664 {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
2665 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2666 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2667 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2668 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2669 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2670 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002671 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2672 {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
2673 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2674 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2675 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2676 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2677 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2678 {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
2679 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2680 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2681 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2682 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2683 {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
2684 {0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
2685 {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
2686 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2687 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2688 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002689 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002690};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002691static const struct usb_action icm105a_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002692 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002693 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2694 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2695 {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2696 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2697 {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
2698 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2699 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2700 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2701 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2702 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2703 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002704 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2705 {0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
2706 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2707 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2708 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
2709 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2710 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2711 {0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
2712 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2713 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2714 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2715 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2716 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2717 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2718 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2719 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002720 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002721};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002722static const struct usb_action icm105a_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002723 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002724 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2725 {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
2726 {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
2727 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2728 {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
2729 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2730 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2731 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2732 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2733 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2734 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002735 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2736 {0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
2737 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2738 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2739 {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
2740 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2741 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2742 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
2743 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2744 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2745 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2746 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2747 {0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
2748 {0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
2749 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2750 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2751 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2752 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002753 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002754};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002755static const struct usb_action icm105a_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002756 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002757 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2758 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2759 {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2760 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2761 {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
2762 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2763 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2764 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2765 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2766 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2767 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002768 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2769 {0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
2770 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2771 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2772 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2773 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2774 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2775 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2776 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2777 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2778 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2779 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2780 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2781 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2782 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2783 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002784 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002785};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002786static const struct usb_action icm105a_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002787 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002788 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2789 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2790 {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
2791 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2792 {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
2793 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2794 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2795 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2796 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2797 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2798 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002799 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2800 {0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
2801 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2802 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2803 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2804 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2805 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2806 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2807 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2808 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2809 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2810 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2811 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2812 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2813 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2814 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2815 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2816 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002817 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002818};
2819
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002820static const struct usb_action mc501cb_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002821 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2822 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
2823 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2824 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2825 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2826 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2827 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2828 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2829 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2830 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2831 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
2832 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2833 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2834 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2835 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2836 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2837 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
2838 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2839 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
2840 {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2841 {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2842 {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2843 {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2844 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002845 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2846 {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2847 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2848 {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2849 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2850 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
2851 {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
2852 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
2853 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
2854 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
2855 {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
2856 {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
2857 {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
2858 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
2859 {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
2860 {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
2861 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2862 {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
2863 {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
2864 {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
2865 {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
2866 {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
2867 {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
2868 {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
2869 {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
2870 {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
2871 {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
2872 {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
2873 {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
2874 {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
2875 {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
2876 {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
2877 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2878 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
2879 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
Jean-François Moine4e5144e2011-02-26 13:56:20 -03002880 {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002881 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
2882 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
2883 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
2884 {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
2885 {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
2886 {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
2887 {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
2888 {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
2889 {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
2890 {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
2891 {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
2892 {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
2893 {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
2894 {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
2895 {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
2896 {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
2897 {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
2898 {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
2899 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2900 {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
2901 {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
2902 {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
2903 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2904 {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
2905 {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
2906 {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
2907 {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
2908 {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
2909 {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
2910 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
2911 {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002912 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2913 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
2914 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
2915 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
2916 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
2917 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
2918 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
2919 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
2920 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002921 {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
2922 {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
2923 {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
2924 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2925 {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
2926 {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
2927 {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
2928 {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
2929 {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
2930 {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
2931
2932 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2933 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2934 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
2935 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
2936 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002937 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002938};
2939
Jean-François Moine780e3122010-10-19 04:29:10 -03002940static const struct usb_action mc501cb_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002941 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2942 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
2943 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2944 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2945 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2946 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2947 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2948 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2949 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2950 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2951 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
2952 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2953 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2954 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2955 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2956 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2957 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
2958 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2959 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
2960 {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2961 {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2962 {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2963 {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2964 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002965 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2966 {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2967 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2968 {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2969 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2970 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
2971 {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
2972 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
2973 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
2974 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
2975 {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
2976 {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
2977 {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
2978 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
2979 {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
2980 {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
2981 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2982 {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
2983 {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
2984 {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
2985 {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
2986 {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
2987 {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
2988 {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
2989 {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
2990 {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
2991 {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
2992 {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
2993 {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
2994 {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
2995 {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
2996 {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
2997 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2998 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
2999 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
Jean-François Moine4e5144e2011-02-26 13:56:20 -03003000 {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003001 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3002 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3003 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
3004 {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
3005 {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
3006 {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
3007 {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
3008 {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
3009 {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
3010 {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
3011 {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
3012 {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
3013 {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
3014 {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
3015 {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
3016 {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
3017 {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
3018 {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
3019 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3020 {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
3021 {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
3022 {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
3023 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3024 {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
3025 {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
3026 {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
3027 {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
3028 {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
3029 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3030 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
3031 {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003032 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3033 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3034 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3035 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3036 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3037 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3038 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3039 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3040 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003041 {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
3042 {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
3043 {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
3044 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3045 {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
3046 {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
3047 {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
3048 {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
3049 {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
3050 {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
3051 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3052 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3053 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3054 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3055 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003056 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003057};
3058
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003059static const struct usb_action mc501cb_50HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003060 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3061 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3062 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
3063 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
3064 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3065 {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
3066 {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
3067 {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
3068 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3069 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3070 {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3071 {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3072 {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003073 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003074};
3075
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003076static const struct usb_action mc501cb_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003077 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3078 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3079 {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
3080 {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
3081 {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3082 {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
3083 {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
3084 {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
3085 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3086 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3087 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3088 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3089 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003090 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003091};
3092
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003093static const struct usb_action mc501cb_60HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003094 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3095 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3096 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3097 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3098 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3099 {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3100 {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3101 {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3102 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3103 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3104 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3105 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3106 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003107 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003108};
3109
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003110static const struct usb_action mc501cb_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003111 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3112 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3113 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3114 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3115 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3116 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3117 {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3118 {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3119 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3120 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3121 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3122 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3123 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003124 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003125};
3126
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003127static const struct usb_action mc501cb_NoFlikerScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003128 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3129 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3130 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3131 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3132 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3133 {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3134 {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3135 {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3136 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3137 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3138 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3139 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3140 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003141 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003142};
3143
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003144static const struct usb_action mc501cb_NoFliker[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003145 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3146 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3147 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3148 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3149 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3150 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3151 {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3152 {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003153 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003154};
3155
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003156/* from zs211.inf */
3157static const struct usb_action ov7620_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003158 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3159 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
3160 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3161 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3162 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3163 {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3164 {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3165 {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3166 {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3167 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3168 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3169 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3170 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3171 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3172 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3173 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3174 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3175 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3176 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3177 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3178 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3179 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3180 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3181 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003182 {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3183 {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3184 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3185 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3186 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3187 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3188 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3189 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3190 {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3191 {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3192 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3193 {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3194 {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3195 {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3196 {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3197 {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3198 {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3199 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3200 {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3201 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3202 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3203 {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3204 {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3205 {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3206 {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3207 {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3208 {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3209 {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003210 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3211 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3212 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3213 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003214 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003215 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3216 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3217 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3218 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3219 {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3220 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3221 {0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
3222 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3223 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003224 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003225};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003226static const struct usb_action ov7620_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003227 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3228 {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT}, /* 00,02,50,cc */
3229 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3230 /* mx change? */
3231 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3232 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3233 {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3234 {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3235 {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3236 {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3237 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3238 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3239 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3240 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3241 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3242 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3243 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3244 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3245 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3246 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3247 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3248 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3249 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3250 {0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d6,cc */
3251 /* OV7648 00,9c,d8,cc */
3252 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003253 {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3254 {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3255 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3256 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3257 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3258 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3259 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3260 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3261 {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3262 {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3263 {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3264 {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3265 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3266 {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3267 {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3268 {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3269 {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3270 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3271 {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3272 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3273 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3274 {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3275 {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3276 {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3277 {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3278 {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3279 {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3280 {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003281 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3282 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3283 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3284 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3285 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3286 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3287 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3288 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3289 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3290 {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3291 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3292 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,50,cc */
3293 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3294 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003295 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003296};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003297static const struct usb_action ov7620_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003298 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3299 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3300 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3301 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3302 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003303 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3304 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3305 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3306 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3307 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3308 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3309 {0xaa, 0x10, 0x0082}, /* 00,10,82,aa */
3310 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3311/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
Jean-François Moine4e5144e2011-02-26 13:56:20 -03003312 * if mode0 (640x480) */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003313 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003314};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003315static const struct usb_action ov7620_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003316 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3317 /* (bug in zs211.inf) */
3318 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3319 {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3320 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3321 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3322 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3323 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3324 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3325 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3326 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3327 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3328 {0xaa, 0x10, 0x0020}, /* 00,10,20,aa */
3329 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3330/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
3331 * if mode0 (640x480) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003332/* ?? in gspca v1, it was
3333 {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
3334 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003335 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003336};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003337static const struct usb_action ov7620_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003338 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3339 /* (bug in zs211.inf) */
3340 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3341 {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3342 {0xaa, 0x75, 0x008e}, /* 00,75,8e,aa */
3343 {0xaa, 0x2d, 0x0001}, /* 00,2d,01,aa */
3344 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3345 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3346 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3347 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3348 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3349 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
3350/* {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT}, * 00,02,44,cc
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003351 * if mode1 (320x240) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003352/* ?? was
3353 {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
3354 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003355 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003356};
3357
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003358static const struct usb_action ov7630c_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003359 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3360 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3361 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3362 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3363 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3364 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3365 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3366 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3367 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3368 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3369 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3370 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3371 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3372 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003373 {0xaa, 0x12, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003374 {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3375 {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3376 {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3377 {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3378 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3379 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3380 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3381 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3382 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3383 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
3384 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003385 {0xaa, 0x12, 0x0069},
3386 {0xaa, 0x04, 0x0020},
3387 {0xaa, 0x06, 0x0050},
3388 {0xaa, 0x13, 0x0083},
3389 {0xaa, 0x14, 0x0000},
3390 {0xaa, 0x15, 0x0024},
3391 {0xaa, 0x17, 0x0018},
3392 {0xaa, 0x18, 0x00ba},
3393 {0xaa, 0x19, 0x0002},
3394 {0xaa, 0x1a, 0x00f6},
3395 {0xaa, 0x1b, 0x0002},
3396 {0xaa, 0x20, 0x00c2},
3397 {0xaa, 0x24, 0x0060},
3398 {0xaa, 0x25, 0x0040},
3399 {0xaa, 0x26, 0x0030},
3400 {0xaa, 0x27, 0x00ea},
3401 {0xaa, 0x28, 0x00a0},
3402 {0xaa, 0x21, 0x0000},
3403 {0xaa, 0x2a, 0x0081},
3404 {0xaa, 0x2b, 0x0096},
3405 {0xaa, 0x2d, 0x0094},
3406 {0xaa, 0x2f, 0x003d},
3407 {0xaa, 0x30, 0x0024},
3408 {0xaa, 0x60, 0x0000},
3409 {0xaa, 0x61, 0x0040},
3410 {0xaa, 0x68, 0x007c},
3411 {0xaa, 0x6f, 0x0015},
3412 {0xaa, 0x75, 0x0088},
3413 {0xaa, 0x77, 0x00b5},
3414 {0xaa, 0x01, 0x0060},
3415 {0xaa, 0x02, 0x0060},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003416 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3417 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3418 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3419 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3420 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003421 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003422 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3423 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3424 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3425 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3426 {0xa0, 0x60, ZC3XX_R116_RGAIN},
3427 {0xa0, 0x46, ZC3XX_R118_BGAIN},
3428 {0xa0, 0x04, ZC3XX_R113_RGB03},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003429/* 0x10, */
3430 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003431 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3432 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3433 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3434 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3435 {0xa0, 0x50, ZC3XX_R10E_RGB11},
3436 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3437 {0xa0, 0xf8, ZC3XX_R110_RGB20},
3438 {0xa0, 0xf8, ZC3XX_R111_RGB21},
3439 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003440 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003441 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
3442 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003443 {0xa1, 0x01, 0x01c8},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003444 {0xa1, 0x01, 0x01c9},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003445 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003446 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
3447 {0xa0, 0x01, ZC3XX_R120_GAMMA00}, /* gamma 2 ?*/
3448 {0xa0, 0x0c, ZC3XX_R121_GAMMA01},
3449 {0xa0, 0x1f, ZC3XX_R122_GAMMA02},
3450 {0xa0, 0x3a, ZC3XX_R123_GAMMA03},
3451 {0xa0, 0x53, ZC3XX_R124_GAMMA04},
3452 {0xa0, 0x6d, ZC3XX_R125_GAMMA05},
3453 {0xa0, 0x85, ZC3XX_R126_GAMMA06},
3454 {0xa0, 0x9c, ZC3XX_R127_GAMMA07},
3455 {0xa0, 0xb0, ZC3XX_R128_GAMMA08},
3456 {0xa0, 0xc2, ZC3XX_R129_GAMMA09},
3457 {0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
3458 {0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
3459 {0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
3460 {0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
3461 {0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
3462 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3463 {0xa0, 0x05, ZC3XX_R130_GAMMA10},
3464 {0xa0, 0x0f, ZC3XX_R131_GAMMA11},
3465 {0xa0, 0x16, ZC3XX_R132_GAMMA12},
3466 {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
3467 {0xa0, 0x19, ZC3XX_R134_GAMMA14},
3468 {0xa0, 0x19, ZC3XX_R135_GAMMA15},
3469 {0xa0, 0x17, ZC3XX_R136_GAMMA16},
3470 {0xa0, 0x15, ZC3XX_R137_GAMMA17},
3471 {0xa0, 0x12, ZC3XX_R138_GAMMA18},
3472 {0xa0, 0x10, ZC3XX_R139_GAMMA19},
3473 {0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
3474 {0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
3475 {0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
3476 {0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
3477 {0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
3478 {0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
3479 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3480 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3481 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3482 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3483 {0xa0, 0x50, ZC3XX_R10E_RGB11},
3484 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3485 {0xa0, 0xf8, ZC3XX_R110_RGB20},
3486 {0xa0, 0xf8, ZC3XX_R111_RGB21},
3487 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003488
3489 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003490 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003491 {0xaa, 0x10, 0x001b},
3492 {0xaa, 0x76, 0x0002},
3493 {0xaa, 0x2a, 0x0081},
3494 {0xaa, 0x2b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003495 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3496 {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
3497 {0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
3498 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3499 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3500 {0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
3501 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3502 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3503 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3504 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3505 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3506 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3507 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003508 {0xaa, 0x13, 0x0083}, /* 40 */
3509 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003510 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003511 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003512};
3513
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003514static const struct usb_action ov7630c_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003515 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3516 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
3517 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3518 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3519 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3520 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3521 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3522 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3523 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3524 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3525 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3526 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003527
3528 {0xaa, 0x12, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003529 {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3530 {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3531 {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3532 {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3533 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3534 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3535 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3536 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3537 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3538 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
3539 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003540 {0xaa, 0x12, 0x0069}, /* i2c */
3541 {0xaa, 0x04, 0x0020},
3542 {0xaa, 0x06, 0x0050},
3543 {0xaa, 0x13, 0x00c3},
3544 {0xaa, 0x14, 0x0000},
3545 {0xaa, 0x15, 0x0024},
3546 {0xaa, 0x19, 0x0003},
3547 {0xaa, 0x1a, 0x00f6},
3548 {0xaa, 0x1b, 0x0002},
3549 {0xaa, 0x20, 0x00c2},
3550 {0xaa, 0x24, 0x0060},
3551 {0xaa, 0x25, 0x0040},
3552 {0xaa, 0x26, 0x0030},
3553 {0xaa, 0x27, 0x00ea},
3554 {0xaa, 0x28, 0x00a0},
3555 {0xaa, 0x21, 0x0000},
3556 {0xaa, 0x2a, 0x0081},
3557 {0xaa, 0x2b, 0x0096},
3558 {0xaa, 0x2d, 0x0084},
3559 {0xaa, 0x2f, 0x003d},
3560 {0xaa, 0x30, 0x0024},
3561 {0xaa, 0x60, 0x0000},
3562 {0xaa, 0x61, 0x0040},
3563 {0xaa, 0x68, 0x007c},
3564 {0xaa, 0x6f, 0x0015},
3565 {0xaa, 0x75, 0x0088},
3566 {0xaa, 0x77, 0x00b5},
3567 {0xaa, 0x01, 0x0060},
3568 {0xaa, 0x02, 0x0060},
3569 {0xaa, 0x17, 0x0018},
3570 {0xaa, 0x18, 0x00ba},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003571 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3572 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3573 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3574 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3575 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003576 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003577 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3578 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3579 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3580 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3581 {0xa0, 0x60, ZC3XX_R116_RGAIN},
3582 {0xa0, 0x46, ZC3XX_R118_BGAIN},
3583 {0xa0, 0x04, ZC3XX_R113_RGB03},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003584
3585 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003586 {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3587 {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3588 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3589 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3590 {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3591 {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3592 {0xa0, 0x00, ZC3XX_R110_RGB20},
3593 {0xa0, 0xf6, ZC3XX_R111_RGB21},
3594 {0xa0, 0x4a, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003595
3596 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003597 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
3598 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003599 {0xa1, 0x01, 0x01c8},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003600 {0xa1, 0x01, 0x01c9},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003601 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003602 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
3603 {0xa0, 0x16, ZC3XX_R120_GAMMA00}, /* gamma ~4 */
3604 {0xa0, 0x3a, ZC3XX_R121_GAMMA01},
3605 {0xa0, 0x5b, ZC3XX_R122_GAMMA02},
3606 {0xa0, 0x7c, ZC3XX_R123_GAMMA03},
3607 {0xa0, 0x94, ZC3XX_R124_GAMMA04},
3608 {0xa0, 0xa9, ZC3XX_R125_GAMMA05},
3609 {0xa0, 0xbb, ZC3XX_R126_GAMMA06},
3610 {0xa0, 0xca, ZC3XX_R127_GAMMA07},
3611 {0xa0, 0xd7, ZC3XX_R128_GAMMA08},
3612 {0xa0, 0xe1, ZC3XX_R129_GAMMA09},
3613 {0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
3614 {0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
3615 {0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
3616 {0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
3617 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
3618 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3619 {0xa0, 0x20, ZC3XX_R130_GAMMA10},
3620 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
3621 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
3622 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
3623 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
3624 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
3625 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
3626 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
3627 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
3628 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
3629 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
3630 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
3631 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
3632 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
3633 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
3634 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
3635 {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3636 {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3637 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3638 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3639 {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3640 {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3641 {0xa0, 0x00, ZC3XX_R110_RGB20},
3642 {0xa0, 0xf6, ZC3XX_R111_RGB21},
3643 {0xa0, 0x4a, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003644
3645 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003646 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003647 {0xaa, 0x10, 0x000d},
3648 {0xaa, 0x76, 0x0002},
3649 {0xaa, 0x2a, 0x0081},
3650 {0xaa, 0x2b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003651 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3652 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
3653 {0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
3654 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3655 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3656 {0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
3657 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3658 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3659 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3660 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3661 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3662 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3663 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003664 {0xaa, 0x13, 0x00c3},
3665
3666 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003667 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003668 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003669};
3670
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003671static const struct usb_action pas106b_Initial_com[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003672/* Sream and Sensor specific */
3673 {0xa1, 0x01, 0x0010}, /* CMOSSensorSelect */
3674/* System */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003675 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
3676 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003677/* Picture size */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003678 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* ClockSelect */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003679 {0xa0, 0x03, 0x003a},
3680 {0xa0, 0x0c, 0x003b},
3681 {0xa0, 0x04, 0x0038},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003682 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003683};
3684
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003685static const struct usb_action pas106b_InitialScale[] = { /* 176x144 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003686/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003687 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003688/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003689 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003690/* Picture size */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003691 {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
3692 {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
3693 {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
3694 {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003695/* System */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003696 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003697/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003698 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3699 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003700/* Sensor Interface */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003701 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003702/* Window inside sensor array */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003703 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3704 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3705 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3706 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3707 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003708/* Init the sensor */
3709 {0xaa, 0x02, 0x0004},
3710 {0xaa, 0x08, 0x0000},
3711 {0xaa, 0x09, 0x0005},
3712 {0xaa, 0x0a, 0x0002},
3713 {0xaa, 0x0b, 0x0002},
3714 {0xaa, 0x0c, 0x0005},
3715 {0xaa, 0x0d, 0x0000},
3716 {0xaa, 0x0e, 0x0002},
3717 {0xaa, 0x14, 0x0081},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003718/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003719 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003720/* Frame retreiving */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003721 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003722/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003723 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003724/* Unknown */
3725 {0xa0, 0x00, 0x01ad},
3726/* Sharpness */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003727 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3728 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003729/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003730 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003731/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003732 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003733/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003734 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003735/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003736 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003737/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003738 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3739 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3740 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003741/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003742 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003743/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003744 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003745/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003746 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003747/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003748 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003749/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003750 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3751 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3752 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003753
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003754 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
3755 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
3756 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3757 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
3758 {0xa0, 0x58, ZC3XX_R10E_RGB11},
3759 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
3760 {0xa0, 0xf4, ZC3XX_R110_RGB20},
3761 {0xa0, 0xf4, ZC3XX_R111_RGB21},
3762 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003763/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003764 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
3765 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3766 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3767 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
3768 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3769 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3770 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003771/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003772 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3773 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3774 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
3775 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3776 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3777 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
3778 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
3779 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003780/* sensor on */
3781 {0xaa, 0x07, 0x00b1},
3782 {0xaa, 0x05, 0x0003},
3783 {0xaa, 0x04, 0x0001},
3784 {0xaa, 0x03, 0x003b},
3785/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003786 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3787 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3788 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
3789 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003790/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003791 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003792 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003793 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003794/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003795 {0xa0, 0x40, ZC3XX_R116_RGAIN},
3796 {0xa0, 0x40, ZC3XX_R117_GGAIN},
3797 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003798 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003799};
3800
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003801static const struct usb_action pas106b_Initial[] = { /* 352x288 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003802/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003803 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003804/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003805 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003806/* Picture size */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003807 {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
3808 {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
3809 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3810 {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003811/* System */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003812 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003813/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003814 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3815 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003816/* Sensor Interface */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003817 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003818/* Window inside sensor array */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003819 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3820 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3821 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3822 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3823 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003824/* Init the sensor */
3825 {0xaa, 0x02, 0x0004},
3826 {0xaa, 0x08, 0x0000},
3827 {0xaa, 0x09, 0x0005},
3828 {0xaa, 0x0a, 0x0002},
3829 {0xaa, 0x0b, 0x0002},
3830 {0xaa, 0x0c, 0x0005},
3831 {0xaa, 0x0d, 0x0000},
3832 {0xaa, 0x0e, 0x0002},
3833 {0xaa, 0x14, 0x0081},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003834/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003835 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003836/* Frame retreiving */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003837 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003838/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003839 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003840/* Unknown */
3841 {0xa0, 0x00, 0x01ad},
3842/* Sharpness */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003843 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3844 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003845/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003846 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003847/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003848 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3849 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003850/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003851 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003852/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003853 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003854/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003855 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3856 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3857 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003858/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003859 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003860/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003861 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003862/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003863 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003864/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003865 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003866/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003867 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3868 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3869 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003870
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003871 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
3872 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
3873 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3874 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
3875 {0xa0, 0x58, ZC3XX_R10E_RGB11},
3876 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
3877 {0xa0, 0xf4, ZC3XX_R110_RGB20},
3878 {0xa0, 0xf4, ZC3XX_R111_RGB21},
3879 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003880/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003881 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
3882 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3883 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3884 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
3885 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3886 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3887 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003888
3889/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003890 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3891 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3892 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003893
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003894 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3895 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3896 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003897
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003898 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3899 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003900/* sensor on */
3901 {0xaa, 0x07, 0x00b1},
3902 {0xaa, 0x05, 0x0003},
3903 {0xaa, 0x04, 0x0001},
3904 {0xaa, 0x03, 0x003b},
3905/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003906 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3907 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3908 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
3909 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003910/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003911 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003912 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003913 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003914/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003915 {0xa0, 0x40, ZC3XX_R116_RGAIN},
3916 {0xa0, 0x40, ZC3XX_R117_GGAIN},
3917 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003918
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003919 {0xa0, 0x00, 0x0007}, /* AutoCorrectEnable */
3920 {0xa0, 0xff, ZC3XX_R018_FRAMELOST}, /* Frame adjust */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003921 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003922};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003923static const struct usb_action pas106b_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003924 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3925 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3926 {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
3927 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3928 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3929 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
3930 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3931 {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
3932 {0xaa, 0x03, 0x0021}, /* 00,03,21,aa */
3933 {0xaa, 0x04, 0x000c}, /* 00,04,0c,aa */
3934 {0xaa, 0x05, 0x0002}, /* 00,05,02,aa */
3935 {0xaa, 0x07, 0x001c}, /* 00,07,1c,aa */
3936 {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003937 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003938};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003939static const struct usb_action pas106b_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003940 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3941 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3942 {0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
3943 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3944 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3945 {0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
3946 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3947 {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
3948 {0xaa, 0x03, 0x001c}, /* 00,03,1c,aa */
3949 {0xaa, 0x04, 0x0004}, /* 00,04,04,aa */
3950 {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
3951 {0xaa, 0x07, 0x00c4}, /* 00,07,c4,aa */
3952 {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003953 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003954};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003955static const struct usb_action pas106b_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003956 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3957 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3958 {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
3959 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3960 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3961 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
3962 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3963 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3964 {0xaa, 0x03, 0x0013}, /* 00,03,13,aa */
3965 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3966 {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
3967 {0xaa, 0x07, 0x0030}, /* 00,07,30,aa */
3968 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003969 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003970};
3971
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003972/* from lvWIMv.inf 046d:08a2/:08aa 2007/06/03 */
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003973static const struct usb_action pas202b_Initial[] = { /* 640x480 */
3974 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003975 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003976 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
3977 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
3978 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3979 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3980 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3981 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
3982 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3983 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3984 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3985 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3986 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3987 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,03,cc */
3988 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3989 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,03,cc */
3990 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3991 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
3992 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3993 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3994 {0xaa, 0x02, 0x0002}, /* 00,02,04,aa --> 02 */
3995 {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
3996 {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
3997 {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
3998 {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
3999 {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004000 {0xaa, 0x0c, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004001 {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
4002 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
4003 {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
4004 {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
4005 {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
4006 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
4007 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4008 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
4009 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
4010 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4011 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4012 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4013 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4014 {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
4015 {}
4016};
4017static const struct usb_action pas202b_InitialScale[] = { /* 320x240 */
4018 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004019 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004020 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
4021 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
4022 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4023 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4024 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004025 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004026 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4027 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4028 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4029 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
4030 {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,08,cc */
4031 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,02,cc */
4032 {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,08,cc */
4033 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,02,cc */
4034 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004035 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004036 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
4037 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
4038 {0xaa, 0x02, 0x0002}, /* 00,02,02,aa */
4039 {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
4040 {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
4041 {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
4042 {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
4043 {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004044 {0xaa, 0x0c, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004045 {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
4046 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
4047 {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
4048 {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
4049 {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
4050 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
4051 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4052 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
4053 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
4054 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4055 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4056 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4057 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4058 {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004059 {0xa0, 0xff, ZC3XX_R097_WINYSTARTHIGH},
4060 {0xa0, 0xfe, ZC3XX_R098_WINYSTARTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004061 {}
4062};
4063static const struct usb_action pas202b_50HZ[] = {
4064 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4065 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4066 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4067 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004068 {0xaa, 0x21, 0x001b},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004069 {0xaa, 0x03, 0x0044}, /* 00,03,44,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004070 {0xaa, 0x04, 0x0008},
4071 {0xaa, 0x05, 0x001b},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004072 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4073 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004074 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004075 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4076 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004077 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4078 {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004079 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4080 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4081 {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4d,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004082 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4083 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004084 {0xa0, 0x44, ZC3XX_R01D_HSYNC_0}, /* 00,1d,44,cc */
4085 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4086 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
4087 {0xa0, 0xeb, ZC3XX_R020_HSYNC_3}, /* 00,20,eb,cc */
4088 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4089 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4090 {}
4091};
4092static const struct usb_action pas202b_50HZScale[] = {
4093 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4094 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4095 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004096 {0xaa, 0x20, 0x0004},
4097 {0xaa, 0x21, 0x003d},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004098 {0xaa, 0x03, 0x0041}, /* 00,03,41,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004099 {0xaa, 0x04, 0x0010},
4100 {0xaa, 0x05, 0x003d},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004101 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4102 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004103 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004104 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4105 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004106 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4107 {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004108 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4109 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4110 {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,9b,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004111 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4112 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004113 {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
4114 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4115 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
4116 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4117 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4118 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4119 {}
4120};
4121static const struct usb_action pas202b_60HZ[] = {
4122 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4123 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4124 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4125 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4126 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4127 {0xaa, 0x03, 0x0045}, /* 00,03,45,aa */
4128 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
4129 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
4130 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4131 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004132 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004133 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4134 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004135 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4136 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004137 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4138 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4139 {0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,40,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004140 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4141 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004142 {0xa0, 0x45, ZC3XX_R01D_HSYNC_0}, /* 00,1d,45,cc */
4143 {0xa0, 0x8e, ZC3XX_R01E_HSYNC_1}, /* 00,1e,8e,cc */
4144 {0xa0, 0xc1, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c1,cc */
4145 {0xa0, 0xf5, ZC3XX_R020_HSYNC_3}, /* 00,20,f5,cc */
4146 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4147 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4148 {}
4149};
4150static const struct usb_action pas202b_60HZScale[] = {
4151 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4152 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4153 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004154 {0xaa, 0x20, 0x0004},
4155 {0xaa, 0x21, 0x0008},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004156 {0xaa, 0x03, 0x0042}, /* 00,03,42,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004157 {0xaa, 0x04, 0x0010},
4158 {0xaa, 0x05, 0x0008},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004159 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4160 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004161 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004162 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4163 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004164 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4165 {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004166 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4167 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4168 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004169 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4170 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004171 {0xa0, 0x42, ZC3XX_R01D_HSYNC_0}, /* 00,1d,42,cc */
4172 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4173 {0xa0, 0xaf, ZC3XX_R01F_HSYNC_2}, /* 00,1f,af,cc */
4174 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4175 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4176 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4177 {}
4178};
4179static const struct usb_action pas202b_NoFliker[] = {
4180 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4181 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4182 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4183 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004184 {0xaa, 0x21, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004185 {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
4186 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004187 {0xaa, 0x05, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004188 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4189 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4190 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004191 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4192 {0xa0, 0x06, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004193 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4194 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004195 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004196 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4197 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4198 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004199 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004200 {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
4201 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
4202 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4203 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4204 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4205 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4206 {}
4207};
4208static const struct usb_action pas202b_NoFlikerScale[] = {
4209 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4210 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4211 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004212 {0xaa, 0x20, 0x0004},
4213 {0xaa, 0x21, 0x000c},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004214 {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004215 {0xaa, 0x04, 0x0010},
4216 {0xaa, 0x05, 0x000c},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004217 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4218 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4219 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004220 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4221 {0xa0, 0x0c, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004222 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4223 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4224 {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,02,cc */
4225 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4226 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4227 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004228 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004229 {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
4230 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
4231 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4232 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4233 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4234 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4235 {}
4236};
4237
Jean-François Moinea484dd92010-08-04 07:25:12 -03004238/* mt9v111 (mi0360soc) and pb0330 from vm30x.inf 0ac8:301b 07/02/13 */
4239static const struct usb_action mt9v111_1_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004240 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4241 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4242 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4243 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4244 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4245 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4246 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4247 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004248 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004249 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004250 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004251 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4252 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4253 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4254 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4255 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004256 {0xdd, 0x00, 0x0200},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004257 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004258 {0xaa, 0x01, 0x0001},
4259 {0xaa, 0x06, 0x0000},
4260 {0xaa, 0x08, 0x0483},
4261 {0xaa, 0x01, 0x0004},
4262 {0xaa, 0x08, 0x0006},
4263 {0xaa, 0x02, 0x0011},
4264 {0xaa, 0x03, 0x01e5}, /*jfm: was 01e7*/
4265 {0xaa, 0x04, 0x0285}, /*jfm: was 0287*/
4266 {0xaa, 0x07, 0x3002},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004267 {0xaa, 0x20, 0x5100},
4268 {0xaa, 0x35, 0x507f},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004269 {0xaa, 0x30, 0x0005},
4270 {0xaa, 0x31, 0x0000},
4271 {0xaa, 0x58, 0x0078},
4272 {0xaa, 0x62, 0x0411},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004273 {0xaa, 0x2b, 0x007f},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004274 {0xaa, 0x2c, 0x007f}, /*jfm: was 0030*/
4275 {0xaa, 0x2d, 0x007f}, /*jfm: was 0030*/
4276 {0xaa, 0x2e, 0x007f}, /*jfm: was 0030*/
4277 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004278 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004279 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4280 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4281 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4282 {0xa0, 0x09, 0x01ad}, /*jfm: was 00*/
4283 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4284 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4285 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4286 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4287 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004288 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004289 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4290 {0xa0, 0x65, ZC3XX_R118_BGAIN},
4291 {}
4292};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004293static const struct usb_action mt9v111_1_InitialScale[] = { /* 320x240 */
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004294 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4295 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4296 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4297 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4298 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4299 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4300 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4301 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4302 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4303 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004304 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004305 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4306 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4307 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4308 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4309 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4310 {0xdd, 0x00, 0x0200},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004311 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004312 {0xaa, 0x01, 0x0001},
4313 {0xaa, 0x06, 0x0000},
4314 {0xaa, 0x08, 0x0483},
4315 {0xaa, 0x01, 0x0004},
4316 {0xaa, 0x08, 0x0006},
4317 {0xaa, 0x02, 0x0011},
4318 {0xaa, 0x03, 0x01e7},
4319 {0xaa, 0x04, 0x0287},
4320 {0xaa, 0x07, 0x3002},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004321 {0xaa, 0x20, 0x5100},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004322 {0xaa, 0x35, 0x007f}, /*jfm: was 0050*/
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004323 {0xaa, 0x30, 0x0005},
4324 {0xaa, 0x31, 0x0000},
4325 {0xaa, 0x58, 0x0078},
4326 {0xaa, 0x62, 0x0411},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004327 {0xaa, 0x2b, 0x007f}, /*jfm: was 28*/
4328 {0xaa, 0x2c, 0x007f}, /*jfm: was 30*/
4329 {0xaa, 0x2d, 0x007f}, /*jfm: was 30*/
4330 {0xaa, 0x2e, 0x007f}, /*jfm: was 28*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004331 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004332 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004333 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4334 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4335 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004336 {0xa0, 0x09, 0x01ad}, /*jfm: was 00*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004337 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4338 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4339 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4340 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4341 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004342 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004343 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4344 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004345 {}
4346};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004347static const struct usb_action mt9v111_1_AE50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004348 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4349 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004350 {0xbb, 0x00, 0x0562},
4351 {0xbb, 0x01, 0x09aa},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004352 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004353 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4354 {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004355 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4356 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004357 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
4358 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4359 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4360 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4361 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4362 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
4363 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4364 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4365 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4366 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4367 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4368 {}
4369};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004370static const struct usb_action mt9v111_1_AE50HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004371 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4372 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4373 {0xbb, 0x00, 0x0509},
4374 {0xbb, 0x01, 0x0934},
4375 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4376 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4377 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4378 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4379 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4380 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4381 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4382 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4383 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4384 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4385 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4386 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4387 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4388 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4389 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4390 {}
4391};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004392static const struct usb_action mt9v111_1_AE60HZ[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004393 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4394 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004395 {0xaa, 0x05, 0x003d},
4396 {0xaa, 0x09, 0x016e},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004397 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4398 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4399 {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW},
4400 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4401 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4402 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
4403 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4404 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4405 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4406 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4407 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
4408 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4409 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4410 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4411 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4412 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4413 {}
4414};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004415static const struct usb_action mt9v111_1_AE60HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004416 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4417 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4418 {0xbb, 0x00, 0x0509},
4419 {0xbb, 0x01, 0x0983},
4420 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4421 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4422 {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4423 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4424 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4425 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004426 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4427 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4428 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4429 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4430 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4431 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4432 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4433 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4434 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004435 {}
4436};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004437static const struct usb_action mt9v111_1_AENoFliker[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004438 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4439 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4440 {0xbb, 0x00, 0x0509},
4441 {0xbb, 0x01, 0x0960},
4442 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4443 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4444 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4445 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4446 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4447 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4448 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4449 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4450 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4451 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4452 {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
4453 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
4454 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4455 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4456 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004457 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004458 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004459};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004460static const struct usb_action mt9v111_1_AENoFlikerScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004461 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4462 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4463 {0xbb, 0x00, 0x0534},
4464 {0xbb, 0x02, 0x0960},
4465 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4466 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4467 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4468 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4469 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4470 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4471 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4472 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4473 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4474 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4475 {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4476 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4477 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4478 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4479 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4480 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4481 {}
4482};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004483/* from usbvm303.inf 0ac8:303b 07/03/25 (3 - tas5130c) */
4484static const struct usb_action mt9v111_3_Initial[] = {
4485 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4486 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4487 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
Jean-François Moined581bcd2010-10-29 08:01:01 -03004488 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004489 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4490 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4491 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4492 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4493 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4494 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4495 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4496 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4497 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4498 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4499 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4500 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4501 {0xdd, 0x00, 0x0200},
4502 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4503 {0xaa, 0x01, 0x0001}, /* select IFP/SOC registers */
4504 {0xaa, 0x06, 0x0000}, /* operating mode control */
4505 {0xaa, 0x08, 0x0483}, /* output format control */
4506 /* H red first, V red or blue first,
4507 * raw Bayer, auto flicker */
4508 {0xaa, 0x01, 0x0004}, /* select sensor core registers */
4509 {0xaa, 0x08, 0x0006}, /* row start */
4510 {0xaa, 0x02, 0x0011}, /* column start */
4511 {0xaa, 0x03, 0x01e5}, /* window height - 1 */
4512 {0xaa, 0x04, 0x0285}, /* window width - 1 */
4513 {0xaa, 0x07, 0x3002}, /* output control */
4514 {0xaa, 0x20, 0x1100}, /* read mode: bits 8 & 12 (?) */
4515 {0xaa, 0x35, 0x007f}, /* global gain */
4516 {0xaa, 0x30, 0x0005},
4517 {0xaa, 0x31, 0x0000},
4518 {0xaa, 0x58, 0x0078},
4519 {0xaa, 0x62, 0x0411},
4520 {0xaa, 0x2b, 0x007f}, /* green1 gain */
4521 {0xaa, 0x2c, 0x007f}, /* blue gain */
4522 {0xaa, 0x2d, 0x007f}, /* red gain */
4523 {0xaa, 0x2e, 0x007f}, /* green2 gain */
4524 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4525 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4526 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4527 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4528 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4529 {0xa0, 0x00, 0x01ad},
4530 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4531 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4532 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4533 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4534 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4535 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
4536 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4537 {0xa0, 0x65, ZC3XX_R118_BGAIN},
4538 {}
4539};
4540static const struct usb_action mt9v111_3_InitialScale[] = {
4541 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4542 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4543 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4544 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4545 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4546 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4547 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4548 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4549 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4550 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4551 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4552 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4553 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4554 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4555 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4556 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4557 {0xdd, 0x00, 0x0200},
4558 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4559 {0xaa, 0x01, 0x0001},
4560 {0xaa, 0x06, 0x0000},
4561 {0xaa, 0x08, 0x0483},
4562 {0xaa, 0x01, 0x0004},
4563 {0xaa, 0x08, 0x0006},
4564 {0xaa, 0x02, 0x0011},
4565 {0xaa, 0x03, 0x01e7},
4566 {0xaa, 0x04, 0x0287},
4567 {0xaa, 0x07, 0x3002},
4568 {0xaa, 0x20, 0x1100},
4569 {0xaa, 0x35, 0x007f},
4570 {0xaa, 0x30, 0x0005},
4571 {0xaa, 0x31, 0x0000},
4572 {0xaa, 0x58, 0x0078},
4573 {0xaa, 0x62, 0x0411},
4574 {0xaa, 0x2b, 0x007f},
4575 {0xaa, 0x2c, 0x007f},
4576 {0xaa, 0x2d, 0x007f},
4577 {0xaa, 0x2e, 0x007f},
4578 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4579 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4580 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4581 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4582 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4583 {0xa0, 0x00, 0x01ad},
4584 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4585 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4586 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4587 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4588 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4589 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
4590 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4591 {0xa0, 0x65, ZC3XX_R118_BGAIN},
4592 {}
4593};
4594static const struct usb_action mt9v111_3_AE50HZ[] = {
4595 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4596 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4597 {0xaa, 0x05, 0x0009}, /* horizontal blanking */
4598 {0xaa, 0x09, 0x01ce}, /* shutter width */
4599 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4600 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4601 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4602 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4603 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4604 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4605 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4606 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4607 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4608 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4609 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4610 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4611 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4612 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4613 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4614 {}
4615};
4616static const struct usb_action mt9v111_3_AE50HZScale[] = {
4617 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4618 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4619 {0xaa, 0x05, 0x0009},
4620 {0xaa, 0x09, 0x01ce},
4621 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4622 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4623 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4624 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4625 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4626 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4627 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4628 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4629 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4630 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4631 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4632 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4633 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4634 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4635 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4636 {}
4637};
4638static const struct usb_action mt9v111_3_AE60HZ[] = {
4639 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4640 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4641 {0xaa, 0x05, 0x0009},
4642 {0xaa, 0x09, 0x0083},
4643 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4644 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4645 {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4646 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4647 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4648 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
4649 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4650 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4651 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4652 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4653 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4654 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4655 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4656 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4657 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4658 {}
4659};
4660static const struct usb_action mt9v111_3_AE60HZScale[] = {
4661 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4662 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4663 {0xaa, 0x05, 0x0009},
4664 {0xaa, 0x09, 0x0083},
4665 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4666 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4667 {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4668 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4669 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4670 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
4671 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4672 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4673 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4674 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4675 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4676 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4677 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4678 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4679 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4680 {}
4681};
4682static const struct usb_action mt9v111_3_AENoFliker[] = {
4683 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4684 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4685 {0xaa, 0x05, 0x0034},
4686 {0xaa, 0x09, 0x0260},
4687 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4688 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4689 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4690 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4691 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4692 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4693 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4694 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4695 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4696 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4697 {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4698 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4699 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4700 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4701 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4702 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4703 {}
4704};
4705static const struct usb_action mt9v111_3_AENoFlikerScale[] = {
4706 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4707 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4708 {0xaa, 0x05, 0x0034},
4709 {0xaa, 0x09, 0x0260},
4710 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4711 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4712 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4713 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4714 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4715 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4716 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4717 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4718 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4719 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4720 {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4721 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4722 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4723 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4724 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4725 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4726 {}
4727};
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004728
4729static const struct usb_action pb0330_Initial[] = { /* 640x480 */
4730 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4731 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
4732 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4733 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4734 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4735 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4736 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4737 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4738 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4739 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4740 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4741 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4742 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4743 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4744 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4745 {0xdd, 0x00, 0x0200},
4746 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4747 {0xaa, 0x01, 0x0006},
4748 {0xaa, 0x02, 0x0011},
4749 {0xaa, 0x03, 0x01e5}, /*jfm: was 1e7*/
4750 {0xaa, 0x04, 0x0285}, /*jfm: was 0287*/
4751 {0xaa, 0x06, 0x0003},
4752 {0xaa, 0x07, 0x3002},
4753 {0xaa, 0x20, 0x1100},
4754 {0xaa, 0x2f, 0xf7b0},
4755 {0xaa, 0x30, 0x0005},
4756 {0xaa, 0x31, 0x0000},
4757 {0xaa, 0x34, 0x0100},
4758 {0xaa, 0x35, 0x0060},
4759 {0xaa, 0x3d, 0x068f},
4760 {0xaa, 0x40, 0x01e0},
4761 {0xaa, 0x58, 0x0078},
4762 {0xaa, 0x62, 0x0411},
4763 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4764 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4765 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4766 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4767 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4768 {0xa0, 0x09, 0x01ad}, /*jfm: was 00 */
4769 {0xa0, 0x15, 0x01ae},
4770 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4771 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4772 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4773 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4774 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4775 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /*jfm: was 6c*/
4776 {}
4777};
4778static const struct usb_action pb0330_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004779 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4780 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
4781 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4782 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4783 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4784 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4785 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4786 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4787 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4788 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4789 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4790 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4791 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4792 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4793 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004794 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004795 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004796 {0xaa, 0x01, 0x0006},
4797 {0xaa, 0x02, 0x0011},
4798 {0xaa, 0x03, 0x01e7},
4799 {0xaa, 0x04, 0x0287},
4800 {0xaa, 0x06, 0x0003},
4801 {0xaa, 0x07, 0x3002},
4802 {0xaa, 0x20, 0x1100},
4803 {0xaa, 0x2f, 0xf7b0},
4804 {0xaa, 0x30, 0x0005},
4805 {0xaa, 0x31, 0x0000},
4806 {0xaa, 0x34, 0x0100},
4807 {0xaa, 0x35, 0x0060},
4808 {0xaa, 0x3d, 0x068f},
4809 {0xaa, 0x40, 0x01e0},
4810 {0xaa, 0x58, 0x0078},
4811 {0xaa, 0x62, 0x0411},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004812 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4813 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4814 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4815 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4816 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004817 {0xa0, 0x09, 0x01ad},
4818 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004819 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4820 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4821 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4822 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4823 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004824 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /*jfm: was 6c*/
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004825 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004826};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004827static const struct usb_action pb0330_50HZ[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004828 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4829 {0xbb, 0x00, 0x055c},
4830 {0xbb, 0x01, 0x09aa},
4831 {0xbb, 0x00, 0x1001},
4832 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4833 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4834 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4835 {0xa0, 0xc4, ZC3XX_R192_EXPOSURELIMITLOW},
4836 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4837 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4838 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
4839 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4840 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4841 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4842 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4843 {0xa0, 0x5c, ZC3XX_R01D_HSYNC_0},
4844 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4845 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4846 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004847 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004848};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004849static const struct usb_action pb0330_50HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004850 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4851 {0xbb, 0x00, 0x0566},
4852 {0xbb, 0x02, 0x09b2},
4853 {0xbb, 0x00, 0x1002},
4854 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4855 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4856 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4857 {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4858 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4859 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4860 {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4861 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4862 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4863 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4864 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4865 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4866 {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4867 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4868 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004869 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004870};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004871static const struct usb_action pb0330_60HZ[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004872 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4873 {0xbb, 0x00, 0x0535},
4874 {0xbb, 0x01, 0x0974},
4875 {0xbb, 0x00, 0x1001},
4876 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4877 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4878 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4879 {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
4880 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4881 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4882 {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW},
4883 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4884 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4885 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4886 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4887 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4888 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
4889 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4890 {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004891 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004892};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004893static const struct usb_action pb0330_60HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004894 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4895 {0xbb, 0x00, 0x0535},
4896 {0xbb, 0x02, 0x096c},
4897 {0xbb, 0x00, 0x1002},
4898 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4899 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4900 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4901 {0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},
4902 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4903 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4904 {0xa0, 0x7c, ZC3XX_R197_ANTIFLICKERLOW},
4905 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4906 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4907 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4908 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4909 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4910 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
4911 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4912 {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004913 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004914};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004915static const struct usb_action pb0330_NoFliker[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004916 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4917 {0xbb, 0x00, 0x0509},
4918 {0xbb, 0x02, 0x0940},
4919 {0xbb, 0x00, 0x1002},
4920 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4921 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4922 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4923 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4924 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4925 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4926 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4927 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4928 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4929 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4930 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4931 {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
4932 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
4933 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4934 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004935 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004936};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004937static const struct usb_action pb0330_NoFlikerScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004938 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4939 {0xbb, 0x00, 0x0535},
4940 {0xbb, 0x01, 0x0980},
4941 {0xbb, 0x00, 0x1001},
4942 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4943 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4944 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4945 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4946 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4947 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4948 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4949 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4950 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4951 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4952 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4953 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4954 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4955 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4956 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004957 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004958};
4959
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004960/* from oem9.inf */
4961static const struct usb_action po2030_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004962 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4963 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
4964 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
4965 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4966 {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
4967 {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
4968 {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
4969 {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
4970 {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
4971 {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
4972 {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
4973 {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
4974 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
4975 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4976 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4977 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4978 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4979 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4980 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
4981 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
4982 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
4983 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
4984 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
4985 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
4986 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
4987 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
4988 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004989 {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
4990 {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
4991 {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
4992 {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
4993 {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
4994 {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
4995 {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
4996 {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
4997 {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
4998 {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
4999 {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5000 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5001 {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5002 {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5003 {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5004 {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5005 {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5006 {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5007 {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5008 {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5009 {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5010 {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5011 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5012 {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5013 {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5014 {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5015 {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5016 {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5017 {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5018 {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5019 {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5020 {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5021 {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5022 {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005023 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5024 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5025 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5026 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005027 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005028 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5029 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5030 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5031 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5032 {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5033 {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005034 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005035};
5036
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005037/* from oem9.inf */
5038static const struct usb_action po2030_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005039 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
5040 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
5041 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
5042 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
5043 {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
5044 {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
5045 {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
5046 {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
5047 {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
5048 {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
5049 {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
5050 {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
5051 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
5052 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
5053 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
5054 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
5055 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
5056 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
5057 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
5058 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5059 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5060 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
5061 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
5062 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
5063 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
5064 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
5065 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005066 {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
5067 {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
5068 {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
5069 {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
5070 {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
5071 {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
5072 {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
5073 {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
5074 {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
5075 {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
5076 {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
5077 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
5078 {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
5079 {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
5080 {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
5081 {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
5082 {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
5083 {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
5084 {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
5085 {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
5086 {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
5087 {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
5088 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
5089 {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
5090 {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
5091 {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
5092 {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
5093 {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
5094 {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
5095 {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
5096 {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
5097 {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
5098 {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
5099 {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005100 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
5101 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
5102 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
5103 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005104 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005105 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5106 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5107 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5108 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5109 {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5110 {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005111 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005112};
5113
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005114static const struct usb_action po2030_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005115 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5116 {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
5117 {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
5118 {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005119 {0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
5120 {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
5121 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
5122 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5123 {0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
5124 {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
5125 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5126 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5127 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5128 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5129 {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5130 {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5131 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5132 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005133 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005134};
5135
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005136static const struct usb_action po2030_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005137 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5138 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5139 {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
5140 {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005141 {0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
5142 {0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
5143 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
5144 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5145 {0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
5146 {0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
5147 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5148 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5149 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5150 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5151 {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5152 {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5153 /* win: 01,8d,80 */
5154 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5155 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005156 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005157};
5158
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005159static const struct usb_action po2030_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005160 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005161 {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
5162 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5163 {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
5164 {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
5165 {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
5166 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005167 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005168};
5169
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005170static const struct usb_action tas5130c_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005171 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5172 {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
5173 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5174 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5175 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5176 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5177 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5178 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5179 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005180 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5181 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5182 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5183 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005184
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005185 {0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
5186 {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5187 {0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
5188 {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5189 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
5190 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5191 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
5192 {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5193 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5194 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5195 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005196 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
Jean-Francois Moine013db752009-10-07 05:24:19 -03005197 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005198 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005199 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5200 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5201 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5202 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005203 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5204 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005205 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005206};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005207static const struct usb_action tas5130c_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005208 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5209 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005210 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005211 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5212 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5213 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5214 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5215 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5216 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005217 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5218 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5219 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5220 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5221 {0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
5222 {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5223 {0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
5224 {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5225 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
5226 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5227 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
5228 {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5229 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5230 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5231 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005232 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
Jean-Francois Moine013db752009-10-07 05:24:19 -03005233 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005234 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005235 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5236 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5237 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5238 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005239 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5240 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005241 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005242};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005243static const struct usb_action tas5130c_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005244 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005245 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5246 {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005247 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5248 {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
5249 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005250 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
5251 {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005252 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5253 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5254 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005255 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5256 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5257 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5258 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005259 {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
5260 {0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
5261 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
5262 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5263 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005264 {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
5265 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005266 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005267};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005268static const struct usb_action tas5130c_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005269 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005270 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5271 {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005272 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5273 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5274 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005275 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5276 {0xa0, 0xd0, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005277 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5278 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5279 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005280 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5281 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5282 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5283 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005284 {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
5285 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
5286 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
5287 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5288 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005289 {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
5290 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005291 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005292};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005293static const struct usb_action tas5130c_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005294 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005295 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5296 {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005297 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5298 {0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
5299 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005300 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
5301 {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005302 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5303 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5304 {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005305 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5306 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5307 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5308 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005309 {0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
5310 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5311 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5312 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5313 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005314 {0xa0, 0x28, ZC3XX_R0A0_MAXXLOW},
5315 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005316 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005317};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005318static const struct usb_action tas5130c_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005319 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005320 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5321 {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005322 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5323 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5324 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005325 {0xa0, 0x09, ZC3XX_R191_EXPOSURELIMITMID},
5326 {0xa0, 0x47, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005327 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5328 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5329 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005330 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5331 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5332 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5333 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005334 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
5335 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5336 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5337 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5338 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005339 {0xa0, 0x20, ZC3XX_R0A0_MAXXLOW},
5340 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005341 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005342};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005343static const struct usb_action tas5130c_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005344 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005345 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5346 {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005347 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5348 {0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
5349 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005350 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
5351 {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
5352 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5353 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5354 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
5355 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5356 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005357 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5358 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5359 {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5360 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5361 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5362 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5363 {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005364 {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
5365 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005366 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005367};
5368
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005369static const struct usb_action tas5130c_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005370 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005371 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5372 {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005373 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5374 {0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
5375 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005376 {0xa0, 0x0a, ZC3XX_R191_EXPOSURELIMITMID},
5377 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
5378 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5379 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5380 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
5381 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5382 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005383 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5384 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5385 {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5386 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5387 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5388 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5389 {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005390 {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
5391 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005392 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005393};
5394
Jean-François Moine7fbee992010-12-28 07:17:40 -03005395static const struct usb_action gc0303_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005396 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
5397 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
5398 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
5399 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc,
5400 * 0<->10 */
5401 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
5402 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
5403 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
5404 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
5405 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
5406 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
5407 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
5408 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
5409 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
5410 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
5411 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
5412 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
5413 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc,
5414 * 6<->8 */
5415 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc,
5416 * 6<->8 */
5417 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
5418 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005419 {0xaa, 0x1b, 0x0024}, /* 00,1b,24,aa, */
5420 {0xdd, 0x00, 0x0080}, /* 00,00,80,dd, */
5421 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */
5422 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */
5423 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005424/*?? {0xaa, 0x01, 0x0000}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005425 {0xaa, 0x01, 0x0000},
5426 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
5427 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005428 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
5429 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
5430 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005431 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
5432 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa, */
5433 {0xaa, 0x0b, 0x00a0}, /* 00,0b,a0,aa, */
5434 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa, */
5435 {0xaa, 0x0d, 0x00a0}, /* 00,0d,a0,aa, */
5436 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa, */
5437 {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */
5438 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */
5439 {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005440/*?? {0xa0, 0x00, 0x0039},
5441 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005442 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
5443 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa, (e6 -> e8) */
5444 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
5445 {0xaa, 0x19, 0x0088}, /* 00,19,86,aa, */
5446 {0xaa, 0x20, 0x0020}, /* 00,20,20,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005447 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
5448 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
5449 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
5450 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
5451 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
5452 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
5453 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
5454 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
5455 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
5456 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc, */
5457 {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
5458 {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005459 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005460};
5461
Jean-François Moine7fbee992010-12-28 07:17:40 -03005462static const struct usb_action gc0303_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005463 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
5464 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
5465 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
5466 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc, */
5467 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
5468 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
5469 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
5470 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
5471 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
5472 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
5473 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
5474 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
5475 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
5476 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
5477 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
5478 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
5479 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc,
5480 * 8<->6 */
5481 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc,
5482 * 8<->6 */
5483 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
5484 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005485 {0xaa, 0x1b, 0x0024}, /* 00,1b,24,aa, */
5486 {0xdd, 0x00, 0x0080}, /* 00,00,80,dd, */
5487 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */
5488 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */
5489 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
Jean-Francois Moine2ed9f812008-11-28 15:31:43 -03005490/*?? {0xaa, 0x01, 0x0000}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005491 {0xaa, 0x01, 0x0000},
5492 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
5493 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005494 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
5495 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
5496 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005497 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
5498 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa, */
5499 {0xaa, 0x0b, 0x00a0}, /* 00,0b,a0,aa, */
5500 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa, */
5501 {0xaa, 0x0d, 0x00a0}, /* 00,0d,a0,aa, */
5502 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa, */
5503 {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */
5504 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */
5505 {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */
Jean-Francois Moine2ed9f812008-11-28 15:31:43 -03005506/*?? {0xa0, 0x00, 0x0039},
5507 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005508 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
5509 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa (e6 -> e8) */
5510 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
5511 {0xaa, 0x19, 0x0088}, /* 00,19,88,aa, */
5512 {0xaa, 0x20, 0x0020}, /* 00,20,20,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005513 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
5514 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
5515 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
5516 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
5517 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
5518 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
5519 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
5520 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
5521 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
5522 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc, */
5523 {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
5524 {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005525 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005526};
Jean-François Moine7fbee992010-12-28 07:17:40 -03005527static const struct usb_action gc0303_50HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005528 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5529 {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */
5530 {0xaa, 0x84, 0x00aa}, /* 00,84,aa,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005531 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5532 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
5533 {0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
5534 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5535 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5536 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc, */
5537 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5538 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5539 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
5540 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
5541 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5542 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5543 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5544 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5545 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5546 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
5547 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005548 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005549};
5550
Jean-François Moine7fbee992010-12-28 07:17:40 -03005551static const struct usb_action gc0303_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005552 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5553 {0xaa, 0x83, 0x0003}, /* 00,83,03,aa */
5554 {0xaa, 0x84, 0x0054}, /* 00,84,54,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005555 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5556 {0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
5557 {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
5558 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5559 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5560 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc, */
5561 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5562 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5563 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
5564 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
5565 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5566 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5567 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5568 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5569 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5570 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
5571 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005572 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005573};
5574
Jean-François Moine7fbee992010-12-28 07:17:40 -03005575static const struct usb_action gc0303_60HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005576 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5577 {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */
5578 {0xaa, 0x84, 0x0062}, /* 00,84,62,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005579 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5580 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,05,cc, */
5581 {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,88,cc, */
5582 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5583 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5584 {0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3b,cc, */
5585 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5586 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5587 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
5588 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
5589 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5590 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5591 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5592 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5593 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5594 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
5595 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,8d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005596 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005597};
5598
Jean-François Moine7fbee992010-12-28 07:17:40 -03005599static const struct usb_action gc0303_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005600 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5601 {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */
5602 {0xaa, 0x84, 0x00c4}, /* 00,84,c4,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005603 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5604 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,1,0b,cc, */
5605 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,2,10,cc, */
5606 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,5,00,cc, */
5607 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,6,00,cc, */
5608 {0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,7,76,cc, */
5609 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,c,0e,cc, */
5610 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,f,15,cc, */
5611 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,9,10,cc, */
5612 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,a,24,cc, */
5613 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,d,62,cc, */
5614 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,e,90,cc, */
5615 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,f,c8,cc, */
5616 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,0,ff,cc, */
5617 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,d,58,cc, */
5618 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
5619 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /* 01,d,78,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005620 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005621};
5622
Jean-François Moine7fbee992010-12-28 07:17:40 -03005623static const struct usb_action gc0303_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005624 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005625 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5626 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
5627 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005628 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,0,00,cc, */
5629 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,05,cc, */
5630 {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,88,cc, */
5631 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5632 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5633 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
5634 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5635 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5636 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5637 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5638 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5639 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5640 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5641 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005642 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005643};
5644
Jean-François Moine7fbee992010-12-28 07:17:40 -03005645static const struct usb_action gc0303_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005646 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005647 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5648 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
5649 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005650 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5651 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc, */
5652 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc, */
5653 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5654 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5655 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
5656 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5657 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5658 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5659 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5660 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5661 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5662 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5663 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005664 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005665};
5666
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03005667static u8 reg_r_i(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005668 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005669{
Jean-François Moine6d314502010-08-04 05:44:13 -03005670 int ret;
5671
5672 if (gspca_dev->usb_err < 0)
5673 return 0;
5674 ret = usb_control_msg(gspca_dev->dev,
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005675 usb_rcvctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005676 0xa1,
5677 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
5678 0x01, /* value */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005679 index, gspca_dev->usb_buf, 1,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005680 500);
Jean-François Moine6d314502010-08-04 05:44:13 -03005681 if (ret < 0) {
Jean-François Moine0b656322010-09-13 05:19:58 -03005682 err("reg_r_i err %d", ret);
Jean-François Moine6d314502010-08-04 05:44:13 -03005683 gspca_dev->usb_err = ret;
5684 return 0;
5685 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005686 return gspca_dev->usb_buf[0];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005687}
5688
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03005689static u8 reg_r(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005690 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005691{
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03005692 u8 ret;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005693
5694 ret = reg_r_i(gspca_dev, index);
5695 PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
5696 return ret;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005697}
5698
Jean-François Moine6d314502010-08-04 05:44:13 -03005699static void reg_w_i(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005700 u8 value,
5701 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005702{
Jean-François Moine6d314502010-08-04 05:44:13 -03005703 int ret;
5704
5705 if (gspca_dev->usb_err < 0)
5706 return;
5707 ret = usb_control_msg(gspca_dev->dev,
5708 usb_sndctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005709 0xa0,
5710 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
5711 value, index, NULL, 0,
5712 500);
Jean-François Moine6d314502010-08-04 05:44:13 -03005713 if (ret < 0) {
Jean-François Moine0b656322010-09-13 05:19:58 -03005714 err("reg_w_i err %d", ret);
Jean-François Moine6d314502010-08-04 05:44:13 -03005715 gspca_dev->usb_err = ret;
5716 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005717}
5718
Jean-François Moine6d314502010-08-04 05:44:13 -03005719static void reg_w(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005720 u8 value,
5721 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005722{
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005723 PDEBUG(D_USBO, "reg w [%04x] = %02x", index, value);
Jean-François Moine6d314502010-08-04 05:44:13 -03005724 reg_w_i(gspca_dev, value, index);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005725}
5726
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005727static u16 i2c_read(struct gspca_dev *gspca_dev,
5728 u8 reg)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005729{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005730 u8 retbyte;
5731 u16 retval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005732
Jean-François Moine6d314502010-08-04 05:44:13 -03005733 if (gspca_dev->usb_err < 0)
5734 return 0;
5735 reg_w_i(gspca_dev, reg, 0x0092);
5736 reg_w_i(gspca_dev, 0x02, 0x0090); /* <- read command */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005737 msleep(20);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005738 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005739 if (retbyte != 0x00)
5740 err("i2c_r status error %02x", retbyte);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005741 retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */
5742 retval |= reg_r_i(gspca_dev, 0x0096) << 8; /* read Hightbyte */
Jean-Francois Moine0b119b72009-04-07 05:30:31 -03005743 PDEBUG(D_USBI, "i2c r [%02x] -> %04x (%02x)",
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005744 reg, retval, retbyte);
5745 return retval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005746}
5747
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005748static u8 i2c_write(struct gspca_dev *gspca_dev,
5749 u8 reg,
5750 u8 valL,
5751 u8 valH)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005752{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005753 u8 retbyte;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005754
Jean-François Moine6d314502010-08-04 05:44:13 -03005755 if (gspca_dev->usb_err < 0)
5756 return 0;
5757 reg_w_i(gspca_dev, reg, 0x92);
5758 reg_w_i(gspca_dev, valL, 0x93);
5759 reg_w_i(gspca_dev, valH, 0x94);
5760 reg_w_i(gspca_dev, 0x01, 0x90); /* <- write command */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005761 msleep(1);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005762 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005763 if (retbyte != 0x00)
5764 err("i2c_w status error %02x", retbyte);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005765 PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005766 reg, valH, valL, retbyte);
5767 return retbyte;
5768}
5769
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005770static void usb_exchange(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005771 const struct usb_action *action)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005772{
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005773 while (action->req) {
5774 switch (action->req) {
5775 case 0xa0: /* write register */
Jean-François Moine6d314502010-08-04 05:44:13 -03005776 reg_w(gspca_dev, action->val, action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005777 break;
5778 case 0xa1: /* read status */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005779 reg_r(gspca_dev, action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005780 break;
5781 case 0xaa:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005782 i2c_write(gspca_dev,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005783 action->val, /* reg */
5784 action->idx & 0xff, /* valL */
5785 action->idx >> 8); /* valH */
5786 break;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03005787 case 0xbb:
5788 i2c_write(gspca_dev,
5789 action->idx >> 8, /* reg */
5790 action->idx & 0xff, /* valL */
5791 action->val); /* valH */
5792 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005793 default:
5794/* case 0xdd: * delay */
Jean-François Moine7c45f2c2011-01-24 15:15:34 -03005795 msleep(action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005796 break;
5797 }
5798 action++;
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005799 msleep(1);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005800 }
5801}
5802
5803static void setmatrix(struct gspca_dev *gspca_dev)
5804{
5805 struct sd *sd = (struct sd *) gspca_dev;
5806 int i;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005807 const u8 *matrix;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03005808 static const u8 adcm2700_matrix[9] =
Jean-Francois Moinec675e792009-01-26 05:29:06 -03005809/* {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; */
5810/*ms-win*/
5811 {0x74, 0xed, 0xed, 0xed, 0x74, 0xed, 0xed, 0xed, 0x74};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005812 static const u8 gc0305_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005813 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005814 static const u8 ov7620_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005815 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005816 static const u8 pas202b_matrix[9] =
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03005817 {0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005818 static const u8 po2030_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005819 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
Jean-Francois Moine013db752009-10-07 05:24:19 -03005820 static const u8 tas5130c_matrix[9] =
5821 {0x68, 0xec, 0xec, 0xec, 0x68, 0xec, 0xec, 0xec, 0x68};
Jean-François Moine7fbee992010-12-28 07:17:40 -03005822 static const u8 gc0303_matrix[9] =
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005823 {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005824 static const u8 *matrix_tb[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005825 [SENSOR_ADCM2700] = adcm2700_matrix,
5826 [SENSOR_CS2102] = ov7620_matrix,
5827 [SENSOR_CS2102K] = NULL,
Jean-François Moine7fbee992010-12-28 07:17:40 -03005828 [SENSOR_GC0303] = gc0303_matrix,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005829 [SENSOR_GC0305] = gc0305_matrix,
Jean-François Moine4e5144e2011-02-26 13:56:20 -03005830 [SENSOR_HDCS2020] = NULL,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005831 [SENSOR_HV7131B] = NULL,
Jean-François Moine3d244062011-01-24 16:22:11 -03005832 [SENSOR_HV7131R] = po2030_matrix,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005833 [SENSOR_ICM105A] = po2030_matrix,
5834 [SENSOR_MC501CB] = NULL,
Jean-François Moinea484dd92010-08-04 07:25:12 -03005835 [SENSOR_MT9V111_1] = gc0305_matrix,
5836 [SENSOR_MT9V111_3] = gc0305_matrix,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005837 [SENSOR_OV7620] = ov7620_matrix,
5838 [SENSOR_OV7630C] = NULL,
5839 [SENSOR_PAS106] = NULL,
5840 [SENSOR_PAS202B] = pas202b_matrix,
5841 [SENSOR_PB0330] = gc0305_matrix,
5842 [SENSOR_PO2030] = po2030_matrix,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005843 [SENSOR_TAS5130C] = tas5130c_matrix,
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03005844 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005845
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03005846 matrix = matrix_tb[sd->sensor];
5847 if (matrix == NULL)
5848 return; /* matrix already loaded */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005849 for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
Jean-François Moine6d314502010-08-04 05:44:13 -03005850 reg_w(gspca_dev, matrix[i], 0x010a + i);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005851}
5852
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005853static void setsharpness(struct gspca_dev *gspca_dev)
5854{
5855 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005856 int sharpness;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005857 static const u8 sharpness_tb[][2] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005858 {0x02, 0x03},
5859 {0x04, 0x07},
5860 {0x08, 0x0f},
5861 {0x10, 0x1e}
5862 };
5863
Jean-François Moine49fb5e62010-12-28 07:09:34 -03005864 sharpness = sd->ctrls[SHARPNESS].val;
Jean-François Moine6d314502010-08-04 05:44:13 -03005865 reg_w(gspca_dev, sharpness_tb[sharpness][0], 0x01c6);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005866 reg_r(gspca_dev, 0x01c8);
5867 reg_r(gspca_dev, 0x01c9);
5868 reg_r(gspca_dev, 0x01ca);
Jean-François Moine6d314502010-08-04 05:44:13 -03005869 reg_w(gspca_dev, sharpness_tb[sharpness][1], 0x01cb);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005870}
5871
5872static void setcontrast(struct gspca_dev *gspca_dev)
5873{
5874 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005875 const u8 *Tgamma;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005876 int g, i, brightness, contrast, adj, gp1, gp2;
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005877 u8 gr[16];
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005878 static const u8 delta_b[16] = /* delta for brightness */
5879 {0x50, 0x38, 0x2d, 0x28, 0x24, 0x21, 0x1e, 0x1d,
5880 0x1d, 0x1b, 0x1b, 0x1b, 0x19, 0x18, 0x18, 0x18};
5881 static const u8 delta_c[16] = /* delta for contrast */
Jean-François Moinea8567532010-04-25 15:25:42 -03005882 {0x2c, 0x1a, 0x12, 0x0c, 0x0a, 0x06, 0x06, 0x06,
5883 0x04, 0x06, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02};
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005884 static const u8 gamma_tb[6][16] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005885 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005886 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005887 {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005888 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005889 {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005890 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005891 {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005892 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005893 {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005894 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005895 {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005896 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005897 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005898
Jean-François Moine49fb5e62010-12-28 07:09:34 -03005899 Tgamma = gamma_tb[sd->ctrls[GAMMA].val - 1];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005900
Jean-François Moine49fb5e62010-12-28 07:09:34 -03005901 contrast = ((int) sd->ctrls[CONTRAST].val - 128); /* -128 / 127 */
5902 brightness = ((int) sd->ctrls[BRIGHTNESS].val - 128); /* -128 / 92 */
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005903 adj = 0;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005904 gp1 = gp2 = 0;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005905 for (i = 0; i < 16; i++) {
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005906 g = Tgamma[i] + delta_b[i] * brightness / 256
5907 - delta_c[i] * contrast / 256 - adj / 2;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005908 if (g > 0xff)
5909 g = 0xff;
Jean-François Moinea8567532010-04-25 15:25:42 -03005910 else if (g < 0)
5911 g = 0;
Jean-François Moine6d314502010-08-04 05:44:13 -03005912 reg_w(gspca_dev, g, 0x0120 + i); /* gamma */
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005913 if (contrast > 0)
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005914 adj--;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005915 else if (contrast < 0)
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005916 adj++;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005917 if (i > 1)
5918 gr[i - 1] = (g - gp2) / 2;
5919 else if (i != 0)
5920 gr[0] = gp1 == 0 ? 0 : (g - gp1);
5921 gp2 = gp1;
5922 gp1 = g;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005923 }
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005924 gr[15] = (0xff - gp2) / 2;
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005925 for (i = 0; i < 16; i++)
Jean-François Moine6d314502010-08-04 05:44:13 -03005926 reg_w(gspca_dev, gr[i], 0x0130 + i); /* gradient */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005927}
5928
5929static void setquality(struct gspca_dev *gspca_dev)
5930{
5931 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005932 u8 frxt;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005933
5934 switch (sd->sensor) {
Jean-Francois Moinec675e792009-01-26 05:29:06 -03005935 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005936 case SENSOR_GC0305:
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03005937 case SENSOR_HV7131B:
Jean-François Moine3d244062011-01-24 16:22:11 -03005938 case SENSOR_HV7131R:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005939 case SENSOR_OV7620:
Jean-Francois Moine38719d42010-01-04 16:09:47 -03005940 case SENSOR_PAS202B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005941 case SENSOR_PO2030:
5942 return;
5943 }
5944/*fixme: is it really 0008 0007 0018 for all other sensors? */
Jean-François Moine6d314502010-08-04 05:44:13 -03005945 reg_w(gspca_dev, QUANT_VAL, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005946 frxt = 0x30;
Jean-François Moine6d314502010-08-04 05:44:13 -03005947 reg_w(gspca_dev, frxt, 0x0007);
Jean-Francois Moine36e819d2009-01-07 16:49:57 -03005948#if QUANT_VAL == 0 || QUANT_VAL == 1 || QUANT_VAL == 2
5949 frxt = 0xff;
5950#elif QUANT_VAL == 3
5951 frxt = 0xf0;
5952#elif QUANT_VAL == 4
5953 frxt = 0xe0;
5954#else
5955 frxt = 0x20;
5956#endif
Jean-François Moine6d314502010-08-04 05:44:13 -03005957 reg_w(gspca_dev, frxt, 0x0018);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005958}
5959
5960/* Matches the sensor's internal frame rate to the lighting frequency.
5961 * Valid frequencies are:
5962 * 50Hz, for European and Asian lighting (default)
5963 * 60Hz, for American lighting
5964 * 0 = No Fliker (for outdoore usage)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005965 */
Jean-François Moine6d314502010-08-04 05:44:13 -03005966static void setlightfreq(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005967{
5968 struct sd *sd = (struct sd *) gspca_dev;
5969 int i, mode;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005970 const struct usb_action *zc3_freq;
5971 static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005972 [SENSOR_ADCM2700] =
Jean-Francois Moinec314b532009-01-20 10:02:35 -03005973 {adcm2700_NoFliker, adcm2700_NoFliker,
5974 adcm2700_50HZ, adcm2700_50HZ,
5975 adcm2700_60HZ, adcm2700_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005976 [SENSOR_CS2102] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005977 {cs2102_NoFliker, cs2102_NoFlikerScale,
5978 cs2102_50HZ, cs2102_50HZScale,
5979 cs2102_60HZ, cs2102_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005980 [SENSOR_CS2102K] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005981 {cs2102_NoFliker, cs2102_NoFlikerScale,
Costantino Leandro5be8b73e2008-09-09 04:32:46 -03005982 NULL, NULL, /* currently disabled */
5983 NULL, NULL},
Jean-François Moine7fbee992010-12-28 07:17:40 -03005984 [SENSOR_GC0303] =
5985 {gc0303_NoFliker, gc0303_NoFlikerScale,
5986 gc0303_50HZ, gc0303_50HZScale,
5987 gc0303_60HZ, gc0303_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005988 [SENSOR_GC0305] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005989 {gc0305_NoFliker, gc0305_NoFliker,
5990 gc0305_50HZ, gc0305_50HZ,
5991 gc0305_60HZ, gc0305_60HZ},
Jean-François Moine4e5144e2011-02-26 13:56:20 -03005992 [SENSOR_HDCS2020] =
5993 {hdcs2020_NoFliker, hdcs2020_NoFliker,
5994 hdcs2020_50HZ, hdcs2020_50HZ,
5995 hdcs2020_60HZ, hdcs2020_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005996 [SENSOR_HV7131B] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005997 {hv7131b_NoFliker, hv7131b_NoFlikerScale,
5998 hv7131b_50HZ, hv7131b_50HZScale,
5999 hv7131b_60HZ, hv7131b_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006000 [SENSOR_HV7131R] =
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03006001 {hv7131r_NoFliker, hv7131r_NoFlikerScale,
6002 hv7131r_50HZ, hv7131r_50HZScale,
6003 hv7131r_60HZ, hv7131r_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006004 [SENSOR_ICM105A] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006005 {icm105a_NoFliker, icm105a_NoFlikerScale,
6006 icm105a_50HZ, icm105a_50HZScale,
6007 icm105a_60HZ, icm105a_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006008 [SENSOR_MC501CB] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006009 {mc501cb_NoFliker, mc501cb_NoFlikerScale,
6010 mc501cb_50HZ, mc501cb_50HZScale,
6011 mc501cb_60HZ, mc501cb_60HZScale},
Jean-François Moinea484dd92010-08-04 07:25:12 -03006012 [SENSOR_MT9V111_1] =
6013 {mt9v111_1_AENoFliker, mt9v111_1_AENoFlikerScale,
6014 mt9v111_1_AE50HZ, mt9v111_1_AE50HZScale,
6015 mt9v111_1_AE60HZ, mt9v111_1_AE60HZScale},
6016 [SENSOR_MT9V111_3] =
6017 {mt9v111_3_AENoFliker, mt9v111_3_AENoFlikerScale,
6018 mt9v111_3_AE50HZ, mt9v111_3_AE50HZScale,
6019 mt9v111_3_AE60HZ, mt9v111_3_AE60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006020 [SENSOR_OV7620] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006021 {ov7620_NoFliker, ov7620_NoFliker,
6022 ov7620_50HZ, ov7620_50HZ,
6023 ov7620_60HZ, ov7620_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006024 [SENSOR_OV7630C] =
Harvey Harrisonefab8212008-07-05 06:12:47 -03006025 {NULL, NULL,
6026 NULL, NULL,
6027 NULL, NULL},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006028 [SENSOR_PAS106] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006029 {pas106b_NoFliker, pas106b_NoFliker,
6030 pas106b_50HZ, pas106b_50HZ,
6031 pas106b_60HZ, pas106b_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006032 [SENSOR_PAS202B] =
Jean-François Moinea6a86f0d2010-04-25 14:57:10 -03006033 {pas202b_NoFliker, pas202b_NoFlikerScale,
6034 pas202b_50HZ, pas202b_50HZScale,
6035 pas202b_60HZ, pas202b_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006036 [SENSOR_PB0330] =
Jean-François Moinea6a86f0d2010-04-25 14:57:10 -03006037 {pb0330_NoFliker, pb0330_NoFlikerScale,
6038 pb0330_50HZ, pb0330_50HZScale,
6039 pb0330_60HZ, pb0330_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006040 [SENSOR_PO2030] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006041 {po2030_NoFliker, po2030_NoFliker,
6042 po2030_50HZ, po2030_50HZ,
6043 po2030_60HZ, po2030_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006044 [SENSOR_TAS5130C] =
6045 {tas5130c_NoFliker, tas5130c_NoFlikerScale,
6046 tas5130c_50HZ, tas5130c_50HZScale,
6047 tas5130c_60HZ, tas5130c_60HZScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006048 };
6049
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006050 i = sd->ctrls[LIGHTFREQ].val * 2;
6051 mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03006052 if (mode)
6053 i++; /* 320x240 */
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006054 zc3_freq = freq_tb[sd->sensor][i];
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006055 if (zc3_freq == NULL)
Jean-François Moine6d314502010-08-04 05:44:13 -03006056 return;
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006057 usb_exchange(gspca_dev, zc3_freq);
6058 switch (sd->sensor) {
6059 case SENSOR_GC0305:
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006060 if (mode /* if 320x240 */
6061 && sd->ctrls[LIGHTFREQ].val == 1) /* and 50Hz */
Jean-François Moine6d314502010-08-04 05:44:13 -03006062 reg_w(gspca_dev, 0x85, 0x018d);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006063 /* win: 0x80, 0x018d */
6064 break;
6065 case SENSOR_OV7620:
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006066 if (!mode) { /* if 640x480 */
6067 if (sd->ctrls[LIGHTFREQ].val != 0) /* and filter */
Jean-François Moine6d314502010-08-04 05:44:13 -03006068 reg_w(gspca_dev, 0x40, 0x0002);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006069 else
Jean-François Moine6d314502010-08-04 05:44:13 -03006070 reg_w(gspca_dev, 0x44, 0x0002);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006071 }
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006072 break;
6073 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03006074 reg_w(gspca_dev, 0x00, 0x01a7);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006075 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006076 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006077}
6078
6079static void setautogain(struct gspca_dev *gspca_dev)
6080{
6081 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006082 u8 autoval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006083
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006084 if (sd->ctrls[AUTOGAIN].val)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006085 autoval = 0x42;
6086 else
6087 autoval = 0x02;
Jean-François Moine6d314502010-08-04 05:44:13 -03006088 reg_w(gspca_dev, autoval, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006089}
6090
Jean-François Moine6d314502010-08-04 05:44:13 -03006091static void send_unknown(struct gspca_dev *gspca_dev, int sensor)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006092{
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006093 reg_w(gspca_dev, 0x01, 0x0000); /* bridge reset */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006094 switch (sensor) {
6095 case SENSOR_PAS106:
Jean-François Moine6d314502010-08-04 05:44:13 -03006096 reg_w(gspca_dev, 0x03, 0x003a);
6097 reg_w(gspca_dev, 0x0c, 0x003b);
6098 reg_w(gspca_dev, 0x08, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006099 break;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006100 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006101 case SENSOR_GC0305:
6102 case SENSOR_OV7620:
Jean-François Moinea484dd92010-08-04 07:25:12 -03006103 case SENSOR_MT9V111_1:
6104 case SENSOR_MT9V111_3:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006105 case SENSOR_PB0330:
6106 case SENSOR_PO2030:
Jean-François Moine6d314502010-08-04 05:44:13 -03006107 reg_w(gspca_dev, 0x0d, 0x003a);
6108 reg_w(gspca_dev, 0x02, 0x003b);
6109 reg_w(gspca_dev, 0x00, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006110 break;
Jean-François Moine3d244062011-01-24 16:22:11 -03006111 case SENSOR_HV7131R:
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006112 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03006113 reg_w(gspca_dev, 0x03, 0x003b);
6114 reg_w(gspca_dev, 0x0c, 0x003a);
6115 reg_w(gspca_dev, 0x0b, 0x0039);
Jean-François Moine3d244062011-01-24 16:22:11 -03006116 if (sensor == SENSOR_PAS202B)
6117 reg_w(gspca_dev, 0x0b, 0x0038);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006118 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006119 }
6120}
6121
6122/* start probe 2 wires */
Jean-François Moine6d314502010-08-04 05:44:13 -03006123static void start_2wr_probe(struct gspca_dev *gspca_dev, int sensor)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006124{
Jean-François Moine6d314502010-08-04 05:44:13 -03006125 reg_w(gspca_dev, 0x01, 0x0000);
6126 reg_w(gspca_dev, sensor, 0x0010);
6127 reg_w(gspca_dev, 0x01, 0x0001);
6128 reg_w(gspca_dev, 0x03, 0x0012);
6129 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006130/* msleep(2); */
6131}
6132
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006133static int sif_probe(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006134{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006135 u16 checkword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006136
Jean-François Moine6d314502010-08-04 05:44:13 -03006137 start_2wr_probe(gspca_dev, 0x0f); /* PAS106 */
6138 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006139 msleep(150);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006140 checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
6141 | ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006142 PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
6143 if (checkword == 0x0007) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006144 send_unknown(gspca_dev, SENSOR_PAS106);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006145 return 0x0f; /* PAS106 */
6146 }
6147 return -1;
6148}
6149
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006150static int vga_2wr_probe(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006151{
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006152 u16 retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006153
Jean-François Moine6d314502010-08-04 05:44:13 -03006154 start_2wr_probe(gspca_dev, 0x00); /* HV7131B */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006155 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006156 retword = i2c_read(gspca_dev, 0x01);
6157 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006158 return 0x00; /* HV7131B */
6159
Jean-François Moine6d314502010-08-04 05:44:13 -03006160 start_2wr_probe(gspca_dev, 0x04); /* CS2102 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006161 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006162 retword = i2c_read(gspca_dev, 0x01);
6163 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006164 return 0x04; /* CS2102 */
6165
Jean-François Moine6d314502010-08-04 05:44:13 -03006166 start_2wr_probe(gspca_dev, 0x06); /* OmniVision */
6167 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006168 i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006169 retword = i2c_read(gspca_dev, 0x11);
6170 if (retword != 0) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006171 /* (should have returned 0xaa) --> Omnivision? */
6172 /* reg_r 0x10 -> 0x06 --> */
6173 goto ov_check;
6174 }
6175
Jean-François Moine6d314502010-08-04 05:44:13 -03006176 start_2wr_probe(gspca_dev, 0x08); /* HDCS2020 */
Jean-Francois Moine1eed40a2010-01-08 08:01:43 -03006177 i2c_write(gspca_dev, 0x1c, 0x00, 0x00);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006178 i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006179 retword = i2c_read(gspca_dev, 0x15);
6180 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006181 return 0x08; /* HDCS2020 */
6182
Jean-François Moine6d314502010-08-04 05:44:13 -03006183 start_2wr_probe(gspca_dev, 0x0a); /* PB0330 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006184 i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006185 retword = i2c_read(gspca_dev, 0x07);
6186 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006187 return 0x0a; /* PB0330 */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006188 retword = i2c_read(gspca_dev, 0x03);
6189 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006190 return 0x0a; /* PB0330 ?? */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006191 retword = i2c_read(gspca_dev, 0x04);
6192 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006193 return 0x0a; /* PB0330 ?? */
6194
Jean-François Moine6d314502010-08-04 05:44:13 -03006195 start_2wr_probe(gspca_dev, 0x0c); /* ICM105A */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006196 i2c_write(gspca_dev, 0x01, 0x11, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006197 retword = i2c_read(gspca_dev, 0x01);
6198 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006199 return 0x0c; /* ICM105A */
6200
Jean-François Moine6d314502010-08-04 05:44:13 -03006201 start_2wr_probe(gspca_dev, 0x0e); /* PAS202BCB */
6202 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006203 i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03006204 msleep(50);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006205 retword = i2c_read(gspca_dev, 0x03);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006206 if (retword != 0) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006207 send_unknown(gspca_dev, SENSOR_PAS202B);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006208 return 0x0e; /* PAS202BCB */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006209 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006210
Jean-François Moine6d314502010-08-04 05:44:13 -03006211 start_2wr_probe(gspca_dev, 0x02); /* TAS5130C */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006212 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006213 retword = i2c_read(gspca_dev, 0x01);
6214 if (retword != 0)
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006215 return 0x02; /* TAS5130C */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006216ov_check:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006217 reg_r(gspca_dev, 0x0010); /* ?? */
6218 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006219
Jean-François Moine6d314502010-08-04 05:44:13 -03006220 reg_w(gspca_dev, 0x01, 0x0000);
6221 reg_w(gspca_dev, 0x01, 0x0001);
6222 reg_w(gspca_dev, 0x06, 0x0010); /* OmniVision */
6223 reg_w(gspca_dev, 0xa1, 0x008b);
6224 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006225 msleep(500);
Jean-François Moine6d314502010-08-04 05:44:13 -03006226 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006227 i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006228 retword = i2c_read(gspca_dev, 0x0a) << 8;
6229 retword |= i2c_read(gspca_dev, 0x0b);
6230 PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", retword);
6231 switch (retword) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006232 case 0x7631: /* OV7630C */
Jean-François Moine6d314502010-08-04 05:44:13 -03006233 reg_w(gspca_dev, 0x06, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006234 break;
6235 case 0x7620: /* OV7620 */
6236 case 0x7648: /* OV7648 */
6237 break;
6238 default:
6239 return -1; /* not OmniVision */
6240 }
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006241 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006242}
6243
6244struct sensor_by_chipset_revision {
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006245 u16 revision;
6246 u8 internal_sensor_id;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006247};
6248static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
Jean-Francois Moine013db752009-10-07 05:24:19 -03006249 {0xc000, 0x12}, /* TAS5130C */
Jean-François Moinea484dd92010-08-04 07:25:12 -03006250 {0xc001, 0x13}, /* MT9V111 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006251 {0xe001, 0x13},
6252 {0x8001, 0x13},
6253 {0x8000, 0x14}, /* CS2102K */
Jean-François Moinea484dd92010-08-04 07:25:12 -03006254 {0x8400, 0x15}, /* MT9V111 */
Luis Maia658604e2009-12-15 13:40:44 -03006255 {0xe400, 0x15},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006256};
6257
6258static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6259{
6260 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006261 int i;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006262 u8 retbyte;
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006263 u16 retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006264
6265/*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
Jean-François Moine6d314502010-08-04 05:44:13 -03006266 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006267 reg_r(gspca_dev, 0x0010);
Jean-François Moine6d314502010-08-04 05:44:13 -03006268 reg_w(gspca_dev, 0x01, 0x0000);
6269 reg_w(gspca_dev, 0x00, 0x0010);
6270 reg_w(gspca_dev, 0x01, 0x0001);
6271 reg_w(gspca_dev, 0x91, 0x008b);
6272 reg_w(gspca_dev, 0x03, 0x0012);
6273 reg_w(gspca_dev, 0x01, 0x0012);
6274 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006275 retword = i2c_read(gspca_dev, 0x14);
6276 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006277 return 0x11; /* HV7131R */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006278 retword = i2c_read(gspca_dev, 0x15);
6279 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006280 return 0x11; /* HV7131R */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006281 retword = i2c_read(gspca_dev, 0x16);
6282 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006283 return 0x11; /* HV7131R */
6284
Jean-François Moine6d314502010-08-04 05:44:13 -03006285 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006286 retword = reg_r(gspca_dev, 0x000b) << 8;
6287 retword |= reg_r(gspca_dev, 0x000a);
6288 PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006289 reg_r(gspca_dev, 0x0010);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006290 if ((retword & 0xff00) == 0x6400)
6291 return 0x02; /* TAS5130C */
6292 for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6293 if (chipset_revision_sensor[i].revision == retword) {
6294 sd->chip_revision = retword;
Jean-François Moine6d314502010-08-04 05:44:13 -03006295 send_unknown(gspca_dev, SENSOR_PB0330);
Jean-François Moine780e3122010-10-19 04:29:10 -03006296 return chipset_revision_sensor[i].internal_sensor_id;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006297 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006298 }
6299
Jean-François Moine6d314502010-08-04 05:44:13 -03006300 reg_w(gspca_dev, 0x01, 0x0000); /* check PB0330 */
6301 reg_w(gspca_dev, 0x01, 0x0001);
6302 reg_w(gspca_dev, 0xdd, 0x008b);
6303 reg_w(gspca_dev, 0x0a, 0x0010);
6304 reg_w(gspca_dev, 0x03, 0x0012);
6305 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006306 retword = i2c_read(gspca_dev, 0x00);
6307 if (retword != 0) {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006308 PDEBUG(D_PROBE, "probe 3wr vga type 0a");
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006309 return 0x0a; /* PB0330 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006310 }
6311
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006312 /* probe gc0303 / gc0305 */
Jean-François Moine6d314502010-08-04 05:44:13 -03006313 reg_w(gspca_dev, 0x01, 0x0000);
6314 reg_w(gspca_dev, 0x01, 0x0001);
6315 reg_w(gspca_dev, 0x98, 0x008b);
6316 reg_w(gspca_dev, 0x01, 0x0010);
6317 reg_w(gspca_dev, 0x03, 0x0012);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006318 msleep(2);
Jean-François Moine6d314502010-08-04 05:44:13 -03006319 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006320 retword = i2c_read(gspca_dev, 0x00);
6321 if (retword != 0) {
6322 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retword);
Jean-François Moine7fbee992010-12-28 07:17:40 -03006323 if (retword == 0x0011) /* gc0303 */
6324 return 0x0303;
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006325 if (retword == 0x0029) /* gc0305 */
Jean-François Moine6d314502010-08-04 05:44:13 -03006326 send_unknown(gspca_dev, SENSOR_GC0305);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006327 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006328 }
6329
Jean-François Moine6d314502010-08-04 05:44:13 -03006330 reg_w(gspca_dev, 0x01, 0x0000); /* check OmniVision */
6331 reg_w(gspca_dev, 0x01, 0x0001);
6332 reg_w(gspca_dev, 0xa1, 0x008b);
6333 reg_w(gspca_dev, 0x08, 0x008d);
6334 reg_w(gspca_dev, 0x06, 0x0010);
6335 reg_w(gspca_dev, 0x01, 0x0012);
6336 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006337 if (i2c_read(gspca_dev, 0x1c) == 0x007f /* OV7610 - manufacturer ID */
6338 && i2c_read(gspca_dev, 0x1d) == 0x00a2) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006339 send_unknown(gspca_dev, SENSOR_OV7620);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006340 return 0x06; /* OmniVision confirm ? */
6341 }
6342
Jean-François Moine6d314502010-08-04 05:44:13 -03006343 reg_w(gspca_dev, 0x01, 0x0000);
6344 reg_w(gspca_dev, 0x00, 0x0002);
6345 reg_w(gspca_dev, 0x01, 0x0010);
6346 reg_w(gspca_dev, 0x01, 0x0001);
6347 reg_w(gspca_dev, 0xee, 0x008b);
6348 reg_w(gspca_dev, 0x03, 0x0012);
6349 reg_w(gspca_dev, 0x01, 0x0012);
6350 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006351 retword = i2c_read(gspca_dev, 0x00) << 8; /* ID 0 */
6352 retword |= i2c_read(gspca_dev, 0x01); /* ID 1 */
6353 PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", retword);
6354 if (retword == 0x2030) {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006355 retbyte = i2c_read(gspca_dev, 0x02); /* revision number */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006356 PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
Jean-François Moine6d314502010-08-04 05:44:13 -03006357 send_unknown(gspca_dev, SENSOR_PO2030);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006358 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006359 }
6360
Jean-François Moine6d314502010-08-04 05:44:13 -03006361 reg_w(gspca_dev, 0x01, 0x0000);
6362 reg_w(gspca_dev, 0x0a, 0x0010);
6363 reg_w(gspca_dev, 0xd3, 0x008b);
6364 reg_w(gspca_dev, 0x01, 0x0001);
6365 reg_w(gspca_dev, 0x03, 0x0012);
6366 reg_w(gspca_dev, 0x01, 0x0012);
6367 reg_w(gspca_dev, 0x05, 0x0012);
6368 reg_w(gspca_dev, 0xd3, 0x008b);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006369 retword = i2c_read(gspca_dev, 0x01);
6370 if (retword != 0) {
6371 PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword);
Jean-Francois Moine881cd412009-04-05 04:01:13 -03006372 return 0x16; /* adcm2700 (6100/6200) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006373 }
6374 return -1;
6375}
6376
6377static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6378{
6379 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006380 int sensor;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006381
6382 switch (sd->sensor) {
6383 case SENSOR_MC501CB:
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006384 return -1; /* don't probe */
Jean-François Moine7fbee992010-12-28 07:17:40 -03006385 case SENSOR_GC0303:
Hans de Goede346623422008-09-03 16:47:28 -03006386 /* may probe but with no write in reg 0x0010 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006387 return -1; /* don't probe */
Hans de Goede346623422008-09-03 16:47:28 -03006388 case SENSOR_PAS106:
6389 sensor = sif_probe(gspca_dev);
6390 if (sensor >= 0)
6391 return sensor;
6392 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006393 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006394 sensor = vga_2wr_probe(gspca_dev);
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006395 if (sensor >= 0)
Hans de Goede346623422008-09-03 16:47:28 -03006396 return sensor;
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006397 return vga_3wr_probe(gspca_dev);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006398}
6399
6400/* this function is called at probe time */
6401static int sd_config(struct gspca_dev *gspca_dev,
6402 const struct usb_device_id *id)
6403{
6404 struct sd *sd = (struct sd *) gspca_dev;
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006405
Jean-François Moinea484dd92010-08-04 07:25:12 -03006406 if (id->idProduct == 0x301b)
6407 sd->bridge = BRIDGE_ZC301;
6408 else
6409 sd->bridge = BRIDGE_ZC303;
6410
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006411 /* define some sensors from the vendor/product */
6412 sd->sensor = id->driver_info;
6413
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006414 gspca_dev->cam.ctrls = sd->ctrls;
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006415 sd->quality = QUALITY_DEF;
6416
Jean-François Moine062909f2011-02-10 08:10:50 -03006417 /* if USB 1.1, let some bandwidth for the audio device */
6418 if (gspca_dev->audio && gspca_dev->dev->speed < USB_SPEED_HIGH)
6419 gspca_dev->nbalt--;
6420
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006421 return 0;
6422}
6423
6424/* this function is called at probe and resume time */
6425static int sd_init(struct gspca_dev *gspca_dev)
6426{
6427 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006428 struct cam *cam;
6429 int sensor;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006430 static const u8 gamma[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006431 [SENSOR_ADCM2700] = 4,
6432 [SENSOR_CS2102] = 4,
6433 [SENSOR_CS2102K] = 5,
Jean-François Moine7fbee992010-12-28 07:17:40 -03006434 [SENSOR_GC0303] = 3,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006435 [SENSOR_GC0305] = 4,
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006436 [SENSOR_HDCS2020] = 4,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006437 [SENSOR_HV7131B] = 4,
6438 [SENSOR_HV7131R] = 4,
6439 [SENSOR_ICM105A] = 4,
6440 [SENSOR_MC501CB] = 4,
Jean-François Moinea484dd92010-08-04 07:25:12 -03006441 [SENSOR_MT9V111_1] = 4,
6442 [SENSOR_MT9V111_3] = 4,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006443 [SENSOR_OV7620] = 3,
6444 [SENSOR_OV7630C] = 4,
6445 [SENSOR_PAS106] = 4,
6446 [SENSOR_PAS202B] = 4,
6447 [SENSOR_PB0330] = 4,
6448 [SENSOR_PO2030] = 4,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006449 [SENSOR_TAS5130C] = 3,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006450 };
Hans de Goede9919fe82010-01-13 07:12:28 -03006451 static const u8 mode_tb[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006452 [SENSOR_ADCM2700] = 2,
6453 [SENSOR_CS2102] = 1,
6454 [SENSOR_CS2102K] = 1,
Jean-François Moine7fbee992010-12-28 07:17:40 -03006455 [SENSOR_GC0303] = 1,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006456 [SENSOR_GC0305] = 1,
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006457 [SENSOR_HDCS2020] = 1,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006458 [SENSOR_HV7131B] = 1,
6459 [SENSOR_HV7131R] = 1,
6460 [SENSOR_ICM105A] = 1,
6461 [SENSOR_MC501CB] = 2,
Jean-François Moinea484dd92010-08-04 07:25:12 -03006462 [SENSOR_MT9V111_1] = 1,
6463 [SENSOR_MT9V111_3] = 1,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006464 [SENSOR_OV7620] = 2,
6465 [SENSOR_OV7630C] = 1,
6466 [SENSOR_PAS106] = 0,
6467 [SENSOR_PAS202B] = 1,
6468 [SENSOR_PB0330] = 1,
6469 [SENSOR_PO2030] = 1,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006470 [SENSOR_TAS5130C] = 1,
Hans de Goede9919fe82010-01-13 07:12:28 -03006471 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006472
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006473 sensor = zcxx_probeSensor(gspca_dev);
6474 if (sensor >= 0)
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006475 PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006476 if ((unsigned) force_sensor < SENSOR_MAX) {
6477 sd->sensor = force_sensor;
6478 PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
6479 } else {
6480 switch (sensor) {
6481 case -1:
6482 switch (sd->sensor) {
6483 case SENSOR_MC501CB:
6484 PDEBUG(D_PROBE, "Sensor MC501CB");
6485 break;
Jean-François Moine7fbee992010-12-28 07:17:40 -03006486 case SENSOR_GC0303:
6487 PDEBUG(D_PROBE, "Sensor GC0303");
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006488 break;
6489 default:
Jean-François Moine0b656322010-09-13 05:19:58 -03006490 warn("Unknown sensor - set to TAS5130C");
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006491 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006492 }
6493 break;
6494 case 0:
Jean-Francois Moined754a6c2009-12-20 05:07:10 -03006495 /* check the sensor type */
6496 sensor = i2c_read(gspca_dev, 0x00);
6497 PDEBUG(D_PROBE, "Sensor hv7131 type %d", sensor);
6498 switch (sensor) {
6499 case 0: /* hv7131b */
6500 case 1: /* hv7131e */
6501 PDEBUG(D_PROBE, "Find Sensor HV7131B");
6502 sd->sensor = SENSOR_HV7131B;
6503 break;
6504 default:
6505/* case 2: * hv7131r */
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006506 PDEBUG(D_PROBE, "Find Sensor HV7131R");
6507 sd->sensor = SENSOR_HV7131R;
Jean-Francois Moined754a6c2009-12-20 05:07:10 -03006508 break;
6509 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006510 break;
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006511 case 0x02:
6512 PDEBUG(D_PROBE, "Sensor TAS5130C");
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006513 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006514 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006515 case 0x04:
6516 PDEBUG(D_PROBE, "Find Sensor CS2102");
6517 sd->sensor = SENSOR_CS2102;
6518 break;
6519 case 0x08:
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006520 PDEBUG(D_PROBE, "Find Sensor HDCS2020");
6521 sd->sensor = SENSOR_HDCS2020;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006522 break;
6523 case 0x0a:
6524 PDEBUG(D_PROBE,
6525 "Find Sensor PB0330. Chip revision %x",
6526 sd->chip_revision);
6527 sd->sensor = SENSOR_PB0330;
6528 break;
6529 case 0x0c:
6530 PDEBUG(D_PROBE, "Find Sensor ICM105A");
6531 sd->sensor = SENSOR_ICM105A;
6532 break;
6533 case 0x0e:
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006534 PDEBUG(D_PROBE, "Find Sensor PAS202B");
6535 sd->sensor = SENSOR_PAS202B;
Jean-Francois Moine56af5ef2010-01-08 08:02:42 -03006536/* sd->sharpness = 1; */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006537 break;
6538 case 0x0f:
6539 PDEBUG(D_PROBE, "Find Sensor PAS106");
6540 sd->sensor = SENSOR_PAS106;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006541 break;
6542 case 0x10:
6543 case 0x12:
Jean-Francois Moine013db752009-10-07 05:24:19 -03006544 PDEBUG(D_PROBE, "Find Sensor TAS5130C");
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006545 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006546 break;
6547 case 0x11:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006548 PDEBUG(D_PROBE, "Find Sensor HV7131R");
6549 sd->sensor = SENSOR_HV7131R;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006550 break;
6551 case 0x13:
Jean-François Moinea484dd92010-08-04 07:25:12 -03006552 case 0x15:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006553 PDEBUG(D_PROBE,
Jean-François Moinea484dd92010-08-04 07:25:12 -03006554 "Sensor MT9V111. Chip revision %04x",
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006555 sd->chip_revision);
Jean-François Moinea484dd92010-08-04 07:25:12 -03006556 sd->sensor = sd->bridge == BRIDGE_ZC301
6557 ? SENSOR_MT9V111_1
6558 : SENSOR_MT9V111_3;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006559 break;
6560 case 0x14:
6561 PDEBUG(D_PROBE,
6562 "Find Sensor CS2102K?. Chip revision %x",
6563 sd->chip_revision);
6564 sd->sensor = SENSOR_CS2102K;
6565 break;
Jean-Francois Moine5be2b092009-01-20 05:12:34 -03006566 case 0x16:
6567 PDEBUG(D_PROBE, "Find Sensor ADCM2700");
6568 sd->sensor = SENSOR_ADCM2700;
6569 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006570 case 0x29:
6571 PDEBUG(D_PROBE, "Find Sensor GC0305");
6572 sd->sensor = SENSOR_GC0305;
6573 break;
Jean-François Moine7fbee992010-12-28 07:17:40 -03006574 case 0x0303:
6575 PDEBUG(D_PROBE, "Sensor GC0303");
6576 sd->sensor = SENSOR_GC0303;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006577 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006578 case 0x2030:
6579 PDEBUG(D_PROBE, "Find Sensor PO2030");
6580 sd->sensor = SENSOR_PO2030;
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006581 sd->ctrls[SHARPNESS].def = 0; /* from win traces */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006582 break;
6583 case 0x7620:
6584 PDEBUG(D_PROBE, "Find Sensor OV7620");
6585 sd->sensor = SENSOR_OV7620;
6586 break;
Jean-Francois Moinee2d750f2009-02-19 15:41:28 -03006587 case 0x7631:
6588 PDEBUG(D_PROBE, "Find Sensor OV7630C");
6589 sd->sensor = SENSOR_OV7630C;
6590 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006591 case 0x7648:
6592 PDEBUG(D_PROBE, "Find Sensor OV7648");
6593 sd->sensor = SENSOR_OV7620; /* same sensor (?) */
6594 break;
6595 default:
Jean-François Moine0b656322010-09-13 05:19:58 -03006596 err("Unknown sensor %04x", sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006597 return -EINVAL;
6598 }
6599 }
6600 if (sensor < 0x20) {
6601 if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
Jean-François Moine6d314502010-08-04 05:44:13 -03006602 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006603 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006604 }
6605
6606 cam = &gspca_dev->cam;
Hans de Goede9919fe82010-01-13 07:12:28 -03006607 switch (mode_tb[sd->sensor]) {
6608 case 0:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006609 cam->cam_mode = sif_mode;
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03006610 cam->nmodes = ARRAY_SIZE(sif_mode);
Hans de Goede9919fe82010-01-13 07:12:28 -03006611 break;
6612 case 1:
6613 cam->cam_mode = vga_mode;
6614 cam->nmodes = ARRAY_SIZE(vga_mode);
6615 break;
6616 default:
6617/* case 2: */
6618 cam->cam_mode = broken_vga_mode;
6619 cam->nmodes = ARRAY_SIZE(broken_vga_mode);
6620 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006621 }
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006622
6623 sd->ctrls[GAMMA].def = gamma[sd->sensor];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006624
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03006625 switch (sd->sensor) {
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03006626 case SENSOR_OV7630C:
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006627 gspca_dev->ctrl_dis = (1 << LIGHTFREQ);
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03006628 break;
6629 }
6630
Jean-Francois Moine77880ba32010-01-08 08:04:21 -03006631 /* switch off the led */
Jean-François Moine6d314502010-08-04 05:44:13 -03006632 reg_w(gspca_dev, 0x01, 0x0000);
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006633 return gspca_dev->usb_err;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006634}
6635
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03006636static int sd_start(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006637{
6638 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006639 int mode;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006640 static const struct usb_action *init_tb[SENSOR_MAX][2] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006641 [SENSOR_ADCM2700] =
6642 {adcm2700_Initial, adcm2700_InitialScale},
6643 [SENSOR_CS2102] =
6644 {cs2102_Initial, cs2102_InitialScale},
6645 [SENSOR_CS2102K] =
6646 {cs2102K_Initial, cs2102K_InitialScale},
Jean-François Moine7fbee992010-12-28 07:17:40 -03006647 [SENSOR_GC0303] =
6648 {gc0303_Initial, gc0303_InitialScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006649 [SENSOR_GC0305] =
6650 {gc0305_Initial, gc0305_InitialScale},
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006651 [SENSOR_HDCS2020] =
6652 {hdcs2020_Initial, hdcs2020_InitialScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006653 [SENSOR_HV7131B] =
6654 {hv7131b_Initial, hv7131b_InitialScale},
6655 [SENSOR_HV7131R] =
6656 {hv7131r_Initial, hv7131r_InitialScale},
6657 [SENSOR_ICM105A] =
6658 {icm105a_Initial, icm105a_InitialScale},
6659 [SENSOR_MC501CB] =
6660 {mc501cb_Initial, mc501cb_InitialScale},
Jean-François Moinea484dd92010-08-04 07:25:12 -03006661 [SENSOR_MT9V111_1] =
6662 {mt9v111_1_Initial, mt9v111_1_InitialScale},
6663 [SENSOR_MT9V111_3] =
6664 {mt9v111_3_Initial, mt9v111_3_InitialScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006665 [SENSOR_OV7620] =
6666 {ov7620_Initial, ov7620_InitialScale},
6667 [SENSOR_OV7630C] =
6668 {ov7630c_Initial, ov7630c_InitialScale},
6669 [SENSOR_PAS106] =
6670 {pas106b_Initial, pas106b_InitialScale},
6671 [SENSOR_PAS202B] =
6672 {pas202b_Initial, pas202b_InitialScale},
6673 [SENSOR_PB0330] =
6674 {pb0330_Initial, pb0330_InitialScale},
6675 [SENSOR_PO2030] =
6676 {po2030_Initial, po2030_InitialScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006677 [SENSOR_TAS5130C] =
6678 {tas5130c_Initial, tas5130c_InitialScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006679 };
6680
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006681 /* create the JPEG header */
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006682 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
6683 0x21); /* JPEG 422 */
6684 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
6685
Jean-Francois Moine50924512010-01-08 08:08:12 -03006686 mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006687 switch (sd->sensor) {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006688 case SENSOR_HV7131R:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006689 zcxx_probeSensor(gspca_dev);
6690 break;
6691 case SENSOR_PAS106:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006692 usb_exchange(gspca_dev, pas106b_Initial_com);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006693 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006694 }
Jean-Francois Moine50924512010-01-08 08:08:12 -03006695 usb_exchange(gspca_dev, init_tb[sd->sensor][mode]);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006696
6697 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006698 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006699 case SENSOR_GC0305:
6700 case SENSOR_OV7620:
6701 case SENSOR_PO2030:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006702 case SENSOR_TAS5130C:
Jean-François Moine7fbee992010-12-28 07:17:40 -03006703 case SENSOR_GC0303:
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006704/* msleep(100); * ?? */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006705 reg_r(gspca_dev, 0x0002); /* --> 0x40 */
Jean-François Moine6d314502010-08-04 05:44:13 -03006706 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6707 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006708 if (sd->sensor == SENSOR_TAS5130C)
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006709 break;
Jean-François Moine6d314502010-08-04 05:44:13 -03006710 reg_w(gspca_dev, 0x0d, 0x003a);
6711 reg_w(gspca_dev, 0x02, 0x003b);
6712 reg_w(gspca_dev, 0x00, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006713 break;
Jean-François Moine3d244062011-01-24 16:22:11 -03006714 case SENSOR_HV7131R:
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006715 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03006716 reg_w(gspca_dev, 0x03, 0x003b);
6717 reg_w(gspca_dev, 0x0c, 0x003a);
6718 reg_w(gspca_dev, 0x0b, 0x0039);
Jean-François Moine3d244062011-01-24 16:22:11 -03006719 if (sd->sensor == SENSOR_HV7131R)
6720 reg_w(gspca_dev, 0x50, ZC3XX_R11D_GLOBALGAIN);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006721 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006722 }
6723
6724 setmatrix(gspca_dev);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006725 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006726 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006727 case SENSOR_OV7620:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006728 reg_r(gspca_dev, 0x0008);
Jean-François Moine6d314502010-08-04 05:44:13 -03006729 reg_w(gspca_dev, 0x00, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006730 break;
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006731 case SENSOR_PAS202B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006732 case SENSOR_GC0305:
Jean-François Moine3d244062011-01-24 16:22:11 -03006733 case SENSOR_HV7131R:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006734 case SENSOR_TAS5130C:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006735 reg_r(gspca_dev, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006736 /* fall thru */
6737 case SENSOR_PO2030:
Jean-François Moine6d314502010-08-04 05:44:13 -03006738 reg_w(gspca_dev, 0x03, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006739 break;
6740 }
6741 setsharpness(gspca_dev);
6742
6743 /* set the gamma tables when not set */
6744 switch (sd->sensor) {
Jean-Francois Moine1d763312009-09-18 05:36:24 -03006745 case SENSOR_CS2102K: /* gamma set in xxx_Initial */
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006746 case SENSOR_HDCS2020:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006747 case SENSOR_OV7630C:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006748 break;
6749 default:
6750 setcontrast(gspca_dev);
6751 break;
6752 }
6753 setmatrix(gspca_dev); /* one more time? */
6754 switch (sd->sensor) {
6755 case SENSOR_OV7620:
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006756 case SENSOR_PAS202B:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006757 reg_r(gspca_dev, 0x0180); /* from win */
Jean-François Moine6d314502010-08-04 05:44:13 -03006758 reg_w(gspca_dev, 0x00, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006759 break;
6760 default:
6761 setquality(gspca_dev);
6762 break;
6763 }
6764 setlightfreq(gspca_dev);
6765
6766 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006767 case SENSOR_ADCM2700:
Jean-François Moine6d314502010-08-04 05:44:13 -03006768 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6769 reg_w(gspca_dev, 0x15, 0x01ae);
6770 reg_w(gspca_dev, 0x02, 0x0180);
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006771 /* ms-win + */
Jean-François Moine6d314502010-08-04 05:44:13 -03006772 reg_w(gspca_dev, 0x40, 0x0117);
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006773 break;
Jean-François Moine3d244062011-01-24 16:22:11 -03006774 case SENSOR_HV7131R:
6775 i2c_write(gspca_dev, 0x25, 0x04, 0x00); /* exposure */
6776 i2c_write(gspca_dev, 0x26, 0x93, 0x00);
6777 i2c_write(gspca_dev, 0x27, 0xe0, 0x00);
6778 reg_w(gspca_dev, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN);
6779 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006780 case SENSOR_GC0305:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006781 case SENSOR_TAS5130C:
Jean-François Moine6d314502010-08-04 05:44:13 -03006782 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6783 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006784 /* fall thru */
6785 case SENSOR_PAS202B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006786 case SENSOR_PO2030:
Jean-François Moine780e3122010-10-19 04:29:10 -03006787/* reg_w(gspca_dev, 0x40, ZC3XX_R117_GGAIN); in win traces */
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006788 reg_r(gspca_dev, 0x0180);
6789 break;
6790 case SENSOR_OV7620:
Jean-François Moine6d314502010-08-04 05:44:13 -03006791 reg_w(gspca_dev, 0x09, 0x01ad);
6792 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006793 i2c_read(gspca_dev, 0x13); /*fixme: returns 0xa3 */
6794 i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
Jean-François Moine780e3122010-10-19 04:29:10 -03006795 /*fixme: returned value to send? */
Jean-François Moine6d314502010-08-04 05:44:13 -03006796 reg_w(gspca_dev, 0x40, 0x0117);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006797 reg_r(gspca_dev, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006798 break;
6799 }
6800
6801 setautogain(gspca_dev);
6802 switch (sd->sensor) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006803 case SENSOR_PO2030:
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03006804 msleep(50);
Jean-François Moine6d314502010-08-04 05:44:13 -03006805 reg_w(gspca_dev, 0x00, 0x0007); /* (from win traces) */
6806 reg_w(gspca_dev, 0x02, ZC3XX_R008_CLOCKSETTING);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006807 break;
6808 }
Jean-François Moine6d314502010-08-04 05:44:13 -03006809 return gspca_dev->usb_err;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006810}
6811
Jean-Francois Moine98522a72008-11-18 06:33:08 -03006812/* called on streamoff with alt 0 and on disconnect */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006813static void sd_stop0(struct gspca_dev *gspca_dev)
6814{
6815 struct sd *sd = (struct sd *) gspca_dev;
6816
Jean-Francois Moine98522a72008-11-18 06:33:08 -03006817 if (!gspca_dev->present)
6818 return;
Jean-François Moine6d314502010-08-04 05:44:13 -03006819 send_unknown(gspca_dev, sd->sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006820}
6821
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006822static void sd_pkt_scan(struct gspca_dev *gspca_dev,
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006823 u8 *data,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006824 int len)
6825{
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006826 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006827
Jean-François Moinea5ecdfb2011-01-24 16:31:58 -03006828 /* check the JPEG end of frame */
6829 if (len >= 3
6830 && data[len - 3] == 0xff && data[len - 2] == 0xd9) {
6831/*fixme: what does the last byte mean?*/
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006832 gspca_frame_add(gspca_dev, LAST_PACKET,
Jean-François Moinea5ecdfb2011-01-24 16:31:58 -03006833 data, len - 1);
6834 return;
6835 }
6836
6837 /* check the JPEG start of a frame */
6838 if (data[0] == 0xff && data[1] == 0xd8) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006839 /* put the JPEG header in the new frame */
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006840 gspca_frame_add(gspca_dev, FIRST_PACKET,
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006841 sd->jpeg_hdr, JPEG_HDR_SZ);
6842
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006843 /* remove the webcam's header:
6844 * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
6845 * - 'ss ss' is the frame sequence number (BE)
Jean-François Moine780e3122010-10-19 04:29:10 -03006846 * - 'ww ww' and 'hh hh' are the window dimensions (BE)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006847 * - 'pp pp' is the packet sequence number (BE)
6848 */
6849 data += 18;
6850 len -= 18;
6851 }
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006852 gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006853}
6854
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006855static int sd_querymenu(struct gspca_dev *gspca_dev,
6856 struct v4l2_querymenu *menu)
6857{
6858 switch (menu->id) {
6859 case V4L2_CID_POWER_LINE_FREQUENCY:
6860 switch (menu->index) {
6861 case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006862 strcpy((char *) menu->name, "NoFliker");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006863 return 0;
6864 case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006865 strcpy((char *) menu->name, "50 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006866 return 0;
6867 case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006868 strcpy((char *) menu->name, "60 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006869 return 0;
6870 }
6871 break;
6872 }
6873 return -EINVAL;
6874}
6875
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03006876static int sd_set_jcomp(struct gspca_dev *gspca_dev,
6877 struct v4l2_jpegcompression *jcomp)
6878{
6879 struct sd *sd = (struct sd *) gspca_dev;
6880
6881 if (jcomp->quality < QUALITY_MIN)
6882 sd->quality = QUALITY_MIN;
6883 else if (jcomp->quality > QUALITY_MAX)
6884 sd->quality = QUALITY_MAX;
6885 else
6886 sd->quality = jcomp->quality;
6887 if (gspca_dev->streaming)
6888 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
Jean-François Moine6d314502010-08-04 05:44:13 -03006889 return gspca_dev->usb_err;
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03006890}
6891
6892static int sd_get_jcomp(struct gspca_dev *gspca_dev,
6893 struct v4l2_jpegcompression *jcomp)
6894{
6895 struct sd *sd = (struct sd *) gspca_dev;
6896
6897 memset(jcomp, 0, sizeof *jcomp);
6898 jcomp->quality = sd->quality;
6899 jcomp->jpeg_markers = V4L2_JPEG_MARKER_DHT
6900 | V4L2_JPEG_MARKER_DQT;
6901 return 0;
6902}
6903
Jean-François Moine28566432010-10-01 07:33:26 -03006904#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
Hans de Goede1a351022010-01-29 11:05:25 -03006905static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
6906 u8 *data, /* interrupt packet data */
6907 int len) /* interrput packet length */
6908{
6909 if (len == 8 && data[4] == 1) {
6910 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
6911 input_sync(gspca_dev->input_dev);
6912 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
6913 input_sync(gspca_dev->input_dev);
6914 }
6915
6916 return 0;
6917}
6918#endif
6919
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006920static const struct sd_desc sd_desc = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006921 .name = MODULE_NAME,
6922 .ctrls = sd_ctrls,
Mauro Carvalho Chehabd6f76b92009-07-22 00:02:29 -03006923 .nctrls = ARRAY_SIZE(sd_ctrls),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006924 .config = sd_config,
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03006925 .init = sd_init,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006926 .start = sd_start,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006927 .stop0 = sd_stop0,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006928 .pkt_scan = sd_pkt_scan,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03006929 .querymenu = sd_querymenu,
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03006930 .get_jcomp = sd_get_jcomp,
6931 .set_jcomp = sd_set_jcomp,
Jean-François Moine28566432010-10-01 07:33:26 -03006932#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
Hans de Goede1a351022010-01-29 11:05:25 -03006933 .int_pkt_scan = sd_int_pkt_scan,
6934#endif
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006935};
6936
Jean-François Moine95c967c2011-01-13 05:20:29 -03006937static const struct usb_device_id device_table[] = {
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006938 {USB_DEVICE(0x041e, 0x041e)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006939 {USB_DEVICE(0x041e, 0x4017)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03006940 {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006941 {USB_DEVICE(0x041e, 0x401e)},
6942 {USB_DEVICE(0x041e, 0x401f)},
Hans de Goede222a07f2008-09-03 17:12:20 -03006943 {USB_DEVICE(0x041e, 0x4022)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006944 {USB_DEVICE(0x041e, 0x4029)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03006945 {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
6946 {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006947 {USB_DEVICE(0x041e, 0x4036)},
6948 {USB_DEVICE(0x041e, 0x403a)},
Jean-François Moine7fbee992010-12-28 07:17:40 -03006949 {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_GC0303},
6950 {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_GC0303},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006951 {USB_DEVICE(0x0458, 0x7007)},
6952 {USB_DEVICE(0x0458, 0x700c)},
6953 {USB_DEVICE(0x0458, 0x700f)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006954 {USB_DEVICE(0x0461, 0x0a00)},
Fabio Rossi88a40cf2008-12-26 14:41:48 -03006955 {USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006956 {USB_DEVICE(0x046d, 0x08a0)},
6957 {USB_DEVICE(0x046d, 0x08a1)},
6958 {USB_DEVICE(0x046d, 0x08a2)},
6959 {USB_DEVICE(0x046d, 0x08a3)},
6960 {USB_DEVICE(0x046d, 0x08a6)},
6961 {USB_DEVICE(0x046d, 0x08a7)},
6962 {USB_DEVICE(0x046d, 0x08a9)},
6963 {USB_DEVICE(0x046d, 0x08aa)},
6964 {USB_DEVICE(0x046d, 0x08ac)},
6965 {USB_DEVICE(0x046d, 0x08ad)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006966 {USB_DEVICE(0x046d, 0x08ae)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006967 {USB_DEVICE(0x046d, 0x08af)},
6968 {USB_DEVICE(0x046d, 0x08b9)},
6969 {USB_DEVICE(0x046d, 0x08d7)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006970 {USB_DEVICE(0x046d, 0x08d8)},
Jean-François Moine7d55a842010-12-28 07:02:32 -03006971 {USB_DEVICE(0x046d, 0x08d9)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006972 {USB_DEVICE(0x046d, 0x08da)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03006973 {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
6974 {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
6975 {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
6976 {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
6977 {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006978 {USB_DEVICE(0x055f, 0xc005)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006979 {USB_DEVICE(0x055f, 0xd003)},
6980 {USB_DEVICE(0x055f, 0xd004)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006981 {USB_DEVICE(0x0698, 0x2003)},
Hans de Goede222a07f2008-09-03 17:12:20 -03006982 {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
Douglas Schilling Landgrafd99819d2009-03-26 05:10:55 -03006983 {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006984 {USB_DEVICE(0x0ac8, 0x301b)},
6985 {USB_DEVICE(0x0ac8, 0x303b)},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006986 {USB_DEVICE(0x0ac8, 0x305b)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006987 {USB_DEVICE(0x0ac8, 0x307b)},
6988 {USB_DEVICE(0x10fd, 0x0128)},
Hans de Goede222a07f2008-09-03 17:12:20 -03006989 {USB_DEVICE(0x10fd, 0x804d)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006990 {USB_DEVICE(0x10fd, 0x8050)},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006991 {} /* end of entry */
6992};
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006993MODULE_DEVICE_TABLE(usb, device_table);
6994
6995/* -- device connect -- */
6996static int sd_probe(struct usb_interface *intf,
6997 const struct usb_device_id *id)
6998{
6999 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7000 THIS_MODULE);
7001}
7002
7003/* USB driver */
7004static struct usb_driver sd_driver = {
7005 .name = MODULE_NAME,
7006 .id_table = device_table,
7007 .probe = sd_probe,
7008 .disconnect = gspca_disconnect,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03007009#ifdef CONFIG_PM
7010 .suspend = gspca_suspend,
7011 .resume = gspca_resume,
7012#endif
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007013};
7014
7015static int __init sd_mod_init(void)
7016{
Jean-François Moine54826432010-09-13 04:53:03 -03007017 return usb_register(&sd_driver);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007018}
7019
7020static void __exit sd_mod_exit(void)
7021{
7022 usb_deregister(&sd_driver);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007023}
7024
7025module_init(sd_mod_init);
7026module_exit(sd_mod_exit);
7027
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007028module_param(force_sensor, int, 0644);
7029MODULE_PARM_DESC(force_sensor,
7030 "Force sensor. Only for experts!!!");