blob: d3e1b6d8bf494f79d449c38c96be5d022ab61043 [file] [log] [blame]
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001/*
Jean-François Moine0b74e2c2012-02-27 08:26:05 -03002 * Z-Star/Vimicro zc301/zc302p/vc30x driver
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003 *
Jean-François Moine0b74e2c2012-02-27 08:26:05 -03004 * Copyright (C) 2009-2012 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
Joe Perches133a9fe2011-08-21 19:56:57 -030022#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
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
Hans de Goede83fb2e22012-05-06 09:28:24 -030035#define REG08_DEF 3 /* default JPEG compression (75%) */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -030036#include "zc3xx-reg.h"
Jean-Francois Moined43fa322008-06-12 10:58:58 -030037
38/* specific webcam descriptor */
39struct sd {
40 struct gspca_dev gspca_dev; /* !! must be the first item */
41
Hans Verkuilc06ba282012-05-06 09:28:28 -030042 struct { /* gamma/brightness/contrast control cluster */
43 struct v4l2_ctrl *gamma;
44 struct v4l2_ctrl *brightness;
45 struct v4l2_ctrl *contrast;
46 };
47 struct { /* autogain/exposure control cluster */
48 struct v4l2_ctrl *autogain;
49 struct v4l2_ctrl *exposure;
50 };
51 struct v4l2_ctrl *plfreq;
52 struct v4l2_ctrl *sharpness;
53 struct v4l2_ctrl *jpegqual;
Jean-François Moine49fb5e62010-12-28 07:09:34 -030054
Jean-François Moinef1801902012-02-27 07:48:32 -030055 struct work_struct work;
56 struct workqueue_struct *work_thread;
57
Jean-François Moine30c73d42012-02-27 07:26:30 -030058 u8 reg08; /* webcam compression quality */
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
Jean-Francois Moinecc611b82008-12-29 07:49:41 -030093static const struct v4l2_pix_format vga_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -030094 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
95 .bytesperline = 320,
96 .sizeimage = 320 * 240 * 3 / 8 + 590,
97 .colorspace = V4L2_COLORSPACE_JPEG,
98 .priv = 1},
99 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
100 .bytesperline = 640,
101 .sizeimage = 640 * 480 * 3 / 8 + 590,
102 .colorspace = V4L2_COLORSPACE_JPEG,
103 .priv = 0},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300104};
105
Hans de Goede9919fe82010-01-13 07:12:28 -0300106static const struct v4l2_pix_format broken_vga_mode[] = {
107 {320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
108 .bytesperline = 320,
109 .sizeimage = 320 * 232 * 4 / 8 + 590,
110 .colorspace = V4L2_COLORSPACE_JPEG,
111 .priv = 1},
112 {640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
113 .bytesperline = 640,
114 .sizeimage = 640 * 472 * 3 / 8 + 590,
115 .colorspace = V4L2_COLORSPACE_JPEG,
116 .priv = 0},
117};
118
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300119static const struct v4l2_pix_format sif_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300120 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
121 .bytesperline = 176,
122 .sizeimage = 176 * 144 * 3 / 8 + 590,
123 .colorspace = V4L2_COLORSPACE_JPEG,
124 .priv = 1},
125 {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
126 .bytesperline = 352,
127 .sizeimage = 352 * 288 * 3 / 8 + 590,
128 .colorspace = V4L2_COLORSPACE_JPEG,
129 .priv = 0},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300130};
131
Hans de Goede1b3bbcf2012-05-06 09:28:26 -0300132/*
133 * Bridge reg08 bits 1-2 -> JPEG quality conversion table. Note the highest
134 * quality setting is not usable as USB 1 does not have enough bandwidth.
135 */
136static u8 jpeg_qual[] = {50, 75, 87, /* 94 */};
Jean-François Moine30c73d42012-02-27 07:26:30 -0300137
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300138/* usb exchanges */
139struct usb_action {
Jean-Francois Moine47c833922010-01-07 15:59:12 -0300140 u8 req;
141 u8 val;
142 u16 idx;
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300143};
144
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300145static const struct usb_action adcm2700_Initial[] = {
146 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
147 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300148 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300149 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
150 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
151 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
152 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
153 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
154 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
155 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
156 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
157 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
158 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
159 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
160 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
161 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
162 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
163 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
164 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
165 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
166 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
167 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300168 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300169 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
170 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
171 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
172 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
173 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
174 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
175 {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */
176 {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */
177 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
178 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
179 {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */
180 {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */
181 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
182 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
183 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
184 {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */
185 {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */
186 {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */
187 {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */
188 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
189 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
190 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
191 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
192 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
193 {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */
194 {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */
195 {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */
196 {0xbb, 0x86, 0x0002}, /* 00,86,02,bb */
197 {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
198 {0xbb, 0x86, 0x0802}, /* 08,86,02,bb */
199 {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */
200 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
201 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
202 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
203 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
204 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
205 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
206 {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300207/*mswin+*/
208 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
209 {0xaa, 0xfe, 0x0002},
210 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
211 {0xaa, 0xb4, 0xcd37},
212 {0xaa, 0xa4, 0x0004},
213 {0xaa, 0xa8, 0x0007},
214 {0xaa, 0xac, 0x0004},
215/*mswin-*/
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300216 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
217 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
218 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
219 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
220 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
221 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
222 {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */
223 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
224 {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */
225 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
226 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
227 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
228 {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */
229 {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */
230 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
231 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
232 {}
233};
234static const struct usb_action adcm2700_InitialScale[] = {
235 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
236 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300237 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300238 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
239 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
240 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
241 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
242 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
243 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
244 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
245 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
246 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
247 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
248 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
249 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
250 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
251 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
252 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
253 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
254 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
255 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
256 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300257 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300258 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
259 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
260 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
261 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
262 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
263 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
264 {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */
265 {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */
266 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
267 {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
268 {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */
269 {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */
270 {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
271 {0xdd, 0x00, 0x0050}, /* 00,00,50,dd */
272 {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
273 {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */
274 {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */
275 {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */
276 {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */
277 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
278 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
279 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
280 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
281 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
282 {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */
283 {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */
284 {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300285 {0xbb, 0x86, 0x0002}, /* 00,88,02,bb */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300286 {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
Jean-Francois Moinec675e792009-01-26 05:29:06 -0300287 {0xbb, 0x86, 0x0802}, /* 08,88,02,bb */
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300288 {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */
289 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
290 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
291 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
292 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
293 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
294 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
295 {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */
296 /*******/
297 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
298 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
299 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
300 {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
301 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
302 {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
303 {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */
304 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
305 {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */
306 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
307 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
308 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
309 {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */
310 {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */
311 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
312 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
313 {}
314};
315static const struct usb_action adcm2700_50HZ[] = {
316 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
317 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
318 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
319 {0xbb, 0x05, 0x8400}, /* 84,05,00,bb */
320 {0xbb, 0xd0, 0xb007}, /* b0,d0,07,bb */
321 {0xbb, 0xa0, 0xb80f}, /* b8,a0,0f,bb */
322 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
323 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
324 {0xaa, 0x26, 0x00d0}, /* 00,26,d0,aa */
325 {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */
326 {}
327};
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300328static const struct usb_action adcm2700_60HZ[] = {
329 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
330 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
331 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
332 {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */
333 {0xbb, 0x82, 0xb006}, /* b0,82,06,bb */
334 {0xbb, 0x04, 0xb80d}, /* b8,04,0d,bb */
335 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
336 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
337 {0xaa, 0x26, 0x0057}, /* 00,26,57,aa */
338 {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */
339 {}
340};
Jean-Francois Moine3d221182009-01-19 15:18:44 -0300341static const struct usb_action adcm2700_NoFliker[] = {
342 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
343 {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
344 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
345 {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */
346 {0xbb, 0x05, 0xb000}, /* b0,05,00,bb */
347 {0xbb, 0xa0, 0xb801}, /* b8,a0,01,bb */
348 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
349 {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
350 {}
351};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300352static const struct usb_action cs2102_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300353 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
354 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
355 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
356 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
357 {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
358 {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
359 {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
360 {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
361 {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
362 {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
363 {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
364 {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
365 {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
366 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
367 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
368 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
369 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
370 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
371 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
372 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
373 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
374 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
375 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
376 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300377 {0xaa, 0x02, 0x0008},
378 {0xaa, 0x03, 0x0000},
379 {0xaa, 0x11, 0x0000},
380 {0xaa, 0x12, 0x0089},
381 {0xaa, 0x13, 0x0000},
382 {0xaa, 0x14, 0x00e9},
383 {0xaa, 0x20, 0x0000},
384 {0xaa, 0x22, 0x0000},
385 {0xaa, 0x0b, 0x0004},
386 {0xaa, 0x30, 0x0030},
387 {0xaa, 0x31, 0x0030},
388 {0xaa, 0x32, 0x0030},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300389 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
390 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
391 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
392 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
393 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
394 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
395 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300396 {0xa0, 0x10, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300397 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
398 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
399 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300400 {0xa0, 0x00, 0x01ad},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300401 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300402};
403
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300404static const struct usb_action cs2102_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300405 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
406 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
407 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
408 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
409 {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
410 {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
411 {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
412 {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
413 {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
414 {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
415 {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
416 {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
417 {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
418 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
419 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
420 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
421 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
422 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
423 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
424 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
425 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
426 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
427 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
428 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300429 {0xaa, 0x02, 0x0008},
430 {0xaa, 0x03, 0x0000},
431 {0xaa, 0x11, 0x0001},
432 {0xaa, 0x12, 0x0087},
433 {0xaa, 0x13, 0x0001},
434 {0xaa, 0x14, 0x00e7},
435 {0xaa, 0x20, 0x0000},
436 {0xaa, 0x22, 0x0000},
437 {0xaa, 0x0b, 0x0004},
438 {0xaa, 0x30, 0x0030},
439 {0xaa, 0x31, 0x0030},
440 {0xaa, 0x32, 0x0030},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300441 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
442 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
443 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
444 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
445 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
446 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
447 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300448 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300449 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
450 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
451 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300452 {0xa0, 0x00, 0x01ad},
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300453 {}
454};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300455static const struct usb_action cs2102_50HZScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300456 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
457 {0xaa, 0x23, 0x0001},
458 {0xaa, 0x24, 0x005f},
459 {0xaa, 0x25, 0x0090},
460 {0xaa, 0x21, 0x00dd},
461 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
462 {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
463 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
464 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
465 {0xa0, 0x3a, ZC3XX_R196_ANTIFLICKERMID},
466 {0xa0, 0x98, ZC3XX_R197_ANTIFLICKERLOW},
467 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
468 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
469 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
470 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
471 {0xa0, 0xdd, ZC3XX_R01D_HSYNC_0},
472 {0xa0, 0xe4, ZC3XX_R01E_HSYNC_1},
473 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
474 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
475 {}
476};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300477static const struct usb_action cs2102_50HZ[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300478 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
479 {0xaa, 0x23, 0x0000},
480 {0xaa, 0x24, 0x00af},
481 {0xaa, 0x25, 0x00c8},
482 {0xaa, 0x21, 0x0068},
483 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
484 {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
485 {0xa0, 0x90, ZC3XX_R192_EXPOSURELIMITLOW},
486 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
487 {0xa0, 0x1d, ZC3XX_R196_ANTIFLICKERMID},
488 {0xa0, 0x4c, ZC3XX_R197_ANTIFLICKERLOW},
489 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
490 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
491 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
492 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
493 {0xa0, 0x68, ZC3XX_R01D_HSYNC_0},
494 {0xa0, 0xe3, ZC3XX_R01E_HSYNC_1},
495 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
496 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
497 {}
498};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300499static const struct usb_action cs2102_60HZScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300500 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
501 {0xaa, 0x23, 0x0001},
502 {0xaa, 0x24, 0x0055},
503 {0xaa, 0x25, 0x00cc},
504 {0xaa, 0x21, 0x003f},
505 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
506 {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
507 {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
508 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
509 {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
510 {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
511 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
512 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
513 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
514 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
515 {0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
516 {0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
517 {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
518 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
519 {}
520};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300521static const struct usb_action cs2102_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300522 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300523 {0xaa, 0x23, 0x0000},
524 {0xaa, 0x24, 0x00aa},
525 {0xaa, 0x25, 0x00e6},
526 {0xaa, 0x21, 0x003f},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300527 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
528 {0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
529 {0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
530 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
531 {0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
532 {0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
533 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
534 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
535 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
536 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
537 {0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
538 {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
539 {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
540 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300541 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300542};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300543static const struct usb_action cs2102_NoFlikerScale[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300544 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
545 {0xaa, 0x23, 0x0001},
546 {0xaa, 0x24, 0x005f},
547 {0xaa, 0x25, 0x0000},
548 {0xaa, 0x21, 0x0001},
549 {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
550 {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
551 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
552 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
553 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
554 {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
555 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
556 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
557 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
558 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
559 {0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
560 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
561 {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
562 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300563 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300564};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300565static const struct usb_action cs2102_NoFliker[] = {
Jean-Francois Moine1d763312009-09-18 05:36:24 -0300566 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
567 {0xaa, 0x23, 0x0000},
568 {0xaa, 0x24, 0x00af},
569 {0xaa, 0x25, 0x0080},
570 {0xaa, 0x21, 0x0001},
571 {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
572 {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
573 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
574 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
575 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
576 {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
577 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
578 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
579 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
580 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
581 {0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
582 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
583 {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
584 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300585 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300586};
587
588/* CS2102_KOCOM */
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300589static const struct usb_action cs2102K_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300590 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
591 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
592 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
593 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
594 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
595 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
596 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
597 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
598 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
599 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
600 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
601 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
602 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
603 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
604 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
605 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
606 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
607 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
608 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
609 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
610 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
611 {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
612 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
613 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
614 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
615 {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
616 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
617 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
618 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
619 {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
620 {0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
621 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
622 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
623 {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
624 {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
625 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
626 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
627 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
628 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
629 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
630 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
631 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
632 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
633 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
634 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
635 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
636 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
637 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
638 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
639 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
640 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
641 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
642 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
643 {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
644 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
645 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
646 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
647 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
648 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
649 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
650 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
651 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
652 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
653 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
654 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
655 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
656 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
657 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
658 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
659 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
660 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
661 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
662 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
663 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
664 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
665 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
666 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
667 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
668 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
669 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
670 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
671 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
672 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
673 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
674 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
675 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
676 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
677 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
678 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
679 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
680 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
681 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
682 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
683 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
684 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
685 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
686 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
687 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
688 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
689 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300690 {0xa0, 0x00, 0x01ad},
691 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300692 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
693 {0xa0, 0x60, ZC3XX_R116_RGAIN},
694 {0xa0, 0x40, ZC3XX_R117_GGAIN},
695 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
696 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
697 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
698 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
699 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
700 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
701 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
702 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
703 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
704 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
705 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
706 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
707 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
708 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
709 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
710 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
711 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
712 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
713 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
714 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
715 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
716 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
717 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
718 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
719 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
720 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
721 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
722 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
723 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
724 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
725 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
726 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
727 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
728 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
729 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
730 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
731 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
732 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
733 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
734 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
735 {0xa0, 0x58, ZC3XX_R10E_RGB11},
736 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
737 {0xa0, 0xf4, ZC3XX_R110_RGB20},
738 {0xa0, 0xf4, ZC3XX_R111_RGB21},
739 {0xa0, 0x58, ZC3XX_R112_RGB22},
740 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
741 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
742 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
743 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
744 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
745 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
746 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
747 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
748 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
749 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
750 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
751 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
752 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
753 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
754 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
755 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
756 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
757 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
758 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
759 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
760 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
761 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
762 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
763 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
764 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
765 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
766 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
767 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
768 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
769 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
770 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
771 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
772 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
773 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
774 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
775 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
776 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
777 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
778 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
779 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
780 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
781 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
782 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
783 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
784 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
785 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
786 {0xa0, 0x60, ZC3XX_R116_RGAIN},
787 {0xa0, 0x40, ZC3XX_R117_GGAIN},
788 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
789 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
790 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
791 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
792 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
793 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
794 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
795 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
796 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
797 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
798 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
799 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
800 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
801 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
802 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
803 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
804 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
805 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
806 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
807 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
808 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
809 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
810 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
811 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
812 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
813 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
814 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
815 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
816 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
817 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
818 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
819 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
820 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
821 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
822 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
823 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
824 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
825 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
826 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
827 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
828 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
829 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
830 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
831 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
832 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
833 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
834 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
835 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
836 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
837 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
838 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
839 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
840 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
841 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
842 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
843 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
844 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300845 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300846};
847
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -0300848static const struct usb_action cs2102K_Initial[] = {
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -0300849 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300850 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
851 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
852 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
853 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
854 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
855 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
856 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
857 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
858 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
859 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
860 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
861 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
862 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
863 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
864 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
865 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -0300866/*fixme: next sequence = i2c exchanges*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300867 {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
868 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
869 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
870 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
871 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
872 {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
873 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
874 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
875 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
876 {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
877 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
878 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
879 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
880 {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
881 {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
882 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
883 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
884 {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
885 {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
886 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
887 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
888 {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
889 {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
890 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
891 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
892 {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
893 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
894 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
895 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
896 {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
897 {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
898 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
899 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
900 {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
901 {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
902 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
903 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
904 {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
905 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
906 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
907 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
908 {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
909 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
910 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
911 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
912 {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
913 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
914 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
915 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
916 {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
917 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
918 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
919 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
920 {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
921 {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
922 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
923 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
924 {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
925 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
926 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
927 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
928 {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
929 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
930 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
931 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
932 {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
933 {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
934 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
935 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
936 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
937 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
938 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
939 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
940 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
941 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
942 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
943 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
944 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
945 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
946 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
947 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
948 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
949 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
950 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -0300951 {0xa0, 0x00, 0x01ad},
952 {0xa0, 0x01, 0x01b1},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -0300953 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
954 {0xa0, 0x60, ZC3XX_R116_RGAIN},
955 {0xa0, 0x40, ZC3XX_R117_GGAIN},
956 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
957 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
958 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
959 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
960 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
961 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
962 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
963 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
964 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
965 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
966 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
967 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
968 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
969 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
970 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
971 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
972 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
973 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
974 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
975 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
976 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
977 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
978 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
979 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
980 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
981 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
982 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
983 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
984 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
985 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
986 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
987 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
988 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
989 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
990 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
991 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
992 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
993 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
994 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
995 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
996 {0xa0, 0x58, ZC3XX_R10E_RGB11},
997 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
998 {0xa0, 0xf4, ZC3XX_R110_RGB20},
999 {0xa0, 0xf4, ZC3XX_R111_RGB21},
1000 {0xa0, 0x58, ZC3XX_R112_RGB22},
1001 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1002 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1003 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1004 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1005 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1006 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1007 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1008 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1009 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1010 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1011 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1012 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1013 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1014 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1015 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1016 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1017 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1018 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1019 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1020 {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1021 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1022 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1023 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1024 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1025 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1026 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1027 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1028 {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1029 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1030 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1031 {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1032 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1033 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1034 {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1035 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1036 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1037 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1038 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1039 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1040 {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1041 {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1042 {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1043 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1044 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1045 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1046 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1047 {0xa0, 0x60, ZC3XX_R116_RGAIN},
1048 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1049 {0xa0, 0x4c, ZC3XX_R118_BGAIN},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001050 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1051 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1052 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1053 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1054 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1055 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1056 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1057 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1058 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1059 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1060 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1061 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1062 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1063 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1064 {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1065 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1066 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1067 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1068 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1069 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1070 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1071 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1072 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1073 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1074 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1075 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1076 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1077 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1078 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1079 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1080 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1081 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1082 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1083 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1084 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1085 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1086 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1087 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1088 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1089 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1090 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1091 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1092 {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1093 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1094 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1095 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1096 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1097 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1098 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1099 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1100 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1101 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1102 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1103 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1104 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1105 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moinef1ee8e82009-01-20 08:14:17 -03001106/*fixme:what does the next sequence?*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001107 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1108 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1109 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1110 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1111 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1112 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1113 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1114 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1115 {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1116 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1117 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1118 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1119 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1120 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1121 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1122 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1123 {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1124 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1125 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1126 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1127 {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1128 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1129 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1130 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1131 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1132 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1133 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1134 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1135 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
1136 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1137 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1138 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1139 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1140 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1141 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1142 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1143 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1144 {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1145 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1146 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1147 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1148 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1149 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1150 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1151 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1152 {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1153 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1154 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1155 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1156 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1157 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1158 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1159 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1160 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1161 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1162 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1163 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1164 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1165 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1166 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1167 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1168 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1169 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1170 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1171 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1172 {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1173 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1174 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1175 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1176 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1177 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1178 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1179 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1180 {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1181 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1182 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1183 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1184 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1185 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1186 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1187 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1188 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1189 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1190 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1191 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1192 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1193 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1194 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1195 {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1196 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1197 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1198 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1199 {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1200 {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1201 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1202 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1203 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1204 {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1205 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1206 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1207 {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1208 {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1209 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1210 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1211 {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1212 {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1213 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1214 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1215 {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1216 {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1217 {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1218 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1219 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1220 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1221 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1222 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001223 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001224};
1225
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001226static const struct usb_action gc0305_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001227 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1228 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
1229 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
1230 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
1231 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
1232 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1233 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
1234 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
1235 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
1236 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
1237 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
1238 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
1239 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
1240 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
1241 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
1242 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
1243 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
1244 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001245 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa */
1246 {0xaa, 0x15, 0x0003}, /* 00,15,03,aa */
1247 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
1248 {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
1249 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
1250 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
1251 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
1252 {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
1253 {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001254 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
1255 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
1256 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001257 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
1258 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
1259 {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
1260 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
1261 {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
1262 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
1263 {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
1264 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
1265 {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
1266 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
1267 {0xaa, 0x17, 0x00e6}, /* 00,17,e6,aa */
1268 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
1269 {0xaa, 0x19, 0x0086}, /* 00,19,86,aa */
1270 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1271 {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001272 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
1273 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
1274 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1275 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001276 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001277 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1278 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
1279 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
1280 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
1281 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
1282 {0xa0, 0x85, ZC3XX_R18D_YTARGET}, /* 01,8d,85,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001283 {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001284 {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1285 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1286 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1287 {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001288 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001289};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001290static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001291 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
1292 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
1293 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
1294 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
1295 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
1296 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
1297 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
1298 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
1299 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
1300 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
1301 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
1302 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
1303 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
1304 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
1305 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
1306 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
1307 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
1308 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001309 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
1310 {0xaa, 0x15, 0x0001}, /* 00,15,01,aa */
1311 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
1312 {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
1313 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
1314 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
1315 {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
1316 {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
1317 {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001318 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
1319 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
1320 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001321 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
1322 {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
1323 {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
1324 {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
1325 {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
1326 {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
1327 {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
1328 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
1329 {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
1330 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
1331 {0xaa, 0x17, 0x00e8}, /* 00,17,e8,aa */
1332 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
1333 {0xaa, 0x19, 0x0088}, /* 00,19,88,aa */
1334 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1335 {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001336 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
1337 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
1338 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
1339 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001340 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001341 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
1342 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
1343 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
1344 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
1345 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001346 {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001347 {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
1348 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
1349 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
1350 {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001351 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001352};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001353static const struct usb_action gc0305_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001354 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1355 {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */
1356 {0xaa, 0x84, 0x0038}, /* 00,84,38,aa */ /* win: 00,84,ec */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001357 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1358 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
1359 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
1360 /* win: 01,92,10 */
1361 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1362 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1363 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc */
1364 /* win: 01,97,ec */
1365 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1366 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1367 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
1368 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1369 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1370 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1371 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1372 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1373 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1374 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
1375/* {0xa0, 0x85, ZC3XX_R18D_YTARGET}, * 01,8d,85,cc *
1376 * if 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001377 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001378};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001379static const struct usb_action gc0305_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001380 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1381 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
1382 {0xaa, 0x84, 0x00ec}, /* 00,84,ec,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001383 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1384 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
1385 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
1386 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1387 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1388 {0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,ec,cc */
1389 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1390 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1391 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
1392 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1393 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1394 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1395 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1396 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1397 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1398 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
1399 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001400 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001401};
1402
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001403static const struct usb_action gc0305_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001404 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001405 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
1406 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
1407 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001408 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1409 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,00,cc */
1410 {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,48,cc */
1411 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1412 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1413 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1414 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
1415 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
1416 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
1417 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
1418 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
1419 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
1420 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
1421 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
1422 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001423 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001424};
1425
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001426static const struct usb_action hdcs2020_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001427 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1428 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1429 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* qtable 0x05 */
1430 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1431 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1432 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1433 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1434 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1435 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1436 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1437 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1438 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1439 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1440 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1441 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1442 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1443 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001444 {0xaa, 0x1c, 0x0000},
1445 {0xaa, 0x0a, 0x0001},
1446 {0xaa, 0x0b, 0x0006},
1447 {0xaa, 0x0c, 0x007b},
1448 {0xaa, 0x0d, 0x00a7},
1449 {0xaa, 0x03, 0x00fb},
1450 {0xaa, 0x05, 0x0000},
1451 {0xaa, 0x06, 0x0003},
1452 {0xaa, 0x09, 0x0008},
1453
1454 {0xaa, 0x0f, 0x0018}, /* set sensor gain */
1455 {0xaa, 0x10, 0x0018},
1456 {0xaa, 0x11, 0x0018},
1457 {0xaa, 0x12, 0x0018},
1458
1459 {0xaa, 0x15, 0x004e},
1460 {0xaa, 0x1c, 0x0004},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001461 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1462 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1463 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1464 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1465 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1466 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1467 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1468 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1469 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001470 {0xa1, 0x01, 0x0002},
1471 {0xa1, 0x01, 0x0008},
1472 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001473 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1474 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1475 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1476 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001477 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001478 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1479 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001480 {0xa1, 0x01, 0x01c8},
1481 {0xa1, 0x01, 0x01c9},
1482 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001483 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1484 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1485 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1486 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1487 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1488 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1489 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1490 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1491 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1492 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1493 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1494 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1495 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1496 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1497 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1498 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1499 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1500 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1501 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1502 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1503 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1504 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1505 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1506 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1507 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1508 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1509 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1510 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1511 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1512 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1513 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1514 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1515 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001516
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001517 {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1518 {0xa0, 0xed, ZC3XX_R10B_RGB01},
1519 {0xa0, 0xed, ZC3XX_R10C_RGB02},
1520 {0xa0, 0xed, ZC3XX_R10D_RGB10},
1521 {0xa0, 0x66, ZC3XX_R10E_RGB11},
1522 {0xa0, 0xed, ZC3XX_R10F_RGB12},
1523 {0xa0, 0xed, ZC3XX_R110_RGB20},
1524 {0xa0, 0xed, ZC3XX_R111_RGB21},
1525 {0xa0, 0x66, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001526
1527 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001528 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1529 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001530 {0xaa, 0x13, 0x0031},
1531 {0xaa, 0x14, 0x0001},
1532 {0xaa, 0x0e, 0x0004},
1533 {0xaa, 0x19, 0x00cd},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001534 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1535 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1536 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1537 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1538 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1539 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1540 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1541 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001542
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001543 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 0x14 */
1544 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1545 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1546 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1547 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1548 {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1549 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1550 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001551 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001552 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1553 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1554 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1555 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001556 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001557};
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001558static const struct usb_action hdcs2020_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001559 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1560 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1561 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1562 {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1563 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1564 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1565 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1566 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1567 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1568 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1569 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1570 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1571 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1572 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1573 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1574 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1575 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001576 {0xaa, 0x1c, 0x0000},
1577 {0xaa, 0x0a, 0x0001},
1578 {0xaa, 0x0b, 0x0006},
1579 {0xaa, 0x0c, 0x007a},
1580 {0xaa, 0x0d, 0x00a7},
1581 {0xaa, 0x03, 0x00fb},
1582 {0xaa, 0x05, 0x0000},
1583 {0xaa, 0x06, 0x0003},
1584 {0xaa, 0x09, 0x0008},
1585 {0xaa, 0x0f, 0x0018}, /* original setting */
1586 {0xaa, 0x10, 0x0018},
1587 {0xaa, 0x11, 0x0018},
1588 {0xaa, 0x12, 0x0018},
1589 {0xaa, 0x15, 0x004e},
1590 {0xaa, 0x1c, 0x0004},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001591 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1592 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1593 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1594 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1595 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1596 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1597 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1598 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1599 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001600 {0xa1, 0x01, 0x0002},
1601 {0xa1, 0x01, 0x0008},
1602 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001603 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1604 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1605 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1606 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001607 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001608 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1609 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001610 {0xa1, 0x01, 0x01c8},
1611 {0xa1, 0x01, 0x01c9},
1612 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001613 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1614 {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
1615 {0xa0, 0x38, ZC3XX_R121_GAMMA01},
1616 {0xa0, 0x59, ZC3XX_R122_GAMMA02},
1617 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1618 {0xa0, 0x92, ZC3XX_R124_GAMMA04},
1619 {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1620 {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1621 {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1622 {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1623 {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1624 {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1625 {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1626 {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1627 {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1628 {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1629 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1630 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1631 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
1632 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1633 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1634 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1635 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1636 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1637 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1638 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1639 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1640 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1641 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1642 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1643 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1644 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1645 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1646 {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
1647 {0xa0, 0xed, ZC3XX_R10B_RGB01},
1648 {0xa0, 0xed, ZC3XX_R10C_RGB02},
1649 {0xa0, 0xed, ZC3XX_R10D_RGB10},
1650 {0xa0, 0x66, ZC3XX_R10E_RGB11},
1651 {0xa0, 0xed, ZC3XX_R10F_RGB12},
1652 {0xa0, 0xed, ZC3XX_R110_RGB20},
1653 {0xa0, 0xed, ZC3XX_R111_RGB21},
1654 {0xa0, 0x66, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001655 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001656 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1657 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001658 /**** set exposure ***/
1659 {0xaa, 0x13, 0x0031},
1660 {0xaa, 0x14, 0x0001},
1661 {0xaa, 0x0e, 0x0004},
1662 {0xaa, 0x19, 0x00cd},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001663 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1664 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1665 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1666 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1667 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1668 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1669 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1670 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1671 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1672 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1673 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1674 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1675 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1676 {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1677 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1678 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001679 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001680 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1681 {0xa0, 0x40, ZC3XX_R116_RGAIN},
1682 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1683 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001684 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001685};
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001686static const struct usb_action hdcs2020_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001687 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001688 {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
1689 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1690 {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */
1691 {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001692 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1693 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1694 {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
1695 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1696 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1697 {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
1698 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1699 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1700 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1701 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1702 {0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
1703 {0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
1704 {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001705 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001706};
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001707static const struct usb_action hdcs2020_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001708 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001709 {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
1710 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1711 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
1712 {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001713 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1714 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1715 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
1716 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1717 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1718 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
1719 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1720 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1721 {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1722 {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1723 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1724 {0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
1725 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001726 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001727};
Jean-François Moine4e5144e2011-02-26 13:56:20 -03001728static const struct usb_action hdcs2020_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001729 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03001730 {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
1731 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
1732 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
1733 {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001734 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1735 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1736 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
1737 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1738 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1739 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1740 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1741 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1742 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
1743 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
1744 {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1745 {0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
1746 {0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001747 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001748};
1749
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001750static const struct usb_action hv7131b_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001751 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1752 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1753 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1754 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1755 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
1756 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
1757 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1758 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1759 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1760 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1761 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1762 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1763 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1764 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1765 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1766 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001767 {0xaa, 0x30, 0x002d},
1768 {0xaa, 0x01, 0x0005},
1769 {0xaa, 0x11, 0x0000},
1770 {0xaa, 0x13, 0x0001}, /* {0xaa, 0x13, 0x0000}, */
1771 {0xaa, 0x14, 0x0001},
1772 {0xaa, 0x15, 0x00e8},
1773 {0xaa, 0x16, 0x0002},
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03001774 {0xaa, 0x17, 0x0086}, /* 00,17,88,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001775 {0xaa, 0x31, 0x0038},
1776 {0xaa, 0x32, 0x0038},
1777 {0xaa, 0x33, 0x0038},
1778 {0xaa, 0x5b, 0x0001},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001779 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1780 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1781 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1782 {0xa0, 0x68, ZC3XX_R18D_YTARGET},
1783 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001784 {0xa0, 0x00, 0x01ad},
1785 {0xa0, 0xc0, 0x019b},
1786 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001787 {0xa0, 0x02, ZC3XX_R188_MINGAIN},
1788 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1789 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1790 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1791 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1792 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moinec9ff1b62008-11-06 15:29:47 -03001793 {0xaa, 0x02, 0x0090}, /* 00,02,80,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001794 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001795};
1796
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001797static const struct usb_action hv7131b_Initial[] = { /* 640x480*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001798 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1799 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1800 {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1801 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1802 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
1803 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
1804 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1805 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1806 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1807 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1808 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1809 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1810 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1811 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1812 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1813 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001814 {0xaa, 0x30, 0x002d},
1815 {0xaa, 0x01, 0x0005},
1816 {0xaa, 0x11, 0x0001},
1817 {0xaa, 0x13, 0x0000}, /* {0xaa, 0x13, 0x0001}; */
1818 {0xaa, 0x14, 0x0001},
1819 {0xaa, 0x15, 0x00e6},
1820 {0xaa, 0x16, 0x0002},
1821 {0xaa, 0x17, 0x0086},
1822 {0xaa, 0x31, 0x0038},
1823 {0xaa, 0x32, 0x0038},
1824 {0xaa, 0x33, 0x0038},
1825 {0xaa, 0x5b, 0x0001},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001826 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1827 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1828 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1829 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1830 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001831 {0xa0, 0x00, 0x01ad},
1832 {0xa0, 0xc0, 0x019b},
1833 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001834 {0xa0, 0x02, ZC3XX_R188_MINGAIN},
1835 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1836 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1837 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1838 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1839 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001840 {0xaa, 0x02, 0x0090}, /* {0xaa, 0x02, 0x0080}, */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001841 {}
1842};
1843static const struct usb_action hv7131b_50HZ[] = { /* 640x480*/
1844 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1845 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1846 {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
1847 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
1848 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1849 {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
1850 {0xaa, 0x22, 0x001b}, /* 00,22,1b,aa */
1851 {0xaa, 0x23, 0x00fc}, /* 00,23,fc,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001852 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1853 {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
1854 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
1855 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1856 {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,ea,cc */
1857 {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,60,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001858 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
1859 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
1860 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1861 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1862 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1863 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
1864 {0xa0, 0x1b, ZC3XX_R01F_HSYNC_2}, /* 00,1f,1b,cc */
1865 {0xa0, 0xfc, ZC3XX_R020_HSYNC_3}, /* 00,20,fc,cc */
1866 {}
1867};
1868static const struct usb_action hv7131b_50HZScale[] = { /* 320x240 */
1869 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1870 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1871 {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
1872 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
1873 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1874 {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
1875 {0xaa, 0x22, 0x0012}, /* 00,22,12,aa */
1876 {0xaa, 0x23, 0x0080}, /* 00,23,80,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001877 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1878 {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
1879 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
1880 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
1881 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,d4,cc */
1882 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,c0,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001883 {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
1884 {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
1885 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1886 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1887 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1888 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
1889 {0xa0, 0x12, ZC3XX_R01F_HSYNC_2}, /* 00,1f,12,cc */
1890 {0xa0, 0x80, ZC3XX_R020_HSYNC_3}, /* 00,20,80,cc */
1891 {}
1892};
1893static const struct usb_action hv7131b_60HZ[] = { /* 640x480*/
1894 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1895 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1896 {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
1897 {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
1898 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1899 {0xaa, 0x21, 0x0040}, /* 00,21,40,aa */
1900 {0xaa, 0x22, 0x0013}, /* 00,22,13,aa */
1901 {0xaa, 0x23, 0x004c}, /* 00,23,4c,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001902 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1903 {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
1904 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
1905 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1906 {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,c3,cc */
1907 {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,50,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001908 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
1909 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
1910 {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
1911 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
1912 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1913 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
1914 {0xa0, 0x13, ZC3XX_R01F_HSYNC_2}, /* 00,1f,13,cc */
1915 {0xa0, 0x4c, ZC3XX_R020_HSYNC_3}, /* 00,20,4c,cc */
1916 {}
1917};
1918static const struct usb_action hv7131b_60HZScale[] = { /* 320x240 */
1919 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1920 {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
1921 {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
1922 {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
1923 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1924 {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
1925 {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
1926 {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001927 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1928 {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
1929 {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
1930 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
1931 {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,86,cc */
1932 {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,a0,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001933 {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
1934 {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,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, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
1939 {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
1940 {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
1941 {}
1942};
1943static const struct usb_action hv7131b_NoFliker[] = { /* 640x480*/
1944 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1945 {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
1946 {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
1947 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
1948 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1949 {0xaa, 0x21, 0x0010}, /* 00,21,10,aa */
1950 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
1951 {0xaa, 0x23, 0x0003}, /* 00,23,03,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001952 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1953 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
1954 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
1955 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1956 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
1957 {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001958 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1959 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1960 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
1961 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
1962 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1963 {0xa0, 0x10, ZC3XX_R01E_HSYNC_1}, /* 00,1e,10,cc */
1964 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2}, /* 00,1f,00,cc */
1965 {0xa0, 0x03, ZC3XX_R020_HSYNC_3}, /* 00,20,03,cc */
1966 {}
1967};
1968static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
1969 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1970 {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
1971 {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
1972 {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
1973 {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
1974 {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
1975 {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
1976 {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
Jean-Francois Moinef4f4ef72008-12-08 06:25:40 -03001977 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
1978 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
1979 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
1980 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1981 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
1982 {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
Jean-Francois Moine13563f42008-11-06 15:35:21 -03001983 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1984 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1985 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
1986 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
1987 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
1988 {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
1989 {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
1990 {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001991 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03001992};
1993
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03001994/* from lPEPI264v.inf (hv7131b!) */
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03001995static const struct usb_action hv7131r_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03001996 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1997 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1998 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
1999 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2000 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2001 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002002 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002003 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002004 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2005 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2006 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2007 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2008 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2009 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2010 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2011 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2012 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2013 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2014 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2015 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002016 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2017 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002018 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002019 {0xaa, 0x01, 0x000c},
2020 {0xaa, 0x11, 0x0000},
2021 {0xaa, 0x13, 0x0000},
2022 {0xaa, 0x14, 0x0001},
2023 {0xaa, 0x15, 0x00e8},
2024 {0xaa, 0x16, 0x0002},
2025 {0xaa, 0x17, 0x0088},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002026 {0xaa, 0x30, 0x000b},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002027 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2028 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002029 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002030 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002031 {0xa0, 0x00, 0x01ad},
2032 {0xa0, 0xc0, 0x019b},
2033 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002034 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2035 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2036 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2037 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2038 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002039 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002040};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002041static const struct usb_action hv7131r_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002042 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002043 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002044 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2045 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2046 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2047 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002048 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002049 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002050 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2051 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2052 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002053 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002054 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2055 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2056 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002057 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002058 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002059 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002060 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2061 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002062 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2063 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002064 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002065 {0xaa, 0x01, 0x000c},
2066 {0xaa, 0x11, 0x0000},
2067 {0xaa, 0x13, 0x0000},
2068 {0xaa, 0x14, 0x0001},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002069 {0xaa, 0x15, 0x00e6},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002070 {0xaa, 0x16, 0x0002},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002071 {0xaa, 0x17, 0x0086},
2072 {0xaa, 0x30, 0x000b},
2073 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002074 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002075 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002076 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002077 {0xa0, 0x00, 0x01ad},
2078 {0xa0, 0xc0, 0x019b},
2079 {0xa0, 0xa0, 0x019c},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002080 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2081 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2082 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2083 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2084 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002085 {}
2086};
2087static const struct usb_action hv7131r_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002088 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002089 {0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
2090 {0xa0, 0x68, ZC3XX_R191_EXPOSURELIMITMID},
2091 {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
2092 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2093 {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},
2094 {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},
2095 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2096 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2097 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2098 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2099 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2100 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2101 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2102 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2103 {}
2104};
2105static const struct usb_action hv7131r_50HZScale[] = {
2106 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2107 {0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
2108 {0xa0, 0xd1, ZC3XX_R191_EXPOSURELIMITMID},
2109 {0xa0, 0x40, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002110 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2111 {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2112 {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002113 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002114 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002115 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03002116 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2117 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2118 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2119 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2120 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2121 {}
2122};
2123static const struct usb_action hv7131r_60HZ[] = {
2124 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2125 {0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
2126 {0xa0, 0x1a, ZC3XX_R191_EXPOSURELIMITMID},
2127 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
2128 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2129 {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},
2130 {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},
2131 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2132 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2133 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2134 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2135 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2136 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2137 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2138 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2139 {}
2140};
2141static const struct usb_action hv7131r_60HZScale[] = {
2142 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2143 {0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
2144 {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID},
2145 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2146 {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2147 {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},
2148 {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},
2149 {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2150 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2151 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2152 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2153 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2154 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2155 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2156 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2157 {}
2158};
2159static const struct usb_action hv7131r_NoFliker[] = {
2160 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2161 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
2162 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
2163 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2164 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2165 {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},
2166 {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW},
2167 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2168 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2169 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
2170 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
2171 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2172 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2173 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2174 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2175 {}
2176};
2177static const struct usb_action hv7131r_NoFlikerScale[] = {
2178 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2179 {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
2180 {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
2181 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2182 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2183 {0xa0, 0x04, ZC3XX_R196_ANTIFLICKERMID},
2184 {0xa0, 0xb0, ZC3XX_R197_ANTIFLICKERLOW},
2185 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2186 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2187 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
2188 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
2189 {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2190 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2191 {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2192 {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002193 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002194};
2195
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002196static const struct usb_action icm105a_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002197 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2198 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2199 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2200 {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2201 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2202 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2203 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2204 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2205 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2206 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2207 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2208 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2209 {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2210 {0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
2211 {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2212 {0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
2213 {0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
2214 {0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
2215 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2216 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2217 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2218 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2219 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2220 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2221 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2222 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2223 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002224 {0xaa, 0x01, 0x0010},
2225 {0xaa, 0x03, 0x0000},
2226 {0xaa, 0x04, 0x0001},
2227 {0xaa, 0x05, 0x0020},
2228 {0xaa, 0x06, 0x0001},
2229 {0xaa, 0x08, 0x0000},
2230 {0xaa, 0x03, 0x0001},
2231 {0xaa, 0x04, 0x0011},
2232 {0xaa, 0x05, 0x00a0},
2233 {0xaa, 0x06, 0x0001},
2234 {0xaa, 0x08, 0x0000},
2235 {0xaa, 0x03, 0x0002},
2236 {0xaa, 0x04, 0x0013},
2237 {0xaa, 0x05, 0x0020},
2238 {0xaa, 0x06, 0x0001},
2239 {0xaa, 0x08, 0x0000},
2240 {0xaa, 0x03, 0x0003},
2241 {0xaa, 0x04, 0x0015},
2242 {0xaa, 0x05, 0x0020},
2243 {0xaa, 0x06, 0x0005},
2244 {0xaa, 0x08, 0x0000},
2245 {0xaa, 0x03, 0x0004},
2246 {0xaa, 0x04, 0x0017},
2247 {0xaa, 0x05, 0x0020},
2248 {0xaa, 0x06, 0x000d},
2249 {0xaa, 0x08, 0x0000},
2250 {0xaa, 0x03, 0x0005},
2251 {0xaa, 0x04, 0x0019},
2252 {0xaa, 0x05, 0x0020},
2253 {0xaa, 0x06, 0x0005},
2254 {0xaa, 0x08, 0x0000},
2255 {0xaa, 0x03, 0x0006},
2256 {0xaa, 0x04, 0x0017},
2257 {0xaa, 0x05, 0x0026},
2258 {0xaa, 0x06, 0x0005},
2259 {0xaa, 0x08, 0x0000},
2260 {0xaa, 0x03, 0x0007},
2261 {0xaa, 0x04, 0x0019},
2262 {0xaa, 0x05, 0x0022},
2263 {0xaa, 0x06, 0x0005},
2264 {0xaa, 0x08, 0x0000},
2265 {0xaa, 0x03, 0x0008},
2266 {0xaa, 0x04, 0x0021},
2267 {0xaa, 0x05, 0x00aa},
2268 {0xaa, 0x06, 0x0005},
2269 {0xaa, 0x08, 0x0000},
2270 {0xaa, 0x03, 0x0009},
2271 {0xaa, 0x04, 0x0023},
2272 {0xaa, 0x05, 0x00aa},
2273 {0xaa, 0x06, 0x000d},
2274 {0xaa, 0x08, 0x0000},
2275 {0xaa, 0x03, 0x000a},
2276 {0xaa, 0x04, 0x0025},
2277 {0xaa, 0x05, 0x00aa},
2278 {0xaa, 0x06, 0x0005},
2279 {0xaa, 0x08, 0x0000},
2280 {0xaa, 0x03, 0x000b},
2281 {0xaa, 0x04, 0x00ec},
2282 {0xaa, 0x05, 0x002e},
2283 {0xaa, 0x06, 0x0005},
2284 {0xaa, 0x08, 0x0000},
2285 {0xaa, 0x03, 0x000c},
2286 {0xaa, 0x04, 0x00fa},
2287 {0xaa, 0x05, 0x002a},
2288 {0xaa, 0x06, 0x0005},
2289 {0xaa, 0x08, 0x0000},
2290 {0xaa, 0x07, 0x000d},
2291 {0xaa, 0x01, 0x0005},
2292 {0xaa, 0x94, 0x0002},
2293 {0xaa, 0x90, 0x0000},
2294 {0xaa, 0x91, 0x001f},
2295 {0xaa, 0x10, 0x0064},
2296 {0xaa, 0x9b, 0x00f0},
2297 {0xaa, 0x9c, 0x0002},
2298 {0xaa, 0x14, 0x001a},
2299 {0xaa, 0x20, 0x0080},
2300 {0xaa, 0x22, 0x0080},
2301 {0xaa, 0x24, 0x0080},
2302 {0xaa, 0x26, 0x0080},
2303 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002304 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2305 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002306 {0xaa, 0xa8, 0x00c0},
2307 {0xa1, 0x01, 0x0002},
2308 {0xa1, 0x01, 0x0008},
2309 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002310 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2311 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2312 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2313 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002314 {0xa1, 0x01, 0x0008},
2315
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002316 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2317 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002318 {0xa1, 0x01, 0x01c8},
2319 {0xa1, 0x01, 0x01c9},
2320 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002321 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
2322 {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2323 {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2324 {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2325 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2326 {0xa0, 0x52, ZC3XX_R10E_RGB11},
2327 {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2328 {0xa0, 0xf7, ZC3XX_R110_RGB20},
2329 {0xa0, 0xf7, ZC3XX_R111_RGB21},
2330 {0xa0, 0x52, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002331 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002332 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2333 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002334 {0xaa, 0x0d, 0x0003},
2335 {0xaa, 0x0c, 0x008c},
2336 {0xaa, 0x0e, 0x0095},
2337 {0xaa, 0x0f, 0x0002},
2338 {0xaa, 0x1c, 0x0094},
2339 {0xaa, 0x1d, 0x0002},
2340 {0xaa, 0x20, 0x0080},
2341 {0xaa, 0x22, 0x0080},
2342 {0xaa, 0x24, 0x0080},
2343 {0xaa, 0x26, 0x0080},
2344 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002345 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2346 {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
2347 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2348 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2349 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
2350 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2351 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2352 {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
2353 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2354 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2355 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2356 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2357 {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
2358 {0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
2359 {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
2360 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2361 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2362 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
2363 {0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
2364 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002365 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002366 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2367 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2368 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2369 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002370 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002371};
2372
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002373static const struct usb_action icm105a_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002374 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2375 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2376 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2377 {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2378 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2379 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2380 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2381 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2382 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2383 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2384 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2385 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2386 {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2387 {0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
2388 {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2389 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
2390 {0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
2391 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
2392 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2393 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2394 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2395 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2396 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2397 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2398 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2399 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2400 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002401 {0xaa, 0x01, 0x0010},
2402 {0xaa, 0x03, 0x0000},
2403 {0xaa, 0x04, 0x0001},
2404 {0xaa, 0x05, 0x0020},
2405 {0xaa, 0x06, 0x0001},
2406 {0xaa, 0x08, 0x0000},
2407 {0xaa, 0x03, 0x0001},
2408 {0xaa, 0x04, 0x0011},
2409 {0xaa, 0x05, 0x00a0},
2410 {0xaa, 0x06, 0x0001},
2411 {0xaa, 0x08, 0x0000},
2412 {0xaa, 0x03, 0x0002},
2413 {0xaa, 0x04, 0x0013},
2414 {0xaa, 0x05, 0x0020},
2415 {0xaa, 0x06, 0x0001},
2416 {0xaa, 0x08, 0x0000},
2417 {0xaa, 0x03, 0x0003},
2418 {0xaa, 0x04, 0x0015},
2419 {0xaa, 0x05, 0x0020},
2420 {0xaa, 0x06, 0x0005},
2421 {0xaa, 0x08, 0x0000},
2422 {0xaa, 0x03, 0x0004},
2423 {0xaa, 0x04, 0x0017},
2424 {0xaa, 0x05, 0x0020},
2425 {0xaa, 0x06, 0x000d},
2426 {0xaa, 0x08, 0x0000},
2427 {0xaa, 0x03, 0x0005},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002428 {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
2429 {0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
2430 {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002431 {0xa1, 0x01, 0x0091},
2432 {0xaa, 0x05, 0x0020},
2433 {0xaa, 0x06, 0x0005},
2434 {0xaa, 0x08, 0x0000},
2435 {0xaa, 0x03, 0x0006},
2436 {0xaa, 0x04, 0x0017},
2437 {0xaa, 0x05, 0x0026},
2438 {0xaa, 0x06, 0x0005},
2439 {0xaa, 0x08, 0x0000},
2440 {0xaa, 0x03, 0x0007},
2441 {0xaa, 0x04, 0x0019},
2442 {0xaa, 0x05, 0x0022},
2443 {0xaa, 0x06, 0x0005},
2444 {0xaa, 0x08, 0x0000},
2445 {0xaa, 0x03, 0x0008},
2446 {0xaa, 0x04, 0x0021},
2447 {0xaa, 0x05, 0x00aa},
2448 {0xaa, 0x06, 0x0005},
2449 {0xaa, 0x08, 0x0000},
2450 {0xaa, 0x03, 0x0009},
2451 {0xaa, 0x04, 0x0023},
2452 {0xaa, 0x05, 0x00aa},
2453 {0xaa, 0x06, 0x000d},
2454 {0xaa, 0x08, 0x0000},
2455 {0xaa, 0x03, 0x000a},
2456 {0xaa, 0x04, 0x0025},
2457 {0xaa, 0x05, 0x00aa},
2458 {0xaa, 0x06, 0x0005},
2459 {0xaa, 0x08, 0x0000},
2460 {0xaa, 0x03, 0x000b},
2461 {0xaa, 0x04, 0x00ec},
2462 {0xaa, 0x05, 0x002e},
2463 {0xaa, 0x06, 0x0005},
2464 {0xaa, 0x08, 0x0000},
2465 {0xaa, 0x03, 0x000c},
2466 {0xaa, 0x04, 0x00fa},
2467 {0xaa, 0x05, 0x002a},
2468 {0xaa, 0x06, 0x0005},
2469 {0xaa, 0x08, 0x0000},
2470 {0xaa, 0x07, 0x000d},
2471 {0xaa, 0x01, 0x0005},
2472 {0xaa, 0x94, 0x0002},
2473 {0xaa, 0x90, 0x0000},
2474 {0xaa, 0x91, 0x0010},
2475 {0xaa, 0x10, 0x0064},
2476 {0xaa, 0x9b, 0x00f0},
2477 {0xaa, 0x9c, 0x0002},
2478 {0xaa, 0x14, 0x001a},
2479 {0xaa, 0x20, 0x0080},
2480 {0xaa, 0x22, 0x0080},
2481 {0xaa, 0x24, 0x0080},
2482 {0xaa, 0x26, 0x0080},
2483 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002484 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2485 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002486 {0xaa, 0xa8, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002487 {0xa0, 0x78, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002488 {0xa1, 0x01, 0x0002},
2489 {0xa1, 0x01, 0x0008},
2490 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002491 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2492 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2493 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2494 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002495 {0xa1, 0x01, 0x0008},
2496
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002497 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
2498 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002499 {0xa1, 0x01, 0x01c8},
2500 {0xa1, 0x01, 0x01c9},
2501 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002502 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002503
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002504 {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
2505 {0xa0, 0xf7, ZC3XX_R10B_RGB01},
2506 {0xa0, 0xf7, ZC3XX_R10C_RGB02},
2507 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
2508 {0xa0, 0x52, ZC3XX_R10E_RGB11},
2509 {0xa0, 0xf7, ZC3XX_R10F_RGB12},
2510 {0xa0, 0xf7, ZC3XX_R110_RGB20},
2511 {0xa0, 0xf7, ZC3XX_R111_RGB21},
2512 {0xa0, 0x52, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002513 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002514 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2515 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002516 {0xaa, 0x0d, 0x0003},
2517 {0xaa, 0x0c, 0x0020},
2518 {0xaa, 0x0e, 0x000e},
2519 {0xaa, 0x0f, 0x0002},
2520 {0xaa, 0x1c, 0x000d},
2521 {0xaa, 0x1d, 0x0002},
2522 {0xaa, 0x20, 0x0080},
2523 {0xaa, 0x22, 0x0080},
2524 {0xaa, 0x24, 0x0080},
2525 {0xaa, 0x26, 0x0080},
2526 {0xaa, 0x00, 0x0084},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002527 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2528 {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
2529 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2530 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2531 {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
2532 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2533 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2534 {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
2535 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2536 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2537 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2538 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2539 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
2540 {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
2541 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
2542 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2543 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2544 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002545 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002546 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2547 {0xa0, 0x40, ZC3XX_R116_RGAIN},
2548 {0xa0, 0x40, ZC3XX_R117_GGAIN},
2549 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002550 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002551};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002552static const struct usb_action icm105a_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002553 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002554 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2555 {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
2556 {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
2557 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2558 {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
2559 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2560 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2561 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2562 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2563 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2564 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002565 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2566 {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
2567 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2568 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2569 {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
2570 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2571 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2572 {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
2573 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2574 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2575 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2576 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2577 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
2578 {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
2579 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2580 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002581 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002582};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002583static const struct usb_action icm105a_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002584 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002585 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2586 {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
2587 {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
2588 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2589 {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
2590 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2591 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2592 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2593 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2594 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2595 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002596 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2597 {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
2598 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2599 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2600 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2601 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2602 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2603 {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
2604 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2605 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2606 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2607 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2608 {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
2609 {0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
2610 {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
2611 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2612 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2613 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002614 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002615};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002616static const struct usb_action icm105a_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002617 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002618 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2619 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2620 {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2621 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2622 {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
2623 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2624 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2625 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2626 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2627 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2628 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002629 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2630 {0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
2631 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2632 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2633 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
2634 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2635 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2636 {0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
2637 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2638 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2639 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2640 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2641 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2642 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2643 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2644 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002645 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002646};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002647static const struct usb_action icm105a_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002648 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002649 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2650 {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
2651 {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
2652 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2653 {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
2654 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2655 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2656 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2657 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2658 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2659 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002660 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2661 {0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
2662 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2663 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2664 {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
2665 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2666 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2667 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
2668 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2669 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2670 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2671 {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2672 {0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
2673 {0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
2674 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2675 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2676 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2677 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002678 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002679};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002680static const struct usb_action icm105a_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002681 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002682 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2683 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2684 {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2685 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2686 {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
2687 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2688 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2689 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2690 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2691 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2692 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002693 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2694 {0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
2695 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2696 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2697 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2698 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2699 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2700 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2701 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2702 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2703 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2704 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2705 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2706 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2707 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2708 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002709 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002710};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002711static const struct usb_action icm105a_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002712 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002713 {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2714 {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2715 {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
2716 {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2717 {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
2718 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2719 {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2720 {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2721 {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2722 {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2723 {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002724 {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2725 {0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
2726 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2727 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2728 {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2729 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2730 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2731 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2732 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2733 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2734 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2735 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2736 {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2737 {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2738 {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2739 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2740 {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2741 {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002742 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002743};
2744
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03002745static const struct usb_action mc501cb_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002746 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2747 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
2748 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2749 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2750 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2751 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2752 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2753 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2754 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2755 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2756 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
2757 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2758 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2759 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2760 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2761 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2762 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
2763 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2764 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
2765 {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2766 {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2767 {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2768 {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2769 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002770 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2771 {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2772 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2773 {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2774 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2775 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
2776 {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
2777 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
2778 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
2779 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
2780 {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
2781 {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
2782 {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
2783 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
2784 {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
2785 {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
2786 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2787 {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
2788 {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
2789 {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
2790 {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
2791 {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
2792 {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
2793 {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
2794 {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
2795 {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
2796 {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
2797 {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
2798 {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
2799 {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
2800 {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
2801 {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
2802 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2803 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
2804 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
Jean-François Moine4e5144e2011-02-26 13:56:20 -03002805 {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002806 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
2807 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
2808 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
2809 {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
2810 {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
2811 {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
2812 {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
2813 {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
2814 {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
2815 {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
2816 {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
2817 {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
2818 {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
2819 {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
2820 {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
2821 {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
2822 {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
2823 {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
2824 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2825 {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
2826 {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
2827 {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
2828 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2829 {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
2830 {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
2831 {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
2832 {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
2833 {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
2834 {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
2835 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
2836 {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002837 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2838 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
2839 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
2840 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
2841 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
2842 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
2843 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
2844 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
2845 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002846 {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
2847 {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
2848 {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
2849 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2850 {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
2851 {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
2852 {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
2853 {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
2854 {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
2855 {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
2856
2857 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2858 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2859 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
2860 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
2861 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002862 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002863};
2864
Jean-François Moine780e3122010-10-19 04:29:10 -03002865static const struct usb_action mc501cb_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002866 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2867 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
2868 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2869 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2870 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2871 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2872 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2873 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2874 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2875 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2876 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
2877 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2878 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2879 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2880 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2881 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2882 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
2883 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2884 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
2885 {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2886 {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2887 {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2888 {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2889 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002890 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2891 {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2892 {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2893 {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2894 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2895 {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
2896 {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
2897 {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
2898 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
2899 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
2900 {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
2901 {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
2902 {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
2903 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
2904 {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
2905 {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
2906 {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2907 {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
2908 {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
2909 {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
2910 {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
2911 {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
2912 {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
2913 {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
2914 {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
2915 {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
2916 {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
2917 {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
2918 {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
2919 {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
2920 {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
2921 {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
2922 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2923 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
2924 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
Jean-François Moine4e5144e2011-02-26 13:56:20 -03002925 {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002926 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
2927 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
2928 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
2929 {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
2930 {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
2931 {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
2932 {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
2933 {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
2934 {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
2935 {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
2936 {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
2937 {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
2938 {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
2939 {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
2940 {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
2941 {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
2942 {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
2943 {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
2944 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2945 {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
2946 {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
2947 {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
2948 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2949 {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
2950 {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
2951 {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
2952 {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
2953 {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
2954 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
2955 {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
2956 {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03002957 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2958 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
2959 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
2960 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
2961 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
2962 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
2963 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
2964 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
2965 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002966 {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
2967 {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
2968 {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
2969 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2970 {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
2971 {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
2972 {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
2973 {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
2974 {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
2975 {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002976 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002977};
2978
Jean-François Moineda751912011-04-19 14:51:15 -03002979static const struct usb_action mc501cb_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002980 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2981 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2982 {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
2983 {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
2984 {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
2985 {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
2986 {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
2987 {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002988 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002989};
2990
Jean-François Moineda751912011-04-19 14:51:15 -03002991static const struct usb_action mc501cb_50HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03002992 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2993 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2994 {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
2995 {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
2996 {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
2997 {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
2998 {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
2999 {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003000 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003001};
3002
Jean-François Moineda751912011-04-19 14:51:15 -03003003static const struct usb_action mc501cb_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003004 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3005 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3006 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3007 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3008 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3009 {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3010 {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3011 {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003012 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003013};
3014
Jean-François Moineda751912011-04-19 14:51:15 -03003015static const struct usb_action mc501cb_60HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003016 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3017 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3018 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3019 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3020 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3021 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3022 {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3023 {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003024 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003025};
3026
Jean-François Moineda751912011-04-19 14:51:15 -03003027static const struct usb_action mc501cb_NoFliker[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003028 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3029 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3030 {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3031 {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3032 {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3033 {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3034 {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3035 {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003036 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003037};
3038
Jean-François Moineda751912011-04-19 14:51:15 -03003039static const struct usb_action mc501cb_NoFlikerScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003040 {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3041 {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3042 {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3043 {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3044 {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3045 {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3046 {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3047 {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003048 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003049};
3050
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003051/* from zs211.inf */
3052static const struct usb_action ov7620_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003053 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3054 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
3055 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3056 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3057 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3058 {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3059 {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3060 {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3061 {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3062 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3063 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3064 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3065 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3066 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3067 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3068 {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3069 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3070 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3071 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3072 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3073 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3074 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3075 {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3076 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003077 {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3078 {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3079 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3080 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3081 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3082 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3083 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3084 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3085 {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3086 {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3087 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3088 {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3089 {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3090 {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3091 {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3092 {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3093 {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3094 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3095 {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3096 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3097 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3098 {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3099 {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3100 {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3101 {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3102 {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3103 {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3104 {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003105 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3106 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3107 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3108 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003109 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003110 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3111 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3112 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3113 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3114 {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3115 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3116 {0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
3117 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3118 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003119 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003120};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003121static const struct usb_action ov7620_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003122 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3123 {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT}, /* 00,02,50,cc */
3124 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3125 /* mx change? */
3126 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3127 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3128 {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3129 {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3130 {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3131 {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3132 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3133 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3134 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3135 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3136 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3137 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3138 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3139 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3140 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3141 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3142 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3143 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3144 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3145 {0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d6,cc */
3146 /* OV7648 00,9c,d8,cc */
3147 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003148 {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3149 {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3150 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3151 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3152 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3153 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3154 {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3155 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3156 {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3157 {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3158 {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3159 {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3160 {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3161 {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3162 {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3163 {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3164 {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3165 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3166 {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3167 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3168 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3169 {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3170 {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3171 {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3172 {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3173 {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3174 {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3175 {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003176 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3177 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3178 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3179 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3180 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3181 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3182 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3183 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3184 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3185 {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3186 {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3187 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,50,cc */
3188 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3189 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003190 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003191};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003192static const struct usb_action ov7620_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003193 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3194 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3195 {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3196 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3197 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003198 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3199 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3200 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3201 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3202 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3203 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3204 {0xaa, 0x10, 0x0082}, /* 00,10,82,aa */
3205 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3206/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
Jean-François Moine4e5144e2011-02-26 13:56:20 -03003207 * if mode0 (640x480) */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003208 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003209};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003210static const struct usb_action ov7620_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003211 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3212 /* (bug in zs211.inf) */
3213 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3214 {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3215 {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3216 {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3217 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3218 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3219 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3220 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3221 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3222 {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3223 {0xaa, 0x10, 0x0020}, /* 00,10,20,aa */
3224 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3225/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
3226 * if mode0 (640x480) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003227/* ?? in gspca v1, it was
3228 {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
3229 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003230 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003231};
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003232static const struct usb_action ov7620_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003233 {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3234 /* (bug in zs211.inf) */
3235 {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
3236 {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
3237 {0xaa, 0x75, 0x008e}, /* 00,75,8e,aa */
3238 {0xaa, 0x2d, 0x0001}, /* 00,2d,01,aa */
3239 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3240 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3241 {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3242 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3243 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3244 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
3245/* {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT}, * 00,02,44,cc
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003246 * if mode1 (320x240) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003247/* ?? was
3248 {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
3249 {0xa1, 0x01, 0x0037}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003250 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003251};
3252
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003253static const struct usb_action ov7630c_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003254 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3255 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3256 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3257 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3258 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3259 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3260 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3261 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3262 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3263 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3264 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3265 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3266 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3267 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003268 {0xaa, 0x12, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003269 {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3270 {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3271 {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3272 {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3273 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3274 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3275 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3276 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3277 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3278 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
3279 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003280 {0xaa, 0x12, 0x0069},
3281 {0xaa, 0x04, 0x0020},
3282 {0xaa, 0x06, 0x0050},
3283 {0xaa, 0x13, 0x0083},
3284 {0xaa, 0x14, 0x0000},
3285 {0xaa, 0x15, 0x0024},
3286 {0xaa, 0x17, 0x0018},
3287 {0xaa, 0x18, 0x00ba},
3288 {0xaa, 0x19, 0x0002},
3289 {0xaa, 0x1a, 0x00f6},
3290 {0xaa, 0x1b, 0x0002},
3291 {0xaa, 0x20, 0x00c2},
3292 {0xaa, 0x24, 0x0060},
3293 {0xaa, 0x25, 0x0040},
3294 {0xaa, 0x26, 0x0030},
3295 {0xaa, 0x27, 0x00ea},
3296 {0xaa, 0x28, 0x00a0},
3297 {0xaa, 0x21, 0x0000},
3298 {0xaa, 0x2a, 0x0081},
3299 {0xaa, 0x2b, 0x0096},
3300 {0xaa, 0x2d, 0x0094},
3301 {0xaa, 0x2f, 0x003d},
3302 {0xaa, 0x30, 0x0024},
3303 {0xaa, 0x60, 0x0000},
3304 {0xaa, 0x61, 0x0040},
3305 {0xaa, 0x68, 0x007c},
3306 {0xaa, 0x6f, 0x0015},
3307 {0xaa, 0x75, 0x0088},
3308 {0xaa, 0x77, 0x00b5},
3309 {0xaa, 0x01, 0x0060},
3310 {0xaa, 0x02, 0x0060},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003311 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3312 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3313 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3314 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3315 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003316 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003317 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3318 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3319 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3320 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3321 {0xa0, 0x60, ZC3XX_R116_RGAIN},
3322 {0xa0, 0x46, ZC3XX_R118_BGAIN},
3323 {0xa0, 0x04, ZC3XX_R113_RGB03},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003324/* 0x10, */
3325 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003326 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3327 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3328 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3329 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3330 {0xa0, 0x50, ZC3XX_R10E_RGB11},
3331 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3332 {0xa0, 0xf8, ZC3XX_R110_RGB20},
3333 {0xa0, 0xf8, ZC3XX_R111_RGB21},
3334 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003335 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003336 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
3337 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003338 {0xa1, 0x01, 0x01c8},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003339 {0xa1, 0x01, 0x01c9},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003340 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003341 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
3342 {0xa0, 0x01, ZC3XX_R120_GAMMA00}, /* gamma 2 ?*/
3343 {0xa0, 0x0c, ZC3XX_R121_GAMMA01},
3344 {0xa0, 0x1f, ZC3XX_R122_GAMMA02},
3345 {0xa0, 0x3a, ZC3XX_R123_GAMMA03},
3346 {0xa0, 0x53, ZC3XX_R124_GAMMA04},
3347 {0xa0, 0x6d, ZC3XX_R125_GAMMA05},
3348 {0xa0, 0x85, ZC3XX_R126_GAMMA06},
3349 {0xa0, 0x9c, ZC3XX_R127_GAMMA07},
3350 {0xa0, 0xb0, ZC3XX_R128_GAMMA08},
3351 {0xa0, 0xc2, ZC3XX_R129_GAMMA09},
3352 {0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
3353 {0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
3354 {0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
3355 {0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
3356 {0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
3357 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3358 {0xa0, 0x05, ZC3XX_R130_GAMMA10},
3359 {0xa0, 0x0f, ZC3XX_R131_GAMMA11},
3360 {0xa0, 0x16, ZC3XX_R132_GAMMA12},
3361 {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
3362 {0xa0, 0x19, ZC3XX_R134_GAMMA14},
3363 {0xa0, 0x19, ZC3XX_R135_GAMMA15},
3364 {0xa0, 0x17, ZC3XX_R136_GAMMA16},
3365 {0xa0, 0x15, ZC3XX_R137_GAMMA17},
3366 {0xa0, 0x12, ZC3XX_R138_GAMMA18},
3367 {0xa0, 0x10, ZC3XX_R139_GAMMA19},
3368 {0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
3369 {0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
3370 {0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
3371 {0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
3372 {0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
3373 {0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
3374 {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
3375 {0xa0, 0xf8, ZC3XX_R10B_RGB01},
3376 {0xa0, 0xf8, ZC3XX_R10C_RGB02},
3377 {0xa0, 0xf8, ZC3XX_R10D_RGB10},
3378 {0xa0, 0x50, ZC3XX_R10E_RGB11},
3379 {0xa0, 0xf8, ZC3XX_R10F_RGB12},
3380 {0xa0, 0xf8, ZC3XX_R110_RGB20},
3381 {0xa0, 0xf8, ZC3XX_R111_RGB21},
3382 {0xa0, 0x50, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003383
3384 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003385 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003386 {0xaa, 0x10, 0x001b},
3387 {0xaa, 0x76, 0x0002},
3388 {0xaa, 0x2a, 0x0081},
3389 {0xaa, 0x2b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003390 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3391 {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
3392 {0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
3393 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3394 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3395 {0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
3396 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3397 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3398 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3399 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3400 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3401 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3402 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003403 {0xaa, 0x13, 0x0083}, /* 40 */
3404 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003405 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003406 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003407};
3408
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003409static const struct usb_action ov7630c_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003410 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3411 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
3412 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3413 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3414 {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3415 {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3416 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3417 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3418 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3419 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3420 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3421 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003422
3423 {0xaa, 0x12, 0x0080},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003424 {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3425 {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3426 {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3427 {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3428 {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3429 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3430 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3431 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3432 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3433 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
3434 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003435 {0xaa, 0x12, 0x0069}, /* i2c */
3436 {0xaa, 0x04, 0x0020},
3437 {0xaa, 0x06, 0x0050},
3438 {0xaa, 0x13, 0x00c3},
3439 {0xaa, 0x14, 0x0000},
3440 {0xaa, 0x15, 0x0024},
3441 {0xaa, 0x19, 0x0003},
3442 {0xaa, 0x1a, 0x00f6},
3443 {0xaa, 0x1b, 0x0002},
3444 {0xaa, 0x20, 0x00c2},
3445 {0xaa, 0x24, 0x0060},
3446 {0xaa, 0x25, 0x0040},
3447 {0xaa, 0x26, 0x0030},
3448 {0xaa, 0x27, 0x00ea},
3449 {0xaa, 0x28, 0x00a0},
3450 {0xaa, 0x21, 0x0000},
3451 {0xaa, 0x2a, 0x0081},
3452 {0xaa, 0x2b, 0x0096},
3453 {0xaa, 0x2d, 0x0084},
3454 {0xaa, 0x2f, 0x003d},
3455 {0xaa, 0x30, 0x0024},
3456 {0xaa, 0x60, 0x0000},
3457 {0xaa, 0x61, 0x0040},
3458 {0xaa, 0x68, 0x007c},
3459 {0xaa, 0x6f, 0x0015},
3460 {0xaa, 0x75, 0x0088},
3461 {0xaa, 0x77, 0x00b5},
3462 {0xaa, 0x01, 0x0060},
3463 {0xaa, 0x02, 0x0060},
3464 {0xaa, 0x17, 0x0018},
3465 {0xaa, 0x18, 0x00ba},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003466 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3467 {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3468 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3469 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3470 {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003471 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003472 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3473 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3474 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3475 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3476 {0xa0, 0x60, ZC3XX_R116_RGAIN},
3477 {0xa0, 0x46, ZC3XX_R118_BGAIN},
3478 {0xa0, 0x04, ZC3XX_R113_RGB03},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003479
3480 {0xa1, 0x01, 0x0002},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003481 {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3482 {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3483 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3484 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3485 {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3486 {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3487 {0xa0, 0x00, ZC3XX_R110_RGB20},
3488 {0xa0, 0xf6, ZC3XX_R111_RGB21},
3489 {0xa0, 0x4a, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003490
3491 {0xa1, 0x01, 0x0008},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003492 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
3493 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003494 {0xa1, 0x01, 0x01c8},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003495 {0xa1, 0x01, 0x01c9},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003496 {0xa1, 0x01, 0x01ca},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003497 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
3498 {0xa0, 0x16, ZC3XX_R120_GAMMA00}, /* gamma ~4 */
3499 {0xa0, 0x3a, ZC3XX_R121_GAMMA01},
3500 {0xa0, 0x5b, ZC3XX_R122_GAMMA02},
3501 {0xa0, 0x7c, ZC3XX_R123_GAMMA03},
3502 {0xa0, 0x94, ZC3XX_R124_GAMMA04},
3503 {0xa0, 0xa9, ZC3XX_R125_GAMMA05},
3504 {0xa0, 0xbb, ZC3XX_R126_GAMMA06},
3505 {0xa0, 0xca, ZC3XX_R127_GAMMA07},
3506 {0xa0, 0xd7, ZC3XX_R128_GAMMA08},
3507 {0xa0, 0xe1, ZC3XX_R129_GAMMA09},
3508 {0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
3509 {0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
3510 {0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
3511 {0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
3512 {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
3513 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3514 {0xa0, 0x20, ZC3XX_R130_GAMMA10},
3515 {0xa0, 0x22, ZC3XX_R131_GAMMA11},
3516 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
3517 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
3518 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
3519 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
3520 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
3521 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
3522 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
3523 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
3524 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
3525 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
3526 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
3527 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
3528 {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
3529 {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
3530 {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
3531 {0xa0, 0xfe, ZC3XX_R10B_RGB01},
3532 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3533 {0xa0, 0xf7, ZC3XX_R10D_RGB10},
3534 {0xa0, 0x4d, ZC3XX_R10E_RGB11},
3535 {0xa0, 0xfc, ZC3XX_R10F_RGB12},
3536 {0xa0, 0x00, ZC3XX_R110_RGB20},
3537 {0xa0, 0xf6, ZC3XX_R111_RGB21},
3538 {0xa0, 0x4a, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003539
3540 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003541 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003542 {0xaa, 0x10, 0x000d},
3543 {0xaa, 0x76, 0x0002},
3544 {0xaa, 0x2a, 0x0081},
3545 {0xaa, 0x2b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003546 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3547 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
3548 {0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
3549 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3550 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3551 {0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
3552 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3553 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3554 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3555 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3556 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3557 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3558 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003559 {0xaa, 0x13, 0x00c3},
3560
3561 {0xa1, 0x01, 0x0180},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003562 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003563 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003564};
3565
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003566static const struct usb_action pas106b_Initial_com[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003567/* Sream and Sensor specific */
3568 {0xa1, 0x01, 0x0010}, /* CMOSSensorSelect */
3569/* System */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003570 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
3571 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003572/* Picture size */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003573 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* ClockSelect */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003574 {0xa0, 0x03, 0x003a},
3575 {0xa0, 0x0c, 0x003b},
3576 {0xa0, 0x04, 0x0038},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003577 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003578};
3579
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003580static const struct usb_action pas106b_InitialScale[] = { /* 176x144 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003581/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003582 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003583/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003584 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003585/* Picture size */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003586 {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
3587 {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
3588 {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
3589 {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003590/* System */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003591 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003592/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003593 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3594 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003595/* Sensor Interface */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003596 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003597/* Window inside sensor array */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003598 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3599 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3600 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3601 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3602 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003603/* Init the sensor */
3604 {0xaa, 0x02, 0x0004},
3605 {0xaa, 0x08, 0x0000},
3606 {0xaa, 0x09, 0x0005},
3607 {0xaa, 0x0a, 0x0002},
3608 {0xaa, 0x0b, 0x0002},
3609 {0xaa, 0x0c, 0x0005},
3610 {0xaa, 0x0d, 0x0000},
3611 {0xaa, 0x0e, 0x0002},
3612 {0xaa, 0x14, 0x0081},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003613/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003614 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003615/* Frame retreiving */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003616 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003617/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003618 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003619/* Unknown */
3620 {0xa0, 0x00, 0x01ad},
3621/* Sharpness */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003622 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3623 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003624/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003625 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003626/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003627 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003628/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003629 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003630/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003631 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003632/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003633 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3634 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3635 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003636/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003637 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003638/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003639 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003640/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003641 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003642/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003643 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003644/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003645 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3646 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3647 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003648
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003649 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
3650 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
3651 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3652 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
3653 {0xa0, 0x58, ZC3XX_R10E_RGB11},
3654 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
3655 {0xa0, 0xf4, ZC3XX_R110_RGB20},
3656 {0xa0, 0xf4, ZC3XX_R111_RGB21},
3657 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003658/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003659 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
3660 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3661 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3662 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
3663 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3664 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3665 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003666/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003667 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3668 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3669 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
3670 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3671 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3672 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
3673 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
3674 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003675/* sensor on */
3676 {0xaa, 0x07, 0x00b1},
3677 {0xaa, 0x05, 0x0003},
3678 {0xaa, 0x04, 0x0001},
3679 {0xaa, 0x03, 0x003b},
3680/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003681 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3682 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3683 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
3684 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003685/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003686 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003687 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003688 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003689/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003690 {0xa0, 0x40, ZC3XX_R116_RGAIN},
3691 {0xa0, 0x40, ZC3XX_R117_GGAIN},
3692 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003693 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003694};
3695
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03003696static const struct usb_action pas106b_Initial[] = { /* 352x288 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003697/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003698 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003699/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003700 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003701/* Picture size */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003702 {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
3703 {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
3704 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3705 {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003706/* System */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003707 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003708/* Sream and Sensor specific */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003709 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3710 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003711/* Sensor Interface */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003712 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003713/* Window inside sensor array */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003714 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3715 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3716 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3717 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3718 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003719/* Init the sensor */
3720 {0xaa, 0x02, 0x0004},
3721 {0xaa, 0x08, 0x0000},
3722 {0xaa, 0x09, 0x0005},
3723 {0xaa, 0x0a, 0x0002},
3724 {0xaa, 0x0b, 0x0002},
3725 {0xaa, 0x0c, 0x0005},
3726 {0xaa, 0x0d, 0x0000},
3727 {0xaa, 0x0e, 0x0002},
3728 {0xaa, 0x14, 0x0081},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003729/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003730 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003731/* Frame retreiving */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003732 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003733/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003734 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003735/* Unknown */
3736 {0xa0, 0x00, 0x01ad},
3737/* Sharpness */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003738 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3739 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03003740/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003741 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003742/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003743 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3744 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003745/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003746 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003747/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003748 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003749/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003750 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3751 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3752 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003753/* Other registers */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003754 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003755/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003756 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003757/*Dead pixels */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003758 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003759/* EEPROM */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003760 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003761/* JPEG control */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003762 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3763 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3764 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003765
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003766 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
3767 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
3768 {0xa0, 0xf4, ZC3XX_R10C_RGB02},
3769 {0xa0, 0xf4, ZC3XX_R10D_RGB10},
3770 {0xa0, 0x58, ZC3XX_R10E_RGB11},
3771 {0xa0, 0xf4, ZC3XX_R10F_RGB12},
3772 {0xa0, 0xf4, ZC3XX_R110_RGB20},
3773 {0xa0, 0xf4, ZC3XX_R111_RGB21},
3774 {0xa0, 0x58, ZC3XX_R112_RGB22},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003775/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003776 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
3777 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3778 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3779 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
3780 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3781 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3782 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003783
3784/* Auto exposure and white balance */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003785 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3786 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3787 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003788
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003789 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3790 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3791 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003792
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003793 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3794 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003795/* sensor on */
3796 {0xaa, 0x07, 0x00b1},
3797 {0xaa, 0x05, 0x0003},
3798 {0xaa, 0x04, 0x0001},
3799 {0xaa, 0x03, 0x003b},
3800/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003801 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3802 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003803 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003804/* Auto correction */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003805 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003806 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003807 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003808/* Gains */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03003809 {0xa0, 0x40, ZC3XX_R116_RGAIN},
3810 {0xa0, 0x40, ZC3XX_R117_GGAIN},
3811 {0xa0, 0x40, ZC3XX_R118_BGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003812
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003813 {0xa0, 0x00, 0x0007}, /* AutoCorrectEnable */
3814 {0xa0, 0xff, ZC3XX_R018_FRAMELOST}, /* Frame adjust */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003815 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003816};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003817static const struct usb_action pas106b_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003818 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3819 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3820 {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
3821 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3822 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3823 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
3824 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3825 {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
3826 {0xaa, 0x03, 0x0021}, /* 00,03,21,aa */
3827 {0xaa, 0x04, 0x000c}, /* 00,04,0c,aa */
3828 {0xaa, 0x05, 0x0002}, /* 00,05,02,aa */
3829 {0xaa, 0x07, 0x001c}, /* 00,07,1c,aa */
3830 {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003831 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003832};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003833static const struct usb_action pas106b_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003834 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3835 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3836 {0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
3837 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3838 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3839 {0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
3840 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3841 {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
3842 {0xaa, 0x03, 0x001c}, /* 00,03,1c,aa */
3843 {0xaa, 0x04, 0x0004}, /* 00,04,04,aa */
3844 {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
3845 {0xaa, 0x07, 0x00c4}, /* 00,07,c4,aa */
3846 {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003847 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003848};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003849static const struct usb_action pas106b_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03003850 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3851 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3852 {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
3853 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3854 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3855 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
3856 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
3857 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
3858 {0xaa, 0x03, 0x0013}, /* 00,03,13,aa */
3859 {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3860 {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
3861 {0xaa, 0x07, 0x0030}, /* 00,07,30,aa */
3862 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003863 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03003864};
3865
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003866/* from lvWIMv.inf 046d:08a2/:08aa 2007/06/03 */
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003867static const struct usb_action pas202b_Initial[] = { /* 640x480 */
3868 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003869 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003870 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
3871 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
3872 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3873 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3874 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3875 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
3876 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3877 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3878 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3879 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3880 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3881 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,03,cc */
3882 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3883 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,03,cc */
3884 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
3885 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
3886 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3887 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3888 {0xaa, 0x02, 0x0002}, /* 00,02,04,aa --> 02 */
3889 {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
3890 {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
3891 {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
3892 {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
3893 {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003894 {0xaa, 0x0c, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003895 {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
3896 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3897 {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
3898 {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
3899 {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
3900 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
3901 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3902 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3903 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3904 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3905 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3906 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3907 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3908 {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
3909 {}
3910};
3911static const struct usb_action pas202b_InitialScale[] = { /* 320x240 */
3912 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003913 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003914 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
3915 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
3916 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3917 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3918 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003919 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003920 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3921 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3922 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3923 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3924 {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,08,cc */
3925 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,02,cc */
3926 {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,08,cc */
3927 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,02,cc */
3928 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003929 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003930 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
3931 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
3932 {0xaa, 0x02, 0x0002}, /* 00,02,02,aa */
3933 {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
3934 {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
3935 {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
3936 {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
3937 {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003938 {0xaa, 0x0c, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003939 {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
3940 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
3941 {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
3942 {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
3943 {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
3944 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
3945 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3946 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3947 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3948 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3949 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3950 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3951 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3952 {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003953 {0xa0, 0xff, ZC3XX_R097_WINYSTARTHIGH},
3954 {0xa0, 0xfe, ZC3XX_R098_WINYSTARTLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003955 {}
3956};
3957static const struct usb_action pas202b_50HZ[] = {
3958 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3959 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
3960 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
3961 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003962 {0xaa, 0x21, 0x001b},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003963 {0xaa, 0x03, 0x0044}, /* 00,03,44,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003964 {0xaa, 0x04, 0x0008},
3965 {0xaa, 0x05, 0x001b},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003966 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
3967 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003968 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003969 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
3970 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003971 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
3972 {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003973 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3974 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3975 {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4d,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003976 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
3977 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003978 {0xa0, 0x44, ZC3XX_R01D_HSYNC_0}, /* 00,1d,44,cc */
3979 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
3980 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
3981 {0xa0, 0xeb, ZC3XX_R020_HSYNC_3}, /* 00,20,eb,cc */
3982 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
3983 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
3984 {}
3985};
3986static const struct usb_action pas202b_50HZScale[] = {
3987 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
3988 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
3989 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003990 {0xaa, 0x20, 0x0004},
3991 {0xaa, 0x21, 0x003d},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003992 {0xaa, 0x03, 0x0041}, /* 00,03,41,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003993 {0xaa, 0x04, 0x0010},
3994 {0xaa, 0x05, 0x003d},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003995 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
3996 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03003997 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03003998 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
3999 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004000 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4001 {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004002 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4003 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4004 {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,9b,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004005 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4006 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004007 {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
4008 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4009 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
4010 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4011 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4012 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4013 {}
4014};
4015static const struct usb_action pas202b_60HZ[] = {
4016 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4017 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4018 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4019 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4020 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4021 {0xaa, 0x03, 0x0045}, /* 00,03,45,aa */
4022 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
4023 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
4024 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4025 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004026 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004027 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4028 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004029 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4030 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004031 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4032 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4033 {0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,40,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004034 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4035 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004036 {0xa0, 0x45, ZC3XX_R01D_HSYNC_0}, /* 00,1d,45,cc */
4037 {0xa0, 0x8e, ZC3XX_R01E_HSYNC_1}, /* 00,1e,8e,cc */
4038 {0xa0, 0xc1, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c1,cc */
4039 {0xa0, 0xf5, ZC3XX_R020_HSYNC_3}, /* 00,20,f5,cc */
4040 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4041 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4042 {}
4043};
4044static const struct usb_action pas202b_60HZScale[] = {
4045 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4046 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4047 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004048 {0xaa, 0x20, 0x0004},
4049 {0xaa, 0x21, 0x0008},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004050 {0xaa, 0x03, 0x0042}, /* 00,03,42,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004051 {0xaa, 0x04, 0x0010},
4052 {0xaa, 0x05, 0x0008},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004053 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4054 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004055 {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004056 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4057 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004058 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4059 {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004060 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4061 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4062 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004063 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4064 {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004065 {0xa0, 0x42, ZC3XX_R01D_HSYNC_0}, /* 00,1d,42,cc */
4066 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4067 {0xa0, 0xaf, ZC3XX_R01F_HSYNC_2}, /* 00,1f,af,cc */
4068 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4069 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4070 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4071 {}
4072};
4073static const struct usb_action pas202b_NoFliker[] = {
4074 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4075 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4076 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4077 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004078 {0xaa, 0x21, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004079 {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
4080 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004081 {0xaa, 0x05, 0x0006},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004082 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4083 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4084 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004085 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4086 {0xa0, 0x06, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004087 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4088 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004089 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004090 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4091 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4092 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004093 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004094 {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
4095 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
4096 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4097 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4098 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4099 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4100 {}
4101};
4102static const struct usb_action pas202b_NoFlikerScale[] = {
4103 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4104 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4105 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004106 {0xaa, 0x20, 0x0004},
4107 {0xaa, 0x21, 0x000c},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004108 {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004109 {0xaa, 0x04, 0x0010},
4110 {0xaa, 0x05, 0x000c},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004111 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4112 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4113 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004114 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4115 {0xa0, 0x0c, ZC3XX_R192_EXPOSURELIMITLOW},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004116 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4117 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4118 {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,02,cc */
4119 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4120 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4121 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03004122 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03004123 {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
4124 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
4125 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4126 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4127 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4128 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4129 {}
4130};
4131
Jean-François Moinea484dd92010-08-04 07:25:12 -03004132/* mt9v111 (mi0360soc) and pb0330 from vm30x.inf 0ac8:301b 07/02/13 */
4133static const struct usb_action mt9v111_1_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004134 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4135 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4136 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4137 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4138 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4139 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4140 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4141 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004142 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004143 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004144 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004145 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4146 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4147 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4148 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4149 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004150 {0xdd, 0x00, 0x0200},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004151 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004152 {0xaa, 0x01, 0x0001},
4153 {0xaa, 0x06, 0x0000},
4154 {0xaa, 0x08, 0x0483},
4155 {0xaa, 0x01, 0x0004},
4156 {0xaa, 0x08, 0x0006},
4157 {0xaa, 0x02, 0x0011},
4158 {0xaa, 0x03, 0x01e5}, /*jfm: was 01e7*/
4159 {0xaa, 0x04, 0x0285}, /*jfm: was 0287*/
4160 {0xaa, 0x07, 0x3002},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004161 {0xaa, 0x20, 0x5100},
4162 {0xaa, 0x35, 0x507f},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004163 {0xaa, 0x30, 0x0005},
4164 {0xaa, 0x31, 0x0000},
4165 {0xaa, 0x58, 0x0078},
4166 {0xaa, 0x62, 0x0411},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004167 {0xaa, 0x2b, 0x007f},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004168 {0xaa, 0x2c, 0x007f}, /*jfm: was 0030*/
4169 {0xaa, 0x2d, 0x007f}, /*jfm: was 0030*/
4170 {0xaa, 0x2e, 0x007f}, /*jfm: was 0030*/
4171 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004172 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004173 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4174 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4175 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4176 {0xa0, 0x09, 0x01ad}, /*jfm: was 00*/
4177 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4178 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4179 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4180 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4181 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004182 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004183 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4184 {0xa0, 0x65, ZC3XX_R118_BGAIN},
4185 {}
4186};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004187static const struct usb_action mt9v111_1_InitialScale[] = { /* 320x240 */
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004188 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4189 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4190 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4191 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4192 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4193 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4194 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4195 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4196 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4197 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004198 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004199 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4200 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4201 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4202 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4203 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4204 {0xdd, 0x00, 0x0200},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004205 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004206 {0xaa, 0x01, 0x0001},
4207 {0xaa, 0x06, 0x0000},
4208 {0xaa, 0x08, 0x0483},
4209 {0xaa, 0x01, 0x0004},
4210 {0xaa, 0x08, 0x0006},
4211 {0xaa, 0x02, 0x0011},
4212 {0xaa, 0x03, 0x01e7},
4213 {0xaa, 0x04, 0x0287},
4214 {0xaa, 0x07, 0x3002},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004215 {0xaa, 0x20, 0x5100},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004216 {0xaa, 0x35, 0x007f}, /*jfm: was 0050*/
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004217 {0xaa, 0x30, 0x0005},
4218 {0xaa, 0x31, 0x0000},
4219 {0xaa, 0x58, 0x0078},
4220 {0xaa, 0x62, 0x0411},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004221 {0xaa, 0x2b, 0x007f}, /*jfm: was 28*/
4222 {0xaa, 0x2c, 0x007f}, /*jfm: was 30*/
4223 {0xaa, 0x2d, 0x007f}, /*jfm: was 30*/
4224 {0xaa, 0x2e, 0x007f}, /*jfm: was 28*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004225 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004226 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004227 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4228 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4229 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004230 {0xa0, 0x09, 0x01ad}, /*jfm: was 00*/
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004231 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4232 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4233 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4234 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4235 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004236 {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004237 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4238 {0xa0, 0x65, ZC3XX_R118_BGAIN},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004239 {}
4240};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004241static const struct usb_action mt9v111_1_AE50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004242 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4243 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004244 {0xbb, 0x00, 0x0562},
4245 {0xbb, 0x01, 0x09aa},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004246 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004247 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4248 {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004249 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4250 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004251 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
4252 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4253 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4254 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4255 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4256 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
4257 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4258 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4259 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4260 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4261 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4262 {}
4263};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004264static const struct usb_action mt9v111_1_AE50HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004265 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4266 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4267 {0xbb, 0x00, 0x0509},
4268 {0xbb, 0x01, 0x0934},
4269 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4270 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4271 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4272 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4273 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4274 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4275 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4276 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4277 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4278 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4279 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4280 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4281 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4282 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4283 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4284 {}
4285};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004286static const struct usb_action mt9v111_1_AE60HZ[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004287 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4288 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004289 {0xaa, 0x05, 0x003d},
4290 {0xaa, 0x09, 0x016e},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004291 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4292 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4293 {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW},
4294 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4295 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4296 {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
4297 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4298 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4299 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4300 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4301 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
4302 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4303 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4304 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4305 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4306 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4307 {}
4308};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004309static const struct usb_action mt9v111_1_AE60HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004310 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4311 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4312 {0xbb, 0x00, 0x0509},
4313 {0xbb, 0x01, 0x0983},
4314 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4315 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4316 {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4317 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4318 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4319 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004320 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4321 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4322 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4323 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4324 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4325 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4326 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4327 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4328 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004329 {}
4330};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004331static const struct usb_action mt9v111_1_AENoFliker[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004332 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4333 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4334 {0xbb, 0x00, 0x0509},
4335 {0xbb, 0x01, 0x0960},
4336 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4337 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4338 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4339 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4340 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4341 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4342 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4343 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4344 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4345 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4346 {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
4347 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
4348 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4349 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4350 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004351 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004352 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004353};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004354static const struct usb_action mt9v111_1_AENoFlikerScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004355 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4356 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4357 {0xbb, 0x00, 0x0534},
4358 {0xbb, 0x02, 0x0960},
4359 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4360 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4361 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4362 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4363 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4364 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4365 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4366 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4367 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4368 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4369 {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4370 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4371 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4372 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4373 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4374 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4375 {}
4376};
Jean-François Moinea484dd92010-08-04 07:25:12 -03004377/* from usbvm303.inf 0ac8:303b 07/03/25 (3 - tas5130c) */
4378static const struct usb_action mt9v111_3_Initial[] = {
4379 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4380 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4381 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
Jean-François Moined581bcd2010-10-29 08:01:01 -03004382 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
Jean-François Moinea484dd92010-08-04 07:25:12 -03004383 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4384 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4385 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4386 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4387 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4388 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4389 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4390 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4391 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4392 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4393 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4394 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4395 {0xdd, 0x00, 0x0200},
4396 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4397 {0xaa, 0x01, 0x0001}, /* select IFP/SOC registers */
4398 {0xaa, 0x06, 0x0000}, /* operating mode control */
4399 {0xaa, 0x08, 0x0483}, /* output format control */
4400 /* H red first, V red or blue first,
4401 * raw Bayer, auto flicker */
4402 {0xaa, 0x01, 0x0004}, /* select sensor core registers */
4403 {0xaa, 0x08, 0x0006}, /* row start */
4404 {0xaa, 0x02, 0x0011}, /* column start */
4405 {0xaa, 0x03, 0x01e5}, /* window height - 1 */
4406 {0xaa, 0x04, 0x0285}, /* window width - 1 */
4407 {0xaa, 0x07, 0x3002}, /* output control */
4408 {0xaa, 0x20, 0x1100}, /* read mode: bits 8 & 12 (?) */
4409 {0xaa, 0x35, 0x007f}, /* global gain */
4410 {0xaa, 0x30, 0x0005},
4411 {0xaa, 0x31, 0x0000},
4412 {0xaa, 0x58, 0x0078},
4413 {0xaa, 0x62, 0x0411},
4414 {0xaa, 0x2b, 0x007f}, /* green1 gain */
4415 {0xaa, 0x2c, 0x007f}, /* blue gain */
4416 {0xaa, 0x2d, 0x007f}, /* red gain */
4417 {0xaa, 0x2e, 0x007f}, /* green2 gain */
4418 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4419 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4420 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4421 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4422 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4423 {0xa0, 0x00, 0x01ad},
4424 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4425 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4426 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4427 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4428 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4429 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
4430 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4431 {0xa0, 0x65, ZC3XX_R118_BGAIN},
4432 {}
4433};
4434static const struct usb_action mt9v111_3_InitialScale[] = {
4435 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4436 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4437 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4438 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4439 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4440 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4441 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4442 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4443 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4444 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4445 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4446 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4447 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4448 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4449 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4450 {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4451 {0xdd, 0x00, 0x0200},
4452 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4453 {0xaa, 0x01, 0x0001},
4454 {0xaa, 0x06, 0x0000},
4455 {0xaa, 0x08, 0x0483},
4456 {0xaa, 0x01, 0x0004},
4457 {0xaa, 0x08, 0x0006},
4458 {0xaa, 0x02, 0x0011},
4459 {0xaa, 0x03, 0x01e7},
4460 {0xaa, 0x04, 0x0287},
4461 {0xaa, 0x07, 0x3002},
4462 {0xaa, 0x20, 0x1100},
4463 {0xaa, 0x35, 0x007f},
4464 {0xaa, 0x30, 0x0005},
4465 {0xaa, 0x31, 0x0000},
4466 {0xaa, 0x58, 0x0078},
4467 {0xaa, 0x62, 0x0411},
4468 {0xaa, 0x2b, 0x007f},
4469 {0xaa, 0x2c, 0x007f},
4470 {0xaa, 0x2d, 0x007f},
4471 {0xaa, 0x2e, 0x007f},
4472 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4473 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4474 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4475 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4476 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4477 {0xa0, 0x00, 0x01ad},
4478 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4479 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4480 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4481 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4482 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4483 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
4484 {0xa0, 0x61, ZC3XX_R116_RGAIN},
4485 {0xa0, 0x65, ZC3XX_R118_BGAIN},
4486 {}
4487};
4488static const struct usb_action mt9v111_3_AE50HZ[] = {
4489 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4490 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4491 {0xaa, 0x05, 0x0009}, /* horizontal blanking */
4492 {0xaa, 0x09, 0x01ce}, /* shutter width */
4493 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4494 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4495 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4496 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4497 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4498 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4499 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4500 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4501 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4502 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4503 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4504 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4505 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4506 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4507 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4508 {}
4509};
4510static const struct usb_action mt9v111_3_AE50HZScale[] = {
4511 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4512 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4513 {0xaa, 0x05, 0x0009},
4514 {0xaa, 0x09, 0x01ce},
4515 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4516 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4517 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4518 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4519 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4520 {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4521 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4522 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4523 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4524 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4525 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4526 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4527 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4528 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4529 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4530 {}
4531};
4532static const struct usb_action mt9v111_3_AE60HZ[] = {
4533 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4534 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4535 {0xaa, 0x05, 0x0009},
4536 {0xaa, 0x09, 0x0083},
4537 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4538 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4539 {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4540 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4541 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4542 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
4543 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4544 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4545 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4546 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4547 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4548 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4549 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4550 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4551 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4552 {}
4553};
4554static const struct usb_action mt9v111_3_AE60HZScale[] = {
4555 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4556 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4557 {0xaa, 0x05, 0x0009},
4558 {0xaa, 0x09, 0x0083},
4559 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4560 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4561 {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4562 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4563 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4564 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
4565 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4566 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4567 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4568 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4569 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4570 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4571 {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4572 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4573 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4574 {}
4575};
4576static const struct usb_action mt9v111_3_AENoFliker[] = {
4577 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4578 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4579 {0xaa, 0x05, 0x0034},
4580 {0xaa, 0x09, 0x0260},
4581 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4582 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4583 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4584 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4585 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4586 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4587 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4588 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4589 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4590 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4591 {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4592 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4593 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4594 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4595 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4596 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4597 {}
4598};
4599static const struct usb_action mt9v111_3_AENoFlikerScale[] = {
4600 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4601 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4602 {0xaa, 0x05, 0x0034},
4603 {0xaa, 0x09, 0x0260},
4604 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4605 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4606 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4607 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4608 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4609 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4610 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4611 {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4612 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4613 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4614 {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4615 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4616 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4617 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4618 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4619 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4620 {}
4621};
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004622
4623static const struct usb_action pb0330_Initial[] = { /* 640x480 */
4624 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4625 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
4626 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4627 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4628 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4629 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4630 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4631 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4632 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4633 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4634 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4635 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4636 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4637 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4638 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4639 {0xdd, 0x00, 0x0200},
4640 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4641 {0xaa, 0x01, 0x0006},
4642 {0xaa, 0x02, 0x0011},
4643 {0xaa, 0x03, 0x01e5}, /*jfm: was 1e7*/
4644 {0xaa, 0x04, 0x0285}, /*jfm: was 0287*/
4645 {0xaa, 0x06, 0x0003},
4646 {0xaa, 0x07, 0x3002},
4647 {0xaa, 0x20, 0x1100},
4648 {0xaa, 0x2f, 0xf7b0},
4649 {0xaa, 0x30, 0x0005},
4650 {0xaa, 0x31, 0x0000},
4651 {0xaa, 0x34, 0x0100},
4652 {0xaa, 0x35, 0x0060},
4653 {0xaa, 0x3d, 0x068f},
4654 {0xaa, 0x40, 0x01e0},
4655 {0xaa, 0x58, 0x0078},
4656 {0xaa, 0x62, 0x0411},
4657 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4658 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4659 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4660 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4661 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4662 {0xa0, 0x09, 0x01ad}, /*jfm: was 00 */
4663 {0xa0, 0x15, 0x01ae},
4664 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4665 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4666 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4667 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4668 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4669 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /*jfm: was 6c*/
4670 {}
4671};
4672static const struct usb_action pb0330_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004673 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4674 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
4675 {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4676 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4677 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4678 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4679 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4680 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4681 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4682 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4683 {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4684 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4685 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4686 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4687 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004688 {0xdd, 0x00, 0x0200},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004689 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004690 {0xaa, 0x01, 0x0006},
4691 {0xaa, 0x02, 0x0011},
4692 {0xaa, 0x03, 0x01e7},
4693 {0xaa, 0x04, 0x0287},
4694 {0xaa, 0x06, 0x0003},
4695 {0xaa, 0x07, 0x3002},
4696 {0xaa, 0x20, 0x1100},
4697 {0xaa, 0x2f, 0xf7b0},
4698 {0xaa, 0x30, 0x0005},
4699 {0xaa, 0x31, 0x0000},
4700 {0xaa, 0x34, 0x0100},
4701 {0xaa, 0x35, 0x0060},
4702 {0xaa, 0x3d, 0x068f},
4703 {0xaa, 0x40, 0x01e0},
4704 {0xaa, 0x58, 0x0078},
4705 {0xaa, 0x62, 0x0411},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004706 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4707 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4708 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4709 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4710 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004711 {0xa0, 0x09, 0x01ad},
4712 {0xa0, 0x15, 0x01ae},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004713 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4714 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4715 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4716 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4717 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004718 {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /*jfm: was 6c*/
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004719 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004720};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004721static const struct usb_action pb0330_50HZ[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004722 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4723 {0xbb, 0x00, 0x055c},
4724 {0xbb, 0x01, 0x09aa},
4725 {0xbb, 0x00, 0x1001},
4726 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4727 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4728 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4729 {0xa0, 0xc4, ZC3XX_R192_EXPOSURELIMITLOW},
4730 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4731 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4732 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
4733 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4734 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4735 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4736 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4737 {0xa0, 0x5c, ZC3XX_R01D_HSYNC_0},
4738 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4739 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4740 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004741 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004742};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004743static const struct usb_action pb0330_50HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004744 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4745 {0xbb, 0x00, 0x0566},
4746 {0xbb, 0x02, 0x09b2},
4747 {0xbb, 0x00, 0x1002},
4748 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4749 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4750 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4751 {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4752 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4753 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4754 {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4755 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4756 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4757 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4758 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4759 {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4760 {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4761 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4762 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004763 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004764};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004765static const struct usb_action pb0330_60HZ[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004766 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4767 {0xbb, 0x00, 0x0535},
4768 {0xbb, 0x01, 0x0974},
4769 {0xbb, 0x00, 0x1001},
4770 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4771 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4772 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4773 {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
4774 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4775 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4776 {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW},
4777 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4778 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4779 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4780 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4781 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4782 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
4783 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4784 {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004785 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004786};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004787static const struct usb_action pb0330_60HZScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004788 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4789 {0xbb, 0x00, 0x0535},
4790 {0xbb, 0x02, 0x096c},
4791 {0xbb, 0x00, 0x1002},
4792 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4793 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4794 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4795 {0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},
4796 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4797 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4798 {0xa0, 0x7c, ZC3XX_R197_ANTIFLICKERLOW},
4799 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4800 {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4801 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4802 {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4803 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4804 {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
4805 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4806 {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004807 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004808};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004809static const struct usb_action pb0330_NoFliker[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004810 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4811 {0xbb, 0x00, 0x0509},
4812 {0xbb, 0x02, 0x0940},
4813 {0xbb, 0x00, 0x1002},
4814 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4815 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4816 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4817 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4818 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4819 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4820 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4821 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4822 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4823 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4824 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4825 {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
4826 {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
4827 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4828 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004829 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004830};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03004831static const struct usb_action pb0330_NoFlikerScale[] = {
Jean-Francois Moine56205cc2009-11-04 16:38:04 -03004832 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4833 {0xbb, 0x00, 0x0535},
4834 {0xbb, 0x01, 0x0980},
4835 {0xbb, 0x00, 0x1001},
4836 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4837 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4838 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4839 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4840 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4841 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4842 {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4843 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4844 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4845 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4846 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4847 {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4848 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4849 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4850 {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004851 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004852};
4853
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004854/* from oem9.inf */
4855static const struct usb_action po2030_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004856 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4857 {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
4858 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
4859 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4860 {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
4861 {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
4862 {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
4863 {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
4864 {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
4865 {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
4866 {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
4867 {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
4868 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
4869 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4870 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4871 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4872 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4873 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4874 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
4875 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
4876 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
4877 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
4878 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
4879 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
4880 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
4881 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
4882 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004883 {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
4884 {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
4885 {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
4886 {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
4887 {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
4888 {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
4889 {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
4890 {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
4891 {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
4892 {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
4893 {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
4894 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
4895 {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
4896 {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
4897 {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
4898 {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
4899 {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
4900 {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
4901 {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
4902 {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
4903 {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
4904 {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
4905 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4906 {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
4907 {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
4908 {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
4909 {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
4910 {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
4911 {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
4912 {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
4913 {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
4914 {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
4915 {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
4916 {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004917 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
4918 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
4919 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4920 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004921 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004922 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4923 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4924 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4925 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4926 {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
4927 {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004928 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004929};
4930
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03004931/* from oem9.inf */
4932static const struct usb_action po2030_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004933 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4934 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
4935 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
4936 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4937 {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
4938 {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
4939 {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
4940 {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
4941 {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
4942 {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
4943 {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
4944 {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
4945 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
4946 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4947 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4948 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4949 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4950 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4951 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
4952 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
4953 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
4954 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
4955 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
4956 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
4957 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
4958 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
4959 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004960 {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
4961 {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
4962 {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
4963 {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
4964 {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
4965 {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
4966 {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
4967 {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
4968 {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
4969 {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
4970 {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
4971 {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
4972 {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
4973 {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
4974 {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
4975 {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
4976 {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
4977 {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
4978 {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
4979 {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
4980 {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
4981 {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
4982 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4983 {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
4984 {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
4985 {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
4986 {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
4987 {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
4988 {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
4989 {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
4990 {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
4991 {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
4992 {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
4993 {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004994 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
4995 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
4996 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4997 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03004998 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03004999 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
5000 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
5001 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
5002 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
5003 {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
5004 {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005005 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005006};
5007
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005008static const struct usb_action po2030_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005009 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5010 {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
5011 {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
5012 {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005013 {0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
5014 {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
5015 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
5016 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5017 {0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
5018 {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
5019 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5020 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5021 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5022 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5023 {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5024 {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5025 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5026 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005027 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005028};
5029
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005030static const struct usb_action po2030_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005031 {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5032 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5033 {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
5034 {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005035 {0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
5036 {0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
5037 {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
5038 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5039 {0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
5040 {0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
5041 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5042 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5043 {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5044 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5045 {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5046 {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5047 /* win: 01,8d,80 */
5048 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5049 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005050 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005051};
5052
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005053static const struct usb_action po2030_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005054 {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005055 {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
5056 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5057 {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
5058 {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
5059 {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
5060 {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005061 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005062};
5063
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005064static const struct usb_action tas5130c_InitialScale[] = { /* 320x240 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005065 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5066 {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
5067 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5068 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5069 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5070 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5071 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5072 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5073 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005074 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5075 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5076 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5077 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005078
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005079 {0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
5080 {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5081 {0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
5082 {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5083 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
5084 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5085 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
5086 {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5087 {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5088 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5089 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005090 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
Jean-Francois Moine013db752009-10-07 05:24:19 -03005091 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005092 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005093 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5094 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5095 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5096 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005097 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5098 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005099 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005100};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005101static const struct usb_action tas5130c_Initial[] = { /* 640x480 */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005102 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5103 {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005104 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005105 {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5106 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5107 {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5108 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5109 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5110 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005111 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5112 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5113 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5114 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5115 {0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
5116 {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5117 {0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
5118 {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5119 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
5120 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5121 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
5122 {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5123 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5124 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5125 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005126 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
Jean-Francois Moine013db752009-10-07 05:24:19 -03005127 {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005128 {0xa0, 0x00, 0x01ad},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005129 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5130 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5131 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5132 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03005133 {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5134 {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005135 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005136};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005137static const struct usb_action tas5130c_50HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005138 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005139 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5140 {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005141 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5142 {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
5143 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005144 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
5145 {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005146 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5147 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5148 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005149 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5150 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5151 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5152 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005153 {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
5154 {0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
5155 {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
5156 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5157 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005158 {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
5159 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005160 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005161};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005162static const struct usb_action tas5130c_50HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005163 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005164 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5165 {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005166 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5167 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5168 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005169 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5170 {0xa0, 0xd0, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005171 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5172 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5173 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005174 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5175 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5176 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5177 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005178 {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
5179 {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
5180 {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
5181 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5182 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005183 {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
5184 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005185 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005186};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005187static const struct usb_action tas5130c_60HZ[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005188 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005189 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5190 {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005191 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5192 {0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
5193 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005194 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
5195 {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005196 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5197 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5198 {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005199 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5200 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5201 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5202 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005203 {0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
5204 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5205 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5206 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5207 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005208 {0xa0, 0x28, ZC3XX_R0A0_MAXXLOW},
5209 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005210 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005211};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005212static const struct usb_action tas5130c_60HZScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005213 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005214 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5215 {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005216 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5217 {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5218 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005219 {0xa0, 0x09, ZC3XX_R191_EXPOSURELIMITMID},
5220 {0xa0, 0x47, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005221 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5222 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5223 {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005224 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5225 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5226 {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5227 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005228 {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
5229 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5230 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5231 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5232 {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005233 {0xa0, 0x20, ZC3XX_R0A0_MAXXLOW},
5234 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005235 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005236};
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005237static const struct usb_action tas5130c_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005238 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005239 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5240 {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005241 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5242 {0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
5243 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005244 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
5245 {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
5246 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5247 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5248 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
5249 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5250 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005251 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5252 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5253 {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5254 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5255 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5256 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5257 {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005258 {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
5259 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005260 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005261};
5262
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005263static const struct usb_action tas5130c_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005264 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005265 {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5266 {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005267 {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5268 {0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
5269 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005270 {0xa0, 0x0a, ZC3XX_R191_EXPOSURELIMITMID},
5271 {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
5272 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5273 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5274 {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
5275 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5276 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005277 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5278 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5279 {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5280 {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5281 {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5282 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5283 {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
Jean-Francois Moine013db752009-10-07 05:24:19 -03005284 {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
5285 {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005286 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005287};
5288
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005289/* from usbvm305.inf 0ac8:305b 07/06/15 (3 - tas5130c) */
5290static const struct usb_action gc0303_Initial[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005291 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
5292 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
5293 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005294 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005295 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
5296 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
5297 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
5298 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
5299 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
5300 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
5301 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
5302 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
5303 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
5304 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
5305 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
5306 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
5307 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc,
5308 * 6<->8 */
5309 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc,
5310 * 6<->8 */
5311 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
5312 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005313 {0xaa, 0x01, 0x0000},
5314 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
5315 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005316 {0xaa, 0x1b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005317 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
5318 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
5319 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005320 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005321 {0xaa, 0x0a, 0x0002},
5322 {0xaa, 0x0b, 0x0000},
5323 {0xaa, 0x0c, 0x0002},
5324 {0xaa, 0x0d, 0x0000},
5325 {0xaa, 0x0e, 0x0002},
5326 {0xaa, 0x0f, 0x0000},
5327 {0xaa, 0x10, 0x0002},
5328 {0xaa, 0x11, 0x0000},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005329 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
5330 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa, (e6 -> e8) */
5331 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
5332 {0xaa, 0x19, 0x0088}, /* 00,19,86,aa, */
5333 {0xaa, 0x20, 0x0020}, /* 00,20,20,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005334 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
5335 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
5336 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
5337 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
5338 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
5339 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
5340 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
5341 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
5342 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005343 {0xa0, 0x58, ZC3XX_R1A8_DIGITALGAIN},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005344 {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
5345 {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005346 {0xaa, 0x1b, 0x0000},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005347 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005348};
5349
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005350static const struct usb_action gc0303_InitialScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005351 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
5352 {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
5353 {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005354 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005355 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
5356 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
5357 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
5358 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
5359 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
5360 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
5361 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
5362 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
5363 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
5364 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
5365 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
5366 {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
5367 {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc,
5368 * 8<->6 */
5369 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc,
5370 * 8<->6 */
5371 {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
5372 {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005373 {0xaa, 0x01, 0x0000},
5374 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
5375 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005376 {0xaa, 0x1b, 0x0000},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005377 {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
5378 {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
5379 {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005380 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005381 {0xaa, 0x0a, 0x0001},
5382 {0xaa, 0x0b, 0x0000},
5383 {0xaa, 0x0c, 0x0001},
5384 {0xaa, 0x0d, 0x0000},
5385 {0xaa, 0x0e, 0x0001},
5386 {0xaa, 0x0f, 0x0000},
5387 {0xaa, 0x10, 0x0001},
5388 {0xaa, 0x11, 0x0000},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005389 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
5390 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa (e6 -> e8) */
5391 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
5392 {0xaa, 0x19, 0x0088}, /* 00,19,88,aa, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005393 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
5394 {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
5395 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
5396 {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
5397 {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
5398 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
5399 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
5400 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
5401 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005402 {0xa0, 0x58, ZC3XX_R1A8_DIGITALGAIN},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005403 {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
5404 {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005405 {0xaa, 0x1b, 0x0000},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005406 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005407};
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005408static const struct usb_action gc0303_50HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005409 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5410 {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005411 {0xaa, 0x84, 0x0063},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005412 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5413 {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
5414 {0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
5415 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5416 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005417 {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005418 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5419 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5420 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005421 {0xa0, 0x48, ZC3XX_R1AA_DIGITALGAINSTEP},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005422 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5423 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5424 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5425 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5426 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5427 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005428 {0xa0, 0x7f, ZC3XX_R18D_YTARGET},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005429 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005430};
5431
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005432static const struct usb_action gc0303_50HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005433 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5434 {0xaa, 0x83, 0x0003}, /* 00,83,03,aa */
5435 {0xaa, 0x84, 0x0054}, /* 00,84,54,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005436 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5437 {0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
5438 {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
5439 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5440 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5441 {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc, */
5442 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5443 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5444 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005445 {0xa0, 0x48, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005446 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5447 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5448 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5449 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5450 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5451 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005452 {0xa0, 0x7f, ZC3XX_R18D_YTARGET},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005453 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005454};
5455
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005456static const struct usb_action gc0303_60HZ[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005457 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005458 {0xaa, 0x83, 0x0000},
5459 {0xaa, 0x84, 0x003b},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005460 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5461 {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,05,cc, */
5462 {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,88,cc, */
5463 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5464 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5465 {0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3b,cc, */
5466 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5467 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5468 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
5469 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
5470 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5471 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5472 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5473 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5474 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5475 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005476 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005477 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005478};
5479
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005480static const struct usb_action gc0303_60HZScale[] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005481 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005482 {0xaa, 0x83, 0x0000},
5483 {0xaa, 0x84, 0x0076},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005484 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
5485 {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,1,0b,cc, */
5486 {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,2,10,cc, */
5487 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,5,00,cc, */
5488 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,6,00,cc, */
5489 {0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,7,76,cc, */
5490 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,c,0e,cc, */
5491 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,f,15,cc, */
5492 {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,9,10,cc, */
5493 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,a,24,cc, */
5494 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,d,62,cc, */
5495 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,e,90,cc, */
5496 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,f,c8,cc, */
5497 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,0,ff,cc, */
5498 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,d,58,cc, */
5499 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005500 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005501 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005502};
5503
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005504static const struct usb_action gc0303_NoFliker[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005505 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005506 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5507 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
5508 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005509 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,0,00,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005510 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
5511 {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005512 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5513 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5514 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
5515 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5516 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5517 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5518 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5519 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5520 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5521 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5522 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005523 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005524};
5525
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005526static const struct usb_action gc0303_NoFlikerScale[] = {
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005527 {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005528 {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
5529 {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
5530 {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005531 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005532 {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
5533 {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},
Mauro Carvalho Chehab9a97a2a2008-07-15 14:23:08 -03005534 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
5535 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
5536 {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
5537 {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
5538 {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
5539 {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
5540 {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
5541 {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
5542 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
5543 {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
5544 {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005545 {}
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005546};
5547
Jean-François Moine1b3b2122012-02-27 07:51:09 -03005548static u8 reg_r(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005549 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005550{
Jean-François Moine6d314502010-08-04 05:44:13 -03005551 int ret;
5552
5553 if (gspca_dev->usb_err < 0)
5554 return 0;
5555 ret = usb_control_msg(gspca_dev->dev,
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005556 usb_rcvctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005557 0xa1,
5558 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
5559 0x01, /* value */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005560 index, gspca_dev->usb_buf, 1,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005561 500);
Jean-François Moine6d314502010-08-04 05:44:13 -03005562 if (ret < 0) {
Jean-François Moine1b3b2122012-02-27 07:51:09 -03005563 pr_err("reg_r err %d\n", ret);
Jean-François Moine6d314502010-08-04 05:44:13 -03005564 gspca_dev->usb_err = ret;
5565 return 0;
5566 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005567 return gspca_dev->usb_buf[0];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005568}
5569
Jean-François Moine1b3b2122012-02-27 07:51:09 -03005570static void reg_w(struct gspca_dev *gspca_dev,
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005571 u8 value,
5572 u16 index)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005573{
Jean-François Moine6d314502010-08-04 05:44:13 -03005574 int ret;
5575
5576 if (gspca_dev->usb_err < 0)
5577 return;
5578 ret = usb_control_msg(gspca_dev->dev,
5579 usb_sndctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005580 0xa0,
5581 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
5582 value, index, NULL, 0,
5583 500);
Jean-François Moine6d314502010-08-04 05:44:13 -03005584 if (ret < 0) {
Joe Perches133a9fe2011-08-21 19:56:57 -03005585 pr_err("reg_w_i err %d\n", ret);
Jean-François Moine6d314502010-08-04 05:44:13 -03005586 gspca_dev->usb_err = ret;
5587 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005588}
5589
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005590static u16 i2c_read(struct gspca_dev *gspca_dev,
5591 u8 reg)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005592{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005593 u8 retbyte;
5594 u16 retval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005595
Jean-François Moine6d314502010-08-04 05:44:13 -03005596 if (gspca_dev->usb_err < 0)
5597 return 0;
Jean-François Moine1b3b2122012-02-27 07:51:09 -03005598 reg_w(gspca_dev, reg, 0x0092);
5599 reg_w(gspca_dev, 0x02, 0x0090); /* <- read command */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005600 msleep(20);
Jean-François Moine1b3b2122012-02-27 07:51:09 -03005601 retbyte = reg_r(gspca_dev, 0x0091); /* read status */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005602 if (retbyte != 0x00)
Joe Perches133a9fe2011-08-21 19:56:57 -03005603 pr_err("i2c_r status error %02x\n", retbyte);
Jean-François Moine1b3b2122012-02-27 07:51:09 -03005604 retval = reg_r(gspca_dev, 0x0095); /* read Lowbyte */
5605 retval |= reg_r(gspca_dev, 0x0096) << 8; /* read Hightbyte */
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03005606 return retval;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005607}
5608
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005609static u8 i2c_write(struct gspca_dev *gspca_dev,
5610 u8 reg,
5611 u8 valL,
5612 u8 valH)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005613{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005614 u8 retbyte;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005615
Jean-François Moine6d314502010-08-04 05:44:13 -03005616 if (gspca_dev->usb_err < 0)
5617 return 0;
Jean-François Moine1b3b2122012-02-27 07:51:09 -03005618 reg_w(gspca_dev, reg, 0x92);
5619 reg_w(gspca_dev, valL, 0x93);
5620 reg_w(gspca_dev, valH, 0x94);
5621 reg_w(gspca_dev, 0x01, 0x90); /* <- write command */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005622 msleep(1);
Jean-François Moine1b3b2122012-02-27 07:51:09 -03005623 retbyte = reg_r(gspca_dev, 0x0091); /* read status */
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005624 if (retbyte != 0x00)
Joe Perches133a9fe2011-08-21 19:56:57 -03005625 pr_err("i2c_w status error %02x\n", retbyte);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005626 return retbyte;
5627}
5628
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005629static void usb_exchange(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005630 const struct usb_action *action)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005631{
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005632 while (action->req) {
5633 switch (action->req) {
5634 case 0xa0: /* write register */
Jean-François Moine6d314502010-08-04 05:44:13 -03005635 reg_w(gspca_dev, action->val, action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005636 break;
5637 case 0xa1: /* read status */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005638 reg_r(gspca_dev, action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005639 break;
5640 case 0xaa:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005641 i2c_write(gspca_dev,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005642 action->val, /* reg */
5643 action->idx & 0xff, /* valL */
5644 action->idx >> 8); /* valH */
5645 break;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03005646 case 0xbb:
5647 i2c_write(gspca_dev,
5648 action->idx >> 8, /* reg */
5649 action->idx & 0xff, /* valL */
5650 action->val); /* valH */
5651 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005652 default:
5653/* case 0xdd: * delay */
Jean-François Moine7c45f2c2011-01-24 15:15:34 -03005654 msleep(action->idx);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005655 break;
5656 }
5657 action++;
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03005658 msleep(1);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005659 }
5660}
5661
5662static void setmatrix(struct gspca_dev *gspca_dev)
5663{
5664 struct sd *sd = (struct sd *) gspca_dev;
5665 int i;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005666 const u8 *matrix;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03005667 static const u8 adcm2700_matrix[9] =
Jean-Francois Moinec675e792009-01-26 05:29:06 -03005668/* {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; */
5669/*ms-win*/
5670 {0x74, 0xed, 0xed, 0xed, 0x74, 0xed, 0xed, 0xed, 0x74};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005671 static const u8 gc0305_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005672 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005673 static const u8 ov7620_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005674 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005675 static const u8 pas202b_matrix[9] =
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03005676 {0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005677 static const u8 po2030_matrix[9] =
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005678 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
Jean-Francois Moine013db752009-10-07 05:24:19 -03005679 static const u8 tas5130c_matrix[9] =
5680 {0x68, 0xec, 0xec, 0xec, 0x68, 0xec, 0xec, 0xec, 0x68};
Jean-François Moine7fbee992010-12-28 07:17:40 -03005681 static const u8 gc0303_matrix[9] =
Jean-François Moine885f3ca2011-11-30 06:48:38 -03005682 {0x6c, 0xea, 0xea, 0xea, 0x6c, 0xea, 0xea, 0xea, 0x6c};
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005683 static const u8 *matrix_tb[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005684 [SENSOR_ADCM2700] = adcm2700_matrix,
5685 [SENSOR_CS2102] = ov7620_matrix,
5686 [SENSOR_CS2102K] = NULL,
Jean-François Moine7fbee992010-12-28 07:17:40 -03005687 [SENSOR_GC0303] = gc0303_matrix,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005688 [SENSOR_GC0305] = gc0305_matrix,
Jean-François Moine4e5144e2011-02-26 13:56:20 -03005689 [SENSOR_HDCS2020] = NULL,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005690 [SENSOR_HV7131B] = NULL,
Jean-François Moine3d244062011-01-24 16:22:11 -03005691 [SENSOR_HV7131R] = po2030_matrix,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005692 [SENSOR_ICM105A] = po2030_matrix,
5693 [SENSOR_MC501CB] = NULL,
Jean-François Moinea484dd92010-08-04 07:25:12 -03005694 [SENSOR_MT9V111_1] = gc0305_matrix,
5695 [SENSOR_MT9V111_3] = gc0305_matrix,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005696 [SENSOR_OV7620] = ov7620_matrix,
5697 [SENSOR_OV7630C] = NULL,
5698 [SENSOR_PAS106] = NULL,
5699 [SENSOR_PAS202B] = pas202b_matrix,
5700 [SENSOR_PB0330] = gc0305_matrix,
5701 [SENSOR_PO2030] = po2030_matrix,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005702 [SENSOR_TAS5130C] = tas5130c_matrix,
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03005703 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005704
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03005705 matrix = matrix_tb[sd->sensor];
5706 if (matrix == NULL)
5707 return; /* matrix already loaded */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005708 for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
Jean-François Moine6d314502010-08-04 05:44:13 -03005709 reg_w(gspca_dev, matrix[i], 0x010a + i);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005710}
5711
Hans Verkuilc06ba282012-05-06 09:28:28 -03005712static void setsharpness(struct gspca_dev *gspca_dev, s32 val)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005713{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005714 static const u8 sharpness_tb[][2] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005715 {0x02, 0x03},
5716 {0x04, 0x07},
5717 {0x08, 0x0f},
5718 {0x10, 0x1e}
5719 };
5720
Hans Verkuilc06ba282012-05-06 09:28:28 -03005721 reg_w(gspca_dev, sharpness_tb[val][0], 0x01c6);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03005722 reg_r(gspca_dev, 0x01c8);
5723 reg_r(gspca_dev, 0x01c9);
5724 reg_r(gspca_dev, 0x01ca);
Hans Verkuilc06ba282012-05-06 09:28:28 -03005725 reg_w(gspca_dev, sharpness_tb[val][1], 0x01cb);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005726}
5727
Hans Verkuilc06ba282012-05-06 09:28:28 -03005728static void setcontrast(struct gspca_dev *gspca_dev,
5729 s32 gamma, s32 brightness, s32 contrast)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005730{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005731 const u8 *Tgamma;
Hans Verkuilc06ba282012-05-06 09:28:28 -03005732 int g, i, adj, gp1, gp2;
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005733 u8 gr[16];
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005734 static const u8 delta_b[16] = /* delta for brightness */
5735 {0x50, 0x38, 0x2d, 0x28, 0x24, 0x21, 0x1e, 0x1d,
5736 0x1d, 0x1b, 0x1b, 0x1b, 0x19, 0x18, 0x18, 0x18};
5737 static const u8 delta_c[16] = /* delta for contrast */
Jean-François Moinea8567532010-04-25 15:25:42 -03005738 {0x2c, 0x1a, 0x12, 0x0c, 0x0a, 0x06, 0x06, 0x06,
5739 0x04, 0x06, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02};
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005740 static const u8 gamma_tb[6][16] = {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005741 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005742 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005743 {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005744 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005745 {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005746 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005747 {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005748 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005749 {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005750 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005751 {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005752 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005753 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005754
Hans Verkuilc06ba282012-05-06 09:28:28 -03005755 Tgamma = gamma_tb[gamma - 1];
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005756
Hans Verkuilc06ba282012-05-06 09:28:28 -03005757 contrast -= 128; /* -128 / 127 */
5758 brightness -= 128; /* -128 / 92 */
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005759 adj = 0;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005760 gp1 = gp2 = 0;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005761 for (i = 0; i < 16; i++) {
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005762 g = Tgamma[i] + delta_b[i] * brightness / 256
5763 - delta_c[i] * contrast / 256 - adj / 2;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005764 if (g > 0xff)
5765 g = 0xff;
Jean-François Moinea8567532010-04-25 15:25:42 -03005766 else if (g < 0)
5767 g = 0;
Jean-François Moine6d314502010-08-04 05:44:13 -03005768 reg_w(gspca_dev, g, 0x0120 + i); /* gamma */
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005769 if (contrast > 0)
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005770 adj--;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005771 else if (contrast < 0)
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005772 adj++;
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005773 if (i > 1)
5774 gr[i - 1] = (g - gp2) / 2;
5775 else if (i != 0)
5776 gr[0] = gp1 == 0 ? 0 : (g - gp1);
5777 gp2 = gp1;
5778 gp1 = g;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005779 }
Jean-François Moinea9dfc012010-06-04 06:21:48 -03005780 gr[15] = (0xff - gp2) / 2;
Jean-Francois Moinefd180462010-01-04 15:54:59 -03005781 for (i = 0; i < 16; i++)
Jean-François Moine6d314502010-08-04 05:44:13 -03005782 reg_w(gspca_dev, gr[i], 0x0130 + i); /* gradient */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005783}
5784
Hans Verkuilc06ba282012-05-06 09:28:28 -03005785static s32 getexposure(struct gspca_dev *gspca_dev)
Jean-François Moine590f2162011-03-22 06:47:56 -03005786{
Hans Verkuilc06ba282012-05-06 09:28:28 -03005787 return (i2c_read(gspca_dev, 0x25) << 9)
Jean-François Moine590f2162011-03-22 06:47:56 -03005788 | (i2c_read(gspca_dev, 0x26) << 1)
5789 | (i2c_read(gspca_dev, 0x27) >> 7);
5790}
5791
Hans Verkuilc06ba282012-05-06 09:28:28 -03005792static void setexposure(struct gspca_dev *gspca_dev, s32 val)
Jean-François Moine590f2162011-03-22 06:47:56 -03005793{
Jean-François Moine590f2162011-03-22 06:47:56 -03005794 i2c_write(gspca_dev, 0x25, val >> 9, 0x00);
5795 i2c_write(gspca_dev, 0x26, val >> 1, 0x00);
5796 i2c_write(gspca_dev, 0x27, val << 7, 0x00);
5797}
5798
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005799static void setquality(struct gspca_dev *gspca_dev)
5800{
5801 struct sd *sd = (struct sd *) gspca_dev;
Hans de Goede83fb2e22012-05-06 09:28:24 -03005802 jpeg_set_qual(sd->jpeg_hdr, jpeg_qual[sd->reg08 >> 1]);
Jean-François Moine30c73d42012-02-27 07:26:30 -03005803 reg_w(gspca_dev, sd->reg08, ZC3XX_R008_CLOCKSETTING);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005804}
5805
5806/* Matches the sensor's internal frame rate to the lighting frequency.
5807 * Valid frequencies are:
5808 * 50Hz, for European and Asian lighting (default)
5809 * 60Hz, for American lighting
5810 * 0 = No Fliker (for outdoore usage)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005811 */
Hans Verkuilc06ba282012-05-06 09:28:28 -03005812static void setlightfreq(struct gspca_dev *gspca_dev, s32 val)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005813{
5814 struct sd *sd = (struct sd *) gspca_dev;
5815 int i, mode;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03005816 const struct usb_action *zc3_freq;
5817 static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005818 [SENSOR_ADCM2700] =
Jean-Francois Moinec314b532009-01-20 10:02:35 -03005819 {adcm2700_NoFliker, adcm2700_NoFliker,
5820 adcm2700_50HZ, adcm2700_50HZ,
5821 adcm2700_60HZ, adcm2700_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005822 [SENSOR_CS2102] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005823 {cs2102_NoFliker, cs2102_NoFlikerScale,
5824 cs2102_50HZ, cs2102_50HZScale,
5825 cs2102_60HZ, cs2102_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005826 [SENSOR_CS2102K] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005827 {cs2102_NoFliker, cs2102_NoFlikerScale,
Costantino Leandro5be8b73e2008-09-09 04:32:46 -03005828 NULL, NULL, /* currently disabled */
5829 NULL, NULL},
Jean-François Moine7fbee992010-12-28 07:17:40 -03005830 [SENSOR_GC0303] =
5831 {gc0303_NoFliker, gc0303_NoFlikerScale,
5832 gc0303_50HZ, gc0303_50HZScale,
5833 gc0303_60HZ, gc0303_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005834 [SENSOR_GC0305] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005835 {gc0305_NoFliker, gc0305_NoFliker,
5836 gc0305_50HZ, gc0305_50HZ,
5837 gc0305_60HZ, gc0305_60HZ},
Jean-François Moine4e5144e2011-02-26 13:56:20 -03005838 [SENSOR_HDCS2020] =
5839 {hdcs2020_NoFliker, hdcs2020_NoFliker,
5840 hdcs2020_50HZ, hdcs2020_50HZ,
5841 hdcs2020_60HZ, hdcs2020_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005842 [SENSOR_HV7131B] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005843 {hv7131b_NoFliker, hv7131b_NoFlikerScale,
5844 hv7131b_50HZ, hv7131b_50HZScale,
5845 hv7131b_60HZ, hv7131b_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005846 [SENSOR_HV7131R] =
Jean-François Moine2af0b4c2010-08-04 07:12:57 -03005847 {hv7131r_NoFliker, hv7131r_NoFlikerScale,
5848 hv7131r_50HZ, hv7131r_50HZScale,
5849 hv7131r_60HZ, hv7131r_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005850 [SENSOR_ICM105A] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005851 {icm105a_NoFliker, icm105a_NoFlikerScale,
5852 icm105a_50HZ, icm105a_50HZScale,
5853 icm105a_60HZ, icm105a_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005854 [SENSOR_MC501CB] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005855 {mc501cb_NoFliker, mc501cb_NoFlikerScale,
5856 mc501cb_50HZ, mc501cb_50HZScale,
5857 mc501cb_60HZ, mc501cb_60HZScale},
Jean-François Moinea484dd92010-08-04 07:25:12 -03005858 [SENSOR_MT9V111_1] =
5859 {mt9v111_1_AENoFliker, mt9v111_1_AENoFlikerScale,
5860 mt9v111_1_AE50HZ, mt9v111_1_AE50HZScale,
5861 mt9v111_1_AE60HZ, mt9v111_1_AE60HZScale},
5862 [SENSOR_MT9V111_3] =
5863 {mt9v111_3_AENoFliker, mt9v111_3_AENoFlikerScale,
5864 mt9v111_3_AE50HZ, mt9v111_3_AE50HZScale,
5865 mt9v111_3_AE60HZ, mt9v111_3_AE60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005866 [SENSOR_OV7620] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005867 {ov7620_NoFliker, ov7620_NoFliker,
5868 ov7620_50HZ, ov7620_50HZ,
5869 ov7620_60HZ, ov7620_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005870 [SENSOR_OV7630C] =
Harvey Harrisonefab8212008-07-05 06:12:47 -03005871 {NULL, NULL,
5872 NULL, NULL,
5873 NULL, NULL},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005874 [SENSOR_PAS106] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03005875 {pas106b_NoFliker, pas106b_NoFliker,
5876 pas106b_50HZ, pas106b_50HZ,
5877 pas106b_60HZ, pas106b_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005878 [SENSOR_PAS202B] =
Jean-François Moinea6a86f0d2010-04-25 14:57:10 -03005879 {pas202b_NoFliker, pas202b_NoFlikerScale,
5880 pas202b_50HZ, pas202b_50HZScale,
5881 pas202b_60HZ, pas202b_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005882 [SENSOR_PB0330] =
Jean-François Moinea6a86f0d2010-04-25 14:57:10 -03005883 {pb0330_NoFliker, pb0330_NoFlikerScale,
5884 pb0330_50HZ, pb0330_50HZScale,
5885 pb0330_60HZ, pb0330_60HZScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005886 [SENSOR_PO2030] =
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005887 {po2030_NoFliker, po2030_NoFliker,
5888 po2030_50HZ, po2030_50HZ,
5889 po2030_60HZ, po2030_60HZ},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005890 [SENSOR_TAS5130C] =
5891 {tas5130c_NoFliker, tas5130c_NoFlikerScale,
5892 tas5130c_50HZ, tas5130c_50HZScale,
5893 tas5130c_60HZ, tas5130c_60HZScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005894 };
5895
Hans Verkuilc06ba282012-05-06 09:28:28 -03005896 i = val * 2;
Jean-François Moine49fb5e62010-12-28 07:09:34 -03005897 mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
Jean-Francois Moine1cb6d7b12010-01-08 07:06:06 -03005898 if (mode)
5899 i++; /* 320x240 */
Jean-Francois Moine47c833922010-01-07 15:59:12 -03005900 zc3_freq = freq_tb[sd->sensor][i];
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005901 if (zc3_freq == NULL)
Jean-François Moine6d314502010-08-04 05:44:13 -03005902 return;
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005903 usb_exchange(gspca_dev, zc3_freq);
5904 switch (sd->sensor) {
5905 case SENSOR_GC0305:
Hans Verkuilc06ba282012-05-06 09:28:28 -03005906 if (mode /* if 320x240 */
5907 && val == 1) /* and 50Hz */
Jean-François Moine6d314502010-08-04 05:44:13 -03005908 reg_w(gspca_dev, 0x85, 0x018d);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005909 /* win: 0x80, 0x018d */
5910 break;
5911 case SENSOR_OV7620:
Hans Verkuilc06ba282012-05-06 09:28:28 -03005912 if (!mode) { /* if 640x480 */
5913 if (val != 0) /* and filter */
Jean-François Moine6d314502010-08-04 05:44:13 -03005914 reg_w(gspca_dev, 0x40, 0x0002);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005915 else
Jean-François Moine6d314502010-08-04 05:44:13 -03005916 reg_w(gspca_dev, 0x44, 0x0002);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005917 }
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005918 break;
5919 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03005920 reg_w(gspca_dev, 0x00, 0x01a7);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03005921 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005922 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005923}
5924
Hans Verkuilc06ba282012-05-06 09:28:28 -03005925static void setautogain(struct gspca_dev *gspca_dev, s32 val)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005926{
Hans Verkuilc06ba282012-05-06 09:28:28 -03005927 reg_w(gspca_dev, val ? 0x42 : 0x02, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03005928}
5929
Hans de Goede55db7652012-05-06 09:28:25 -03005930/*
5931 * Update the transfer parameters.
5932 * This function is executed from a work queue.
5933 */
Jean-François Moinef1801902012-02-27 07:48:32 -03005934static void transfer_update(struct work_struct *work)
5935{
5936 struct sd *sd = container_of(work, struct sd, work);
5937 struct gspca_dev *gspca_dev = &sd->gspca_dev;
5938 int change, good;
Hans de Goede55db7652012-05-06 09:28:25 -03005939 u8 reg07, reg11;
Jean-François Moinef1801902012-02-27 07:48:32 -03005940
Hans de Goede55db7652012-05-06 09:28:25 -03005941 /* reg07 gets set to 0 by sd_start before starting us */
5942 reg07 = 0;
Jean-François Moinef1801902012-02-27 07:48:32 -03005943
5944 good = 0;
5945 for (;;) {
5946 msleep(100);
5947
Hans de Goede844db452012-09-09 07:30:02 -03005948 /* To protect gspca_dev->usb_buf and gspca_dev->usb_err */
Jean-François Moinef1801902012-02-27 07:48:32 -03005949 mutex_lock(&gspca_dev->usb_lock);
Hans Verkuil4ad34da2012-05-18 08:40:42 -03005950#ifdef CONFIG_PM
5951 if (gspca_dev->frozen)
5952 goto err;
5953#endif
Hans de Goede345321d2012-09-09 06:30:02 -03005954 if (!gspca_dev->present || !gspca_dev->streaming)
Jean-François Moinef1801902012-02-27 07:48:32 -03005955 goto err;
Hans de Goede55db7652012-05-06 09:28:25 -03005956
5957 /* Bit 0 of register 11 indicates FIFO overflow */
5958 gspca_dev->usb_err = 0;
Jean-François Moinef1801902012-02-27 07:48:32 -03005959 reg11 = reg_r(gspca_dev, 0x0011);
Hans de Goede55db7652012-05-06 09:28:25 -03005960 if (gspca_dev->usb_err)
Jean-François Moinef1801902012-02-27 07:48:32 -03005961 goto err;
5962
5963 change = reg11 & 0x01;
5964 if (change) { /* overflow */
Jean-François Moinef1801902012-02-27 07:48:32 -03005965 good = 0;
Hans de Goede55db7652012-05-06 09:28:25 -03005966
5967 if (reg07 == 0) /* Bit Rate Control not enabled? */
5968 reg07 = 0x32; /* Allow 98 bytes / unit */
5969 else if (reg07 > 2)
5970 reg07 -= 2; /* Decrease allowed bytes / unit */
5971 else
5972 change = 0;
Jean-François Moinef1801902012-02-27 07:48:32 -03005973 } else { /* no overflow */
Hans de Goede55db7652012-05-06 09:28:25 -03005974 good++;
5975 if (good >= 10) {
5976 good = 0;
5977 if (reg07) { /* BRC enabled? */
Jean-François Moinef1801902012-02-27 07:48:32 -03005978 change = 1;
Hans de Goede55db7652012-05-06 09:28:25 -03005979 if (reg07 < 0x32)
5980 reg07 += 2;
5981 else
Jean-François Moinef1801902012-02-27 07:48:32 -03005982 reg07 = 0;
Jean-François Moinef1801902012-02-27 07:48:32 -03005983 }
5984 }
5985 }
5986 if (change) {
Hans de Goede55db7652012-05-06 09:28:25 -03005987 gspca_dev->usb_err = 0;
5988 reg_w(gspca_dev, reg07, 0x0007);
5989 if (gspca_dev->usb_err)
5990 goto err;
Jean-François Moinef1801902012-02-27 07:48:32 -03005991 }
5992 mutex_unlock(&gspca_dev->usb_lock);
5993 }
5994 return;
5995err:
5996 mutex_unlock(&gspca_dev->usb_lock);
5997}
5998
Jean-François Moine6d314502010-08-04 05:44:13 -03005999static void send_unknown(struct gspca_dev *gspca_dev, int sensor)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006000{
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006001 reg_w(gspca_dev, 0x01, 0x0000); /* bridge reset */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006002 switch (sensor) {
6003 case SENSOR_PAS106:
Jean-François Moine6d314502010-08-04 05:44:13 -03006004 reg_w(gspca_dev, 0x03, 0x003a);
6005 reg_w(gspca_dev, 0x0c, 0x003b);
6006 reg_w(gspca_dev, 0x08, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006007 break;
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006008 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006009 case SENSOR_GC0305:
6010 case SENSOR_OV7620:
Jean-François Moinea484dd92010-08-04 07:25:12 -03006011 case SENSOR_MT9V111_1:
6012 case SENSOR_MT9V111_3:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006013 case SENSOR_PB0330:
6014 case SENSOR_PO2030:
Jean-François Moine6d314502010-08-04 05:44:13 -03006015 reg_w(gspca_dev, 0x0d, 0x003a);
6016 reg_w(gspca_dev, 0x02, 0x003b);
6017 reg_w(gspca_dev, 0x00, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006018 break;
Jean-François Moine3d244062011-01-24 16:22:11 -03006019 case SENSOR_HV7131R:
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006020 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03006021 reg_w(gspca_dev, 0x03, 0x003b);
6022 reg_w(gspca_dev, 0x0c, 0x003a);
6023 reg_w(gspca_dev, 0x0b, 0x0039);
Jean-François Moine3d244062011-01-24 16:22:11 -03006024 if (sensor == SENSOR_PAS202B)
6025 reg_w(gspca_dev, 0x0b, 0x0038);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006026 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006027 }
6028}
6029
6030/* start probe 2 wires */
Jean-François Moine6d314502010-08-04 05:44:13 -03006031static void start_2wr_probe(struct gspca_dev *gspca_dev, int sensor)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006032{
Jean-François Moine6d314502010-08-04 05:44:13 -03006033 reg_w(gspca_dev, 0x01, 0x0000);
6034 reg_w(gspca_dev, sensor, 0x0010);
6035 reg_w(gspca_dev, 0x01, 0x0001);
6036 reg_w(gspca_dev, 0x03, 0x0012);
6037 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006038/* msleep(2); */
6039}
6040
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006041static int sif_probe(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006042{
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006043 u16 checkword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006044
Jean-François Moine6d314502010-08-04 05:44:13 -03006045 start_2wr_probe(gspca_dev, 0x0f); /* PAS106 */
6046 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006047 msleep(150);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006048 checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
6049 | ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006050 PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
6051 if (checkword == 0x0007) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006052 send_unknown(gspca_dev, SENSOR_PAS106);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006053 return 0x0f; /* PAS106 */
6054 }
6055 return -1;
6056}
6057
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006058static int vga_2wr_probe(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006059{
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006060 u16 retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006061
Jean-François Moine6d314502010-08-04 05:44:13 -03006062 start_2wr_probe(gspca_dev, 0x00); /* HV7131B */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006063 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006064 retword = i2c_read(gspca_dev, 0x01);
6065 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006066 return 0x00; /* HV7131B */
6067
Jean-François Moine6d314502010-08-04 05:44:13 -03006068 start_2wr_probe(gspca_dev, 0x04); /* CS2102 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006069 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006070 retword = i2c_read(gspca_dev, 0x01);
6071 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006072 return 0x04; /* CS2102 */
6073
Jean-François Moine6d314502010-08-04 05:44:13 -03006074 start_2wr_probe(gspca_dev, 0x06); /* OmniVision */
6075 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006076 i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006077 retword = i2c_read(gspca_dev, 0x11);
6078 if (retword != 0) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006079 /* (should have returned 0xaa) --> Omnivision? */
6080 /* reg_r 0x10 -> 0x06 --> */
6081 goto ov_check;
6082 }
6083
Jean-François Moine6d314502010-08-04 05:44:13 -03006084 start_2wr_probe(gspca_dev, 0x08); /* HDCS2020 */
Jean-Francois Moine1eed40a2010-01-08 08:01:43 -03006085 i2c_write(gspca_dev, 0x1c, 0x00, 0x00);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006086 i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006087 retword = i2c_read(gspca_dev, 0x15);
6088 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006089 return 0x08; /* HDCS2020 */
6090
Jean-François Moine6d314502010-08-04 05:44:13 -03006091 start_2wr_probe(gspca_dev, 0x0a); /* PB0330 */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006092 i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006093 retword = i2c_read(gspca_dev, 0x07);
6094 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006095 return 0x0a; /* PB0330 */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006096 retword = i2c_read(gspca_dev, 0x03);
6097 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006098 return 0x0a; /* PB0330 ?? */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006099 retword = i2c_read(gspca_dev, 0x04);
6100 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006101 return 0x0a; /* PB0330 ?? */
6102
Jean-François Moine6d314502010-08-04 05:44:13 -03006103 start_2wr_probe(gspca_dev, 0x0c); /* ICM105A */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006104 i2c_write(gspca_dev, 0x01, 0x11, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006105 retword = i2c_read(gspca_dev, 0x01);
6106 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006107 return 0x0c; /* ICM105A */
6108
Jean-François Moine6d314502010-08-04 05:44:13 -03006109 start_2wr_probe(gspca_dev, 0x0e); /* PAS202BCB */
6110 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006111 i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
Jean-Francois Moine721ecbc2009-10-20 05:25:16 -03006112 msleep(50);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006113 retword = i2c_read(gspca_dev, 0x03);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006114 if (retword != 0) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006115 send_unknown(gspca_dev, SENSOR_PAS202B);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006116 return 0x0e; /* PAS202BCB */
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006117 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006118
Jean-François Moine6d314502010-08-04 05:44:13 -03006119 start_2wr_probe(gspca_dev, 0x02); /* TAS5130C */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006120 i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006121 retword = i2c_read(gspca_dev, 0x01);
6122 if (retword != 0)
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006123 return 0x02; /* TAS5130C */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006124ov_check:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006125 reg_r(gspca_dev, 0x0010); /* ?? */
6126 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006127
Jean-François Moine6d314502010-08-04 05:44:13 -03006128 reg_w(gspca_dev, 0x01, 0x0000);
6129 reg_w(gspca_dev, 0x01, 0x0001);
6130 reg_w(gspca_dev, 0x06, 0x0010); /* OmniVision */
6131 reg_w(gspca_dev, 0xa1, 0x008b);
6132 reg_w(gspca_dev, 0x08, 0x008d);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006133 msleep(500);
Jean-François Moine6d314502010-08-04 05:44:13 -03006134 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006135 i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006136 retword = i2c_read(gspca_dev, 0x0a) << 8;
6137 retword |= i2c_read(gspca_dev, 0x0b);
6138 PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", retword);
6139 switch (retword) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006140 case 0x7631: /* OV7630C */
Jean-François Moine6d314502010-08-04 05:44:13 -03006141 reg_w(gspca_dev, 0x06, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006142 break;
6143 case 0x7620: /* OV7620 */
6144 case 0x7648: /* OV7648 */
6145 break;
6146 default:
6147 return -1; /* not OmniVision */
6148 }
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006149 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006150}
6151
6152struct sensor_by_chipset_revision {
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006153 u16 revision;
6154 u8 internal_sensor_id;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006155};
6156static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
Jean-Francois Moine013db752009-10-07 05:24:19 -03006157 {0xc000, 0x12}, /* TAS5130C */
Jean-François Moinea484dd92010-08-04 07:25:12 -03006158 {0xc001, 0x13}, /* MT9V111 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006159 {0xe001, 0x13},
6160 {0x8001, 0x13},
6161 {0x8000, 0x14}, /* CS2102K */
Jean-François Moinea484dd92010-08-04 07:25:12 -03006162 {0x8400, 0x15}, /* MT9V111 */
Luis Maia658604e2009-12-15 13:40:44 -03006163 {0xe400, 0x15},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006164};
6165
6166static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6167{
6168 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006169 int i;
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006170 u16 retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006171
6172/*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 -03006173 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006174 reg_r(gspca_dev, 0x0010);
Jean-François Moine6d314502010-08-04 05:44:13 -03006175 reg_w(gspca_dev, 0x01, 0x0000);
6176 reg_w(gspca_dev, 0x00, 0x0010);
6177 reg_w(gspca_dev, 0x01, 0x0001);
6178 reg_w(gspca_dev, 0x91, 0x008b);
6179 reg_w(gspca_dev, 0x03, 0x0012);
6180 reg_w(gspca_dev, 0x01, 0x0012);
6181 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006182 retword = i2c_read(gspca_dev, 0x14);
6183 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006184 return 0x11; /* HV7131R */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006185 retword = i2c_read(gspca_dev, 0x15);
6186 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006187 return 0x11; /* HV7131R */
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006188 retword = i2c_read(gspca_dev, 0x16);
6189 if (retword != 0)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006190 return 0x11; /* HV7131R */
6191
Jean-François Moine6d314502010-08-04 05:44:13 -03006192 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006193 retword = reg_r(gspca_dev, 0x000b) << 8;
6194 retword |= reg_r(gspca_dev, 0x000a);
6195 PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006196 reg_r(gspca_dev, 0x0010);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006197 if ((retword & 0xff00) == 0x6400)
6198 return 0x02; /* TAS5130C */
6199 for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6200 if (chipset_revision_sensor[i].revision == retword) {
6201 sd->chip_revision = retword;
Jean-François Moine6d314502010-08-04 05:44:13 -03006202 send_unknown(gspca_dev, SENSOR_PB0330);
Jean-François Moine780e3122010-10-19 04:29:10 -03006203 return chipset_revision_sensor[i].internal_sensor_id;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006204 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006205 }
6206
Jean-François Moine6d314502010-08-04 05:44:13 -03006207 reg_w(gspca_dev, 0x01, 0x0000); /* check PB0330 */
6208 reg_w(gspca_dev, 0x01, 0x0001);
6209 reg_w(gspca_dev, 0xdd, 0x008b);
6210 reg_w(gspca_dev, 0x0a, 0x0010);
6211 reg_w(gspca_dev, 0x03, 0x0012);
6212 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006213 retword = i2c_read(gspca_dev, 0x00);
6214 if (retword != 0) {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006215 PDEBUG(D_PROBE, "probe 3wr vga type 0a");
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006216 return 0x0a; /* PB0330 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006217 }
6218
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006219 /* probe gc0303 / gc0305 */
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, 0x98, 0x008b);
6223 reg_w(gspca_dev, 0x01, 0x0010);
6224 reg_w(gspca_dev, 0x03, 0x0012);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006225 msleep(2);
Jean-François Moine6d314502010-08-04 05:44:13 -03006226 reg_w(gspca_dev, 0x01, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006227 retword = i2c_read(gspca_dev, 0x00);
6228 if (retword != 0) {
6229 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retword);
Jean-François Moine7fbee992010-12-28 07:17:40 -03006230 if (retword == 0x0011) /* gc0303 */
6231 return 0x0303;
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006232 if (retword == 0x0029) /* gc0305 */
Jean-François Moine6d314502010-08-04 05:44:13 -03006233 send_unknown(gspca_dev, SENSOR_GC0305);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006234 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006235 }
6236
Jean-François Moine6d314502010-08-04 05:44:13 -03006237 reg_w(gspca_dev, 0x01, 0x0000); /* check OmniVision */
6238 reg_w(gspca_dev, 0x01, 0x0001);
6239 reg_w(gspca_dev, 0xa1, 0x008b);
6240 reg_w(gspca_dev, 0x08, 0x008d);
6241 reg_w(gspca_dev, 0x06, 0x0010);
6242 reg_w(gspca_dev, 0x01, 0x0012);
6243 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006244 if (i2c_read(gspca_dev, 0x1c) == 0x007f /* OV7610 - manufacturer ID */
6245 && i2c_read(gspca_dev, 0x1d) == 0x00a2) {
Jean-François Moine6d314502010-08-04 05:44:13 -03006246 send_unknown(gspca_dev, SENSOR_OV7620);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006247 return 0x06; /* OmniVision confirm ? */
6248 }
6249
Jean-François Moine6d314502010-08-04 05:44:13 -03006250 reg_w(gspca_dev, 0x01, 0x0000);
6251 reg_w(gspca_dev, 0x00, 0x0002);
6252 reg_w(gspca_dev, 0x01, 0x0010);
6253 reg_w(gspca_dev, 0x01, 0x0001);
6254 reg_w(gspca_dev, 0xee, 0x008b);
6255 reg_w(gspca_dev, 0x03, 0x0012);
6256 reg_w(gspca_dev, 0x01, 0x0012);
6257 reg_w(gspca_dev, 0x05, 0x0012);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006258 retword = i2c_read(gspca_dev, 0x00) << 8; /* ID 0 */
6259 retword |= i2c_read(gspca_dev, 0x01); /* ID 1 */
6260 PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", retword);
6261 if (retword == 0x2030) {
Jean-François Moinebd62bbc2011-05-17 05:08:59 -03006262 u8 retbyte;
6263
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006264 retbyte = i2c_read(gspca_dev, 0x02); /* revision number */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006265 PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
Theodore Kilgorec93396e2013-02-04 13:17:55 -03006266
Jean-François Moine6d314502010-08-04 05:44:13 -03006267 send_unknown(gspca_dev, SENSOR_PO2030);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006268 return retword;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006269 }
6270
Jean-François Moine6d314502010-08-04 05:44:13 -03006271 reg_w(gspca_dev, 0x01, 0x0000);
6272 reg_w(gspca_dev, 0x0a, 0x0010);
6273 reg_w(gspca_dev, 0xd3, 0x008b);
6274 reg_w(gspca_dev, 0x01, 0x0001);
6275 reg_w(gspca_dev, 0x03, 0x0012);
6276 reg_w(gspca_dev, 0x01, 0x0012);
6277 reg_w(gspca_dev, 0x05, 0x0012);
6278 reg_w(gspca_dev, 0xd3, 0x008b);
Jean-Francois Moine3ab67ba2009-01-08 09:38:45 -03006279 retword = i2c_read(gspca_dev, 0x01);
6280 if (retword != 0) {
6281 PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword);
Jean-Francois Moine881cd412009-04-05 04:01:13 -03006282 return 0x16; /* adcm2700 (6100/6200) */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006283 }
6284 return -1;
6285}
6286
6287static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6288{
6289 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006290 int sensor;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006291
6292 switch (sd->sensor) {
6293 case SENSOR_MC501CB:
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006294 return -1; /* don't probe */
Jean-François Moine7fbee992010-12-28 07:17:40 -03006295 case SENSOR_GC0303:
Hans de Goede346623422008-09-03 16:47:28 -03006296 /* may probe but with no write in reg 0x0010 */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006297 return -1; /* don't probe */
Hans de Goede346623422008-09-03 16:47:28 -03006298 case SENSOR_PAS106:
6299 sensor = sif_probe(gspca_dev);
6300 if (sensor >= 0)
6301 return sensor;
6302 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006303 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006304 sensor = vga_2wr_probe(gspca_dev);
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006305 if (sensor >= 0)
Hans de Goede346623422008-09-03 16:47:28 -03006306 return sensor;
Jean-Francois Moine603538a2009-02-19 15:38:31 -03006307 return vga_3wr_probe(gspca_dev);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006308}
6309
6310/* this function is called at probe time */
6311static int sd_config(struct gspca_dev *gspca_dev,
6312 const struct usb_device_id *id)
6313{
6314 struct sd *sd = (struct sd *) gspca_dev;
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006315
Jean-François Moinea484dd92010-08-04 07:25:12 -03006316 if (id->idProduct == 0x301b)
6317 sd->bridge = BRIDGE_ZC301;
6318 else
6319 sd->bridge = BRIDGE_ZC303;
6320
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006321 /* define some sensors from the vendor/product */
6322 sd->sensor = id->driver_info;
6323
Jean-François Moine30c73d42012-02-27 07:26:30 -03006324 sd->reg08 = REG08_DEF;
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006325
Jean-François Moinef1801902012-02-27 07:48:32 -03006326 INIT_WORK(&sd->work, transfer_update);
6327
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006328 return 0;
6329}
6330
Hans Verkuilc06ba282012-05-06 09:28:28 -03006331static int zcxx_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006332{
Hans de Goedea8a47862012-05-09 11:19:00 -03006333 struct gspca_dev *gspca_dev =
6334 container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
6335 struct sd *sd = (struct sd *)gspca_dev;
Hans Verkuilc06ba282012-05-06 09:28:28 -03006336
6337 switch (ctrl->id) {
6338 case V4L2_CID_AUTOGAIN:
6339 gspca_dev->usb_err = 0;
6340 if (ctrl->val && sd->exposure && gspca_dev->streaming)
6341 sd->exposure->val = getexposure(gspca_dev);
6342 return gspca_dev->usb_err;
6343 }
6344 return -EINVAL;
6345}
6346
6347static int zcxx_s_ctrl(struct v4l2_ctrl *ctrl)
6348{
Hans de Goedea8a47862012-05-09 11:19:00 -03006349 struct gspca_dev *gspca_dev =
6350 container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
6351 struct sd *sd = (struct sd *)gspca_dev;
Hans Verkuilc06ba282012-05-06 09:28:28 -03006352 int i, qual;
6353
6354 gspca_dev->usb_err = 0;
6355
6356 if (ctrl->id == V4L2_CID_JPEG_COMPRESSION_QUALITY) {
6357 qual = sd->reg08 >> 1;
6358
6359 for (i = 0; i < ARRAY_SIZE(jpeg_qual); i++) {
6360 if (ctrl->val <= jpeg_qual[i])
6361 break;
6362 }
6363 if (i > 0 && i == qual && ctrl->val < jpeg_qual[i])
6364 i--;
6365
6366 /* With high quality settings we need max bandwidth */
6367 if (i >= 2 && gspca_dev->streaming &&
6368 !gspca_dev->cam.needs_full_bandwidth)
6369 return -EBUSY;
6370
6371 sd->reg08 = (i << 1) | 1;
6372 ctrl->val = jpeg_qual[i];
6373 }
6374
6375 if (!gspca_dev->streaming)
6376 return 0;
6377
6378 switch (ctrl->id) {
6379 /* gamma/brightness/contrast cluster */
6380 case V4L2_CID_GAMMA:
6381 setcontrast(gspca_dev, sd->gamma->val,
6382 sd->brightness->val, sd->contrast->val);
6383 break;
6384 /* autogain/exposure cluster */
6385 case V4L2_CID_AUTOGAIN:
6386 setautogain(gspca_dev, ctrl->val);
6387 if (!gspca_dev->usb_err && !ctrl->val && sd->exposure)
6388 setexposure(gspca_dev, sd->exposure->val);
6389 break;
6390 case V4L2_CID_POWER_LINE_FREQUENCY:
6391 setlightfreq(gspca_dev, ctrl->val);
6392 break;
6393 case V4L2_CID_SHARPNESS:
6394 setsharpness(gspca_dev, ctrl->val);
6395 break;
6396 case V4L2_CID_JPEG_COMPRESSION_QUALITY:
6397 setquality(gspca_dev);
6398 break;
6399 }
6400 return gspca_dev->usb_err;
6401}
6402
6403static const struct v4l2_ctrl_ops zcxx_ctrl_ops = {
6404 .g_volatile_ctrl = zcxx_g_volatile_ctrl,
6405 .s_ctrl = zcxx_s_ctrl,
6406};
6407
6408static int sd_init_controls(struct gspca_dev *gspca_dev)
6409{
6410 struct sd *sd = (struct sd *)gspca_dev;
Hans de Goedea8a47862012-05-09 11:19:00 -03006411 struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
Jean-Francois Moine47c833922010-01-07 15:59:12 -03006412 static const u8 gamma[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006413 [SENSOR_ADCM2700] = 4,
6414 [SENSOR_CS2102] = 4,
6415 [SENSOR_CS2102K] = 5,
Jean-François Moine7fbee992010-12-28 07:17:40 -03006416 [SENSOR_GC0303] = 3,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006417 [SENSOR_GC0305] = 4,
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006418 [SENSOR_HDCS2020] = 4,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006419 [SENSOR_HV7131B] = 4,
6420 [SENSOR_HV7131R] = 4,
6421 [SENSOR_ICM105A] = 4,
6422 [SENSOR_MC501CB] = 4,
Jean-François Moinea484dd92010-08-04 07:25:12 -03006423 [SENSOR_MT9V111_1] = 4,
6424 [SENSOR_MT9V111_3] = 4,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006425 [SENSOR_OV7620] = 3,
6426 [SENSOR_OV7630C] = 4,
6427 [SENSOR_PAS106] = 4,
6428 [SENSOR_PAS202B] = 4,
6429 [SENSOR_PB0330] = 4,
6430 [SENSOR_PO2030] = 4,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006431 [SENSOR_TAS5130C] = 3,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006432 };
Hans Verkuilc06ba282012-05-06 09:28:28 -03006433
6434 gspca_dev->vdev.ctrl_handler = hdl;
6435 v4l2_ctrl_handler_init(hdl, 8);
6436 sd->brightness = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6437 V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
6438 sd->contrast = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6439 V4L2_CID_CONTRAST, 0, 255, 1, 128);
6440 sd->gamma = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6441 V4L2_CID_GAMMA, 1, 6, 1, gamma[sd->sensor]);
6442 if (sd->sensor == SENSOR_HV7131R)
6443 sd->exposure = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6444 V4L2_CID_EXPOSURE, 0x30d, 0x493e, 1, 0x927);
6445 sd->autogain = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6446 V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
6447 if (sd->sensor != SENSOR_OV7630C)
6448 sd->plfreq = v4l2_ctrl_new_std_menu(hdl, &zcxx_ctrl_ops,
6449 V4L2_CID_POWER_LINE_FREQUENCY,
6450 V4L2_CID_POWER_LINE_FREQUENCY_60HZ, 0,
6451 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED);
6452 sd->sharpness = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6453 V4L2_CID_SHARPNESS, 0, 3, 1,
6454 sd->sensor == SENSOR_PO2030 ? 0 : 2);
6455 sd->jpegqual = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6456 V4L2_CID_JPEG_COMPRESSION_QUALITY,
6457 jpeg_qual[0], jpeg_qual[ARRAY_SIZE(jpeg_qual) - 1], 1,
6458 jpeg_qual[REG08_DEF >> 1]);
6459 if (hdl->error) {
6460 pr_err("Could not initialize controls\n");
6461 return hdl->error;
6462 }
6463 v4l2_ctrl_cluster(3, &sd->gamma);
6464 if (sd->sensor == SENSOR_HV7131R)
6465 v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, true);
6466 return 0;
6467}
6468
6469/* this function is called at probe and resume time */
6470static int sd_init(struct gspca_dev *gspca_dev)
6471{
6472 struct sd *sd = (struct sd *) gspca_dev;
6473 struct cam *cam;
6474 int sensor;
Hans de Goede9919fe82010-01-13 07:12:28 -03006475 static const u8 mode_tb[SENSOR_MAX] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006476 [SENSOR_ADCM2700] = 2,
6477 [SENSOR_CS2102] = 1,
6478 [SENSOR_CS2102K] = 1,
Jean-François Moine7fbee992010-12-28 07:17:40 -03006479 [SENSOR_GC0303] = 1,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006480 [SENSOR_GC0305] = 1,
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006481 [SENSOR_HDCS2020] = 1,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006482 [SENSOR_HV7131B] = 1,
6483 [SENSOR_HV7131R] = 1,
6484 [SENSOR_ICM105A] = 1,
6485 [SENSOR_MC501CB] = 2,
Jean-François Moinea484dd92010-08-04 07:25:12 -03006486 [SENSOR_MT9V111_1] = 1,
6487 [SENSOR_MT9V111_3] = 1,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006488 [SENSOR_OV7620] = 2,
6489 [SENSOR_OV7630C] = 1,
6490 [SENSOR_PAS106] = 0,
6491 [SENSOR_PAS202B] = 1,
6492 [SENSOR_PB0330] = 1,
6493 [SENSOR_PO2030] = 1,
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006494 [SENSOR_TAS5130C] = 1,
Hans de Goede9919fe82010-01-13 07:12:28 -03006495 };
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006496
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006497 sensor = zcxx_probeSensor(gspca_dev);
6498 if (sensor >= 0)
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006499 PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006500 if ((unsigned) force_sensor < SENSOR_MAX) {
6501 sd->sensor = force_sensor;
6502 PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
6503 } else {
6504 switch (sensor) {
6505 case -1:
6506 switch (sd->sensor) {
6507 case SENSOR_MC501CB:
6508 PDEBUG(D_PROBE, "Sensor MC501CB");
6509 break;
Jean-François Moine7fbee992010-12-28 07:17:40 -03006510 case SENSOR_GC0303:
6511 PDEBUG(D_PROBE, "Sensor GC0303");
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006512 break;
6513 default:
Joe Perches133a9fe2011-08-21 19:56:57 -03006514 pr_warn("Unknown sensor - set to TAS5130C\n");
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006515 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006516 }
6517 break;
6518 case 0:
Jean-Francois Moined754a6c2009-12-20 05:07:10 -03006519 /* check the sensor type */
6520 sensor = i2c_read(gspca_dev, 0x00);
6521 PDEBUG(D_PROBE, "Sensor hv7131 type %d", sensor);
6522 switch (sensor) {
6523 case 0: /* hv7131b */
6524 case 1: /* hv7131e */
6525 PDEBUG(D_PROBE, "Find Sensor HV7131B");
6526 sd->sensor = SENSOR_HV7131B;
6527 break;
6528 default:
6529/* case 2: * hv7131r */
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006530 PDEBUG(D_PROBE, "Find Sensor HV7131R");
6531 sd->sensor = SENSOR_HV7131R;
Jean-Francois Moined754a6c2009-12-20 05:07:10 -03006532 break;
6533 }
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006534 break;
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006535 case 0x02:
6536 PDEBUG(D_PROBE, "Sensor TAS5130C");
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006537 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006538 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006539 case 0x04:
6540 PDEBUG(D_PROBE, "Find Sensor CS2102");
6541 sd->sensor = SENSOR_CS2102;
6542 break;
6543 case 0x08:
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006544 PDEBUG(D_PROBE, "Find Sensor HDCS2020");
6545 sd->sensor = SENSOR_HDCS2020;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006546 break;
6547 case 0x0a:
6548 PDEBUG(D_PROBE,
6549 "Find Sensor PB0330. Chip revision %x",
6550 sd->chip_revision);
6551 sd->sensor = SENSOR_PB0330;
6552 break;
6553 case 0x0c:
6554 PDEBUG(D_PROBE, "Find Sensor ICM105A");
6555 sd->sensor = SENSOR_ICM105A;
6556 break;
6557 case 0x0e:
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006558 PDEBUG(D_PROBE, "Find Sensor PAS202B");
6559 sd->sensor = SENSOR_PAS202B;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006560 break;
6561 case 0x0f:
6562 PDEBUG(D_PROBE, "Find Sensor PAS106");
6563 sd->sensor = SENSOR_PAS106;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006564 break;
6565 case 0x10:
6566 case 0x12:
Jean-Francois Moine013db752009-10-07 05:24:19 -03006567 PDEBUG(D_PROBE, "Find Sensor TAS5130C");
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006568 sd->sensor = SENSOR_TAS5130C;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006569 break;
6570 case 0x11:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006571 PDEBUG(D_PROBE, "Find Sensor HV7131R");
6572 sd->sensor = SENSOR_HV7131R;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006573 break;
6574 case 0x13:
Jean-François Moinea484dd92010-08-04 07:25:12 -03006575 case 0x15:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006576 PDEBUG(D_PROBE,
Jean-François Moinea484dd92010-08-04 07:25:12 -03006577 "Sensor MT9V111. Chip revision %04x",
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006578 sd->chip_revision);
Jean-François Moinea484dd92010-08-04 07:25:12 -03006579 sd->sensor = sd->bridge == BRIDGE_ZC301
6580 ? SENSOR_MT9V111_1
6581 : SENSOR_MT9V111_3;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006582 break;
6583 case 0x14:
6584 PDEBUG(D_PROBE,
6585 "Find Sensor CS2102K?. Chip revision %x",
6586 sd->chip_revision);
6587 sd->sensor = SENSOR_CS2102K;
6588 break;
Jean-Francois Moine5be2b092009-01-20 05:12:34 -03006589 case 0x16:
6590 PDEBUG(D_PROBE, "Find Sensor ADCM2700");
6591 sd->sensor = SENSOR_ADCM2700;
6592 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006593 case 0x29:
6594 PDEBUG(D_PROBE, "Find Sensor GC0305");
6595 sd->sensor = SENSOR_GC0305;
6596 break;
Jean-François Moine7fbee992010-12-28 07:17:40 -03006597 case 0x0303:
6598 PDEBUG(D_PROBE, "Sensor GC0303");
6599 sd->sensor = SENSOR_GC0303;
Jean-Francois Moine63fc4a02008-07-21 05:42:17 -03006600 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006601 case 0x2030:
6602 PDEBUG(D_PROBE, "Find Sensor PO2030");
6603 sd->sensor = SENSOR_PO2030;
6604 break;
6605 case 0x7620:
6606 PDEBUG(D_PROBE, "Find Sensor OV7620");
6607 sd->sensor = SENSOR_OV7620;
6608 break;
Jean-Francois Moinee2d750f2009-02-19 15:41:28 -03006609 case 0x7631:
6610 PDEBUG(D_PROBE, "Find Sensor OV7630C");
6611 sd->sensor = SENSOR_OV7630C;
6612 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006613 case 0x7648:
6614 PDEBUG(D_PROBE, "Find Sensor OV7648");
6615 sd->sensor = SENSOR_OV7620; /* same sensor (?) */
6616 break;
6617 default:
Joe Perches133a9fe2011-08-21 19:56:57 -03006618 pr_err("Unknown sensor %04x\n", sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006619 return -EINVAL;
6620 }
6621 }
6622 if (sensor < 0x20) {
6623 if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
Jean-François Moine6d314502010-08-04 05:44:13 -03006624 reg_w(gspca_dev, 0x02, 0x0010);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006625 reg_r(gspca_dev, 0x0010);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006626 }
6627
6628 cam = &gspca_dev->cam;
Hans de Goede9919fe82010-01-13 07:12:28 -03006629 switch (mode_tb[sd->sensor]) {
6630 case 0:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006631 cam->cam_mode = sif_mode;
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03006632 cam->nmodes = ARRAY_SIZE(sif_mode);
Hans de Goede9919fe82010-01-13 07:12:28 -03006633 break;
6634 case 1:
6635 cam->cam_mode = vga_mode;
6636 cam->nmodes = ARRAY_SIZE(vga_mode);
6637 break;
6638 default:
6639/* case 2: */
6640 cam->cam_mode = broken_vga_mode;
6641 cam->nmodes = ARRAY_SIZE(broken_vga_mode);
6642 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006643 }
Jean-François Moine49fb5e62010-12-28 07:09:34 -03006644
Jean-Francois Moine77880ba32010-01-08 08:04:21 -03006645 /* switch off the led */
Jean-François Moine6d314502010-08-04 05:44:13 -03006646 reg_w(gspca_dev, 0x01, 0x0000);
Jean-François Moinec39da6a2010-08-04 06:07:23 -03006647 return gspca_dev->usb_err;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006648}
6649
Hans de Goede55db7652012-05-06 09:28:25 -03006650static int sd_pre_start(struct gspca_dev *gspca_dev)
6651{
6652 struct sd *sd = (struct sd *) gspca_dev;
6653 gspca_dev->cam.needs_full_bandwidth = (sd->reg08 >= 4) ? 1 : 0;
6654 return 0;
6655}
6656
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03006657static int sd_start(struct gspca_dev *gspca_dev)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006658{
6659 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006660 int mode;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006661 static const struct usb_action *init_tb[SENSOR_MAX][2] = {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006662 [SENSOR_ADCM2700] =
6663 {adcm2700_Initial, adcm2700_InitialScale},
6664 [SENSOR_CS2102] =
6665 {cs2102_Initial, cs2102_InitialScale},
6666 [SENSOR_CS2102K] =
6667 {cs2102K_Initial, cs2102K_InitialScale},
Jean-François Moine7fbee992010-12-28 07:17:40 -03006668 [SENSOR_GC0303] =
6669 {gc0303_Initial, gc0303_InitialScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006670 [SENSOR_GC0305] =
6671 {gc0305_Initial, gc0305_InitialScale},
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006672 [SENSOR_HDCS2020] =
6673 {hdcs2020_Initial, hdcs2020_InitialScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006674 [SENSOR_HV7131B] =
6675 {hv7131b_Initial, hv7131b_InitialScale},
6676 [SENSOR_HV7131R] =
6677 {hv7131r_Initial, hv7131r_InitialScale},
6678 [SENSOR_ICM105A] =
6679 {icm105a_Initial, icm105a_InitialScale},
6680 [SENSOR_MC501CB] =
6681 {mc501cb_Initial, mc501cb_InitialScale},
Jean-François Moinea484dd92010-08-04 07:25:12 -03006682 [SENSOR_MT9V111_1] =
6683 {mt9v111_1_Initial, mt9v111_1_InitialScale},
6684 [SENSOR_MT9V111_3] =
6685 {mt9v111_3_Initial, mt9v111_3_InitialScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006686 [SENSOR_OV7620] =
6687 {ov7620_Initial, ov7620_InitialScale},
6688 [SENSOR_OV7630C] =
6689 {ov7630c_Initial, ov7630c_InitialScale},
6690 [SENSOR_PAS106] =
6691 {pas106b_Initial, pas106b_InitialScale},
6692 [SENSOR_PAS202B] =
6693 {pas202b_Initial, pas202b_InitialScale},
6694 [SENSOR_PB0330] =
6695 {pb0330_Initial, pb0330_InitialScale},
6696 [SENSOR_PO2030] =
6697 {po2030_Initial, po2030_InitialScale},
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006698 [SENSOR_TAS5130C] =
6699 {tas5130c_Initial, tas5130c_InitialScale},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006700 };
6701
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006702 /* create the JPEG header */
Ondrej Zary1966bc22013-08-30 17:54:23 -03006703 jpeg_define(sd->jpeg_hdr, gspca_dev->pixfmt.height,
6704 gspca_dev->pixfmt.width,
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006705 0x21); /* JPEG 422 */
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006706
Jean-Francois Moine50924512010-01-08 08:08:12 -03006707 mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006708 switch (sd->sensor) {
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006709 case SENSOR_HV7131R:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006710 zcxx_probeSensor(gspca_dev);
6711 break;
6712 case SENSOR_PAS106:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006713 usb_exchange(gspca_dev, pas106b_Initial_com);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006714 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006715 }
Jean-Francois Moine50924512010-01-08 08:08:12 -03006716 usb_exchange(gspca_dev, init_tb[sd->sensor][mode]);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006717
6718 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006719 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006720 case SENSOR_GC0305:
6721 case SENSOR_OV7620:
6722 case SENSOR_PO2030:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006723 case SENSOR_TAS5130C:
Jean-François Moine7fbee992010-12-28 07:17:40 -03006724 case SENSOR_GC0303:
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006725/* msleep(100); * ?? */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006726 reg_r(gspca_dev, 0x0002); /* --> 0x40 */
Jean-François Moine6d314502010-08-04 05:44:13 -03006727 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6728 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006729 if (sd->sensor == SENSOR_TAS5130C)
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006730 break;
Jean-François Moine6d314502010-08-04 05:44:13 -03006731 reg_w(gspca_dev, 0x0d, 0x003a);
6732 reg_w(gspca_dev, 0x02, 0x003b);
6733 reg_w(gspca_dev, 0x00, 0x0038);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006734 break;
Jean-François Moine3d244062011-01-24 16:22:11 -03006735 case SENSOR_HV7131R:
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006736 case SENSOR_PAS202B:
Jean-François Moine6d314502010-08-04 05:44:13 -03006737 reg_w(gspca_dev, 0x03, 0x003b);
6738 reg_w(gspca_dev, 0x0c, 0x003a);
6739 reg_w(gspca_dev, 0x0b, 0x0039);
Jean-François Moine3d244062011-01-24 16:22:11 -03006740 if (sd->sensor == SENSOR_HV7131R)
6741 reg_w(gspca_dev, 0x50, ZC3XX_R11D_GLOBALGAIN);
Jean-Francois Moine38719d42010-01-04 16:09:47 -03006742 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006743 }
6744
6745 setmatrix(gspca_dev);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006746 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006747 case SENSOR_ADCM2700:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006748 case SENSOR_OV7620:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006749 reg_r(gspca_dev, 0x0008);
Jean-François Moine6d314502010-08-04 05:44:13 -03006750 reg_w(gspca_dev, 0x00, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006751 break;
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006752 case SENSOR_PAS202B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006753 case SENSOR_GC0305:
Jean-François Moine3d244062011-01-24 16:22:11 -03006754 case SENSOR_HV7131R:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006755 case SENSOR_TAS5130C:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006756 reg_r(gspca_dev, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006757 /* fall thru */
6758 case SENSOR_PO2030:
Jean-François Moine6d314502010-08-04 05:44:13 -03006759 reg_w(gspca_dev, 0x03, 0x0008);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006760 break;
6761 }
Hans Verkuilc06ba282012-05-06 09:28:28 -03006762 setsharpness(gspca_dev, v4l2_ctrl_g_ctrl(sd->sharpness));
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006763
6764 /* set the gamma tables when not set */
6765 switch (sd->sensor) {
Jean-Francois Moine1d763312009-09-18 05:36:24 -03006766 case SENSOR_CS2102K: /* gamma set in xxx_Initial */
Jean-François Moine4e5144e2011-02-26 13:56:20 -03006767 case SENSOR_HDCS2020:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006768 case SENSOR_OV7630C:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006769 break;
6770 default:
Hans Verkuilc06ba282012-05-06 09:28:28 -03006771 setcontrast(gspca_dev, v4l2_ctrl_g_ctrl(sd->gamma),
6772 v4l2_ctrl_g_ctrl(sd->brightness),
6773 v4l2_ctrl_g_ctrl(sd->contrast));
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006774 break;
6775 }
6776 setmatrix(gspca_dev); /* one more time? */
6777 switch (sd->sensor) {
6778 case SENSOR_OV7620:
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006779 case SENSOR_PAS202B:
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006780 reg_r(gspca_dev, 0x0180); /* from win */
Jean-François Moine6d314502010-08-04 05:44:13 -03006781 reg_w(gspca_dev, 0x00, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006782 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006783 }
Jean-François Moine30c73d42012-02-27 07:26:30 -03006784 setquality(gspca_dev);
Hans de Goede55db7652012-05-06 09:28:25 -03006785 /* Start with BRC disabled, transfer_update will enable it if needed */
6786 reg_w(gspca_dev, 0x00, 0x0007);
Hans Verkuilc06ba282012-05-06 09:28:28 -03006787 if (sd->plfreq)
6788 setlightfreq(gspca_dev, v4l2_ctrl_g_ctrl(sd->plfreq));
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006789
6790 switch (sd->sensor) {
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006791 case SENSOR_ADCM2700:
Jean-François Moine6d314502010-08-04 05:44:13 -03006792 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6793 reg_w(gspca_dev, 0x15, 0x01ae);
6794 reg_w(gspca_dev, 0x02, 0x0180);
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006795 /* ms-win + */
Jean-François Moine6d314502010-08-04 05:44:13 -03006796 reg_w(gspca_dev, 0x40, 0x0117);
Jean-Francois Moine3d221182009-01-19 15:18:44 -03006797 break;
Jean-François Moine3d244062011-01-24 16:22:11 -03006798 case SENSOR_HV7131R:
Hans Verkuilc06ba282012-05-06 09:28:28 -03006799 setexposure(gspca_dev, v4l2_ctrl_g_ctrl(sd->exposure));
Jean-François Moine3d244062011-01-24 16:22:11 -03006800 reg_w(gspca_dev, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN);
6801 break;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006802 case SENSOR_GC0305:
Jean-François Moine83d1aa32010-08-04 05:11:23 -03006803 case SENSOR_TAS5130C:
Jean-François Moine6d314502010-08-04 05:44:13 -03006804 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
6805 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006806 /* fall thru */
6807 case SENSOR_PAS202B:
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006808 case SENSOR_PO2030:
Jean-François Moine780e3122010-10-19 04:29:10 -03006809/* reg_w(gspca_dev, 0x40, ZC3XX_R117_GGAIN); in win traces */
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006810 reg_r(gspca_dev, 0x0180);
6811 break;
6812 case SENSOR_OV7620:
Jean-François Moine6d314502010-08-04 05:44:13 -03006813 reg_w(gspca_dev, 0x09, 0x01ad);
6814 reg_w(gspca_dev, 0x15, 0x01ae);
Jean-Francois Moine7320d6b2008-12-08 06:41:04 -03006815 i2c_read(gspca_dev, 0x13); /*fixme: returns 0xa3 */
6816 i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
Jean-François Moine780e3122010-10-19 04:29:10 -03006817 /*fixme: returned value to send? */
Jean-François Moine6d314502010-08-04 05:44:13 -03006818 reg_w(gspca_dev, 0x40, 0x0117);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03006819 reg_r(gspca_dev, 0x0180);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006820 break;
6821 }
6822
Hans Verkuilc06ba282012-05-06 09:28:28 -03006823 setautogain(gspca_dev, v4l2_ctrl_g_ctrl(sd->autogain));
Jean-François Moinef1801902012-02-27 07:48:32 -03006824
Hans de Goede55db7652012-05-06 09:28:25 -03006825 if (gspca_dev->usb_err < 0)
6826 return gspca_dev->usb_err;
Jean-François Moinef1801902012-02-27 07:48:32 -03006827
Hans de Goede55db7652012-05-06 09:28:25 -03006828 /* Start the transfer parameters update thread */
6829 sd->work_thread = create_singlethread_workqueue(KBUILD_MODNAME);
6830 queue_work(sd->work_thread, &sd->work);
6831
6832 return 0;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006833}
6834
Hans de Goede844db452012-09-09 07:30:02 -03006835/* called on streamoff with alt==0 and on disconnect */
6836/* the usb_lock is held at entry - restore on exit */
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006837static void sd_stop0(struct gspca_dev *gspca_dev)
6838{
6839 struct sd *sd = (struct sd *) gspca_dev;
6840
Jean-François Moinef1801902012-02-27 07:48:32 -03006841 if (sd->work_thread != NULL) {
6842 mutex_unlock(&gspca_dev->usb_lock);
6843 destroy_workqueue(sd->work_thread);
6844 mutex_lock(&gspca_dev->usb_lock);
6845 sd->work_thread = NULL;
6846 }
Hans de Goede345321d2012-09-09 06:30:02 -03006847 if (!gspca_dev->present)
Jean-Francois Moine98522a72008-11-18 06:33:08 -03006848 return;
Jean-François Moine6d314502010-08-04 05:44:13 -03006849 send_unknown(gspca_dev, sd->sensor);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006850}
6851
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006852static void sd_pkt_scan(struct gspca_dev *gspca_dev,
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006853 u8 *data,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006854 int len)
6855{
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006856 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006857
Jean-François Moinea5ecdfb2011-01-24 16:31:58 -03006858 /* check the JPEG end of frame */
6859 if (len >= 3
6860 && data[len - 3] == 0xff && data[len - 2] == 0xd9) {
6861/*fixme: what does the last byte mean?*/
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006862 gspca_frame_add(gspca_dev, LAST_PACKET,
Jean-François Moinea5ecdfb2011-01-24 16:31:58 -03006863 data, len - 1);
6864 return;
6865 }
6866
6867 /* check the JPEG start of a frame */
6868 if (data[0] == 0xff && data[1] == 0xd8) {
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006869 /* put the JPEG header in the new frame */
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006870 gspca_frame_add(gspca_dev, FIRST_PACKET,
Jean-Francois Moine71cb2762009-03-03 05:33:41 -03006871 sd->jpeg_hdr, JPEG_HDR_SZ);
6872
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006873 /* remove the webcam's header:
6874 * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
6875 * - 'ss ss' is the frame sequence number (BE)
Jean-François Moine780e3122010-10-19 04:29:10 -03006876 * - 'ww ww' and 'hh hh' are the window dimensions (BE)
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006877 * - 'pp pp' is the packet sequence number (BE)
6878 */
6879 data += 18;
6880 len -= 18;
6881 }
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03006882 gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006883}
6884
Jean-François Moinecd7f98f2012-03-16 06:47:23 -03006885static int sd_set_jcomp(struct gspca_dev *gspca_dev,
Hans Verkuild88aab52012-09-17 05:05:25 -03006886 const struct v4l2_jpegcompression *jcomp)
Jean-François Moinecd7f98f2012-03-16 06:47:23 -03006887{
6888 struct sd *sd = (struct sd *) gspca_dev;
6889
Hans Verkuild88aab52012-09-17 05:05:25 -03006890 return v4l2_ctrl_s_ctrl(sd->jpegqual, jcomp->quality);
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03006891}
6892
6893static int sd_get_jcomp(struct gspca_dev *gspca_dev,
6894 struct v4l2_jpegcompression *jcomp)
6895{
6896 struct sd *sd = (struct sd *) gspca_dev;
6897
6898 memset(jcomp, 0, sizeof *jcomp);
Hans Verkuilc06ba282012-05-06 09:28:28 -03006899 jcomp->quality = v4l2_ctrl_g_ctrl(sd->jpegqual);
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03006900 jcomp->jpeg_markers = V4L2_JPEG_MARKER_DHT
6901 | V4L2_JPEG_MARKER_DQT;
6902 return 0;
6903}
6904
Peter Senna Tschudin78f968f2013-01-24 19:29:13 -03006905#if IS_ENABLED(CONFIG_INPUT)
Hans de Goede1a351022010-01-29 11:05:25 -03006906static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
6907 u8 *data, /* interrupt packet data */
Jonathan McCrohanf58c91c2013-10-20 21:34:01 -03006908 int len) /* interrupt packet length */
Hans de Goede1a351022010-01-29 11:05:25 -03006909{
6910 if (len == 8 && data[4] == 1) {
6911 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
6912 input_sync(gspca_dev->input_dev);
6913 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
6914 input_sync(gspca_dev->input_dev);
6915 }
6916
6917 return 0;
6918}
6919#endif
6920
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03006921static const struct sd_desc sd_desc = {
Jean-François Moine0b74e2c2012-02-27 08:26:05 -03006922 .name = KBUILD_MODNAME,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006923 .config = sd_config,
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03006924 .init = sd_init,
Hans Verkuilc06ba282012-05-06 09:28:28 -03006925 .init_controls = sd_init_controls,
Hans de Goede55db7652012-05-06 09:28:25 -03006926 .isoc_init = sd_pre_start,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006927 .start = sd_start,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006928 .stop0 = sd_stop0,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006929 .pkt_scan = sd_pkt_scan,
Jean-Francois Moine77ac0ba2009-03-02 06:40:52 -03006930 .get_jcomp = sd_get_jcomp,
6931 .set_jcomp = sd_set_jcomp,
Peter Senna Tschudin78f968f2013-01-24 19:29:13 -03006932#if IS_ENABLED(CONFIG_INPUT)
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[] = {
Wolfram Sange1771292011-09-23 04:47:58 -03006938 {USB_DEVICE(0x03f0, 0x1b07)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006939 {USB_DEVICE(0x041e, 0x041e)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006940 {USB_DEVICE(0x041e, 0x4017)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03006941 {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006942 {USB_DEVICE(0x041e, 0x401e)},
6943 {USB_DEVICE(0x041e, 0x401f)},
Hans de Goede222a07f2008-09-03 17:12:20 -03006944 {USB_DEVICE(0x041e, 0x4022)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006945 {USB_DEVICE(0x041e, 0x4029)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03006946 {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
6947 {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006948 {USB_DEVICE(0x041e, 0x4036)},
6949 {USB_DEVICE(0x041e, 0x403a)},
Jean-François Moine7fbee992010-12-28 07:17:40 -03006950 {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_GC0303},
6951 {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_GC0303},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006952 {USB_DEVICE(0x0458, 0x7007)},
6953 {USB_DEVICE(0x0458, 0x700c)},
6954 {USB_DEVICE(0x0458, 0x700f)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006955 {USB_DEVICE(0x0461, 0x0a00)},
Fabio Rossi88a40cf2008-12-26 14:41:48 -03006956 {USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006957 {USB_DEVICE(0x046d, 0x08a0)},
6958 {USB_DEVICE(0x046d, 0x08a1)},
6959 {USB_DEVICE(0x046d, 0x08a2)},
6960 {USB_DEVICE(0x046d, 0x08a3)},
6961 {USB_DEVICE(0x046d, 0x08a6)},
6962 {USB_DEVICE(0x046d, 0x08a7)},
6963 {USB_DEVICE(0x046d, 0x08a9)},
6964 {USB_DEVICE(0x046d, 0x08aa)},
6965 {USB_DEVICE(0x046d, 0x08ac)},
6966 {USB_DEVICE(0x046d, 0x08ad)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006967 {USB_DEVICE(0x046d, 0x08ae)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006968 {USB_DEVICE(0x046d, 0x08af)},
6969 {USB_DEVICE(0x046d, 0x08b9)},
6970 {USB_DEVICE(0x046d, 0x08d7)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006971 {USB_DEVICE(0x046d, 0x08d8)},
Jean-François Moine7d55a842010-12-28 07:02:32 -03006972 {USB_DEVICE(0x046d, 0x08d9)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006973 {USB_DEVICE(0x046d, 0x08da)},
Hans de Goeded6db35e2008-09-03 17:12:13 -03006974 {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
6975 {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
6976 {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
6977 {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
6978 {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006979 {USB_DEVICE(0x055f, 0xc005)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006980 {USB_DEVICE(0x055f, 0xd003)},
6981 {USB_DEVICE(0x055f, 0xd004)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006982 {USB_DEVICE(0x0698, 0x2003)},
Hans de Goede222a07f2008-09-03 17:12:20 -03006983 {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
Douglas Schilling Landgrafd99819d2009-03-26 05:10:55 -03006984 {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006985 {USB_DEVICE(0x0ac8, 0x301b)},
6986 {USB_DEVICE(0x0ac8, 0x303b)},
Jean-Francois Moine7bd330b2009-12-02 06:06:03 -03006987 {USB_DEVICE(0x0ac8, 0x305b)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006988 {USB_DEVICE(0x0ac8, 0x307b)},
6989 {USB_DEVICE(0x10fd, 0x0128)},
Hans de Goede222a07f2008-09-03 17:12:20 -03006990 {USB_DEVICE(0x10fd, 0x804d)},
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03006991 {USB_DEVICE(0x10fd, 0x8050)},
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006992 {} /* end of entry */
6993};
Jean-Francois Moined43fa322008-06-12 10:58:58 -03006994MODULE_DEVICE_TABLE(usb, device_table);
6995
6996/* -- device connect -- */
6997static int sd_probe(struct usb_interface *intf,
6998 const struct usb_device_id *id)
6999{
7000 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7001 THIS_MODULE);
7002}
7003
7004/* USB driver */
7005static struct usb_driver sd_driver = {
Jean-François Moine0b74e2c2012-02-27 08:26:05 -03007006 .name = KBUILD_MODNAME,
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007007 .id_table = device_table,
7008 .probe = sd_probe,
7009 .disconnect = gspca_disconnect,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03007010#ifdef CONFIG_PM
7011 .suspend = gspca_suspend,
7012 .resume = gspca_resume,
Hans Verkuilc06ba282012-05-06 09:28:28 -03007013 .reset_resume = gspca_resume,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03007014#endif
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007015};
7016
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08007017module_usb_driver(sd_driver);
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007018
Jean-Francois Moined43fa322008-06-12 10:58:58 -03007019module_param(force_sensor, int, 0644);
7020MODULE_PARM_DESC(force_sensor,
7021 "Force sensor. Only for experts!!!");