Version:  2.0.40 2.2.26 2.4.37 3.13 3.14 3.15 3.16 3.17 3.18 3.19 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10

Linux/drivers/media/usb/gspca/zc3xx.c

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