xref: /OK3568_Linux_fs/kernel/drivers/media/usb/gspca/zc3xx.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-or-later
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Z-Star/Vimicro zc301/zc302p/vc30x driver
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2009-2012 Jean-Francois Moine <http://moinejf.free.fr>
6*4882a593Smuzhiyun  * Copyright (C) 2004 2005 2006 Michel Xhaard mxhaard@magic.fr
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <linux/input.h>
12*4882a593Smuzhiyun #include "gspca.h"
13*4882a593Smuzhiyun #include "jpeg.h"
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>, Serge A. Suchkov <Serge.A.S@tochka.ru>");
16*4882a593Smuzhiyun MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
17*4882a593Smuzhiyun MODULE_LICENSE("GPL");
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun static int force_sensor = -1;
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun #define REG08_DEF 3		/* default JPEG compression (75%) */
22*4882a593Smuzhiyun #include "zc3xx-reg.h"
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun /* specific webcam descriptor */
25*4882a593Smuzhiyun struct sd {
26*4882a593Smuzhiyun 	struct gspca_dev gspca_dev;	/* !! must be the first item */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun 	struct { /* gamma/brightness/contrast control cluster */
29*4882a593Smuzhiyun 		struct v4l2_ctrl *gamma;
30*4882a593Smuzhiyun 		struct v4l2_ctrl *brightness;
31*4882a593Smuzhiyun 		struct v4l2_ctrl *contrast;
32*4882a593Smuzhiyun 	};
33*4882a593Smuzhiyun 	struct { /* autogain/exposure control cluster */
34*4882a593Smuzhiyun 		struct v4l2_ctrl *autogain;
35*4882a593Smuzhiyun 		struct v4l2_ctrl *exposure;
36*4882a593Smuzhiyun 	};
37*4882a593Smuzhiyun 	struct v4l2_ctrl *plfreq;
38*4882a593Smuzhiyun 	struct v4l2_ctrl *sharpness;
39*4882a593Smuzhiyun 	struct v4l2_ctrl *jpegqual;
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun 	struct work_struct work;
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun 	u8 reg08;		/* webcam compression quality */
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun 	u8 bridge;
46*4882a593Smuzhiyun 	u8 sensor;		/* Type of image sensor chip */
47*4882a593Smuzhiyun 	u16 chip_revision;
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun 	u8 jpeg_hdr[JPEG_HDR_SZ];
50*4882a593Smuzhiyun };
51*4882a593Smuzhiyun enum bridges {
52*4882a593Smuzhiyun 	BRIDGE_ZC301,
53*4882a593Smuzhiyun 	BRIDGE_ZC303,
54*4882a593Smuzhiyun };
55*4882a593Smuzhiyun enum sensors {
56*4882a593Smuzhiyun 	SENSOR_ADCM2700,
57*4882a593Smuzhiyun 	SENSOR_CS2102,
58*4882a593Smuzhiyun 	SENSOR_CS2102K,
59*4882a593Smuzhiyun 	SENSOR_GC0303,
60*4882a593Smuzhiyun 	SENSOR_GC0305,
61*4882a593Smuzhiyun 	SENSOR_HDCS2020,
62*4882a593Smuzhiyun 	SENSOR_HV7131B,
63*4882a593Smuzhiyun 	SENSOR_HV7131R,
64*4882a593Smuzhiyun 	SENSOR_ICM105A,
65*4882a593Smuzhiyun 	SENSOR_MC501CB,
66*4882a593Smuzhiyun 	SENSOR_MT9V111_1,	/* (mi360soc) zc301 */
67*4882a593Smuzhiyun 	SENSOR_MT9V111_3,	/* (mi360soc) zc303 */
68*4882a593Smuzhiyun 	SENSOR_OV7620,		/* OV7648 - same values */
69*4882a593Smuzhiyun 	SENSOR_OV7630C,
70*4882a593Smuzhiyun 	SENSOR_PAS106,
71*4882a593Smuzhiyun 	SENSOR_PAS202B,
72*4882a593Smuzhiyun 	SENSOR_PB0330,
73*4882a593Smuzhiyun 	SENSOR_PO2030,
74*4882a593Smuzhiyun 	SENSOR_TAS5130C,
75*4882a593Smuzhiyun 	SENSOR_MAX
76*4882a593Smuzhiyun };
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun static const struct v4l2_pix_format vga_mode[] = {
79*4882a593Smuzhiyun 	{320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
80*4882a593Smuzhiyun 		.bytesperline = 320,
81*4882a593Smuzhiyun 		.sizeimage = 320 * 240 * 3 / 8 + 590,
82*4882a593Smuzhiyun 		.colorspace = V4L2_COLORSPACE_JPEG,
83*4882a593Smuzhiyun 		.priv = 1},
84*4882a593Smuzhiyun 	{640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
85*4882a593Smuzhiyun 		.bytesperline = 640,
86*4882a593Smuzhiyun 		.sizeimage = 640 * 480 * 3 / 8 + 590,
87*4882a593Smuzhiyun 		.colorspace = V4L2_COLORSPACE_JPEG,
88*4882a593Smuzhiyun 		.priv = 0},
89*4882a593Smuzhiyun };
90*4882a593Smuzhiyun 
91*4882a593Smuzhiyun static const struct v4l2_pix_format broken_vga_mode[] = {
92*4882a593Smuzhiyun 	{320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
93*4882a593Smuzhiyun 		.bytesperline = 320,
94*4882a593Smuzhiyun 		.sizeimage = 320 * 232 * 4 / 8 + 590,
95*4882a593Smuzhiyun 		.colorspace = V4L2_COLORSPACE_JPEG,
96*4882a593Smuzhiyun 		.priv = 1},
97*4882a593Smuzhiyun 	{640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
98*4882a593Smuzhiyun 		.bytesperline = 640,
99*4882a593Smuzhiyun 		.sizeimage = 640 * 472 * 3 / 8 + 590,
100*4882a593Smuzhiyun 		.colorspace = V4L2_COLORSPACE_JPEG,
101*4882a593Smuzhiyun 		.priv = 0},
102*4882a593Smuzhiyun };
103*4882a593Smuzhiyun 
104*4882a593Smuzhiyun static const struct v4l2_pix_format sif_mode[] = {
105*4882a593Smuzhiyun 	{176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
106*4882a593Smuzhiyun 		.bytesperline = 176,
107*4882a593Smuzhiyun 		.sizeimage = 176 * 144 * 3 / 8 + 590,
108*4882a593Smuzhiyun 		.colorspace = V4L2_COLORSPACE_JPEG,
109*4882a593Smuzhiyun 		.priv = 1},
110*4882a593Smuzhiyun 	{352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
111*4882a593Smuzhiyun 		.bytesperline = 352,
112*4882a593Smuzhiyun 		.sizeimage = 352 * 288 * 3 / 8 + 590,
113*4882a593Smuzhiyun 		.colorspace = V4L2_COLORSPACE_JPEG,
114*4882a593Smuzhiyun 		.priv = 0},
115*4882a593Smuzhiyun };
116*4882a593Smuzhiyun 
117*4882a593Smuzhiyun /*
118*4882a593Smuzhiyun  * Bridge reg08 bits 1-2 -> JPEG quality conversion table. Note the highest
119*4882a593Smuzhiyun  * quality setting is not usable as USB 1 does not have enough bandwidth.
120*4882a593Smuzhiyun  */
121*4882a593Smuzhiyun static u8 jpeg_qual[] = {50, 75, 87, /* 94 */};
122*4882a593Smuzhiyun 
123*4882a593Smuzhiyun /* usb exchanges */
124*4882a593Smuzhiyun struct usb_action {
125*4882a593Smuzhiyun 	u8	req;
126*4882a593Smuzhiyun 	u8	val;
127*4882a593Smuzhiyun 	u16	idx;
128*4882a593Smuzhiyun };
129*4882a593Smuzhiyun 
130*4882a593Smuzhiyun static const struct usb_action adcm2700_Initial[] = {
131*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc */
132*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},		/* 00,02,04,cc */
133*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},		/* 00,08,03,cc */
134*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
135*4882a593Smuzhiyun 	{0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,d3,cc */
136*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
137*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc */
138*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
139*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,d8,cc */
140*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
141*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
142*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
143*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc */
144*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc */
145*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,00,cc */
146*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc */
147*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,00,cc */
148*4882a593Smuzhiyun 	{0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,de,cc */
149*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,86,cc */
150*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0400},				/* 04,00,00,bb */
151*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
152*4882a593Smuzhiyun 	{0xbb, 0x0f, 0x140f},				/* 14,0f,0f,bb */
153*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,37,cc */
154*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc */
155*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},		/* 01,89,06,cc */
156*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc */
157*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc */
158*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
159*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc */
160*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R116_RGAIN},			/* 01,16,58,cc */
161*4882a593Smuzhiyun 	{0xa0, 0x5a, ZC3XX_R118_BGAIN},			/* 01,18,5a,cc */
162*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,02,cc */
163*4882a593Smuzhiyun 	{0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,d3,cc */
164*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0408},				/* 04,00,08,bb */
165*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},				/* 00,02,00,dd */
166*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0400},				/* 04,00,00,bb */
167*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
168*4882a593Smuzhiyun 	{0xbb, 0x0f, 0x140f},				/* 14,0f,0f,bb */
169*4882a593Smuzhiyun 	{0xbb, 0xe0, 0x0c2e},				/* 0c,e0,2e,bb */
170*4882a593Smuzhiyun 	{0xbb, 0x01, 0x2000},				/* 20,01,00,bb */
171*4882a593Smuzhiyun 	{0xbb, 0x96, 0x2400},				/* 24,96,00,bb */
172*4882a593Smuzhiyun 	{0xbb, 0x06, 0x1006},				/* 10,06,06,bb */
173*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
174*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
175*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
176*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
177*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
178*4882a593Smuzhiyun 	{0xbb, 0x5f, 0x2090},				/* 20,5f,90,bb */
179*4882a593Smuzhiyun 	{0xbb, 0x01, 0x8000},				/* 80,01,00,bb */
180*4882a593Smuzhiyun 	{0xbb, 0x09, 0x8400},				/* 84,09,00,bb */
181*4882a593Smuzhiyun 	{0xbb, 0x86, 0x0002},				/* 00,86,02,bb */
182*4882a593Smuzhiyun 	{0xbb, 0xe6, 0x0401},				/* 04,e6,01,bb */
183*4882a593Smuzhiyun 	{0xbb, 0x86, 0x0802},				/* 08,86,02,bb */
184*4882a593Smuzhiyun 	{0xbb, 0xe6, 0x0c01},				/* 0c,e6,01,bb */
185*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
186*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
187*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0000},				/* 00,fe,00,aa */
188*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
189*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
190*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
191*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0020},				/* 00,fe,20,aa */
192*4882a593Smuzhiyun /*mswin+*/
193*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
194*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0002},
195*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
196*4882a593Smuzhiyun 	{0xaa, 0xb4, 0xcd37},
197*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0004},
198*4882a593Smuzhiyun 	{0xaa, 0xa8, 0x0007},
199*4882a593Smuzhiyun 	{0xaa, 0xac, 0x0004},
200*4882a593Smuzhiyun /*mswin-*/
201*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
202*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
203*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
204*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0000},				/* 00,fe,00,aa */
205*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
206*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
207*4882a593Smuzhiyun 	{0xbb, 0x04, 0x0400},				/* 04,04,00,bb */
208*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0100},				/* 00,01,00,dd */
209*4882a593Smuzhiyun 	{0xbb, 0x01, 0x0400},				/* 04,01,00,bb */
210*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
211*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
212*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
213*4882a593Smuzhiyun 	{0xbb, 0x41, 0x2803},				/* 28,41,03,bb */
214*4882a593Smuzhiyun 	{0xbb, 0x40, 0x2c03},				/* 2c,40,03,bb */
215*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
216*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
217*4882a593Smuzhiyun 	{}
218*4882a593Smuzhiyun };
219*4882a593Smuzhiyun static const struct usb_action adcm2700_InitialScale[] = {
220*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc */
221*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},		/* 00,02,10,cc */
222*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},		/* 00,08,03,cc */
223*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
224*4882a593Smuzhiyun 	{0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,d3,cc */
225*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
226*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc */
227*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
228*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,d0,cc */
229*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
230*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
231*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
232*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc */
233*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc */
234*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,00,cc */
235*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc */
236*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,00,cc */
237*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,d8,cc */
238*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,88,cc */
239*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0400},				/* 04,00,00,bb */
240*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
241*4882a593Smuzhiyun 	{0xbb, 0x0f, 0x140f},				/* 14,0f,0f,bb */
242*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,37,cc */
243*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc */
244*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},		/* 01,89,06,cc */
245*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc */
246*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc */
247*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
248*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc */
249*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R116_RGAIN},			/* 01,16,58,cc */
250*4882a593Smuzhiyun 	{0xa0, 0x5a, ZC3XX_R118_BGAIN},			/* 01,18,5a,cc */
251*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,02,cc */
252*4882a593Smuzhiyun 	{0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,d3,cc */
253*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0408},				/* 04,00,08,bb */
254*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},				/* 00,02,00,dd */
255*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0400},				/* 04,00,00,bb */
256*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0050},				/* 00,00,50,dd */
257*4882a593Smuzhiyun 	{0xbb, 0x0f, 0x140f},				/* 14,0f,0f,bb */
258*4882a593Smuzhiyun 	{0xbb, 0xe0, 0x0c2e},				/* 0c,e0,2e,bb */
259*4882a593Smuzhiyun 	{0xbb, 0x01, 0x2000},				/* 20,01,00,bb */
260*4882a593Smuzhiyun 	{0xbb, 0x96, 0x2400},				/* 24,96,00,bb */
261*4882a593Smuzhiyun 	{0xbb, 0x06, 0x1006},				/* 10,06,06,bb */
262*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
263*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
264*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
265*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
266*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
267*4882a593Smuzhiyun 	{0xbb, 0x5f, 0x2090},				/* 20,5f,90,bb */
268*4882a593Smuzhiyun 	{0xbb, 0x01, 0x8000},				/* 80,01,00,bb */
269*4882a593Smuzhiyun 	{0xbb, 0x09, 0x8400},				/* 84,09,00,bb */
270*4882a593Smuzhiyun 	{0xbb, 0x86, 0x0002},				/* 00,88,02,bb */
271*4882a593Smuzhiyun 	{0xbb, 0xe6, 0x0401},				/* 04,e6,01,bb */
272*4882a593Smuzhiyun 	{0xbb, 0x86, 0x0802},				/* 08,88,02,bb */
273*4882a593Smuzhiyun 	{0xbb, 0xe6, 0x0c01},				/* 0c,e6,01,bb */
274*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
275*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
276*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0000},				/* 00,fe,00,aa */
277*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
278*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
279*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
280*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0020},				/* 00,fe,20,aa */
281*4882a593Smuzhiyun 	/*******/
282*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
283*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
284*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
285*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0000},				/* 00,fe,00,aa */
286*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
287*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
288*4882a593Smuzhiyun 	{0xbb, 0x04, 0x0400},				/* 04,04,00,bb */
289*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0100},				/* 00,01,00,dd */
290*4882a593Smuzhiyun 	{0xbb, 0x01, 0x0400},				/* 04,01,00,bb */
291*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
292*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
293*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
294*4882a593Smuzhiyun 	{0xbb, 0x41, 0x2803},				/* 28,41,03,bb */
295*4882a593Smuzhiyun 	{0xbb, 0x40, 0x2c03},				/* 2c,40,03,bb */
296*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
297*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
298*4882a593Smuzhiyun 	{}
299*4882a593Smuzhiyun };
300*4882a593Smuzhiyun static const struct usb_action adcm2700_50HZ[] = {
301*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
302*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
303*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
304*4882a593Smuzhiyun 	{0xbb, 0x05, 0x8400},				/* 84,05,00,bb */
305*4882a593Smuzhiyun 	{0xbb, 0xd0, 0xb007},				/* b0,d0,07,bb */
306*4882a593Smuzhiyun 	{0xbb, 0xa0, 0xb80f},				/* b8,a0,0f,bb */
307*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
308*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
309*4882a593Smuzhiyun 	{0xaa, 0x26, 0x00d0},				/* 00,26,d0,aa */
310*4882a593Smuzhiyun 	{0xaa, 0x28, 0x0002},				/* 00,28,02,aa */
311*4882a593Smuzhiyun 	{}
312*4882a593Smuzhiyun };
313*4882a593Smuzhiyun static const struct usb_action adcm2700_60HZ[] = {
314*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
315*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
316*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
317*4882a593Smuzhiyun 	{0xbb, 0x07, 0x8400},				/* 84,07,00,bb */
318*4882a593Smuzhiyun 	{0xbb, 0x82, 0xb006},				/* b0,82,06,bb */
319*4882a593Smuzhiyun 	{0xbb, 0x04, 0xb80d},				/* b8,04,0d,bb */
320*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
321*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
322*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0057},				/* 00,26,57,aa */
323*4882a593Smuzhiyun 	{0xaa, 0x28, 0x0002},				/* 00,28,02,aa */
324*4882a593Smuzhiyun 	{}
325*4882a593Smuzhiyun };
326*4882a593Smuzhiyun static const struct usb_action adcm2700_NoFliker[] = {
327*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
328*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
329*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
330*4882a593Smuzhiyun 	{0xbb, 0x07, 0x8400},				/* 84,07,00,bb */
331*4882a593Smuzhiyun 	{0xbb, 0x05, 0xb000},				/* b0,05,00,bb */
332*4882a593Smuzhiyun 	{0xbb, 0xa0, 0xb801},				/* b8,a0,01,bb */
333*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
334*4882a593Smuzhiyun 	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
335*4882a593Smuzhiyun 	{}
336*4882a593Smuzhiyun };
337*4882a593Smuzhiyun static const struct usb_action cs2102_InitialScale[] = {	/* 320x240 */
338*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
339*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
340*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
341*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
342*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
343*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
344*4882a593Smuzhiyun 	{0xa0, 0x30, ZC3XX_R083_RGAINADDR},
345*4882a593Smuzhiyun 	{0xa0, 0x31, ZC3XX_R084_GGAINADDR},
346*4882a593Smuzhiyun 	{0xa0, 0x32, ZC3XX_R085_BGAINADDR},
347*4882a593Smuzhiyun 	{0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
348*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
349*4882a593Smuzhiyun 	{0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
350*4882a593Smuzhiyun 	{0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
351*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
352*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
353*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
354*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
355*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
356*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
357*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
358*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
359*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
360*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
361*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
362*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0008},
363*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0000},
364*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0000},
365*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0089},
366*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0000},
367*4882a593Smuzhiyun 	{0xaa, 0x14, 0x00e9},
368*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},
369*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0000},
370*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0004},
371*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0030},
372*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0030},
373*4882a593Smuzhiyun 	{0xaa, 0x32, 0x0030},
374*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
375*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
376*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
377*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
378*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
379*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
380*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
381*4882a593Smuzhiyun 	{0xa0, 0x10, 0x01ae},
382*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
383*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
384*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R18D_YTARGET},
385*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
386*4882a593Smuzhiyun 	{}
387*4882a593Smuzhiyun };
388*4882a593Smuzhiyun 
389*4882a593Smuzhiyun static const struct usb_action cs2102_Initial[] = {	/* 640x480 */
390*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
391*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
392*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
393*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
394*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
395*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
396*4882a593Smuzhiyun 	{0xa0, 0x30, ZC3XX_R083_RGAINADDR},
397*4882a593Smuzhiyun 	{0xa0, 0x31, ZC3XX_R084_GGAINADDR},
398*4882a593Smuzhiyun 	{0xa0, 0x32, ZC3XX_R085_BGAINADDR},
399*4882a593Smuzhiyun 	{0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
400*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
401*4882a593Smuzhiyun 	{0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
402*4882a593Smuzhiyun 	{0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
403*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
404*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
405*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
406*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
407*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
408*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
409*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
410*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
411*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
412*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
413*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
414*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0008},
415*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0000},
416*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0001},
417*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0087},
418*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0001},
419*4882a593Smuzhiyun 	{0xaa, 0x14, 0x00e7},
420*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},
421*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0000},
422*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0004},
423*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0030},
424*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0030},
425*4882a593Smuzhiyun 	{0xaa, 0x32, 0x0030},
426*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
427*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
428*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
429*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
430*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
431*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
432*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
433*4882a593Smuzhiyun 	{0xa0, 0x15, 0x01ae},
434*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
435*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
436*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R18D_YTARGET},
437*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
438*4882a593Smuzhiyun 	{}
439*4882a593Smuzhiyun };
440*4882a593Smuzhiyun static const struct usb_action cs2102_50HZScale[] = {
441*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
442*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0001},
443*4882a593Smuzhiyun 	{0xaa, 0x24, 0x005f},
444*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0090},
445*4882a593Smuzhiyun 	{0xaa, 0x21, 0x00dd},
446*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
447*4882a593Smuzhiyun 	{0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
448*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
449*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
450*4882a593Smuzhiyun 	{0xa0, 0x3a, ZC3XX_R196_ANTIFLICKERMID},
451*4882a593Smuzhiyun 	{0xa0, 0x98, ZC3XX_R197_ANTIFLICKERLOW},
452*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
453*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
454*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
455*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
456*4882a593Smuzhiyun 	{0xa0, 0xdd, ZC3XX_R01D_HSYNC_0},
457*4882a593Smuzhiyun 	{0xa0, 0xe4, ZC3XX_R01E_HSYNC_1},
458*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
459*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
460*4882a593Smuzhiyun 	{}
461*4882a593Smuzhiyun };
462*4882a593Smuzhiyun static const struct usb_action cs2102_50HZ[] = {
463*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
464*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0000},
465*4882a593Smuzhiyun 	{0xaa, 0x24, 0x00af},
466*4882a593Smuzhiyun 	{0xaa, 0x25, 0x00c8},
467*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0068},
468*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
469*4882a593Smuzhiyun 	{0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
470*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R192_EXPOSURELIMITLOW},
471*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
472*4882a593Smuzhiyun 	{0xa0, 0x1d, ZC3XX_R196_ANTIFLICKERMID},
473*4882a593Smuzhiyun 	{0xa0, 0x4c, ZC3XX_R197_ANTIFLICKERLOW},
474*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
475*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
476*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
477*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
478*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R01D_HSYNC_0},
479*4882a593Smuzhiyun 	{0xa0, 0xe3, ZC3XX_R01E_HSYNC_1},
480*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
481*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
482*4882a593Smuzhiyun 	{}
483*4882a593Smuzhiyun };
484*4882a593Smuzhiyun static const struct usb_action cs2102_60HZScale[] = {
485*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
486*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0001},
487*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0055},
488*4882a593Smuzhiyun 	{0xaa, 0x25, 0x00cc},
489*4882a593Smuzhiyun 	{0xaa, 0x21, 0x003f},
490*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
491*4882a593Smuzhiyun 	{0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
492*4882a593Smuzhiyun 	{0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
493*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
494*4882a593Smuzhiyun 	{0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
495*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
496*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
497*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
498*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
499*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
500*4882a593Smuzhiyun 	{0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
501*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
502*4882a593Smuzhiyun 	{0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
503*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
504*4882a593Smuzhiyun 	{}
505*4882a593Smuzhiyun };
506*4882a593Smuzhiyun static const struct usb_action cs2102_60HZ[] = {
507*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
508*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0000},
509*4882a593Smuzhiyun 	{0xaa, 0x24, 0x00aa},
510*4882a593Smuzhiyun 	{0xaa, 0x25, 0x00e6},
511*4882a593Smuzhiyun 	{0xaa, 0x21, 0x003f},
512*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
513*4882a593Smuzhiyun 	{0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
514*4882a593Smuzhiyun 	{0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
515*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
516*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
517*4882a593Smuzhiyun 	{0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
518*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
519*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
520*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
521*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
522*4882a593Smuzhiyun 	{0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
523*4882a593Smuzhiyun 	{0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
524*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
525*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
526*4882a593Smuzhiyun 	{}
527*4882a593Smuzhiyun };
528*4882a593Smuzhiyun static const struct usb_action cs2102_NoFlikerScale[] = {
529*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
530*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0001},
531*4882a593Smuzhiyun 	{0xaa, 0x24, 0x005f},
532*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0000},
533*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0001},
534*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
535*4882a593Smuzhiyun 	{0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
536*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
537*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
538*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
539*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
540*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
541*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
542*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
543*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
544*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
545*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
546*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
547*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
548*4882a593Smuzhiyun 	{}
549*4882a593Smuzhiyun };
550*4882a593Smuzhiyun static const struct usb_action cs2102_NoFliker[] = {
551*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
552*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0000},
553*4882a593Smuzhiyun 	{0xaa, 0x24, 0x00af},
554*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0080},
555*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0001},
556*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
557*4882a593Smuzhiyun 	{0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
558*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
559*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
560*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
561*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
562*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
563*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
564*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
565*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
566*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
567*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
568*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
569*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
570*4882a593Smuzhiyun 	{}
571*4882a593Smuzhiyun };
572*4882a593Smuzhiyun 
573*4882a593Smuzhiyun /* CS2102_KOCOM */
574*4882a593Smuzhiyun static const struct usb_action cs2102K_InitialScale[] = {
575*4882a593Smuzhiyun 	{0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
576*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
577*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
578*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
579*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
580*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
581*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
582*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
583*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
584*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
585*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
586*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
587*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
588*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
589*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
590*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
591*4882a593Smuzhiyun 	{0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
592*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
593*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
594*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
595*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
596*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
597*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
598*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
599*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
600*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
601*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
602*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
603*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
604*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
605*4882a593Smuzhiyun 	{0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
606*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
607*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
608*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
609*4882a593Smuzhiyun 	{0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
610*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
611*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
612*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
613*4882a593Smuzhiyun 	{0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
614*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
615*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
616*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
617*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
618*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
619*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
620*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
621*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
622*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
623*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
624*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
625*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
626*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
627*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
628*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
629*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
630*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
631*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
632*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
633*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
634*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
635*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
636*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
637*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
638*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
639*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
640*4882a593Smuzhiyun 	{0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
641*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
642*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
643*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
644*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
645*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
646*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
647*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
648*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
649*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
650*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
651*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
652*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
653*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
654*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
655*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
656*4882a593Smuzhiyun 	{0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
657*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
658*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
659*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
660*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
661*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
662*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
663*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
664*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
665*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
666*4882a593Smuzhiyun 	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
667*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
668*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
669*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
670*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
671*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
672*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
673*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
674*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
675*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
676*4882a593Smuzhiyun 	{0xa0, 0x01, 0x01b1},
677*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
678*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R116_RGAIN},
679*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
680*4882a593Smuzhiyun 	{0xa0, 0x4c, ZC3XX_R118_BGAIN},
681*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
682*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
683*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
684*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
685*4882a593Smuzhiyun 	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
686*4882a593Smuzhiyun 	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
687*4882a593Smuzhiyun 	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
688*4882a593Smuzhiyun 	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
689*4882a593Smuzhiyun 	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
690*4882a593Smuzhiyun 	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
691*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
692*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
693*4882a593Smuzhiyun 	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
694*4882a593Smuzhiyun 	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
695*4882a593Smuzhiyun 	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
696*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
697*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
698*4882a593Smuzhiyun 	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
699*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
700*4882a593Smuzhiyun 	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
701*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
702*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
703*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
704*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
705*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
706*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
707*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
708*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
709*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
710*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
711*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
712*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
713*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
714*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
715*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
716*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
717*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
718*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
719*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
720*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R10E_RGB11},
721*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
722*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R110_RGB20},
723*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R111_RGB21},
724*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R112_RGB22},
725*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
726*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
727*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
728*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
729*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
730*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
731*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
732*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
733*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
734*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
735*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
736*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
737*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
738*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
739*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
740*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
741*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
742*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
743*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
744*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
745*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
746*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
747*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
748*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
749*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
750*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
751*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
752*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
753*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
754*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
755*4882a593Smuzhiyun 	{0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
756*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
757*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
758*4882a593Smuzhiyun 	{0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
759*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
760*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
761*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
762*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
763*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
764*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
765*4882a593Smuzhiyun 	{0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
766*4882a593Smuzhiyun 	{0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
767*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
768*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
769*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
770*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
771*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R116_RGAIN},
772*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
773*4882a593Smuzhiyun 	{0xa0, 0x4c, ZC3XX_R118_BGAIN},
774*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
775*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
776*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
777*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
778*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
779*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
780*4882a593Smuzhiyun 	{0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
781*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
782*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
783*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
784*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
785*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
786*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
787*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
788*4882a593Smuzhiyun 	{0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
789*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
790*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
791*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
792*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
793*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
794*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
795*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
796*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
797*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
798*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
799*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
800*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
801*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
802*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
803*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
804*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
805*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
806*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
807*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
808*4882a593Smuzhiyun 	{0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
809*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
810*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
811*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
812*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
813*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
814*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
815*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
816*4882a593Smuzhiyun 	{0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
817*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
818*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
819*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
820*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
821*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
822*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
823*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
824*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
825*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
826*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
827*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
828*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
829*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
830*4882a593Smuzhiyun 	{}
831*4882a593Smuzhiyun };
832*4882a593Smuzhiyun 
833*4882a593Smuzhiyun static const struct usb_action cs2102K_Initial[] = {
834*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
835*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
836*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
837*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
838*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
839*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
840*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
841*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
842*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
843*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
844*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
845*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
846*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
847*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
848*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
849*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
850*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
851*4882a593Smuzhiyun /*fixme: next sequence = i2c exchanges*/
852*4882a593Smuzhiyun 	{0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
853*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
854*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
855*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
856*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
857*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
858*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
859*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
860*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
861*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
862*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
863*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
864*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
865*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
866*4882a593Smuzhiyun 	{0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
867*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
868*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
869*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
870*4882a593Smuzhiyun 	{0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
871*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
872*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
873*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
874*4882a593Smuzhiyun 	{0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
875*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
876*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
877*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
878*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
879*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
880*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
881*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
882*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
883*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
884*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
885*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
886*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
887*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
888*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
889*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
890*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
891*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
892*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
893*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
894*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
895*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
896*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
897*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
898*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
899*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
900*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
901*4882a593Smuzhiyun 	{0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
902*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
903*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
904*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
905*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
906*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
907*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
908*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
909*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
910*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
911*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
912*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
913*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
914*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
915*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
916*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
917*4882a593Smuzhiyun 	{0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
918*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
919*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
920*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
921*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
922*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
923*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
924*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
925*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
926*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
927*4882a593Smuzhiyun 	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
928*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
929*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
930*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
931*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
932*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
933*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
934*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
935*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
936*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
937*4882a593Smuzhiyun 	{0xa0, 0x01, 0x01b1},
938*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
939*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R116_RGAIN},
940*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
941*4882a593Smuzhiyun 	{0xa0, 0x4c, ZC3XX_R118_BGAIN},
942*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
943*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
944*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
945*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
946*4882a593Smuzhiyun 	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
947*4882a593Smuzhiyun 	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
948*4882a593Smuzhiyun 	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
949*4882a593Smuzhiyun 	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
950*4882a593Smuzhiyun 	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
951*4882a593Smuzhiyun 	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
952*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
953*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
954*4882a593Smuzhiyun 	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
955*4882a593Smuzhiyun 	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
956*4882a593Smuzhiyun 	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
957*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
958*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
959*4882a593Smuzhiyun 	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
960*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
961*4882a593Smuzhiyun 	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
962*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
963*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
964*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
965*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
966*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
967*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
968*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
969*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
970*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
971*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
972*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
973*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
974*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
975*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
976*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
977*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
978*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
979*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
980*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
981*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R10E_RGB11},
982*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
983*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R110_RGB20},
984*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R111_RGB21},
985*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R112_RGB22},
986*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
987*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
988*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
989*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
990*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
991*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
992*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
993*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
994*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
995*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
996*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
997*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
998*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
999*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1000*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1001*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1002*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1003*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1004*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1005*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
1006*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1007*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1008*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1009*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1010*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1011*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1012*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
1013*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
1014*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1015*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
1016*4882a593Smuzhiyun 	{0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
1017*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1018*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1019*4882a593Smuzhiyun 	{0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
1020*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1021*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1022*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1023*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1024*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1025*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
1026*4882a593Smuzhiyun 	{0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
1027*4882a593Smuzhiyun 	{0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
1028*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1029*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1030*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1031*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1032*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R116_RGAIN},
1033*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
1034*4882a593Smuzhiyun 	{0xa0, 0x4c, ZC3XX_R118_BGAIN},
1035*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1036*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1037*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1038*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1039*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1040*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1041*4882a593Smuzhiyun 	{0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1042*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1043*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1044*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1045*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1046*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1047*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1048*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1049*4882a593Smuzhiyun 	{0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
1050*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1051*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1052*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1053*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1054*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1055*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1056*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1057*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1058*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1059*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1060*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1061*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1062*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1063*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1064*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1065*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1066*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1067*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1068*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1069*4882a593Smuzhiyun 	{0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1070*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1071*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1072*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1073*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1074*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1075*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1076*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1077*4882a593Smuzhiyun 	{0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
1078*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1079*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1080*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1081*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1082*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1083*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1084*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1085*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1086*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1087*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1088*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1089*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1090*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1091*4882a593Smuzhiyun /*fixme:what does the next sequence?*/
1092*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1093*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1094*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1095*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1096*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1097*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1098*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1099*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1100*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1101*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1102*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1103*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1104*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1105*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1106*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1107*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1108*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
1109*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1110*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1111*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1112*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
1113*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1114*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1115*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1116*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1117*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1118*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1119*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1120*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
1121*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1122*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1123*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1124*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1125*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1126*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1127*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1128*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1129*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1130*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1131*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1132*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1133*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1134*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1135*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1136*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1137*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
1138*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1139*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1140*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1141*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1142*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1143*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1144*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1145*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1146*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1147*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1148*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1149*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1150*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1151*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1152*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1153*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1154*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1155*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1156*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1157*4882a593Smuzhiyun 	{0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1158*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1159*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1160*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1161*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1162*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1163*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1164*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1165*4882a593Smuzhiyun 	{0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
1166*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1167*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1168*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1169*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1170*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1171*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1172*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1173*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1174*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1175*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1176*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1177*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1178*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1179*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1180*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
1181*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1182*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1183*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1184*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
1185*4882a593Smuzhiyun 	{0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1186*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1187*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1188*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1189*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
1190*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1191*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1192*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
1193*4882a593Smuzhiyun 	{0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
1194*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1195*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1196*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
1197*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
1198*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1199*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1200*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
1201*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
1202*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
1203*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
1204*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1205*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1206*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1207*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1208*4882a593Smuzhiyun 	{}
1209*4882a593Smuzhiyun };
1210*4882a593Smuzhiyun 
1211*4882a593Smuzhiyun static const struct usb_action gc0305_Initial[] = {	/* 640x480 */
1212*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},	/* 00,00,01,cc */
1213*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00,08,03,cc */
1214*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
1215*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},	/* 00,02,04,cc */
1216*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
1217*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},	/* 00,04,80,cc */
1218*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
1219*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc */
1220*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
1221*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
1222*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
1223*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},	/* 00,98,00,cc */
1224*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},	/* 00,9a,00,cc */
1225*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},	/* 01,1a,00,cc */
1226*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},	/* 01,1c,00,cc */
1227*4882a593Smuzhiyun 	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},	/* 00,9c,e6,cc */
1228*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},	/* 00,9e,86,cc */
1229*4882a593Smuzhiyun 	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},	/* 00,8b,98,cc */
1230*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0002},	/* 00,13,02,aa */
1231*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0003},	/* 00,15,03,aa */
1232*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0000},	/* 00,01,00,aa */
1233*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0000},	/* 00,02,00,aa */
1234*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0000},	/* 00,1a,00,aa */
1235*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0017},	/* 00,1c,17,aa */
1236*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0080},	/* 00,1d,80,aa */
1237*4882a593Smuzhiyun 	{0xaa, 0x1f, 0x0008},	/* 00,1f,08,aa */
1238*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0012},	/* 00,21,12,aa */
1239*4882a593Smuzhiyun 	{0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},	/* 00,86,82,cc */
1240*4882a593Smuzhiyun 	{0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},	/* 00,87,83,cc */
1241*4882a593Smuzhiyun 	{0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},	/* 00,88,84,cc */
1242*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0000},	/* 00,05,00,aa */
1243*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0000},	/* 00,0a,00,aa */
1244*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x00b0},	/* 00,0b,b0,aa */
1245*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0000},	/* 00,0c,00,aa */
1246*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x00b0},	/* 00,0d,b0,aa */
1247*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0000},	/* 00,0e,00,aa */
1248*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x00b0},	/* 00,0f,b0,aa */
1249*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0000},	/* 00,10,00,aa */
1250*4882a593Smuzhiyun 	{0xaa, 0x11, 0x00b0},	/* 00,11,b0,aa */
1251*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0001},	/* 00,16,01,aa */
1252*4882a593Smuzhiyun 	{0xaa, 0x17, 0x00e6},	/* 00,17,e6,aa */
1253*4882a593Smuzhiyun 	{0xaa, 0x18, 0x0002},	/* 00,18,02,aa */
1254*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0086},	/* 00,19,86,aa */
1255*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},	/* 00,20,00,aa */
1256*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0020},	/* 00,1b,20,aa */
1257*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc */
1258*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc */
1259*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},	/* 01,00,0d,cc */
1260*4882a593Smuzhiyun 	{0xa0, 0x76, ZC3XX_R189_AWBSTATUS},	/* 01,89,76,cc */
1261*4882a593Smuzhiyun 	{0xa0, 0x09, 0x01ad},	/* 01,ad,09,cc */
1262*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},	/* 01,c5,03,cc */
1263*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},	/* 01,cb,13,cc */
1264*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
1265*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},	/* 03,01,08,cc */
1266*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},	/* 01,a8,60,cc */
1267*4882a593Smuzhiyun 	{0xa0, 0x85, ZC3XX_R18D_YTARGET},	/* 01,8d,85,cc */
1268*4882a593Smuzhiyun 	{0xa0, 0x00, 0x011e},	/* 01,1e,00,cc */
1269*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R116_RGAIN},	/* 01,16,52,cc */
1270*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},	/* 01,17,40,cc */
1271*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R118_BGAIN},	/* 01,18,52,cc */
1272*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R113_RGB03},	/* 01,13,03,cc */
1273*4882a593Smuzhiyun 	{}
1274*4882a593Smuzhiyun };
1275*4882a593Smuzhiyun static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
1276*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},	/* 00,00,01,cc */
1277*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00,08,03,cc */
1278*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
1279*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},	/* 00,02,10,cc */
1280*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
1281*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},	/* 00,04,80,cc */
1282*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
1283*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc */
1284*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
1285*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
1286*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
1287*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},	/* 00,98,00,cc */
1288*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},	/* 00,9a,00,cc */
1289*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},	/* 01,1a,00,cc */
1290*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},	/* 01,1c,00,cc */
1291*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},	/* 00,9c,e8,cc */
1292*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},	/* 00,9e,88,cc */
1293*4882a593Smuzhiyun 	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},	/* 00,8b,98,cc */
1294*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0000},	/* 00,13,00,aa */
1295*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0001},	/* 00,15,01,aa */
1296*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0000},	/* 00,01,00,aa */
1297*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0000},	/* 00,02,00,aa */
1298*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0000},	/* 00,1a,00,aa */
1299*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0017},	/* 00,1c,17,aa */
1300*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0080},	/* 00,1d,80,aa */
1301*4882a593Smuzhiyun 	{0xaa, 0x1f, 0x0008},	/* 00,1f,08,aa */
1302*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0012},	/* 00,21,12,aa */
1303*4882a593Smuzhiyun 	{0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},	/* 00,86,82,cc */
1304*4882a593Smuzhiyun 	{0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},	/* 00,87,83,cc */
1305*4882a593Smuzhiyun 	{0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},	/* 00,88,84,cc */
1306*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0000},	/* 00,05,00,aa */
1307*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0000},	/* 00,0a,00,aa */
1308*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x00b0},	/* 00,0b,b0,aa */
1309*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0000},	/* 00,0c,00,aa */
1310*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x00b0},	/* 00,0d,b0,aa */
1311*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0000},	/* 00,0e,00,aa */
1312*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x00b0},	/* 00,0f,b0,aa */
1313*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0000},	/* 00,10,00,aa */
1314*4882a593Smuzhiyun 	{0xaa, 0x11, 0x00b0},	/* 00,11,b0,aa */
1315*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0001},	/* 00,16,01,aa */
1316*4882a593Smuzhiyun 	{0xaa, 0x17, 0x00e8},	/* 00,17,e8,aa */
1317*4882a593Smuzhiyun 	{0xaa, 0x18, 0x0002},	/* 00,18,02,aa */
1318*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0088},	/* 00,19,88,aa */
1319*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},	/* 00,20,00,aa */
1320*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0020},	/* 00,1b,20,aa */
1321*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc */
1322*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc */
1323*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},	/* 01,00,0d,cc */
1324*4882a593Smuzhiyun 	{0xa0, 0x76, ZC3XX_R189_AWBSTATUS},	/* 01,89,76,cc */
1325*4882a593Smuzhiyun 	{0xa0, 0x09, 0x01ad},	/* 01,ad,09,cc */
1326*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},	/* 01,c5,03,cc */
1327*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},	/* 01,cb,13,cc */
1328*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
1329*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},	/* 03,01,08,cc */
1330*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},	/* 01,a8,60,cc */
1331*4882a593Smuzhiyun 	{0xa0, 0x00, 0x011e},	/* 01,1e,00,cc */
1332*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R116_RGAIN},	/* 01,16,52,cc */
1333*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},	/* 01,17,40,cc */
1334*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R118_BGAIN},	/* 01,18,52,cc */
1335*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R113_RGB03},	/* 01,13,03,cc */
1336*4882a593Smuzhiyun 	{}
1337*4882a593Smuzhiyun };
1338*4882a593Smuzhiyun static const struct usb_action gc0305_50HZ[] = {
1339*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},	/* 00,82,00,aa */
1340*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0002},	/* 00,83,02,aa */
1341*4882a593Smuzhiyun 	{0xaa, 0x84, 0x0038},	/* 00,84,38,aa */	/* win: 00,84,ec */
1342*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
1343*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0b,cc */
1344*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,18,cc */
1345*4882a593Smuzhiyun 							/* win: 01,92,10 */
1346*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
1347*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
1348*4882a593Smuzhiyun 	{0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,8e,cc */
1349*4882a593Smuzhiyun 							/* win: 01,97,ec */
1350*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0e,cc */
1351*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,15,cc */
1352*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc */
1353*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
1354*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},	/* 00,1d,62,cc */
1355*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},	/* 00,1e,90,cc */
1356*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},	/* 00,1f,c8,cc */
1357*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},	/* 00,20,ff,cc */
1358*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},	/* 01,1d,60,cc */
1359*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc */
1360*4882a593Smuzhiyun /*	{0xa0, 0x85, ZC3XX_R18D_YTARGET},	 * 01,8d,85,cc *
1361*4882a593Smuzhiyun 						 * if 640x480 */
1362*4882a593Smuzhiyun 	{}
1363*4882a593Smuzhiyun };
1364*4882a593Smuzhiyun static const struct usb_action gc0305_60HZ[] = {
1365*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},	/* 00,82,00,aa */
1366*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0000},	/* 00,83,00,aa */
1367*4882a593Smuzhiyun 	{0xaa, 0x84, 0x00ec},	/* 00,84,ec,aa */
1368*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
1369*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0b,cc */
1370*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,10,cc */
1371*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
1372*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
1373*4882a593Smuzhiyun 	{0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,ec,cc */
1374*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0e,cc */
1375*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,15,cc */
1376*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc */
1377*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
1378*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},	/* 00,1d,62,cc */
1379*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},	/* 00,1e,90,cc */
1380*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},	/* 00,1f,c8,cc */
1381*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},	/* 00,20,ff,cc */
1382*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},	/* 01,1d,60,cc */
1383*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc */
1384*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R18D_YTARGET},	/* 01,8d,80,cc */
1385*4882a593Smuzhiyun 	{}
1386*4882a593Smuzhiyun };
1387*4882a593Smuzhiyun 
1388*4882a593Smuzhiyun static const struct usb_action gc0305_NoFliker[] = {
1389*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},	/* 01,00,0c,cc */
1390*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},	/* 00,82,00,aa */
1391*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0000},	/* 00,83,00,aa */
1392*4882a593Smuzhiyun 	{0xaa, 0x84, 0x0020},	/* 00,84,20,aa */
1393*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
1394*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,00,cc */
1395*4882a593Smuzhiyun 	{0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,48,cc */
1396*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
1397*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
1398*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,10,cc */
1399*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0e,cc */
1400*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,15,cc */
1401*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},	/* 00,1d,62,cc */
1402*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},	/* 00,1e,90,cc */
1403*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},	/* 00,1f,c8,cc */
1404*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},	/* 00,20,ff,cc */
1405*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},	/* 01,1d,60,cc */
1406*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,03,cc */
1407*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R18D_YTARGET},	/* 01,8d,80,cc */
1408*4882a593Smuzhiyun 	{}
1409*4882a593Smuzhiyun };
1410*4882a593Smuzhiyun 
1411*4882a593Smuzhiyun static const struct usb_action hdcs2020_InitialScale[] = {
1412*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1413*4882a593Smuzhiyun 	{0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1414*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* qtable 0x05 */
1415*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1416*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1417*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1418*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1419*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1420*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1421*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1422*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1423*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1424*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1425*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1426*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1427*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1428*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1429*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0000},
1430*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0001},
1431*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0006},
1432*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x007b},
1433*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x00a7},
1434*4882a593Smuzhiyun 	{0xaa, 0x03, 0x00fb},
1435*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0000},
1436*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0003},
1437*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0008},
1438*4882a593Smuzhiyun 
1439*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0018},	/* set sensor gain */
1440*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0018},
1441*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0018},
1442*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0018},
1443*4882a593Smuzhiyun 
1444*4882a593Smuzhiyun 	{0xaa, 0x15, 0x004e},
1445*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0004},
1446*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1447*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1448*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R18D_YTARGET},
1449*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1450*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1451*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1452*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1453*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1454*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1455*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0002},
1456*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
1457*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
1458*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1459*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
1460*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
1461*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
1462*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
1463*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
1464*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
1465*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c8},
1466*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c9},
1467*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01ca},
1468*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
1469*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
1470*4882a593Smuzhiyun 	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
1471*4882a593Smuzhiyun 	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
1472*4882a593Smuzhiyun 	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
1473*4882a593Smuzhiyun 	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
1474*4882a593Smuzhiyun 	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1475*4882a593Smuzhiyun 	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1476*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1477*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1478*4882a593Smuzhiyun 	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1479*4882a593Smuzhiyun 	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1480*4882a593Smuzhiyun 	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1481*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1482*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1483*4882a593Smuzhiyun 	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1484*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1485*4882a593Smuzhiyun 	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
1486*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
1487*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
1488*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1489*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
1490*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
1491*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
1492*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1493*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1494*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
1495*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1496*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1497*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1498*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1499*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1500*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1501*4882a593Smuzhiyun 
1502*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R10A_RGB00},	/* matrix */
1503*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R10B_RGB01},
1504*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R10C_RGB02},
1505*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R10D_RGB10},
1506*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R10E_RGB11},
1507*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R10F_RGB12},
1508*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R110_RGB20},
1509*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R111_RGB21},
1510*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R112_RGB22},
1511*4882a593Smuzhiyun 
1512*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
1513*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1514*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1515*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0031},
1516*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},
1517*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0004},
1518*4882a593Smuzhiyun 	{0xaa, 0x19, 0x00cd},
1519*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1520*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1521*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1522*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1523*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1524*4882a593Smuzhiyun 	{0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1525*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1526*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1527*4882a593Smuzhiyun 
1528*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 0x14 */
1529*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1530*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1531*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1532*4882a593Smuzhiyun 	{0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1533*4882a593Smuzhiyun 	{0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1534*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1535*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1536*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
1537*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1538*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
1539*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
1540*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
1541*4882a593Smuzhiyun 	{}
1542*4882a593Smuzhiyun };
1543*4882a593Smuzhiyun static const struct usb_action hdcs2020_Initial[] = {
1544*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1545*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1546*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1547*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
1548*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1549*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1550*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1551*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1552*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1553*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1554*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1555*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1556*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1557*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1558*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1559*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1560*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1561*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0000},
1562*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0001},
1563*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0006},
1564*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x007a},
1565*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x00a7},
1566*4882a593Smuzhiyun 	{0xaa, 0x03, 0x00fb},
1567*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0000},
1568*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0003},
1569*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0008},
1570*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0018},	/* original setting */
1571*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0018},
1572*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0018},
1573*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0018},
1574*4882a593Smuzhiyun 	{0xaa, 0x15, 0x004e},
1575*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0004},
1576*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
1577*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1578*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R18D_YTARGET},
1579*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1580*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1581*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1582*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1583*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1584*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1585*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0002},
1586*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
1587*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
1588*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
1589*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
1590*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
1591*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
1592*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
1593*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
1594*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
1595*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c8},
1596*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c9},
1597*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01ca},
1598*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
1599*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
1600*4882a593Smuzhiyun 	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
1601*4882a593Smuzhiyun 	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
1602*4882a593Smuzhiyun 	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
1603*4882a593Smuzhiyun 	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
1604*4882a593Smuzhiyun 	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
1605*4882a593Smuzhiyun 	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
1606*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
1607*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
1608*4882a593Smuzhiyun 	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
1609*4882a593Smuzhiyun 	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
1610*4882a593Smuzhiyun 	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
1611*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
1612*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
1613*4882a593Smuzhiyun 	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
1614*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1615*4882a593Smuzhiyun 	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
1616*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
1617*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
1618*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1619*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
1620*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
1621*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
1622*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1623*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1624*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
1625*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1626*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1627*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1628*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1629*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1630*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1631*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R10A_RGB00},	/* matrix */
1632*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R10B_RGB01},
1633*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R10C_RGB02},
1634*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R10D_RGB10},
1635*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R10E_RGB11},
1636*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R10F_RGB12},
1637*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R110_RGB20},
1638*4882a593Smuzhiyun 	{0xa0, 0xed, ZC3XX_R111_RGB21},
1639*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R112_RGB22},
1640*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
1641*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1642*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1643*4882a593Smuzhiyun  /**** set exposure ***/
1644*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0031},
1645*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},
1646*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0004},
1647*4882a593Smuzhiyun 	{0xaa, 0x19, 0x00cd},
1648*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1649*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1650*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
1651*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1652*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1653*4882a593Smuzhiyun 	{0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
1654*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1655*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1656*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
1657*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
1658*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
1659*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
1660*4882a593Smuzhiyun 	{0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
1661*4882a593Smuzhiyun 	{0xa0, 0x41, ZC3XX_R020_HSYNC_3},
1662*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
1663*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1664*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
1665*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1666*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
1667*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
1668*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
1669*4882a593Smuzhiyun 	{}
1670*4882a593Smuzhiyun };
1671*4882a593Smuzhiyun static const struct usb_action hdcs2020_50HZ[] = {
1672*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1673*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0018},			/* 00,13,18,aa */
1674*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},			/* 00,14,01,aa */
1675*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0005},			/* 00,0e,05,aa */
1676*4882a593Smuzhiyun 	{0xaa, 0x19, 0x001f},			/* 00,19,1f,aa */
1677*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1678*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1679*4882a593Smuzhiyun 	{0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
1680*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1681*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1682*4882a593Smuzhiyun 	{0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
1683*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1684*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1685*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1686*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1687*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
1688*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
1689*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
1690*4882a593Smuzhiyun 	{}
1691*4882a593Smuzhiyun };
1692*4882a593Smuzhiyun static const struct usb_action hdcs2020_60HZ[] = {
1693*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1694*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0031},			/* 00,13,31,aa */
1695*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},			/* 00,14,01,aa */
1696*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0004},			/* 00,0e,04,aa */
1697*4882a593Smuzhiyun 	{0xaa, 0x19, 0x00cd},			/* 00,19,cd,aa */
1698*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1699*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1700*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
1701*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1702*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1703*4882a593Smuzhiyun 	{0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
1704*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1705*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1706*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
1707*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
1708*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1709*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
1710*4882a593Smuzhiyun 	{0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
1711*4882a593Smuzhiyun 	{}
1712*4882a593Smuzhiyun };
1713*4882a593Smuzhiyun static const struct usb_action hdcs2020_NoFliker[] = {
1714*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1715*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0010},			/* 00,13,10,aa */
1716*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},			/* 00,14,01,aa */
1717*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0004},			/* 00,0e,04,aa */
1718*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0000},			/* 00,19,00,aa */
1719*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
1720*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
1721*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
1722*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
1723*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
1724*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
1725*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
1726*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
1727*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
1728*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
1729*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
1730*4882a593Smuzhiyun 	{0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
1731*4882a593Smuzhiyun 	{0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
1732*4882a593Smuzhiyun 	{}
1733*4882a593Smuzhiyun };
1734*4882a593Smuzhiyun 
1735*4882a593Smuzhiyun static const struct usb_action hv7131b_InitialScale[] = {	/* 320x240 */
1736*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1737*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1738*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1739*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1740*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
1741*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
1742*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1743*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1744*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1745*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1746*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1747*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1748*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1749*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1750*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1751*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1752*4882a593Smuzhiyun 	{0xaa, 0x30, 0x002d},
1753*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0005},
1754*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0000},
1755*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0001},	/* {0xaa, 0x13, 0x0000}, */
1756*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},
1757*4882a593Smuzhiyun 	{0xaa, 0x15, 0x00e8},
1758*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0002},
1759*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0086},		/* 00,17,88,aa */
1760*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0038},
1761*4882a593Smuzhiyun 	{0xaa, 0x32, 0x0038},
1762*4882a593Smuzhiyun 	{0xaa, 0x33, 0x0038},
1763*4882a593Smuzhiyun 	{0xaa, 0x5b, 0x0001},
1764*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1765*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1766*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1767*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R18D_YTARGET},
1768*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
1769*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
1770*4882a593Smuzhiyun 	{0xa0, 0xc0, 0x019b},
1771*4882a593Smuzhiyun 	{0xa0, 0xa0, 0x019c},
1772*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R188_MINGAIN},
1773*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1774*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1775*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1776*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1777*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1778*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0090},			/* 00,02,80,aa */
1779*4882a593Smuzhiyun 	{}
1780*4882a593Smuzhiyun };
1781*4882a593Smuzhiyun 
1782*4882a593Smuzhiyun static const struct usb_action hv7131b_Initial[] = {	/* 640x480*/
1783*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1784*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1785*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
1786*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1787*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
1788*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
1789*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1790*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1791*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1792*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1793*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1794*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1795*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1796*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1797*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1798*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1799*4882a593Smuzhiyun 	{0xaa, 0x30, 0x002d},
1800*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0005},
1801*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0001},
1802*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0000},	/* {0xaa, 0x13, 0x0001}; */
1803*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},
1804*4882a593Smuzhiyun 	{0xaa, 0x15, 0x00e6},
1805*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0002},
1806*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0086},
1807*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0038},
1808*4882a593Smuzhiyun 	{0xaa, 0x32, 0x0038},
1809*4882a593Smuzhiyun 	{0xaa, 0x33, 0x0038},
1810*4882a593Smuzhiyun 	{0xaa, 0x5b, 0x0001},
1811*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1812*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
1813*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1814*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R18D_YTARGET},
1815*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
1816*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
1817*4882a593Smuzhiyun 	{0xa0, 0xc0, 0x019b},
1818*4882a593Smuzhiyun 	{0xa0, 0xa0, 0x019c},
1819*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R188_MINGAIN},
1820*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1821*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1822*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1823*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1824*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1825*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0090},	/* {0xaa, 0x02, 0x0080}, */
1826*4882a593Smuzhiyun 	{}
1827*4882a593Smuzhiyun };
1828*4882a593Smuzhiyun static const struct usb_action hv7131b_50HZ[] = {	/* 640x480*/
1829*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
1830*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0007},			/* 00,25,07,aa */
1831*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0053},			/* 00,26,53,aa */
1832*4882a593Smuzhiyun 	{0xaa, 0x27, 0x0000},			/* 00,27,00,aa */
1833*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
1834*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0050},			/* 00,21,50,aa */
1835*4882a593Smuzhiyun 	{0xaa, 0x22, 0x001b},			/* 00,22,1b,aa */
1836*4882a593Smuzhiyun 	{0xaa, 0x23, 0x00fc},			/* 00,23,fc,aa */
1837*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
1838*4882a593Smuzhiyun 	{0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,9b,cc */
1839*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,80,cc */
1840*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
1841*4882a593Smuzhiyun 	{0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,ea,cc */
1842*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,60,cc */
1843*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0c,cc */
1844*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,18,cc */
1845*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,18,cc */
1846*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
1847*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
1848*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R01E_HSYNC_1},	/* 00,1e,50,cc */
1849*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R01F_HSYNC_2},	/* 00,1f,1b,cc */
1850*4882a593Smuzhiyun 	{0xa0, 0xfc, ZC3XX_R020_HSYNC_3},	/* 00,20,fc,cc */
1851*4882a593Smuzhiyun 	{}
1852*4882a593Smuzhiyun };
1853*4882a593Smuzhiyun static const struct usb_action hv7131b_50HZScale[] = {	/* 320x240 */
1854*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
1855*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0007},			/* 00,25,07,aa */
1856*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0053},			/* 00,26,53,aa */
1857*4882a593Smuzhiyun 	{0xaa, 0x27, 0x0000},			/* 00,27,00,aa */
1858*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
1859*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0050},			/* 00,21,50,aa */
1860*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0012},			/* 00,22,12,aa */
1861*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0080},			/* 00,23,80,aa */
1862*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
1863*4882a593Smuzhiyun 	{0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,9b,cc */
1864*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,80,cc */
1865*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,01,cc */
1866*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,d4,cc */
1867*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,c0,cc */
1868*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R18C_AEFREEZE},	/* 01,8c,07,cc */
1869*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,0f,cc */
1870*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,18,cc */
1871*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
1872*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
1873*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R01E_HSYNC_1},	/* 00,1e,50,cc */
1874*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R01F_HSYNC_2},	/* 00,1f,12,cc */
1875*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R020_HSYNC_3},	/* 00,20,80,cc */
1876*4882a593Smuzhiyun 	{}
1877*4882a593Smuzhiyun };
1878*4882a593Smuzhiyun static const struct usb_action hv7131b_60HZ[] = {	/* 640x480*/
1879*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
1880*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0007},			/* 00,25,07,aa */
1881*4882a593Smuzhiyun 	{0xaa, 0x26, 0x00a1},			/* 00,26,a1,aa */
1882*4882a593Smuzhiyun 	{0xaa, 0x27, 0x0020},			/* 00,27,20,aa */
1883*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
1884*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0040},			/* 00,21,40,aa */
1885*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0013},			/* 00,22,13,aa */
1886*4882a593Smuzhiyun 	{0xaa, 0x23, 0x004c},			/* 00,23,4c,aa */
1887*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
1888*4882a593Smuzhiyun 	{0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,4d,cc */
1889*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,60,cc */
1890*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
1891*4882a593Smuzhiyun 	{0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,c3,cc */
1892*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,50,cc */
1893*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0c,cc */
1894*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,18,cc */
1895*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,18,cc */
1896*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
1897*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
1898*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},	/* 00,1e,40,cc */
1899*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R01F_HSYNC_2},	/* 00,1f,13,cc */
1900*4882a593Smuzhiyun 	{0xa0, 0x4c, ZC3XX_R020_HSYNC_3},	/* 00,20,4c,cc */
1901*4882a593Smuzhiyun 	{}
1902*4882a593Smuzhiyun };
1903*4882a593Smuzhiyun static const struct usb_action hv7131b_60HZScale[] = {	/* 320x240 */
1904*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
1905*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0007},			/* 00,25,07,aa */
1906*4882a593Smuzhiyun 	{0xaa, 0x26, 0x00a1},			/* 00,26,a1,aa */
1907*4882a593Smuzhiyun 	{0xaa, 0x27, 0x0020},			/* 00,27,20,aa */
1908*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
1909*4882a593Smuzhiyun 	{0xaa, 0x21, 0x00a0},			/* 00,21,a0,aa */
1910*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0016},			/* 00,22,16,aa */
1911*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0040},			/* 00,23,40,aa */
1912*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
1913*4882a593Smuzhiyun 	{0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,4d,cc */
1914*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,60,cc */
1915*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,01,cc */
1916*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,86,cc */
1917*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,a0,cc */
1918*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R18C_AEFREEZE},	/* 01,8c,07,cc */
1919*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,0f,cc */
1920*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,18,cc */
1921*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
1922*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
1923*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},	/* 00,1e,a0,cc */
1924*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R01F_HSYNC_2},	/* 00,1f,16,cc */
1925*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R020_HSYNC_3},	/* 00,20,40,cc */
1926*4882a593Smuzhiyun 	{}
1927*4882a593Smuzhiyun };
1928*4882a593Smuzhiyun static const struct usb_action hv7131b_NoFliker[] = {	/* 640x480*/
1929*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
1930*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0003},			/* 00,25,03,aa */
1931*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0000},			/* 00,26,00,aa */
1932*4882a593Smuzhiyun 	{0xaa, 0x27, 0x0000},			/* 00,27,00,aa */
1933*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
1934*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0010},			/* 00,21,10,aa */
1935*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0000},			/* 00,22,00,aa */
1936*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0003},			/* 00,23,03,aa */
1937*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
1938*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,f8,cc */
1939*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,00,cc */
1940*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
1941*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,02,cc */
1942*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,00,cc */
1943*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
1944*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,20,cc */
1945*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,00,cc */
1946*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,00,cc */
1947*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
1948*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R01E_HSYNC_1},	/* 00,1e,10,cc */
1949*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},	/* 00,1f,00,cc */
1950*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R020_HSYNC_3},	/* 00,20,03,cc */
1951*4882a593Smuzhiyun 	{}
1952*4882a593Smuzhiyun };
1953*4882a593Smuzhiyun static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
1954*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
1955*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0003},			/* 00,25,03,aa */
1956*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0000},			/* 00,26,00,aa */
1957*4882a593Smuzhiyun 	{0xaa, 0x27, 0x0000},			/* 00,27,00,aa */
1958*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
1959*4882a593Smuzhiyun 	{0xaa, 0x21, 0x00a0},			/* 00,21,a0,aa */
1960*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0016},			/* 00,22,16,aa */
1961*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0040},			/* 00,23,40,aa */
1962*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
1963*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,f8,cc */
1964*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,00,cc */
1965*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
1966*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,02,cc */
1967*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,00,cc */
1968*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
1969*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,20,cc */
1970*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,00,cc */
1971*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,00,cc */
1972*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
1973*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},	/* 00,1e,a0,cc */
1974*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R01F_HSYNC_2},	/* 00,1f,16,cc */
1975*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R020_HSYNC_3},	/* 00,20,40,cc */
1976*4882a593Smuzhiyun 	{}
1977*4882a593Smuzhiyun };
1978*4882a593Smuzhiyun 
1979*4882a593Smuzhiyun /* from lPEPI264v.inf (hv7131b!) */
1980*4882a593Smuzhiyun static const struct usb_action hv7131r_InitialScale[] = {
1981*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1982*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1983*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
1984*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1985*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
1986*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1987*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
1988*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1989*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1990*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1991*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1992*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1993*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1994*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
1995*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
1996*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
1997*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
1998*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1999*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2000*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2001*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2002*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},
2003*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2004*4882a593Smuzhiyun 	{0xaa, 0x01, 0x000c},
2005*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0000},
2006*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0000},
2007*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},
2008*4882a593Smuzhiyun 	{0xaa, 0x15, 0x00e8},
2009*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0002},
2010*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0088},
2011*4882a593Smuzhiyun 	{0xaa, 0x30, 0x000b},
2012*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2013*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2014*4882a593Smuzhiyun 	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
2015*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2016*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
2017*4882a593Smuzhiyun 	{0xa0, 0xc0, 0x019b},
2018*4882a593Smuzhiyun 	{0xa0, 0xa0, 0x019c},
2019*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2020*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2021*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2022*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2023*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2024*4882a593Smuzhiyun 	{}
2025*4882a593Smuzhiyun };
2026*4882a593Smuzhiyun static const struct usb_action hv7131r_Initial[] = {
2027*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2028*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2029*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
2030*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2031*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2032*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2033*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2034*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2035*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2036*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2037*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2038*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2039*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2040*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2041*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2042*4882a593Smuzhiyun 	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2043*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2044*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2045*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
2046*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2047*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
2048*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},
2049*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2050*4882a593Smuzhiyun 	{0xaa, 0x01, 0x000c},
2051*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0000},
2052*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0000},
2053*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0001},
2054*4882a593Smuzhiyun 	{0xaa, 0x15, 0x00e6},
2055*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0002},
2056*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0086},
2057*4882a593Smuzhiyun 	{0xaa, 0x30, 0x000b},
2058*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2059*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2060*4882a593Smuzhiyun 	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
2061*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2062*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
2063*4882a593Smuzhiyun 	{0xa0, 0xc0, 0x019b},
2064*4882a593Smuzhiyun 	{0xa0, 0xa0, 0x019c},
2065*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2066*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2067*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2068*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2069*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2070*4882a593Smuzhiyun 	{}
2071*4882a593Smuzhiyun };
2072*4882a593Smuzhiyun static const struct usb_action hv7131r_50HZ[] = {
2073*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2074*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
2075*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R191_EXPOSURELIMITMID},
2076*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
2077*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2078*4882a593Smuzhiyun 	{0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},
2079*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},
2080*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2081*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2082*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2083*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2084*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2085*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2086*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2087*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2088*4882a593Smuzhiyun 	{}
2089*4882a593Smuzhiyun };
2090*4882a593Smuzhiyun static const struct usb_action hv7131r_50HZScale[] = {
2091*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2092*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
2093*4882a593Smuzhiyun 	{0xa0, 0xd1, ZC3XX_R191_EXPOSURELIMITMID},
2094*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R192_EXPOSURELIMITLOW},
2095*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2096*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
2097*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2098*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2099*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2100*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2101*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2102*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2103*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2104*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2105*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2106*4882a593Smuzhiyun 	{}
2107*4882a593Smuzhiyun };
2108*4882a593Smuzhiyun static const struct usb_action hv7131r_60HZ[] = {
2109*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2110*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
2111*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R191_EXPOSURELIMITMID},
2112*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
2113*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2114*4882a593Smuzhiyun 	{0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},
2115*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},
2116*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2117*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2118*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2119*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2120*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2121*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2122*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2123*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2124*4882a593Smuzhiyun 	{}
2125*4882a593Smuzhiyun };
2126*4882a593Smuzhiyun static const struct usb_action hv7131r_60HZScale[] = {
2127*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2128*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
2129*4882a593Smuzhiyun 	{0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID},
2130*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2131*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
2132*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},
2133*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},
2134*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
2135*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2136*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2137*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
2138*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2139*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2140*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2141*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2142*4882a593Smuzhiyun 	{}
2143*4882a593Smuzhiyun };
2144*4882a593Smuzhiyun static const struct usb_action hv7131r_NoFliker[] = {
2145*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2146*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
2147*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
2148*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2149*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2150*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},
2151*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW},
2152*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2153*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2154*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
2155*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
2156*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2157*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2158*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2159*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2160*4882a593Smuzhiyun 	{}
2161*4882a593Smuzhiyun };
2162*4882a593Smuzhiyun static const struct usb_action hv7131r_NoFlikerScale[] = {
2163*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2164*4882a593Smuzhiyun 	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
2165*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
2166*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
2167*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2168*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R196_ANTIFLICKERMID},
2169*4882a593Smuzhiyun 	{0xa0, 0xb0, ZC3XX_R197_ANTIFLICKERLOW},
2170*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
2171*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
2172*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
2173*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
2174*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
2175*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
2176*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
2177*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R020_HSYNC_3},
2178*4882a593Smuzhiyun 	{}
2179*4882a593Smuzhiyun };
2180*4882a593Smuzhiyun 
2181*4882a593Smuzhiyun static const struct usb_action icm105a_InitialScale[] = {
2182*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2183*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
2184*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2185*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2186*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2187*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2188*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2189*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2190*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2191*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2192*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2193*4882a593Smuzhiyun 	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2194*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2195*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
2196*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2197*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
2198*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
2199*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
2200*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2201*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
2202*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2203*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
2204*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
2205*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2206*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2207*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2208*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2209*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0010},
2210*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0000},
2211*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0001},
2212*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2213*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0001},
2214*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2215*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0001},
2216*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0011},
2217*4882a593Smuzhiyun 	{0xaa, 0x05, 0x00a0},
2218*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0001},
2219*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2220*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0002},
2221*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0013},
2222*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2223*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0001},
2224*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2225*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003},
2226*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0015},
2227*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2228*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2229*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2230*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0004},
2231*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0017},
2232*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2233*4882a593Smuzhiyun 	{0xaa, 0x06, 0x000d},
2234*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2235*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0005},
2236*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0019},
2237*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2238*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2239*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2240*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0006},
2241*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0017},
2242*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0026},
2243*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2244*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2245*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0007},
2246*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0019},
2247*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0022},
2248*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2249*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2250*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0008},
2251*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0021},
2252*4882a593Smuzhiyun 	{0xaa, 0x05, 0x00aa},
2253*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2254*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2255*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0009},
2256*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0023},
2257*4882a593Smuzhiyun 	{0xaa, 0x05, 0x00aa},
2258*4882a593Smuzhiyun 	{0xaa, 0x06, 0x000d},
2259*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2260*4882a593Smuzhiyun 	{0xaa, 0x03, 0x000a},
2261*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0025},
2262*4882a593Smuzhiyun 	{0xaa, 0x05, 0x00aa},
2263*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2264*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2265*4882a593Smuzhiyun 	{0xaa, 0x03, 0x000b},
2266*4882a593Smuzhiyun 	{0xaa, 0x04, 0x00ec},
2267*4882a593Smuzhiyun 	{0xaa, 0x05, 0x002e},
2268*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2269*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2270*4882a593Smuzhiyun 	{0xaa, 0x03, 0x000c},
2271*4882a593Smuzhiyun 	{0xaa, 0x04, 0x00fa},
2272*4882a593Smuzhiyun 	{0xaa, 0x05, 0x002a},
2273*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2274*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2275*4882a593Smuzhiyun 	{0xaa, 0x07, 0x000d},
2276*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0005},
2277*4882a593Smuzhiyun 	{0xaa, 0x94, 0x0002},
2278*4882a593Smuzhiyun 	{0xaa, 0x90, 0x0000},
2279*4882a593Smuzhiyun 	{0xaa, 0x91, 0x001f},
2280*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0064},
2281*4882a593Smuzhiyun 	{0xaa, 0x9b, 0x00f0},
2282*4882a593Smuzhiyun 	{0xaa, 0x9c, 0x0002},
2283*4882a593Smuzhiyun 	{0xaa, 0x14, 0x001a},
2284*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080},
2285*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080},
2286*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080},
2287*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080},
2288*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084},
2289*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2290*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2291*4882a593Smuzhiyun 	{0xaa, 0xa8, 0x00c0},
2292*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0002},
2293*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
2294*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
2295*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2296*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
2297*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
2298*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
2299*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
2300*4882a593Smuzhiyun 
2301*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
2302*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
2303*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c8},
2304*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c9},
2305*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01ca},
2306*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
2307*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R10A_RGB00},	/* matrix */
2308*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10B_RGB01},
2309*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10C_RGB02},
2310*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10D_RGB10},
2311*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R10E_RGB11},
2312*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10F_RGB12},
2313*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R110_RGB20},
2314*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R111_RGB21},
2315*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R112_RGB22},
2316*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
2317*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2318*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2319*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0003},
2320*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x008c},
2321*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0095},
2322*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0002},
2323*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0094},
2324*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002},
2325*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080},
2326*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080},
2327*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080},
2328*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080},
2329*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084},
2330*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2331*4882a593Smuzhiyun 	{0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
2332*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2333*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2334*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
2335*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2336*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2337*4882a593Smuzhiyun 	{0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
2338*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2339*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2340*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2341*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2342*4882a593Smuzhiyun 	{0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
2343*4882a593Smuzhiyun 	{0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
2344*4882a593Smuzhiyun 	{0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
2345*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2346*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2347*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
2348*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
2349*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2350*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
2351*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2352*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
2353*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
2354*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
2355*4882a593Smuzhiyun 	{}
2356*4882a593Smuzhiyun };
2357*4882a593Smuzhiyun 
2358*4882a593Smuzhiyun static const struct usb_action icm105a_Initial[] = {
2359*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
2360*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
2361*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
2362*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
2363*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
2364*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2365*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2366*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2367*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
2368*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
2369*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
2370*4882a593Smuzhiyun 	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
2371*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
2372*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
2373*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
2374*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
2375*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
2376*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
2377*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
2378*4882a593Smuzhiyun 	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
2379*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
2380*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
2381*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
2382*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
2383*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
2384*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
2385*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2386*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0010},
2387*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0000},
2388*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0001},
2389*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2390*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0001},
2391*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2392*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0001},
2393*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0011},
2394*4882a593Smuzhiyun 	{0xaa, 0x05, 0x00a0},
2395*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0001},
2396*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2397*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0002},
2398*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0013},
2399*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2400*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0001},
2401*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2402*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003},
2403*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0015},
2404*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2405*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2406*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2407*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0004},
2408*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0017},
2409*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2410*4882a593Smuzhiyun 	{0xaa, 0x06, 0x000d},
2411*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2412*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0005},
2413*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
2414*4882a593Smuzhiyun 	{0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
2415*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
2416*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0091},
2417*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0020},
2418*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2419*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2420*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0006},
2421*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0017},
2422*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0026},
2423*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2424*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2425*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0007},
2426*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0019},
2427*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0022},
2428*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2429*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2430*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0008},
2431*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0021},
2432*4882a593Smuzhiyun 	{0xaa, 0x05, 0x00aa},
2433*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2434*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2435*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0009},
2436*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0023},
2437*4882a593Smuzhiyun 	{0xaa, 0x05, 0x00aa},
2438*4882a593Smuzhiyun 	{0xaa, 0x06, 0x000d},
2439*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2440*4882a593Smuzhiyun 	{0xaa, 0x03, 0x000a},
2441*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0025},
2442*4882a593Smuzhiyun 	{0xaa, 0x05, 0x00aa},
2443*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2444*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2445*4882a593Smuzhiyun 	{0xaa, 0x03, 0x000b},
2446*4882a593Smuzhiyun 	{0xaa, 0x04, 0x00ec},
2447*4882a593Smuzhiyun 	{0xaa, 0x05, 0x002e},
2448*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2449*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2450*4882a593Smuzhiyun 	{0xaa, 0x03, 0x000c},
2451*4882a593Smuzhiyun 	{0xaa, 0x04, 0x00fa},
2452*4882a593Smuzhiyun 	{0xaa, 0x05, 0x002a},
2453*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0005},
2454*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
2455*4882a593Smuzhiyun 	{0xaa, 0x07, 0x000d},
2456*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0005},
2457*4882a593Smuzhiyun 	{0xaa, 0x94, 0x0002},
2458*4882a593Smuzhiyun 	{0xaa, 0x90, 0x0000},
2459*4882a593Smuzhiyun 	{0xaa, 0x91, 0x0010},
2460*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0064},
2461*4882a593Smuzhiyun 	{0xaa, 0x9b, 0x00f0},
2462*4882a593Smuzhiyun 	{0xaa, 0x9c, 0x0002},
2463*4882a593Smuzhiyun 	{0xaa, 0x14, 0x001a},
2464*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080},
2465*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080},
2466*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080},
2467*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080},
2468*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084},
2469*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
2470*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2471*4882a593Smuzhiyun 	{0xaa, 0xa8, 0x0080},
2472*4882a593Smuzhiyun 	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
2473*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0002},
2474*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
2475*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
2476*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
2477*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
2478*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
2479*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
2480*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
2481*4882a593Smuzhiyun 
2482*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
2483*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
2484*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c8},
2485*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c9},
2486*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01ca},
2487*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
2488*4882a593Smuzhiyun 
2489*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R10A_RGB00},	/* matrix */
2490*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10B_RGB01},
2491*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10C_RGB02},
2492*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10D_RGB10},
2493*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R10E_RGB11},
2494*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10F_RGB12},
2495*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R110_RGB20},
2496*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R111_RGB21},
2497*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R112_RGB22},
2498*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
2499*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
2500*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2501*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0003},
2502*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0020},
2503*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x000e},
2504*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0002},
2505*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x000d},
2506*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002},
2507*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080},
2508*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080},
2509*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080},
2510*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080},
2511*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084},
2512*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
2513*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
2514*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
2515*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
2516*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
2517*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
2518*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
2519*4882a593Smuzhiyun 	{0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
2520*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
2521*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
2522*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
2523*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
2524*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
2525*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
2526*4882a593Smuzhiyun 	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
2527*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
2528*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
2529*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2530*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
2531*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2532*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
2533*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
2534*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
2535*4882a593Smuzhiyun 	{}
2536*4882a593Smuzhiyun };
2537*4882a593Smuzhiyun static const struct usb_action icm105a_50HZScale[] = {
2538*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2539*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2540*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
2541*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
2542*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2543*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
2544*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2545*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2546*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2547*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2548*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2549*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2550*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2551*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
2552*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2553*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2554*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
2555*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2556*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2557*4882a593Smuzhiyun 	{0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
2558*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2559*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2560*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2561*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2562*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
2563*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
2564*4882a593Smuzhiyun 	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2565*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2566*4882a593Smuzhiyun 	{}
2567*4882a593Smuzhiyun };
2568*4882a593Smuzhiyun static const struct usb_action icm105a_50HZ[] = {
2569*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2570*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2571*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
2572*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
2573*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2574*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
2575*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2576*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2577*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2578*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2579*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2580*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2581*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2582*4882a593Smuzhiyun 	{0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
2583*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2584*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2585*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2586*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2587*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2588*4882a593Smuzhiyun 	{0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
2589*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2590*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2591*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2592*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2593*4882a593Smuzhiyun 	{0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
2594*4882a593Smuzhiyun 	{0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
2595*4882a593Smuzhiyun 	{0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
2596*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2597*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2598*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2599*4882a593Smuzhiyun 	{}
2600*4882a593Smuzhiyun };
2601*4882a593Smuzhiyun static const struct usb_action icm105a_60HZScale[] = {
2602*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2603*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2604*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2605*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2606*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2607*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
2608*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2609*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2610*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2611*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2612*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2613*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2614*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2615*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
2616*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2617*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2618*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
2619*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2620*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2621*4882a593Smuzhiyun 	{0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
2622*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2623*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2624*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2625*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2626*4882a593Smuzhiyun 	{0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2627*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2628*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2629*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2630*4882a593Smuzhiyun 	{}
2631*4882a593Smuzhiyun };
2632*4882a593Smuzhiyun static const struct usb_action icm105a_60HZ[] = {
2633*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2634*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2635*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
2636*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
2637*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2638*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
2639*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2640*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2641*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2642*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2643*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2644*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2645*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2646*4882a593Smuzhiyun 	{0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
2647*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2648*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2649*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
2650*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2651*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2652*4882a593Smuzhiyun 	{0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
2653*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2654*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2655*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
2656*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
2657*4882a593Smuzhiyun 	{0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
2658*4882a593Smuzhiyun 	{0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
2659*4882a593Smuzhiyun 	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
2660*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2661*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2662*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2663*4882a593Smuzhiyun 	{}
2664*4882a593Smuzhiyun };
2665*4882a593Smuzhiyun static const struct usb_action icm105a_NoFlikerScale[] = {
2666*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2667*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2668*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2669*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
2670*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2671*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
2672*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2673*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2674*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2675*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2676*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2677*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2678*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2679*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
2680*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2681*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2682*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2683*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2684*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2685*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2686*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2687*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2688*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2689*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2690*4882a593Smuzhiyun 	{0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2691*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2692*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2693*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2694*4882a593Smuzhiyun 	{}
2695*4882a593Smuzhiyun };
2696*4882a593Smuzhiyun static const struct usb_action icm105a_NoFliker[] = {
2697*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2698*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
2699*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
2700*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
2701*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
2702*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
2703*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
2704*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
2705*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
2706*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
2707*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
2708*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2709*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
2710*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
2711*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2712*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
2713*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
2714*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
2715*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
2716*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
2717*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
2718*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
2719*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
2720*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
2721*4882a593Smuzhiyun 	{0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
2722*4882a593Smuzhiyun 	{0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
2723*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
2724*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2725*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
2726*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2727*4882a593Smuzhiyun 	{}
2728*4882a593Smuzhiyun };
2729*4882a593Smuzhiyun 
2730*4882a593Smuzhiyun static const struct usb_action mc501cb_Initial[] = {
2731*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2732*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
2733*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2734*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2735*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2736*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2737*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2738*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2739*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2740*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2741*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
2742*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2743*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2744*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2745*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2746*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2747*4882a593Smuzhiyun 	{0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
2748*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2749*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
2750*4882a593Smuzhiyun 	{0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2751*4882a593Smuzhiyun 	{0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2752*4882a593Smuzhiyun 	{0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2753*4882a593Smuzhiyun 	{0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2754*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2755*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2756*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2757*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2758*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2759*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2760*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
2761*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
2762*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
2763*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
2764*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
2765*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
2766*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
2767*4882a593Smuzhiyun 	{0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
2768*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
2769*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
2770*4882a593Smuzhiyun 	{0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
2771*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2772*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
2773*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
2774*4882a593Smuzhiyun 	{0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
2775*4882a593Smuzhiyun 	{0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
2776*4882a593Smuzhiyun 	{0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
2777*4882a593Smuzhiyun 	{0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
2778*4882a593Smuzhiyun 	{0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
2779*4882a593Smuzhiyun 	{0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
2780*4882a593Smuzhiyun 	{0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
2781*4882a593Smuzhiyun 	{0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
2782*4882a593Smuzhiyun 	{0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
2783*4882a593Smuzhiyun 	{0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
2784*4882a593Smuzhiyun 	{0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
2785*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
2786*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
2787*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2788*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
2789*4882a593Smuzhiyun 	{0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
2790*4882a593Smuzhiyun 	{0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
2791*4882a593Smuzhiyun 	{0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
2792*4882a593Smuzhiyun 	{0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
2793*4882a593Smuzhiyun 	{0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
2794*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
2795*4882a593Smuzhiyun 	{0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
2796*4882a593Smuzhiyun 	{0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
2797*4882a593Smuzhiyun 	{0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
2798*4882a593Smuzhiyun 	{0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
2799*4882a593Smuzhiyun 	{0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
2800*4882a593Smuzhiyun 	{0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
2801*4882a593Smuzhiyun 	{0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
2802*4882a593Smuzhiyun 	{0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
2803*4882a593Smuzhiyun 	{0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
2804*4882a593Smuzhiyun 	{0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
2805*4882a593Smuzhiyun 	{0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
2806*4882a593Smuzhiyun 	{0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
2807*4882a593Smuzhiyun 	{0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
2808*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
2809*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2810*4882a593Smuzhiyun 	{0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
2811*4882a593Smuzhiyun 	{0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
2812*4882a593Smuzhiyun 	{0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
2813*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2814*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
2815*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
2816*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
2817*4882a593Smuzhiyun 	{0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
2818*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
2819*4882a593Smuzhiyun 	{0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
2820*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
2821*4882a593Smuzhiyun 	{0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
2822*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2823*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
2824*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
2825*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
2826*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
2827*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
2828*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
2829*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
2830*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
2831*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
2832*4882a593Smuzhiyun 	{0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
2833*4882a593Smuzhiyun 	{0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
2834*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2835*4882a593Smuzhiyun 	{0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
2836*4882a593Smuzhiyun 	{0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
2837*4882a593Smuzhiyun 	{0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
2838*4882a593Smuzhiyun 	{0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
2839*4882a593Smuzhiyun 	{0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
2840*4882a593Smuzhiyun 	{0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
2841*4882a593Smuzhiyun 
2842*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2843*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2844*4882a593Smuzhiyun 	{0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
2845*4882a593Smuzhiyun 	{0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
2846*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
2847*4882a593Smuzhiyun 	{}
2848*4882a593Smuzhiyun };
2849*4882a593Smuzhiyun 
2850*4882a593Smuzhiyun static const struct usb_action mc501cb_InitialScale[] = {	/* 320x240 */
2851*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
2852*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
2853*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
2854*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
2855*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
2856*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
2857*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2858*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
2859*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
2860*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
2861*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
2862*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
2863*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
2864*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
2865*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
2866*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
2867*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
2868*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
2869*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
2870*4882a593Smuzhiyun 	{0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
2871*4882a593Smuzhiyun 	{0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
2872*4882a593Smuzhiyun 	{0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
2873*4882a593Smuzhiyun 	{0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
2874*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2875*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2876*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
2877*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
2878*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
2879*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2880*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
2881*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
2882*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
2883*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
2884*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
2885*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
2886*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
2887*4882a593Smuzhiyun 	{0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
2888*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
2889*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
2890*4882a593Smuzhiyun 	{0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
2891*4882a593Smuzhiyun 	{0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
2892*4882a593Smuzhiyun 	{0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
2893*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
2894*4882a593Smuzhiyun 	{0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
2895*4882a593Smuzhiyun 	{0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
2896*4882a593Smuzhiyun 	{0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
2897*4882a593Smuzhiyun 	{0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
2898*4882a593Smuzhiyun 	{0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
2899*4882a593Smuzhiyun 	{0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
2900*4882a593Smuzhiyun 	{0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
2901*4882a593Smuzhiyun 	{0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
2902*4882a593Smuzhiyun 	{0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
2903*4882a593Smuzhiyun 	{0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
2904*4882a593Smuzhiyun 	{0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
2905*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
2906*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
2907*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2908*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
2909*4882a593Smuzhiyun 	{0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
2910*4882a593Smuzhiyun 	{0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
2911*4882a593Smuzhiyun 	{0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
2912*4882a593Smuzhiyun 	{0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
2913*4882a593Smuzhiyun 	{0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
2914*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
2915*4882a593Smuzhiyun 	{0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
2916*4882a593Smuzhiyun 	{0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
2917*4882a593Smuzhiyun 	{0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
2918*4882a593Smuzhiyun 	{0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
2919*4882a593Smuzhiyun 	{0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
2920*4882a593Smuzhiyun 	{0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
2921*4882a593Smuzhiyun 	{0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
2922*4882a593Smuzhiyun 	{0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
2923*4882a593Smuzhiyun 	{0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
2924*4882a593Smuzhiyun 	{0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
2925*4882a593Smuzhiyun 	{0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
2926*4882a593Smuzhiyun 	{0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
2927*4882a593Smuzhiyun 	{0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
2928*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
2929*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
2930*4882a593Smuzhiyun 	{0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
2931*4882a593Smuzhiyun 	{0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
2932*4882a593Smuzhiyun 	{0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
2933*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2934*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
2935*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
2936*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
2937*4882a593Smuzhiyun 	{0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
2938*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
2939*4882a593Smuzhiyun 	{0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
2940*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
2941*4882a593Smuzhiyun 	{0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
2942*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2943*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
2944*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
2945*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
2946*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
2947*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
2948*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
2949*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
2950*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
2951*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
2952*4882a593Smuzhiyun 	{0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
2953*4882a593Smuzhiyun 	{0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
2954*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2955*4882a593Smuzhiyun 	{0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
2956*4882a593Smuzhiyun 	{0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
2957*4882a593Smuzhiyun 	{0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
2958*4882a593Smuzhiyun 	{0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
2959*4882a593Smuzhiyun 	{0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
2960*4882a593Smuzhiyun 	{0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
2961*4882a593Smuzhiyun 	{}
2962*4882a593Smuzhiyun };
2963*4882a593Smuzhiyun 
2964*4882a593Smuzhiyun static const struct usb_action mc501cb_50HZ[] = {
2965*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2966*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2967*4882a593Smuzhiyun 	{0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
2968*4882a593Smuzhiyun 	{0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
2969*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
2970*4882a593Smuzhiyun 	{0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
2971*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
2972*4882a593Smuzhiyun 	{0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
2973*4882a593Smuzhiyun 	{}
2974*4882a593Smuzhiyun };
2975*4882a593Smuzhiyun 
2976*4882a593Smuzhiyun static const struct usb_action mc501cb_50HZScale[] = {
2977*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2978*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2979*4882a593Smuzhiyun 	{0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
2980*4882a593Smuzhiyun 	{0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
2981*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
2982*4882a593Smuzhiyun 	{0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
2983*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
2984*4882a593Smuzhiyun 	{0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
2985*4882a593Smuzhiyun 	{}
2986*4882a593Smuzhiyun };
2987*4882a593Smuzhiyun 
2988*4882a593Smuzhiyun static const struct usb_action mc501cb_60HZ[] = {
2989*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
2990*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
2991*4882a593Smuzhiyun 	{0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
2992*4882a593Smuzhiyun 	{0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
2993*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
2994*4882a593Smuzhiyun 	{0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
2995*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
2996*4882a593Smuzhiyun 	{0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
2997*4882a593Smuzhiyun 	{}
2998*4882a593Smuzhiyun };
2999*4882a593Smuzhiyun 
3000*4882a593Smuzhiyun static const struct usb_action mc501cb_60HZScale[] = {
3001*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3002*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3003*4882a593Smuzhiyun 	{0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3004*4882a593Smuzhiyun 	{0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3005*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3006*4882a593Smuzhiyun 	{0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3007*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3008*4882a593Smuzhiyun 	{0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3009*4882a593Smuzhiyun 	{}
3010*4882a593Smuzhiyun };
3011*4882a593Smuzhiyun 
3012*4882a593Smuzhiyun static const struct usb_action mc501cb_NoFliker[] = {
3013*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3014*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3015*4882a593Smuzhiyun 	{0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
3016*4882a593Smuzhiyun 	{0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
3017*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3018*4882a593Smuzhiyun 	{0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
3019*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
3020*4882a593Smuzhiyun 	{0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
3021*4882a593Smuzhiyun 	{}
3022*4882a593Smuzhiyun };
3023*4882a593Smuzhiyun 
3024*4882a593Smuzhiyun static const struct usb_action mc501cb_NoFlikerScale[] = {
3025*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
3026*4882a593Smuzhiyun 	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
3027*4882a593Smuzhiyun 	{0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
3028*4882a593Smuzhiyun 	{0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
3029*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3030*4882a593Smuzhiyun 	{0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
3031*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
3032*4882a593Smuzhiyun 	{0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3033*4882a593Smuzhiyun 	{}
3034*4882a593Smuzhiyun };
3035*4882a593Smuzhiyun 
3036*4882a593Smuzhiyun /* from zs211.inf */
3037*4882a593Smuzhiyun static const struct usb_action ov7620_Initial[] = {	/* 640x480 */
3038*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3039*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
3040*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
3041*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3042*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3043*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
3044*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
3045*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
3046*4882a593Smuzhiyun 	{0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
3047*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
3048*4882a593Smuzhiyun 	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3049*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3050*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3051*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3052*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3053*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
3054*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3055*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3056*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
3057*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
3058*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
3059*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
3060*4882a593Smuzhiyun 	{0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
3061*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3062*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3063*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3064*4882a593Smuzhiyun 	{0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3065*4882a593Smuzhiyun 	{0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3066*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3067*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3068*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3069*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3070*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3071*4882a593Smuzhiyun 	{0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3072*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3073*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
3074*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3075*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3076*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3077*4882a593Smuzhiyun 	{0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3078*4882a593Smuzhiyun 	{0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3079*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3080*4882a593Smuzhiyun 	{0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3081*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3082*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3083*4882a593Smuzhiyun 	{0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3084*4882a593Smuzhiyun 	{0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3085*4882a593Smuzhiyun 	{0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3086*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3087*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3088*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3089*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3090*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3091*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3092*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3093*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3094*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3095*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3096*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
3097*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3098*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
3099*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
3100*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
3101*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
3102*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3103*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
3104*4882a593Smuzhiyun 	{}
3105*4882a593Smuzhiyun };
3106*4882a593Smuzhiyun static const struct usb_action ov7620_InitialScale[] = {	/* 320x240 */
3107*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
3108*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},	/* 00,02,50,cc */
3109*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00,08,00,cc */
3110*4882a593Smuzhiyun 						/* mx change? */
3111*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
3112*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
3113*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R083_RGAINADDR},	/* 00,83,02,cc */
3114*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R085_BGAINADDR},	/* 00,85,01,cc */
3115*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH},	/* 00,86,80,cc */
3116*4882a593Smuzhiyun 	{0xa0, 0x81, ZC3XX_R087_EXPTIMEMID},	/* 00,87,81,cc */
3117*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},	/* 00,88,10,cc */
3118*4882a593Smuzhiyun 	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
3119*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
3120*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
3121*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
3122*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
3123*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
3124*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
3125*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
3126*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},	/* 00,98,00,cc */
3127*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},	/* 00,9a,00,cc */
3128*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},	/* 01,1a,00,cc */
3129*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},	/* 01,1c,00,cc */
3130*4882a593Smuzhiyun 	{0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW},	/* 00,9c,d6,cc */
3131*4882a593Smuzhiyun 						/* OV7648 00,9c,d8,cc */
3132*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},	/* 00,9e,88,cc */
3133*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
3134*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
3135*4882a593Smuzhiyun 	{0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
3136*4882a593Smuzhiyun 	{0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
3137*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
3138*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
3139*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
3140*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
3141*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
3142*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
3143*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
3144*4882a593Smuzhiyun 	{0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
3145*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
3146*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
3147*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
3148*4882a593Smuzhiyun 	{0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
3149*4882a593Smuzhiyun 	{0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
3150*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
3151*4882a593Smuzhiyun 	{0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
3152*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
3153*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
3154*4882a593Smuzhiyun 	{0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
3155*4882a593Smuzhiyun 	{0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
3156*4882a593Smuzhiyun 	{0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
3157*4882a593Smuzhiyun 	{0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
3158*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
3159*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
3160*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3161*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
3162*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3163*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
3164*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},	/* 01,89,06,cc */
3165*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},			/* 01,ad,00,cc */
3166*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
3167*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},	/* 01,cb,13,cc */
3168*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
3169*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},	/* 03,01,08,cc */
3170*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R116_RGAIN},		/* 01,16,68,cc */
3171*4882a593Smuzhiyun 	{0xa0, 0x52, ZC3XX_R118_BGAIN},		/* 01,18,52,cc */
3172*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},	/* 01,1d,50,cc */
3173*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3174*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},	/* 01,a8,50,cc */
3175*4882a593Smuzhiyun 	{}
3176*4882a593Smuzhiyun };
3177*4882a593Smuzhiyun static const struct usb_action ov7620_50HZ[] = {
3178*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0100},	/* 00,01,00,dd */
3179*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0096},	/* 00,2b,96,aa */
3180*4882a593Smuzhiyun 	/* enable 1/120s & 1/100s exposures for banding filter */
3181*4882a593Smuzhiyun 	{0xaa, 0x75, 0x008e},
3182*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x0005},	/* 00,2d,05,aa */
3183*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
3184*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,04,cc */
3185*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,18,cc */
3186*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
3187*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
3188*4882a593Smuzhiyun 	{0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,83,cc */
3189*4882a593Smuzhiyun 	{0xaa, 0x76, 0x0003},				/* 00,76,03,aa */
3190*4882a593Smuzhiyun /*	{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},		 * 00,02,40,cc
3191*4882a593Smuzhiyun 							 * if mode0 (640x480) */
3192*4882a593Smuzhiyun 	{}
3193*4882a593Smuzhiyun };
3194*4882a593Smuzhiyun static const struct usb_action ov7620_60HZ[] = {
3195*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0100},			/* 00,01,00,dd */
3196*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0000},			/* 00,2b,00,aa */
3197*4882a593Smuzhiyun 	/* enable 1/120s & 1/100s exposures for banding filter */
3198*4882a593Smuzhiyun 	{0xaa, 0x75, 0x008e},
3199*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x0005},			/* 00,2d,05,aa */
3200*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3201*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3202*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3203*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3204*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3205*4882a593Smuzhiyun 	{0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
3206*4882a593Smuzhiyun 	{0xaa, 0x76, 0x0003},			/* 00,76,03,aa */
3207*4882a593Smuzhiyun /*	{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},	 * 00,02,40,cc
3208*4882a593Smuzhiyun 						 * if mode0 (640x480) */
3209*4882a593Smuzhiyun /* ?? in gspca v1, it was
3210*4882a593Smuzhiyun 	{0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3211*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0037},		*/
3212*4882a593Smuzhiyun 	{}
3213*4882a593Smuzhiyun };
3214*4882a593Smuzhiyun static const struct usb_action ov7620_NoFliker[] = {
3215*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0100},			/* 00,01,00,dd */
3216*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0000},			/* 00,2b,00,aa */
3217*4882a593Smuzhiyun 	/* disable 1/120s & 1/100s exposures for banding filter */
3218*4882a593Smuzhiyun 	{0xaa, 0x75, 0x008a},
3219*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x0001},			/* 00,2d,01,aa */
3220*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3221*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
3222*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
3223*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3224*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3225*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
3226*4882a593Smuzhiyun /*	{0xa0, 0x44, ZC3XX_R002_CLOCKSELECT},	 * 00,02,44,cc
3227*4882a593Smuzhiyun 						 * if mode1 (320x240) */
3228*4882a593Smuzhiyun /* ?? was
3229*4882a593Smuzhiyun 	{0xa0, 0x00, 0x0039},  * 00,00,00,dd *
3230*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0037},		*/
3231*4882a593Smuzhiyun 	{}
3232*4882a593Smuzhiyun };
3233*4882a593Smuzhiyun 
3234*4882a593Smuzhiyun static const struct usb_action ov7630c_InitialScale[] = {
3235*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3236*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3237*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3238*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
3239*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3240*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3241*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3242*4882a593Smuzhiyun 	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3243*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3244*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3245*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3246*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3247*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3248*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3249*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0080},
3250*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3251*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3252*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3253*4882a593Smuzhiyun 	{0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3254*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3255*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3256*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3257*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3258*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3259*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
3260*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
3261*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0069},
3262*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0020},
3263*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0050},
3264*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0083},
3265*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0000},
3266*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0024},
3267*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0018},
3268*4882a593Smuzhiyun 	{0xaa, 0x18, 0x00ba},
3269*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0002},
3270*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x00f6},
3271*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0002},
3272*4882a593Smuzhiyun 	{0xaa, 0x20, 0x00c2},
3273*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0060},
3274*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0040},
3275*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0030},
3276*4882a593Smuzhiyun 	{0xaa, 0x27, 0x00ea},
3277*4882a593Smuzhiyun 	{0xaa, 0x28, 0x00a0},
3278*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0000},
3279*4882a593Smuzhiyun 	{0xaa, 0x2a, 0x0081},
3280*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0096},
3281*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x0094},
3282*4882a593Smuzhiyun 	{0xaa, 0x2f, 0x003d},
3283*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0024},
3284*4882a593Smuzhiyun 	{0xaa, 0x60, 0x0000},
3285*4882a593Smuzhiyun 	{0xaa, 0x61, 0x0040},
3286*4882a593Smuzhiyun 	{0xaa, 0x68, 0x007c},
3287*4882a593Smuzhiyun 	{0xaa, 0x6f, 0x0015},
3288*4882a593Smuzhiyun 	{0xaa, 0x75, 0x0088},
3289*4882a593Smuzhiyun 	{0xaa, 0x77, 0x00b5},
3290*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0060},
3291*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0060},
3292*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3293*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3294*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3295*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3296*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3297*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
3298*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3299*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3300*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3301*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3302*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R116_RGAIN},
3303*4882a593Smuzhiyun 	{0xa0, 0x46, ZC3XX_R118_BGAIN},
3304*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R113_RGB03},
3305*4882a593Smuzhiyun /* 0x10, */
3306*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0002},
3307*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
3308*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
3309*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
3310*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
3311*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R10E_RGB11},
3312*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
3313*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R110_RGB20},
3314*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R111_RGB21},
3315*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R112_RGB22},
3316*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
3317*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
3318*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
3319*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c8},
3320*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c9},
3321*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01ca},
3322*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
3323*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R120_GAMMA00},	/* gamma 2 ?*/
3324*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R121_GAMMA01},
3325*4882a593Smuzhiyun 	{0xa0, 0x1f, ZC3XX_R122_GAMMA02},
3326*4882a593Smuzhiyun 	{0xa0, 0x3a, ZC3XX_R123_GAMMA03},
3327*4882a593Smuzhiyun 	{0xa0, 0x53, ZC3XX_R124_GAMMA04},
3328*4882a593Smuzhiyun 	{0xa0, 0x6d, ZC3XX_R125_GAMMA05},
3329*4882a593Smuzhiyun 	{0xa0, 0x85, ZC3XX_R126_GAMMA06},
3330*4882a593Smuzhiyun 	{0xa0, 0x9c, ZC3XX_R127_GAMMA07},
3331*4882a593Smuzhiyun 	{0xa0, 0xb0, ZC3XX_R128_GAMMA08},
3332*4882a593Smuzhiyun 	{0xa0, 0xc2, ZC3XX_R129_GAMMA09},
3333*4882a593Smuzhiyun 	{0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
3334*4882a593Smuzhiyun 	{0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
3335*4882a593Smuzhiyun 	{0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
3336*4882a593Smuzhiyun 	{0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
3337*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
3338*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3339*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R130_GAMMA10},
3340*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R131_GAMMA11},
3341*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R132_GAMMA12},
3342*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R133_GAMMA13},
3343*4882a593Smuzhiyun 	{0xa0, 0x19, ZC3XX_R134_GAMMA14},
3344*4882a593Smuzhiyun 	{0xa0, 0x19, ZC3XX_R135_GAMMA15},
3345*4882a593Smuzhiyun 	{0xa0, 0x17, ZC3XX_R136_GAMMA16},
3346*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R137_GAMMA17},
3347*4882a593Smuzhiyun 	{0xa0, 0x12, ZC3XX_R138_GAMMA18},
3348*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R139_GAMMA19},
3349*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
3350*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
3351*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
3352*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
3353*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
3354*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
3355*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
3356*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
3357*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
3358*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
3359*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R10E_RGB11},
3360*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
3361*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R110_RGB20},
3362*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R111_RGB21},
3363*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R112_RGB22},
3364*4882a593Smuzhiyun 
3365*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
3366*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3367*4882a593Smuzhiyun 	{0xaa, 0x10, 0x001b},
3368*4882a593Smuzhiyun 	{0xaa, 0x76, 0x0002},
3369*4882a593Smuzhiyun 	{0xaa, 0x2a, 0x0081},
3370*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0000},
3371*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3372*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
3373*4882a593Smuzhiyun 	{0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
3374*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3375*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3376*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
3377*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3378*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3379*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3380*4882a593Smuzhiyun 	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3381*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3382*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3383*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3384*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0083},	/* 40 */
3385*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
3386*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3387*4882a593Smuzhiyun 	{}
3388*4882a593Smuzhiyun };
3389*4882a593Smuzhiyun 
3390*4882a593Smuzhiyun static const struct usb_action ov7630c_Initial[] = {
3391*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
3392*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
3393*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3394*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3395*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
3396*4882a593Smuzhiyun 	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
3397*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3398*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
3399*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
3400*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3401*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3402*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3403*4882a593Smuzhiyun 
3404*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0080},
3405*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R083_RGAINADDR},
3406*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R085_BGAINADDR},
3407*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
3408*4882a593Smuzhiyun 	{0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
3409*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
3410*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
3411*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
3412*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3413*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
3414*4882a593Smuzhiyun 	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
3415*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
3416*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0069},	/* i2c */
3417*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0020},
3418*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0050},
3419*4882a593Smuzhiyun 	{0xaa, 0x13, 0x00c3},
3420*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0000},
3421*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0024},
3422*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0003},
3423*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x00f6},
3424*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0002},
3425*4882a593Smuzhiyun 	{0xaa, 0x20, 0x00c2},
3426*4882a593Smuzhiyun 	{0xaa, 0x24, 0x0060},
3427*4882a593Smuzhiyun 	{0xaa, 0x25, 0x0040},
3428*4882a593Smuzhiyun 	{0xaa, 0x26, 0x0030},
3429*4882a593Smuzhiyun 	{0xaa, 0x27, 0x00ea},
3430*4882a593Smuzhiyun 	{0xaa, 0x28, 0x00a0},
3431*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0000},
3432*4882a593Smuzhiyun 	{0xaa, 0x2a, 0x0081},
3433*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0096},
3434*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x0084},
3435*4882a593Smuzhiyun 	{0xaa, 0x2f, 0x003d},
3436*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0024},
3437*4882a593Smuzhiyun 	{0xaa, 0x60, 0x0000},
3438*4882a593Smuzhiyun 	{0xaa, 0x61, 0x0040},
3439*4882a593Smuzhiyun 	{0xaa, 0x68, 0x007c},
3440*4882a593Smuzhiyun 	{0xaa, 0x6f, 0x0015},
3441*4882a593Smuzhiyun 	{0xaa, 0x75, 0x0088},
3442*4882a593Smuzhiyun 	{0xaa, 0x77, 0x00b5},
3443*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0060},
3444*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0060},
3445*4882a593Smuzhiyun 	{0xaa, 0x17, 0x0018},
3446*4882a593Smuzhiyun 	{0xaa, 0x18, 0x00ba},
3447*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
3448*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
3449*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3450*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3451*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3452*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
3453*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3454*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3455*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3456*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3457*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R116_RGAIN},
3458*4882a593Smuzhiyun 	{0xa0, 0x46, ZC3XX_R118_BGAIN},
3459*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R113_RGB03},
3460*4882a593Smuzhiyun 
3461*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0002},
3462*4882a593Smuzhiyun 	{0xa0, 0x4e, ZC3XX_R10A_RGB00},	/* matrix */
3463*4882a593Smuzhiyun 	{0xa0, 0xfe, ZC3XX_R10B_RGB01},
3464*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
3465*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10D_RGB10},
3466*4882a593Smuzhiyun 	{0xa0, 0x4d, ZC3XX_R10E_RGB11},
3467*4882a593Smuzhiyun 	{0xa0, 0xfc, ZC3XX_R10F_RGB12},
3468*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R110_RGB20},
3469*4882a593Smuzhiyun 	{0xa0, 0xf6, ZC3XX_R111_RGB21},
3470*4882a593Smuzhiyun 	{0xa0, 0x4a, ZC3XX_R112_RGB22},
3471*4882a593Smuzhiyun 
3472*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0008},
3473*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
3474*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
3475*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c8},
3476*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01c9},
3477*4882a593Smuzhiyun 	{0xa1, 0x01, 0x01ca},
3478*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
3479*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R120_GAMMA00},	/* gamma ~4 */
3480*4882a593Smuzhiyun 	{0xa0, 0x3a, ZC3XX_R121_GAMMA01},
3481*4882a593Smuzhiyun 	{0xa0, 0x5b, ZC3XX_R122_GAMMA02},
3482*4882a593Smuzhiyun 	{0xa0, 0x7c, ZC3XX_R123_GAMMA03},
3483*4882a593Smuzhiyun 	{0xa0, 0x94, ZC3XX_R124_GAMMA04},
3484*4882a593Smuzhiyun 	{0xa0, 0xa9, ZC3XX_R125_GAMMA05},
3485*4882a593Smuzhiyun 	{0xa0, 0xbb, ZC3XX_R126_GAMMA06},
3486*4882a593Smuzhiyun 	{0xa0, 0xca, ZC3XX_R127_GAMMA07},
3487*4882a593Smuzhiyun 	{0xa0, 0xd7, ZC3XX_R128_GAMMA08},
3488*4882a593Smuzhiyun 	{0xa0, 0xe1, ZC3XX_R129_GAMMA09},
3489*4882a593Smuzhiyun 	{0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
3490*4882a593Smuzhiyun 	{0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
3491*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
3492*4882a593Smuzhiyun 	{0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
3493*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
3494*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
3495*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R130_GAMMA10},
3496*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
3497*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
3498*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
3499*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
3500*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
3501*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
3502*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
3503*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
3504*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
3505*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
3506*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
3507*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
3508*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
3509*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
3510*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
3511*4882a593Smuzhiyun 	{0xa0, 0x4e, ZC3XX_R10A_RGB00},	/* matrix */
3512*4882a593Smuzhiyun 	{0xa0, 0xfe, ZC3XX_R10B_RGB01},
3513*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
3514*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R10D_RGB10},
3515*4882a593Smuzhiyun 	{0xa0, 0x4d, ZC3XX_R10E_RGB11},
3516*4882a593Smuzhiyun 	{0xa0, 0xfc, ZC3XX_R10F_RGB12},
3517*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R110_RGB20},
3518*4882a593Smuzhiyun 	{0xa0, 0xf6, ZC3XX_R111_RGB21},
3519*4882a593Smuzhiyun 	{0xa0, 0x4a, ZC3XX_R112_RGB22},
3520*4882a593Smuzhiyun 
3521*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
3522*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3523*4882a593Smuzhiyun 	{0xaa, 0x10, 0x000d},
3524*4882a593Smuzhiyun 	{0xaa, 0x76, 0x0002},
3525*4882a593Smuzhiyun 	{0xaa, 0x2a, 0x0081},
3526*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x0000},
3527*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3528*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
3529*4882a593Smuzhiyun 	{0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
3530*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3531*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3532*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
3533*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3534*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3535*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
3536*4882a593Smuzhiyun 	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3537*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
3538*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
3539*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3540*4882a593Smuzhiyun 	{0xaa, 0x13, 0x00c3},
3541*4882a593Smuzhiyun 
3542*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},
3543*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3544*4882a593Smuzhiyun 	{}
3545*4882a593Smuzhiyun };
3546*4882a593Smuzhiyun 
3547*4882a593Smuzhiyun static const struct usb_action pas106b_Initial_com[] = {
3548*4882a593Smuzhiyun /* Sream and Sensor specific */
3549*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0010},	/* CMOSSensorSelect */
3550*4882a593Smuzhiyun /* System */
3551*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},	/* SystemControl */
3552*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},	/* SystemControl */
3553*4882a593Smuzhiyun /* Picture size */
3554*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},	/* ClockSelect */
3555*4882a593Smuzhiyun 	{0xa0, 0x03, 0x003a},
3556*4882a593Smuzhiyun 	{0xa0, 0x0c, 0x003b},
3557*4882a593Smuzhiyun 	{0xa0, 0x04, 0x0038},
3558*4882a593Smuzhiyun 	{}
3559*4882a593Smuzhiyun };
3560*4882a593Smuzhiyun 
3561*4882a593Smuzhiyun static const struct usb_action pas106b_InitialScale[] = {	/* 176x144 */
3562*4882a593Smuzhiyun /* JPEG control */
3563*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3564*4882a593Smuzhiyun /* Sream and Sensor specific */
3565*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
3566*4882a593Smuzhiyun /* Picture size */
3567*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
3568*4882a593Smuzhiyun 	{0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
3569*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
3570*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
3571*4882a593Smuzhiyun /* System */
3572*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3573*4882a593Smuzhiyun /* Sream and Sensor specific */
3574*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3575*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3576*4882a593Smuzhiyun /* Sensor Interface */
3577*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3578*4882a593Smuzhiyun /* Window inside sensor array */
3579*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3580*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3581*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3582*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3583*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
3584*4882a593Smuzhiyun /* Init the sensor */
3585*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0004},
3586*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
3587*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0005},
3588*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0002},
3589*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0002},
3590*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0005},
3591*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0000},
3592*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0002},
3593*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0081},
3594*4882a593Smuzhiyun /* Other registers */
3595*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
3596*4882a593Smuzhiyun /* Frame retrieving */
3597*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
3598*4882a593Smuzhiyun /* Gains */
3599*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
3600*4882a593Smuzhiyun /* Unknown */
3601*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
3602*4882a593Smuzhiyun /* Sharpness */
3603*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3604*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3605*4882a593Smuzhiyun /* Other registers */
3606*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3607*4882a593Smuzhiyun /* Auto exposure and white balance */
3608*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3609*4882a593Smuzhiyun /*Dead pixels */
3610*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3611*4882a593Smuzhiyun /* EEPROM */
3612*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3613*4882a593Smuzhiyun /* JPEG control */
3614*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3615*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3616*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3617*4882a593Smuzhiyun /* Other registers */
3618*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3619*4882a593Smuzhiyun /* Auto exposure and white balance */
3620*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3621*4882a593Smuzhiyun /*Dead pixels */
3622*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3623*4882a593Smuzhiyun /* EEPROM */
3624*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3625*4882a593Smuzhiyun /* JPEG control */
3626*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3627*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3628*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3629*4882a593Smuzhiyun 
3630*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
3631*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
3632*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
3633*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
3634*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R10E_RGB11},
3635*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
3636*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R110_RGB20},
3637*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R111_RGB21},
3638*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R112_RGB22},
3639*4882a593Smuzhiyun /* Auto correction */
3640*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R181_WINXSTART},
3641*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3642*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3643*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R184_WINYSTART},
3644*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3645*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3646*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3647*4882a593Smuzhiyun /* Auto exposure and white balance */
3648*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3649*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3650*4882a593Smuzhiyun 	{0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
3651*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3652*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3653*4882a593Smuzhiyun 	{0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
3654*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
3655*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
3656*4882a593Smuzhiyun /* sensor on */
3657*4882a593Smuzhiyun 	{0xaa, 0x07, 0x00b1},
3658*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0003},
3659*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0001},
3660*4882a593Smuzhiyun 	{0xaa, 0x03, 0x003b},
3661*4882a593Smuzhiyun /* Gains */
3662*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3663*4882a593Smuzhiyun 	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3664*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
3665*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
3666*4882a593Smuzhiyun /* Auto correction */
3667*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3668*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},				/* AutoCorrectEnable */
3669*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3670*4882a593Smuzhiyun /* Gains */
3671*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
3672*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
3673*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
3674*4882a593Smuzhiyun 	{}
3675*4882a593Smuzhiyun };
3676*4882a593Smuzhiyun 
3677*4882a593Smuzhiyun static const struct usb_action pas106b_Initial[] = {	/* 352x288 */
3678*4882a593Smuzhiyun /* JPEG control */
3679*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3680*4882a593Smuzhiyun /* Sream and Sensor specific */
3681*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
3682*4882a593Smuzhiyun /* Picture size */
3683*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
3684*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
3685*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
3686*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
3687*4882a593Smuzhiyun /* System */
3688*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3689*4882a593Smuzhiyun /* Sream and Sensor specific */
3690*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
3691*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3692*4882a593Smuzhiyun /* Sensor Interface */
3693*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3694*4882a593Smuzhiyun /* Window inside sensor array */
3695*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
3696*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
3697*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
3698*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
3699*4882a593Smuzhiyun 	{0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
3700*4882a593Smuzhiyun /* Init the sensor */
3701*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0004},
3702*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0000},
3703*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0005},
3704*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0002},
3705*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0002},
3706*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0005},
3707*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0000},
3708*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0002},
3709*4882a593Smuzhiyun 	{0xaa, 0x14, 0x0081},
3710*4882a593Smuzhiyun /* Other registers */
3711*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
3712*4882a593Smuzhiyun /* Frame retrieving */
3713*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
3714*4882a593Smuzhiyun /* Gains */
3715*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
3716*4882a593Smuzhiyun /* Unknown */
3717*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
3718*4882a593Smuzhiyun /* Sharpness */
3719*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
3720*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3721*4882a593Smuzhiyun /* Other registers */
3722*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3723*4882a593Smuzhiyun /* Auto exposure and white balance */
3724*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3725*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R18D_YTARGET},
3726*4882a593Smuzhiyun /*Dead pixels */
3727*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3728*4882a593Smuzhiyun /* EEPROM */
3729*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3730*4882a593Smuzhiyun /* JPEG control */
3731*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3732*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3733*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3734*4882a593Smuzhiyun /* Other registers */
3735*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3736*4882a593Smuzhiyun /* Auto exposure and white balance */
3737*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3738*4882a593Smuzhiyun /*Dead pixels */
3739*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3740*4882a593Smuzhiyun /* EEPROM */
3741*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3742*4882a593Smuzhiyun /* JPEG control */
3743*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3744*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
3745*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3746*4882a593Smuzhiyun 
3747*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
3748*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
3749*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
3750*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
3751*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R10E_RGB11},
3752*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
3753*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R110_RGB20},
3754*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R111_RGB21},
3755*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R112_RGB22},
3756*4882a593Smuzhiyun /* Auto correction */
3757*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R181_WINXSTART},
3758*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
3759*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R183_WINXCENTER},
3760*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R184_WINYSTART},
3761*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
3762*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R186_WINYCENTER},
3763*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3764*4882a593Smuzhiyun 
3765*4882a593Smuzhiyun /* Auto exposure and white balance */
3766*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
3767*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
3768*4882a593Smuzhiyun 	{0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
3769*4882a593Smuzhiyun 
3770*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
3771*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
3772*4882a593Smuzhiyun 	{0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
3773*4882a593Smuzhiyun 
3774*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
3775*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
3776*4882a593Smuzhiyun /* sensor on */
3777*4882a593Smuzhiyun 	{0xaa, 0x07, 0x00b1},
3778*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0003},
3779*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0001},
3780*4882a593Smuzhiyun 	{0xaa, 0x03, 0x003b},
3781*4882a593Smuzhiyun /* Gains */
3782*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
3783*4882a593Smuzhiyun 	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
3784*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
3785*4882a593Smuzhiyun /* Auto correction */
3786*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3787*4882a593Smuzhiyun 	{0xa1, 0x01, 0x0180},				/* AutoCorrectEnable */
3788*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3789*4882a593Smuzhiyun /* Gains */
3790*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R116_RGAIN},
3791*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R117_GGAIN},
3792*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R118_BGAIN},
3793*4882a593Smuzhiyun 
3794*4882a593Smuzhiyun 	{0xa0, 0x00, 0x0007},			/* AutoCorrectEnable */
3795*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R018_FRAMELOST},	/* Frame adjust */
3796*4882a593Smuzhiyun 	{}
3797*4882a593Smuzhiyun };
3798*4882a593Smuzhiyun static const struct usb_action pas106b_50HZ[] = {
3799*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3800*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3801*4882a593Smuzhiyun 	{0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
3802*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3803*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3804*4882a593Smuzhiyun 	{0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
3805*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
3806*4882a593Smuzhiyun 	{0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,30,cc */
3807*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0021},			/* 00,03,21,aa */
3808*4882a593Smuzhiyun 	{0xaa, 0x04, 0x000c},			/* 00,04,0c,aa */
3809*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0002},			/* 00,05,02,aa */
3810*4882a593Smuzhiyun 	{0xaa, 0x07, 0x001c},			/* 00,07,1c,aa */
3811*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
3812*4882a593Smuzhiyun 	{}
3813*4882a593Smuzhiyun };
3814*4882a593Smuzhiyun static const struct usb_action pas106b_60HZ[] = {
3815*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3816*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3817*4882a593Smuzhiyun 	{0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
3818*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3819*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3820*4882a593Smuzhiyun 	{0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
3821*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
3822*4882a593Smuzhiyun 	{0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,30,cc */
3823*4882a593Smuzhiyun 	{0xaa, 0x03, 0x001c},			/* 00,03,1c,aa */
3824*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0004},			/* 00,04,04,aa */
3825*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0001},			/* 00,05,01,aa */
3826*4882a593Smuzhiyun 	{0xaa, 0x07, 0x00c4},			/* 00,07,c4,aa */
3827*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
3828*4882a593Smuzhiyun 	{}
3829*4882a593Smuzhiyun };
3830*4882a593Smuzhiyun static const struct usb_action pas106b_NoFliker[] = {
3831*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
3832*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
3833*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
3834*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
3835*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
3836*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
3837*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
3838*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,20,cc */
3839*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0013},			/* 00,03,13,aa */
3840*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0000},			/* 00,04,00,aa */
3841*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0001},			/* 00,05,01,aa */
3842*4882a593Smuzhiyun 	{0xaa, 0x07, 0x0030},			/* 00,07,30,aa */
3843*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
3844*4882a593Smuzhiyun 	{}
3845*4882a593Smuzhiyun };
3846*4882a593Smuzhiyun 
3847*4882a593Smuzhiyun /* from lvWIMv.inf 046d:08a2/:08aa 2007/06/03 */
3848*4882a593Smuzhiyun static const struct usb_action pas202b_Initial[] = {	/* 640x480 */
3849*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc */
3850*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3851*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0e,cc */
3852*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},		/* 00,02,00,cc */
3853*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
3854*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc */
3855*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
3856*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc */
3857*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
3858*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
3859*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
3860*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},	/* 00,8d,08,cc */
3861*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc */
3862*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,03,cc */
3863*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc */
3864*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,03,cc */
3865*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},		/* 00,9b,01,cc */
3866*4882a593Smuzhiyun 	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,e6,cc */
3867*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},		/* 00,9d,02,cc */
3868*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,86,cc */
3869*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0002},			/* 00,02,04,aa --> 02 */
3870*4882a593Smuzhiyun 	{0xaa, 0x07, 0x0006},				/* 00,07,06,aa */
3871*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0002},				/* 00,08,02,aa */
3872*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0006},				/* 00,09,06,aa */
3873*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0001},				/* 00,0a,01,aa */
3874*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0001},				/* 00,0b,01,aa */
3875*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0006},
3876*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0000},				/* 00,0d,00,aa */
3877*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0000},				/* 00,10,00,aa */
3878*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0005},				/* 00,12,05,aa */
3879*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0063},				/* 00,13,63,aa */
3880*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0070},				/* 00,15,70,aa */
3881*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc */
3882*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc */
3883*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},		/* 01,89,06,cc */
3884*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},				/* 01,ad,00,cc */
3885*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc */
3886*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc */
3887*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
3888*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc */
3889*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R18D_YTARGET},		/* 01,8d,70,cc */
3890*4882a593Smuzhiyun 	{}
3891*4882a593Smuzhiyun };
3892*4882a593Smuzhiyun static const struct usb_action pas202b_InitialScale[] = {	/* 320x240 */
3893*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc */
3894*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3895*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0e,cc */
3896*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},		/* 00,02,10,cc */
3897*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
3898*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc */
3899*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
3900*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
3901*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
3902*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
3903*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
3904*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},	/* 00,8d,08,cc */
3905*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,08,cc */
3906*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,02,cc */
3907*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,08,cc */
3908*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,02,cc */
3909*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},		/* 00,9b,01,cc */
3910*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
3911*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},		/* 00,9d,02,cc */
3912*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,88,cc */
3913*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0002},				/* 00,02,02,aa */
3914*4882a593Smuzhiyun 	{0xaa, 0x07, 0x0006},				/* 00,07,06,aa */
3915*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0002},				/* 00,08,02,aa */
3916*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0006},				/* 00,09,06,aa */
3917*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0001},				/* 00,0a,01,aa */
3918*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0001},				/* 00,0b,01,aa */
3919*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0006},
3920*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0000},				/* 00,0d,00,aa */
3921*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0000},				/* 00,10,00,aa */
3922*4882a593Smuzhiyun 	{0xaa, 0x12, 0x0005},				/* 00,12,05,aa */
3923*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0063},				/* 00,13,63,aa */
3924*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0070},				/* 00,15,70,aa */
3925*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,37,cc */
3926*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc */
3927*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},		/* 01,89,06,cc */
3928*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},				/* 01,ad,00,cc */
3929*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc */
3930*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc */
3931*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
3932*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc */
3933*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R18D_YTARGET},		/* 01,8d,70,cc */
3934*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R097_WINYSTARTHIGH},
3935*4882a593Smuzhiyun 	{0xa0, 0xfe, ZC3XX_R098_WINYSTARTLOW},
3936*4882a593Smuzhiyun 	{}
3937*4882a593Smuzhiyun };
3938*4882a593Smuzhiyun static const struct usb_action pas202b_50HZ[] = {
3939*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
3940*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
3941*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
3942*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
3943*4882a593Smuzhiyun 	{0xaa, 0x21, 0x001b},
3944*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0044},				/* 00,03,44,aa */
3945*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0008},
3946*4882a593Smuzhiyun 	{0xaa, 0x05, 0x001b},
3947*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
3948*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
3949*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
3950*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
3951*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
3952*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
3953*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
3954*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
3955*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
3956*4882a593Smuzhiyun 	{0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,4d,cc */
3957*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
3958*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
3959*4882a593Smuzhiyun 	{0xa0, 0x44, ZC3XX_R01D_HSYNC_0},		/* 00,1d,44,cc */
3960*4882a593Smuzhiyun 	{0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},		/* 00,1e,6f,cc */
3961*4882a593Smuzhiyun 	{0xa0, 0xad, ZC3XX_R01F_HSYNC_2},		/* 00,1f,ad,cc */
3962*4882a593Smuzhiyun 	{0xa0, 0xeb, ZC3XX_R020_HSYNC_3},		/* 00,20,eb,cc */
3963*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
3964*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
3965*4882a593Smuzhiyun 	{}
3966*4882a593Smuzhiyun };
3967*4882a593Smuzhiyun static const struct usb_action pas202b_50HZScale[] = {
3968*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
3969*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
3970*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
3971*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0004},
3972*4882a593Smuzhiyun 	{0xaa, 0x21, 0x003d},
3973*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0041},				/* 00,03,41,aa */
3974*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0010},
3975*4882a593Smuzhiyun 	{0xaa, 0x05, 0x003d},
3976*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
3977*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
3978*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
3979*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
3980*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
3981*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
3982*4882a593Smuzhiyun 	{0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
3983*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
3984*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
3985*4882a593Smuzhiyun 	{0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,9b,cc */
3986*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
3987*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
3988*4882a593Smuzhiyun 	{0xa0, 0x41, ZC3XX_R01D_HSYNC_0},		/* 00,1d,41,cc */
3989*4882a593Smuzhiyun 	{0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},		/* 00,1e,6f,cc */
3990*4882a593Smuzhiyun 	{0xa0, 0xad, ZC3XX_R01F_HSYNC_2},		/* 00,1f,ad,cc */
3991*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc */
3992*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
3993*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
3994*4882a593Smuzhiyun 	{}
3995*4882a593Smuzhiyun };
3996*4882a593Smuzhiyun static const struct usb_action pas202b_60HZ[] = {
3997*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
3998*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
3999*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
4000*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
4001*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0000},				/* 00,21,00,aa */
4002*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0045},				/* 00,03,45,aa */
4003*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0008},				/* 00,04,08,aa */
4004*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0000},				/* 00,05,00,aa */
4005*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
4006*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
4007*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
4008*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
4009*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
4010*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4011*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
4012*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
4013*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
4014*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,40,cc */
4015*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4016*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
4017*4882a593Smuzhiyun 	{0xa0, 0x45, ZC3XX_R01D_HSYNC_0},		/* 00,1d,45,cc */
4018*4882a593Smuzhiyun 	{0xa0, 0x8e, ZC3XX_R01E_HSYNC_1},		/* 00,1e,8e,cc */
4019*4882a593Smuzhiyun 	{0xa0, 0xc1, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c1,cc */
4020*4882a593Smuzhiyun 	{0xa0, 0xf5, ZC3XX_R020_HSYNC_3},		/* 00,20,f5,cc */
4021*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
4022*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
4023*4882a593Smuzhiyun 	{}
4024*4882a593Smuzhiyun };
4025*4882a593Smuzhiyun static const struct usb_action pas202b_60HZScale[] = {
4026*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
4027*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
4028*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
4029*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0004},
4030*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0008},
4031*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0042},				/* 00,03,42,aa */
4032*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0010},
4033*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0008},
4034*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
4035*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
4036*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
4037*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
4038*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
4039*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4040*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW},
4041*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
4042*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
4043*4882a593Smuzhiyun 	{0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,81,cc */
4044*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4045*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
4046*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R01D_HSYNC_0},		/* 00,1d,42,cc */
4047*4882a593Smuzhiyun 	{0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},		/* 00,1e,6f,cc */
4048*4882a593Smuzhiyun 	{0xa0, 0xaf, ZC3XX_R01F_HSYNC_2},		/* 00,1f,af,cc */
4049*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc */
4050*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
4051*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
4052*4882a593Smuzhiyun 	{}
4053*4882a593Smuzhiyun };
4054*4882a593Smuzhiyun static const struct usb_action pas202b_NoFliker[] = {
4055*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
4056*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
4057*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
4058*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
4059*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0006},
4060*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0040},				/* 00,03,40,aa */
4061*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0008},				/* 00,04,08,aa */
4062*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0006},
4063*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
4064*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
4065*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
4066*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
4067*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R192_EXPOSURELIMITLOW},
4068*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
4069*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
4070*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4071*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},		/* 01,8c,10,cc */
4072*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,20,cc */
4073*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,00,cc */
4074*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4075*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R01D_HSYNC_0},		/* 00,1d,40,cc */
4076*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R01E_HSYNC_1},		/* 00,1e,60,cc */
4077*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},		/* 00,1f,90,cc */
4078*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc */
4079*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
4080*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
4081*4882a593Smuzhiyun 	{}
4082*4882a593Smuzhiyun };
4083*4882a593Smuzhiyun static const struct usb_action pas202b_NoFlikerScale[] = {
4084*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
4085*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
4086*4882a593Smuzhiyun 	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
4087*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0004},
4088*4882a593Smuzhiyun 	{0xaa, 0x21, 0x000c},
4089*4882a593Smuzhiyun 	{0xaa, 0x03, 0x0040},				/* 00,03,40,aa */
4090*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0010},
4091*4882a593Smuzhiyun 	{0xaa, 0x05, 0x000c},
4092*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
4093*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
4094*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
4095*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
4096*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R192_EXPOSURELIMITLOW},
4097*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
4098*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
4099*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,02,cc */
4100*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},		/* 01,8c,10,cc */
4101*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,20,cc */
4102*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,00,cc */
4103*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4104*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R01D_HSYNC_0},		/* 00,1d,40,cc */
4105*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R01E_HSYNC_1},		/* 00,1e,60,cc */
4106*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},		/* 00,1f,90,cc */
4107*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc */
4108*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
4109*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
4110*4882a593Smuzhiyun 	{}
4111*4882a593Smuzhiyun };
4112*4882a593Smuzhiyun 
4113*4882a593Smuzhiyun /* mt9v111 (mi0360soc) and pb0330 from vm30x.inf 0ac8:301b 07/02/13 */
4114*4882a593Smuzhiyun static const struct usb_action mt9v111_1_Initial[] = {	/* 640x480 */
4115*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4116*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4117*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4118*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4119*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4120*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4121*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4122*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4123*4882a593Smuzhiyun 	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4124*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4125*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4126*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4127*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4128*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4129*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4130*4882a593Smuzhiyun 	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4131*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},
4132*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4133*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0001},
4134*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0000},
4135*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0483},
4136*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0004},
4137*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0006},
4138*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0011},
4139*4882a593Smuzhiyun 	{0xaa, 0x03, 0x01e5},			/*jfm: was 01e7*/
4140*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0285},			/*jfm: was 0287*/
4141*4882a593Smuzhiyun 	{0xaa, 0x07, 0x3002},
4142*4882a593Smuzhiyun 	{0xaa, 0x20, 0x5100},
4143*4882a593Smuzhiyun 	{0xaa, 0x35, 0x507f},
4144*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0005},
4145*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0000},
4146*4882a593Smuzhiyun 	{0xaa, 0x58, 0x0078},
4147*4882a593Smuzhiyun 	{0xaa, 0x62, 0x0411},
4148*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x007f},
4149*4882a593Smuzhiyun 	{0xaa, 0x2c, 0x007f},			/*jfm: was 0030*/
4150*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x007f},			/*jfm: was 0030*/
4151*4882a593Smuzhiyun 	{0xaa, 0x2e, 0x007f},			/*jfm: was 0030*/
4152*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4153*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
4154*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4155*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4156*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4157*4882a593Smuzhiyun 	{0xa0, 0x09, 0x01ad},			/*jfm: was 00*/
4158*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4159*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4160*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4161*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4162*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4163*4882a593Smuzhiyun 	{0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4164*4882a593Smuzhiyun 	{0xa0, 0x61, ZC3XX_R116_RGAIN},
4165*4882a593Smuzhiyun 	{0xa0, 0x65, ZC3XX_R118_BGAIN},
4166*4882a593Smuzhiyun 	{}
4167*4882a593Smuzhiyun };
4168*4882a593Smuzhiyun static const struct usb_action mt9v111_1_InitialScale[] = {	/* 320x240 */
4169*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4170*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4171*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4172*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4173*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4174*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4175*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4176*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4177*4882a593Smuzhiyun 	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4178*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4179*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4180*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4181*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4182*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4183*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4184*4882a593Smuzhiyun 	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4185*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},
4186*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4187*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0001},
4188*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0000},
4189*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0483},
4190*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0004},
4191*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0006},
4192*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0011},
4193*4882a593Smuzhiyun 	{0xaa, 0x03, 0x01e7},
4194*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0287},
4195*4882a593Smuzhiyun 	{0xaa, 0x07, 0x3002},
4196*4882a593Smuzhiyun 	{0xaa, 0x20, 0x5100},
4197*4882a593Smuzhiyun 	{0xaa, 0x35, 0x007f},			/*jfm: was 0050*/
4198*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0005},
4199*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0000},
4200*4882a593Smuzhiyun 	{0xaa, 0x58, 0x0078},
4201*4882a593Smuzhiyun 	{0xaa, 0x62, 0x0411},
4202*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x007f},			/*jfm: was 28*/
4203*4882a593Smuzhiyun 	{0xaa, 0x2c, 0x007f},			/*jfm: was 30*/
4204*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x007f},			/*jfm: was 30*/
4205*4882a593Smuzhiyun 	{0xaa, 0x2e, 0x007f},			/*jfm: was 28*/
4206*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4207*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
4208*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4209*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4210*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4211*4882a593Smuzhiyun 	{0xa0, 0x09, 0x01ad},			/*jfm: was 00*/
4212*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4213*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4214*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4215*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4216*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4217*4882a593Smuzhiyun 	{0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4218*4882a593Smuzhiyun 	{0xa0, 0x61, ZC3XX_R116_RGAIN},
4219*4882a593Smuzhiyun 	{0xa0, 0x65, ZC3XX_R118_BGAIN},
4220*4882a593Smuzhiyun 	{}
4221*4882a593Smuzhiyun };
4222*4882a593Smuzhiyun static const struct usb_action mt9v111_1_AE50HZ[] = {
4223*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4224*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4225*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0562},
4226*4882a593Smuzhiyun 	{0xbb, 0x01, 0x09aa},
4227*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4228*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4229*4882a593Smuzhiyun 	{0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
4230*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4231*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4232*4882a593Smuzhiyun 	{0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
4233*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4234*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4235*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4236*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4237*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
4238*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4239*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4240*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4241*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4242*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4243*4882a593Smuzhiyun 	{}
4244*4882a593Smuzhiyun };
4245*4882a593Smuzhiyun static const struct usb_action mt9v111_1_AE50HZScale[] = {
4246*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4247*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4248*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0509},
4249*4882a593Smuzhiyun 	{0xbb, 0x01, 0x0934},
4250*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4251*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4252*4882a593Smuzhiyun 	{0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4253*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4254*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4255*4882a593Smuzhiyun 	{0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4256*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4257*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4258*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4259*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4260*4882a593Smuzhiyun 	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4261*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4262*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4263*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4264*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4265*4882a593Smuzhiyun 	{}
4266*4882a593Smuzhiyun };
4267*4882a593Smuzhiyun static const struct usb_action mt9v111_1_AE60HZ[] = {
4268*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4269*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4270*4882a593Smuzhiyun 	{0xaa, 0x05, 0x003d},
4271*4882a593Smuzhiyun 	{0xaa, 0x09, 0x016e},
4272*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4273*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4274*4882a593Smuzhiyun 	{0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW},
4275*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4276*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4277*4882a593Smuzhiyun 	{0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
4278*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4279*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4280*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4281*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4282*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
4283*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4284*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4285*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4286*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4287*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4288*4882a593Smuzhiyun 	{}
4289*4882a593Smuzhiyun };
4290*4882a593Smuzhiyun static const struct usb_action mt9v111_1_AE60HZScale[] = {
4291*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4292*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4293*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0509},
4294*4882a593Smuzhiyun 	{0xbb, 0x01, 0x0983},
4295*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4296*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4297*4882a593Smuzhiyun 	{0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4298*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4299*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4300*4882a593Smuzhiyun 	{0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
4301*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4302*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4303*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4304*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4305*4882a593Smuzhiyun 	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4306*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4307*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4308*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4309*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4310*4882a593Smuzhiyun 	{}
4311*4882a593Smuzhiyun };
4312*4882a593Smuzhiyun static const struct usb_action mt9v111_1_AENoFliker[] = {
4313*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4314*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4315*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0509},
4316*4882a593Smuzhiyun 	{0xbb, 0x01, 0x0960},
4317*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4318*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4319*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4320*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4321*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4322*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4323*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4324*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4325*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4326*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4327*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
4328*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
4329*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4330*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4331*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4332*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4333*4882a593Smuzhiyun 	{}
4334*4882a593Smuzhiyun };
4335*4882a593Smuzhiyun static const struct usb_action mt9v111_1_AENoFlikerScale[] = {
4336*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4337*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4338*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0534},
4339*4882a593Smuzhiyun 	{0xbb, 0x02, 0x0960},
4340*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4341*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4342*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4343*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4344*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4345*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4346*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4347*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4348*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4349*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4350*4882a593Smuzhiyun 	{0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4351*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4352*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4353*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4354*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4355*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4356*4882a593Smuzhiyun 	{}
4357*4882a593Smuzhiyun };
4358*4882a593Smuzhiyun /* from usbvm303.inf 0ac8:303b 07/03/25 (3 - tas5130c) */
4359*4882a593Smuzhiyun static const struct usb_action mt9v111_3_Initial[] = {
4360*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4361*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4362*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4363*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4364*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4365*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4366*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4367*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4368*4882a593Smuzhiyun 	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4369*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4370*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4371*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4372*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4373*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4374*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4375*4882a593Smuzhiyun 	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4376*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},
4377*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4378*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0001},		/* select IFP/SOC registers */
4379*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0000},		/* operating mode control */
4380*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0483},		/* output format control */
4381*4882a593Smuzhiyun 					/* H red first, V red or blue first,
4382*4882a593Smuzhiyun 					 * raw Bayer, auto flicker */
4383*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0004},		/* select sensor core registers */
4384*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0006},		/* row start */
4385*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0011},		/* column start */
4386*4882a593Smuzhiyun 	{0xaa, 0x03, 0x01e5},		/* window height - 1 */
4387*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0285},		/* window width - 1 */
4388*4882a593Smuzhiyun 	{0xaa, 0x07, 0x3002},		/* output control */
4389*4882a593Smuzhiyun 	{0xaa, 0x20, 0x1100},		/* read mode: bits 8 & 12 (?) */
4390*4882a593Smuzhiyun 	{0xaa, 0x35, 0x007f},		/* global gain */
4391*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0005},
4392*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0000},
4393*4882a593Smuzhiyun 	{0xaa, 0x58, 0x0078},
4394*4882a593Smuzhiyun 	{0xaa, 0x62, 0x0411},
4395*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x007f},		/* green1 gain */
4396*4882a593Smuzhiyun 	{0xaa, 0x2c, 0x007f},		/* blue gain */
4397*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x007f},		/* red gain */
4398*4882a593Smuzhiyun 	{0xaa, 0x2e, 0x007f},		/* green2 gain */
4399*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4400*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4401*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4402*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4403*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4404*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
4405*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4406*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4407*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4408*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4409*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4410*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R18D_YTARGET},
4411*4882a593Smuzhiyun 	{0xa0, 0x61, ZC3XX_R116_RGAIN},
4412*4882a593Smuzhiyun 	{0xa0, 0x65, ZC3XX_R118_BGAIN},
4413*4882a593Smuzhiyun 	{}
4414*4882a593Smuzhiyun };
4415*4882a593Smuzhiyun static const struct usb_action mt9v111_3_InitialScale[] = {
4416*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4417*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4418*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4419*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4420*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4421*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4422*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4423*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4424*4882a593Smuzhiyun 	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4425*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4426*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4427*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4428*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4429*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4430*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4431*4882a593Smuzhiyun 	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4432*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},
4433*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4434*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0001},
4435*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0000},
4436*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0483},
4437*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0004},
4438*4882a593Smuzhiyun 	{0xaa, 0x08, 0x0006},
4439*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0011},
4440*4882a593Smuzhiyun 	{0xaa, 0x03, 0x01e7},
4441*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0287},
4442*4882a593Smuzhiyun 	{0xaa, 0x07, 0x3002},
4443*4882a593Smuzhiyun 	{0xaa, 0x20, 0x1100},
4444*4882a593Smuzhiyun 	{0xaa, 0x35, 0x007f},
4445*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0005},
4446*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0000},
4447*4882a593Smuzhiyun 	{0xaa, 0x58, 0x0078},
4448*4882a593Smuzhiyun 	{0xaa, 0x62, 0x0411},
4449*4882a593Smuzhiyun 	{0xaa, 0x2b, 0x007f},
4450*4882a593Smuzhiyun 	{0xaa, 0x2c, 0x007f},
4451*4882a593Smuzhiyun 	{0xaa, 0x2d, 0x007f},
4452*4882a593Smuzhiyun 	{0xaa, 0x2e, 0x007f},
4453*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4454*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4455*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4456*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4457*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4458*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
4459*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4460*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4461*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4462*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4463*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4464*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R18D_YTARGET},
4465*4882a593Smuzhiyun 	{0xa0, 0x61, ZC3XX_R116_RGAIN},
4466*4882a593Smuzhiyun 	{0xa0, 0x65, ZC3XX_R118_BGAIN},
4467*4882a593Smuzhiyun 	{}
4468*4882a593Smuzhiyun };
4469*4882a593Smuzhiyun static const struct usb_action mt9v111_3_AE50HZ[] = {
4470*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4471*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4472*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0009},		/* horizontal blanking */
4473*4882a593Smuzhiyun 	{0xaa, 0x09, 0x01ce},		/* shutter width */
4474*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4475*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4476*4882a593Smuzhiyun 	{0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4477*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4478*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4479*4882a593Smuzhiyun 	{0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4480*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4481*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4482*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4483*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4484*4882a593Smuzhiyun 	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4485*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4486*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4487*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4488*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4489*4882a593Smuzhiyun 	{}
4490*4882a593Smuzhiyun };
4491*4882a593Smuzhiyun static const struct usb_action mt9v111_3_AE50HZScale[] = {
4492*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4493*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4494*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0009},
4495*4882a593Smuzhiyun 	{0xaa, 0x09, 0x01ce},
4496*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4497*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4498*4882a593Smuzhiyun 	{0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
4499*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4500*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4501*4882a593Smuzhiyun 	{0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
4502*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4503*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4504*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4505*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4506*4882a593Smuzhiyun 	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4507*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4508*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4509*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4510*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4511*4882a593Smuzhiyun 	{}
4512*4882a593Smuzhiyun };
4513*4882a593Smuzhiyun static const struct usb_action mt9v111_3_AE60HZ[] = {
4514*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4515*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4516*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0009},
4517*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0083},
4518*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4519*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4520*4882a593Smuzhiyun 	{0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4521*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4522*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4523*4882a593Smuzhiyun 	{0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
4524*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4525*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4526*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4527*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4528*4882a593Smuzhiyun 	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4529*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4530*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4531*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4532*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4533*4882a593Smuzhiyun 	{}
4534*4882a593Smuzhiyun };
4535*4882a593Smuzhiyun static const struct usb_action mt9v111_3_AE60HZScale[] = {
4536*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4537*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4538*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0009},
4539*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0083},
4540*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4541*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4542*4882a593Smuzhiyun 	{0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
4543*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4544*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4545*4882a593Smuzhiyun 	{0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
4546*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4547*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4548*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4549*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
4550*4882a593Smuzhiyun 	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4551*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
4552*4882a593Smuzhiyun 	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
4553*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4554*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4555*4882a593Smuzhiyun 	{}
4556*4882a593Smuzhiyun };
4557*4882a593Smuzhiyun static const struct usb_action mt9v111_3_AENoFliker[] = {
4558*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4559*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4560*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0034},
4561*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0260},
4562*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4563*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4564*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4565*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4566*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4567*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4568*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4569*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4570*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4571*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4572*4882a593Smuzhiyun 	{0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4573*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4574*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4575*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4576*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4577*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4578*4882a593Smuzhiyun 	{}
4579*4882a593Smuzhiyun };
4580*4882a593Smuzhiyun static const struct usb_action mt9v111_3_AENoFlikerScale[] = {
4581*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4582*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4583*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0034},
4584*4882a593Smuzhiyun 	{0xaa, 0x09, 0x0260},
4585*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4586*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4587*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4588*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4589*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4590*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
4591*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4592*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
4593*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4594*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4595*4882a593Smuzhiyun 	{0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
4596*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4597*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4598*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4599*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4600*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4601*4882a593Smuzhiyun 	{}
4602*4882a593Smuzhiyun };
4603*4882a593Smuzhiyun 
4604*4882a593Smuzhiyun static const struct usb_action pb0330_Initial[] = {	/* 640x480 */
4605*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4606*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
4607*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4608*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
4609*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4610*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4611*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4612*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4613*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4614*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4615*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4616*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4617*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4618*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4619*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4620*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},
4621*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4622*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0006},
4623*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0011},
4624*4882a593Smuzhiyun 	{0xaa, 0x03, 0x01e5},			/*jfm: was 1e7*/
4625*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0285},			/*jfm: was 0287*/
4626*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0003},
4627*4882a593Smuzhiyun 	{0xaa, 0x07, 0x3002},
4628*4882a593Smuzhiyun 	{0xaa, 0x20, 0x1100},
4629*4882a593Smuzhiyun 	{0xaa, 0x2f, 0xf7b0},
4630*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0005},
4631*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0000},
4632*4882a593Smuzhiyun 	{0xaa, 0x34, 0x0100},
4633*4882a593Smuzhiyun 	{0xaa, 0x35, 0x0060},
4634*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x068f},
4635*4882a593Smuzhiyun 	{0xaa, 0x40, 0x01e0},
4636*4882a593Smuzhiyun 	{0xaa, 0x58, 0x0078},
4637*4882a593Smuzhiyun 	{0xaa, 0x62, 0x0411},
4638*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4639*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4640*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4641*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4642*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4643*4882a593Smuzhiyun 	{0xa0, 0x09, 0x01ad},			/*jfm: was 00 */
4644*4882a593Smuzhiyun 	{0xa0, 0x15, 0x01ae},
4645*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4646*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4647*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4648*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4649*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4650*4882a593Smuzhiyun 	{0xa0, 0x78, ZC3XX_R18D_YTARGET},	/*jfm: was 6c*/
4651*4882a593Smuzhiyun 	{}
4652*4882a593Smuzhiyun };
4653*4882a593Smuzhiyun static const struct usb_action pb0330_InitialScale[] = {	/* 320x240 */
4654*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4655*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
4656*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
4657*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
4658*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
4659*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
4660*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4661*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
4662*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4663*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4664*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
4665*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
4666*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
4667*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4668*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
4669*4882a593Smuzhiyun 	{0xdd, 0x00, 0x0200},
4670*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4671*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0006},
4672*4882a593Smuzhiyun 	{0xaa, 0x02, 0x0011},
4673*4882a593Smuzhiyun 	{0xaa, 0x03, 0x01e7},
4674*4882a593Smuzhiyun 	{0xaa, 0x04, 0x0287},
4675*4882a593Smuzhiyun 	{0xaa, 0x06, 0x0003},
4676*4882a593Smuzhiyun 	{0xaa, 0x07, 0x3002},
4677*4882a593Smuzhiyun 	{0xaa, 0x20, 0x1100},
4678*4882a593Smuzhiyun 	{0xaa, 0x2f, 0xf7b0},
4679*4882a593Smuzhiyun 	{0xaa, 0x30, 0x0005},
4680*4882a593Smuzhiyun 	{0xaa, 0x31, 0x0000},
4681*4882a593Smuzhiyun 	{0xaa, 0x34, 0x0100},
4682*4882a593Smuzhiyun 	{0xaa, 0x35, 0x0060},
4683*4882a593Smuzhiyun 	{0xaa, 0x3d, 0x068f},
4684*4882a593Smuzhiyun 	{0xaa, 0x40, 0x01e0},
4685*4882a593Smuzhiyun 	{0xaa, 0x58, 0x0078},
4686*4882a593Smuzhiyun 	{0xaa, 0x62, 0x0411},
4687*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
4688*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4689*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4690*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4691*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4692*4882a593Smuzhiyun 	{0xa0, 0x09, 0x01ad},
4693*4882a593Smuzhiyun 	{0xa0, 0x15, 0x01ae},
4694*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4695*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4696*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4697*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4698*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
4699*4882a593Smuzhiyun 	{0xa0, 0x78, ZC3XX_R18D_YTARGET},	/*jfm: was 6c*/
4700*4882a593Smuzhiyun 	{}
4701*4882a593Smuzhiyun };
4702*4882a593Smuzhiyun static const struct usb_action pb0330_50HZ[] = {
4703*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4704*4882a593Smuzhiyun 	{0xbb, 0x00, 0x055c},
4705*4882a593Smuzhiyun 	{0xbb, 0x01, 0x09aa},
4706*4882a593Smuzhiyun 	{0xbb, 0x00, 0x1001},
4707*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4708*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4709*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4710*4882a593Smuzhiyun 	{0xa0, 0xc4, ZC3XX_R192_EXPOSURELIMITLOW},
4711*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4712*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4713*4882a593Smuzhiyun 	{0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
4714*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4715*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4716*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4717*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4718*4882a593Smuzhiyun 	{0xa0, 0x5c, ZC3XX_R01D_HSYNC_0},
4719*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
4720*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
4721*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4722*4882a593Smuzhiyun 	{}
4723*4882a593Smuzhiyun };
4724*4882a593Smuzhiyun static const struct usb_action pb0330_50HZScale[] = {
4725*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4726*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0566},
4727*4882a593Smuzhiyun 	{0xbb, 0x02, 0x09b2},
4728*4882a593Smuzhiyun 	{0xbb, 0x00, 0x1002},
4729*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4730*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4731*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4732*4882a593Smuzhiyun 	{0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
4733*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4734*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4735*4882a593Smuzhiyun 	{0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
4736*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4737*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4738*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4739*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4740*4882a593Smuzhiyun 	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
4741*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
4742*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
4743*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4744*4882a593Smuzhiyun 	{}
4745*4882a593Smuzhiyun };
4746*4882a593Smuzhiyun static const struct usb_action pb0330_60HZ[] = {
4747*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4748*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0535},
4749*4882a593Smuzhiyun 	{0xbb, 0x01, 0x0974},
4750*4882a593Smuzhiyun 	{0xbb, 0x00, 0x1001},
4751*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4752*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4753*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4754*4882a593Smuzhiyun 	{0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
4755*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4756*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4757*4882a593Smuzhiyun 	{0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW},
4758*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4759*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4760*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4761*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4762*4882a593Smuzhiyun 	{0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4763*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
4764*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4765*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
4766*4882a593Smuzhiyun 	{}
4767*4882a593Smuzhiyun };
4768*4882a593Smuzhiyun static const struct usb_action pb0330_60HZScale[] = {
4769*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4770*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0535},
4771*4882a593Smuzhiyun 	{0xbb, 0x02, 0x096c},
4772*4882a593Smuzhiyun 	{0xbb, 0x00, 0x1002},
4773*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4774*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4775*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4776*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},
4777*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4778*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4779*4882a593Smuzhiyun 	{0xa0, 0x7c, ZC3XX_R197_ANTIFLICKERLOW},
4780*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
4781*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
4782*4882a593Smuzhiyun 	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
4783*4882a593Smuzhiyun 	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
4784*4882a593Smuzhiyun 	{0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4785*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
4786*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4787*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
4788*4882a593Smuzhiyun 	{}
4789*4882a593Smuzhiyun };
4790*4882a593Smuzhiyun static const struct usb_action pb0330_NoFliker[] = {
4791*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4792*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0509},
4793*4882a593Smuzhiyun 	{0xbb, 0x02, 0x0940},
4794*4882a593Smuzhiyun 	{0xbb, 0x00, 0x1002},
4795*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4796*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4797*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4798*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4799*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4800*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4801*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4802*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4803*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4804*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4805*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4806*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
4807*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
4808*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4809*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4810*4882a593Smuzhiyun 	{}
4811*4882a593Smuzhiyun };
4812*4882a593Smuzhiyun static const struct usb_action pb0330_NoFlikerScale[] = {
4813*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4814*4882a593Smuzhiyun 	{0xbb, 0x00, 0x0535},
4815*4882a593Smuzhiyun 	{0xbb, 0x01, 0x0980},
4816*4882a593Smuzhiyun 	{0xbb, 0x00, 0x1001},
4817*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4818*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4819*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
4820*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
4821*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4822*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4823*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
4824*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4825*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4826*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
4827*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
4828*4882a593Smuzhiyun 	{0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
4829*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
4830*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
4831*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
4832*4882a593Smuzhiyun 	{}
4833*4882a593Smuzhiyun };
4834*4882a593Smuzhiyun 
4835*4882a593Smuzhiyun /* from oem9.inf */
4836*4882a593Smuzhiyun static const struct usb_action po2030_Initial[] = {	/* 640x480 */
4837*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4838*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},	/* 00,02,04,cc */
4839*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
4840*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4841*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
4842*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
4843*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
4844*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
4845*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
4846*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
4847*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
4848*4882a593Smuzhiyun 	{0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
4849*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
4850*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4851*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4852*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4853*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4854*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4855*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
4856*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
4857*4882a593Smuzhiyun 	{0xaa, 0x8d, 0x0008},			/* 00,8d,08,aa */
4858*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},	/* 00,98,00,cc */
4859*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},	/* 00,9a,00,cc */
4860*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},	/* 01,1a,00,cc */
4861*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},	/* 01,1c,00,cc */
4862*4882a593Smuzhiyun 	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},	/* 00,9c,e6,cc */
4863*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},	/* 00,9e,86,cc */
4864*4882a593Smuzhiyun 	{0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
4865*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
4866*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
4867*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
4868*4882a593Smuzhiyun 	{0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
4869*4882a593Smuzhiyun 	{0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
4870*4882a593Smuzhiyun 	{0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
4871*4882a593Smuzhiyun 	{0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
4872*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
4873*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
4874*4882a593Smuzhiyun 	{0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
4875*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
4876*4882a593Smuzhiyun 	{0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
4877*4882a593Smuzhiyun 	{0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
4878*4882a593Smuzhiyun 	{0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
4879*4882a593Smuzhiyun 	{0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
4880*4882a593Smuzhiyun 	{0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
4881*4882a593Smuzhiyun 	{0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
4882*4882a593Smuzhiyun 	{0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
4883*4882a593Smuzhiyun 	{0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
4884*4882a593Smuzhiyun 	{0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
4885*4882a593Smuzhiyun 	{0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
4886*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4887*4882a593Smuzhiyun 	{0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
4888*4882a593Smuzhiyun 	{0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
4889*4882a593Smuzhiyun 	{0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
4890*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
4891*4882a593Smuzhiyun 	{0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
4892*4882a593Smuzhiyun 	{0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
4893*4882a593Smuzhiyun 	{0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
4894*4882a593Smuzhiyun 	{0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
4895*4882a593Smuzhiyun 	{0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
4896*4882a593Smuzhiyun 	{0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
4897*4882a593Smuzhiyun 	{0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
4898*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
4899*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
4900*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4901*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
4902*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
4903*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4904*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4905*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4906*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4907*4882a593Smuzhiyun 	{0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
4908*4882a593Smuzhiyun 	{0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
4909*4882a593Smuzhiyun 	{}
4910*4882a593Smuzhiyun };
4911*4882a593Smuzhiyun 
4912*4882a593Smuzhiyun /* from oem9.inf */
4913*4882a593Smuzhiyun static const struct usb_action po2030_InitialScale[] = {	/* 320x240 */
4914*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4915*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
4916*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
4917*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4918*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
4919*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
4920*4882a593Smuzhiyun 	{0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
4921*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
4922*4882a593Smuzhiyun 	{0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
4923*4882a593Smuzhiyun 	{0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
4924*4882a593Smuzhiyun 	{0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
4925*4882a593Smuzhiyun 	{0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
4926*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
4927*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4928*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4929*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4930*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4931*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4932*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
4933*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
4934*4882a593Smuzhiyun 	{0xaa, 0x8d, 0x0008},			/* 00,8d,08,aa */
4935*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
4936*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
4937*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
4938*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
4939*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
4940*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
4941*4882a593Smuzhiyun 	{0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
4942*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
4943*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
4944*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
4945*4882a593Smuzhiyun 	{0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
4946*4882a593Smuzhiyun 	{0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
4947*4882a593Smuzhiyun 	{0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
4948*4882a593Smuzhiyun 	{0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
4949*4882a593Smuzhiyun 	{0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
4950*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
4951*4882a593Smuzhiyun 	{0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
4952*4882a593Smuzhiyun 	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
4953*4882a593Smuzhiyun 	{0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
4954*4882a593Smuzhiyun 	{0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
4955*4882a593Smuzhiyun 	{0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
4956*4882a593Smuzhiyun 	{0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
4957*4882a593Smuzhiyun 	{0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
4958*4882a593Smuzhiyun 	{0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
4959*4882a593Smuzhiyun 	{0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
4960*4882a593Smuzhiyun 	{0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
4961*4882a593Smuzhiyun 	{0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
4962*4882a593Smuzhiyun 	{0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
4963*4882a593Smuzhiyun 	{0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4964*4882a593Smuzhiyun 	{0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
4965*4882a593Smuzhiyun 	{0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
4966*4882a593Smuzhiyun 	{0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
4967*4882a593Smuzhiyun 	{0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
4968*4882a593Smuzhiyun 	{0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
4969*4882a593Smuzhiyun 	{0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
4970*4882a593Smuzhiyun 	{0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
4971*4882a593Smuzhiyun 	{0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
4972*4882a593Smuzhiyun 	{0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
4973*4882a593Smuzhiyun 	{0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
4974*4882a593Smuzhiyun 	{0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
4975*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
4976*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
4977*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4978*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
4979*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
4980*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4981*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4982*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4983*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4984*4882a593Smuzhiyun 	{0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
4985*4882a593Smuzhiyun 	{0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
4986*4882a593Smuzhiyun 	{}
4987*4882a593Smuzhiyun };
4988*4882a593Smuzhiyun 
4989*4882a593Smuzhiyun static const struct usb_action po2030_50HZ[] = {
4990*4882a593Smuzhiyun 	{0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
4991*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
4992*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
4993*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
4994*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
4995*4882a593Smuzhiyun 	{0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
4996*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
4997*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4998*4882a593Smuzhiyun 	{0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
4999*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
5000*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5001*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5002*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5003*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5004*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
5005*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
5006*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
5007*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5008*4882a593Smuzhiyun 	{}
5009*4882a593Smuzhiyun };
5010*4882a593Smuzhiyun 
5011*4882a593Smuzhiyun static const struct usb_action po2030_60HZ[] = {
5012*4882a593Smuzhiyun 	{0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
5013*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5014*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
5015*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
5016*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
5017*4882a593Smuzhiyun 	{0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
5018*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
5019*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5020*4882a593Smuzhiyun 	{0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
5021*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
5022*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
5023*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
5024*4882a593Smuzhiyun 	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
5025*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
5026*4882a593Smuzhiyun 	{0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,22,cc */
5027*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R18D_YTARGET},		/* 01,8d,88,cc */
5028*4882a593Smuzhiyun 							/* win: 01,8d,80 */
5029*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc */
5030*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc */
5031*4882a593Smuzhiyun 	{}
5032*4882a593Smuzhiyun };
5033*4882a593Smuzhiyun 
5034*4882a593Smuzhiyun static const struct usb_action po2030_NoFliker[] = {
5035*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
5036*4882a593Smuzhiyun 	{0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
5037*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
5038*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
5039*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
5040*4882a593Smuzhiyun 	{0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
5041*4882a593Smuzhiyun 	{0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
5042*4882a593Smuzhiyun 	{}
5043*4882a593Smuzhiyun };
5044*4882a593Smuzhiyun 
5045*4882a593Smuzhiyun static const struct usb_action tas5130c_InitialScale[] = {	/* 320x240 */
5046*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5047*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
5048*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5049*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5050*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5051*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5052*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5053*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5054*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5055*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5056*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5057*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5058*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5059*4882a593Smuzhiyun 
5060*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
5061*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5062*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
5063*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5064*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
5065*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5066*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
5067*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5068*4882a593Smuzhiyun 	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
5069*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5070*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5071*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R18D_YTARGET},
5072*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
5073*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
5074*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5075*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5076*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5077*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5078*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5079*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5080*4882a593Smuzhiyun 	{}
5081*4882a593Smuzhiyun };
5082*4882a593Smuzhiyun static const struct usb_action tas5130c_Initial[] = {	/* 640x480 */
5083*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5084*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
5085*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},
5086*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
5087*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5088*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
5089*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
5090*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
5091*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
5092*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
5093*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
5094*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
5095*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
5096*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
5097*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
5098*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
5099*4882a593Smuzhiyun 	{0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
5100*4882a593Smuzhiyun 	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
5101*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
5102*4882a593Smuzhiyun 	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
5103*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
5104*4882a593Smuzhiyun 	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
5105*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
5106*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5107*4882a593Smuzhiyun 	{0xa0, 0x70, ZC3XX_R18D_YTARGET},
5108*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
5109*4882a593Smuzhiyun 	{0xa0, 0x00, 0x01ad},
5110*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
5111*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
5112*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
5113*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5114*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
5115*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
5116*4882a593Smuzhiyun 	{}
5117*4882a593Smuzhiyun };
5118*4882a593Smuzhiyun static const struct usb_action tas5130c_50HZ[] = {
5119*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5120*4882a593Smuzhiyun 	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5121*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
5122*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5123*4882a593Smuzhiyun 	{0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
5124*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5125*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
5126*4882a593Smuzhiyun 	{0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
5127*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5128*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5129*4882a593Smuzhiyun 	{0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
5130*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5131*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5132*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5133*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
5134*4882a593Smuzhiyun 	{0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
5135*4882a593Smuzhiyun 	{0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
5136*4882a593Smuzhiyun 	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
5137*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5138*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5139*4882a593Smuzhiyun 	{0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
5140*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5141*4882a593Smuzhiyun 	{}
5142*4882a593Smuzhiyun };
5143*4882a593Smuzhiyun static const struct usb_action tas5130c_50HZScale[] = {
5144*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5145*4882a593Smuzhiyun 	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5146*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5147*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5148*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5149*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5150*4882a593Smuzhiyun 	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
5151*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R192_EXPOSURELIMITLOW},
5152*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5153*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5154*4882a593Smuzhiyun 	{0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5155*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5156*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5157*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5158*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
5159*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
5160*4882a593Smuzhiyun 	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
5161*4882a593Smuzhiyun 	{0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
5162*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5163*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5164*4882a593Smuzhiyun 	{0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
5165*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5166*4882a593Smuzhiyun 	{}
5167*4882a593Smuzhiyun };
5168*4882a593Smuzhiyun static const struct usb_action tas5130c_60HZ[] = {
5169*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5170*4882a593Smuzhiyun 	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5171*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
5172*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5173*4882a593Smuzhiyun 	{0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
5174*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5175*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
5176*4882a593Smuzhiyun 	{0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW},
5177*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5178*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5179*4882a593Smuzhiyun 	{0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
5180*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5181*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5182*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5183*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
5184*4882a593Smuzhiyun 	{0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
5185*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5186*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5187*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5188*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5189*4882a593Smuzhiyun 	{0xa0, 0x28, ZC3XX_R0A0_MAXXLOW},
5190*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5191*4882a593Smuzhiyun 	{}
5192*4882a593Smuzhiyun };
5193*4882a593Smuzhiyun static const struct usb_action tas5130c_60HZScale[] = {
5194*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5195*4882a593Smuzhiyun 	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5196*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5197*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5198*4882a593Smuzhiyun 	{0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
5199*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5200*4882a593Smuzhiyun 	{0xa0, 0x09, ZC3XX_R191_EXPOSURELIMITMID},
5201*4882a593Smuzhiyun 	{0xa0, 0x47, ZC3XX_R192_EXPOSURELIMITLOW},
5202*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
5203*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
5204*4882a593Smuzhiyun 	{0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
5205*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5206*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5207*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
5208*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
5209*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
5210*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5211*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5212*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5213*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5214*4882a593Smuzhiyun 	{0xa0, 0x20, ZC3XX_R0A0_MAXXLOW},
5215*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5216*4882a593Smuzhiyun 	{}
5217*4882a593Smuzhiyun };
5218*4882a593Smuzhiyun static const struct usb_action tas5130c_NoFliker[] = {
5219*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5220*4882a593Smuzhiyun 	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5221*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
5222*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5223*4882a593Smuzhiyun 	{0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
5224*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5225*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
5226*4882a593Smuzhiyun 	{0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
5227*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5228*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5229*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
5230*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5231*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5232*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5233*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5234*4882a593Smuzhiyun 	{0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5235*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5236*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5237*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5238*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5239*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
5240*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5241*4882a593Smuzhiyun 	{}
5242*4882a593Smuzhiyun };
5243*4882a593Smuzhiyun 
5244*4882a593Smuzhiyun static const struct usb_action tas5130c_NoFlikerScale[] = {
5245*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5246*4882a593Smuzhiyun 	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
5247*4882a593Smuzhiyun 	{0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
5248*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
5249*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
5250*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
5251*4882a593Smuzhiyun 	{0xa0, 0x0a, ZC3XX_R191_EXPOSURELIMITMID},
5252*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
5253*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
5254*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
5255*4882a593Smuzhiyun 	{0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
5256*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
5257*4882a593Smuzhiyun 	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
5258*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
5259*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
5260*4882a593Smuzhiyun 	{0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
5261*4882a593Smuzhiyun 	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
5262*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
5263*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
5264*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5265*4882a593Smuzhiyun 	{0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
5266*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
5267*4882a593Smuzhiyun 	{}
5268*4882a593Smuzhiyun };
5269*4882a593Smuzhiyun 
5270*4882a593Smuzhiyun /* from usbvm305.inf 0ac8:305b 07/06/15 (3 - tas5130c) */
5271*4882a593Smuzhiyun static const struct usb_action gc0303_Initial[] = {
5272*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc, */
5273*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},		/* 00,08,02,cc, */
5274*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc, */
5275*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
5276*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc, */
5277*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc, */
5278*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc, */
5279*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc, */
5280*4882a593Smuzhiyun 	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,98,cc, */
5281*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc, */
5282*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc, */
5283*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc, */
5284*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc, */
5285*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,00,cc, */
5286*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc, */
5287*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,00,cc, */
5288*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,e6,cc,
5289*4882a593Smuzhiyun 							 * 6<->8 */
5290*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,86,cc,
5291*4882a593Smuzhiyun 							 * 6<->8 */
5292*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},		/* 00,87,10,cc, */
5293*4882a593Smuzhiyun 	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,98,cc, */
5294*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0000},
5295*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0000},		/* 00,1a,00,aa, */
5296*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0017},		/* 00,1c,17,aa, */
5297*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0000},
5298*4882a593Smuzhiyun 	{0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},		/* 00,86,82,cc, */
5299*4882a593Smuzhiyun 	{0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},		/* 00,87,83,cc, */
5300*4882a593Smuzhiyun 	{0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},		/* 00,88,84,cc, */
5301*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0010},		/* 00,05,10,aa, */
5302*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0002},
5303*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0000},
5304*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0002},
5305*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0000},
5306*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0002},
5307*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0000},
5308*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0002},
5309*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0000},
5310*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0001},		/* 00,16,01,aa, */
5311*4882a593Smuzhiyun 	{0xaa, 0x17, 0x00e8},		/* 00,17,e6,aa, (e6 -> e8) */
5312*4882a593Smuzhiyun 	{0xaa, 0x18, 0x0002},		/* 00,18,02,aa, */
5313*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0088},		/* 00,19,86,aa, */
5314*4882a593Smuzhiyun 	{0xaa, 0x20, 0x0020},		/* 00,20,20,aa, */
5315*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc, */
5316*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc, */
5317*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc, */
5318*4882a593Smuzhiyun 	{0xa0, 0x76, ZC3XX_R189_AWBSTATUS},		/* 01,89,76,cc, */
5319*4882a593Smuzhiyun 	{0xa0, 0x09, 0x01ad},				/* 01,ad,09,cc, */
5320*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc, */
5321*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc, */
5322*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc, */
5323*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc, */
5324*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R1A8_DIGITALGAIN},
5325*4882a593Smuzhiyun 	{0xa0, 0x61, ZC3XX_R116_RGAIN},			/* 01,16,61,cc, */
5326*4882a593Smuzhiyun 	{0xa0, 0x65, ZC3XX_R118_BGAIN},			/* 01,18,65,cc */
5327*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0000},
5328*4882a593Smuzhiyun 	{}
5329*4882a593Smuzhiyun };
5330*4882a593Smuzhiyun 
5331*4882a593Smuzhiyun static const struct usb_action gc0303_InitialScale[] = {
5332*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc, */
5333*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},		/* 00,08,02,cc, */
5334*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc, */
5335*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
5336*4882a593Smuzhiyun 	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc, */
5337*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc, */
5338*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc, */
5339*4882a593Smuzhiyun 	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc, */
5340*4882a593Smuzhiyun 	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,98,cc, */
5341*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc, */
5342*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc, */
5343*4882a593Smuzhiyun 	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc, */
5344*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc, */
5345*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,00,cc, */
5346*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc, */
5347*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,00,cc, */
5348*4882a593Smuzhiyun 	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,e8,cc,
5349*4882a593Smuzhiyun 							 * 8<->6 */
5350*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,88,cc,
5351*4882a593Smuzhiyun 							 * 8<->6 */
5352*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},		/* 00,87,10,cc, */
5353*4882a593Smuzhiyun 	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,98,cc, */
5354*4882a593Smuzhiyun 	{0xaa, 0x01, 0x0000},
5355*4882a593Smuzhiyun 	{0xaa, 0x1a, 0x0000},		/* 00,1a,00,aa, */
5356*4882a593Smuzhiyun 	{0xaa, 0x1c, 0x0017},		/* 00,1c,17,aa, */
5357*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0000},
5358*4882a593Smuzhiyun 	{0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},	/* 00,86,82,cc, */
5359*4882a593Smuzhiyun 	{0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},	/* 00,87,83,cc, */
5360*4882a593Smuzhiyun 	{0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},	/* 00,88,84,cc, */
5361*4882a593Smuzhiyun 	{0xaa, 0x05, 0x0010},		/* 00,05,10,aa, */
5362*4882a593Smuzhiyun 	{0xaa, 0x0a, 0x0001},
5363*4882a593Smuzhiyun 	{0xaa, 0x0b, 0x0000},
5364*4882a593Smuzhiyun 	{0xaa, 0x0c, 0x0001},
5365*4882a593Smuzhiyun 	{0xaa, 0x0d, 0x0000},
5366*4882a593Smuzhiyun 	{0xaa, 0x0e, 0x0001},
5367*4882a593Smuzhiyun 	{0xaa, 0x0f, 0x0000},
5368*4882a593Smuzhiyun 	{0xaa, 0x10, 0x0001},
5369*4882a593Smuzhiyun 	{0xaa, 0x11, 0x0000},
5370*4882a593Smuzhiyun 	{0xaa, 0x16, 0x0001},		/* 00,16,01,aa, */
5371*4882a593Smuzhiyun 	{0xaa, 0x17, 0x00e8},		/* 00,17,e6,aa (e6 -> e8) */
5372*4882a593Smuzhiyun 	{0xaa, 0x18, 0x0002},		/* 00,18,02,aa, */
5373*4882a593Smuzhiyun 	{0xaa, 0x19, 0x0088},		/* 00,19,88,aa, */
5374*4882a593Smuzhiyun 	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc, */
5375*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc, */
5376*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc, */
5377*4882a593Smuzhiyun 	{0xa0, 0x76, ZC3XX_R189_AWBSTATUS},		/* 01,89,76,cc, */
5378*4882a593Smuzhiyun 	{0xa0, 0x09, 0x01ad},				/* 01,ad,09,cc, */
5379*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc, */
5380*4882a593Smuzhiyun 	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc, */
5381*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc, */
5382*4882a593Smuzhiyun 	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc, */
5383*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R1A8_DIGITALGAIN},
5384*4882a593Smuzhiyun 	{0xa0, 0x61, ZC3XX_R116_RGAIN},		/* 01,16,61,cc, */
5385*4882a593Smuzhiyun 	{0xa0, 0x65, ZC3XX_R118_BGAIN},		/* 01,18,65,cc */
5386*4882a593Smuzhiyun 	{0xaa, 0x1b, 0x0000},
5387*4882a593Smuzhiyun 	{}
5388*4882a593Smuzhiyun };
5389*4882a593Smuzhiyun static const struct usb_action gc0303_50HZ[] = {
5390*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
5391*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0001},		/* 00,83,01,aa */
5392*4882a593Smuzhiyun 	{0xaa, 0x84, 0x0063},
5393*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
5394*4882a593Smuzhiyun 	{0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0d,cc, */
5395*4882a593Smuzhiyun 	{0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,50,cc, */
5396*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
5397*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
5398*4882a593Smuzhiyun 	{0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,47,cc, */
5399*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
5400*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
5401*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc, */
5402*4882a593Smuzhiyun 	{0xa0, 0x48, ZC3XX_R1AA_DIGITALGAINSTEP},
5403*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
5404*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
5405*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
5406*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
5407*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
5408*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc, */
5409*4882a593Smuzhiyun 	{0xa0, 0x7f, ZC3XX_R18D_YTARGET},
5410*4882a593Smuzhiyun 	{}
5411*4882a593Smuzhiyun };
5412*4882a593Smuzhiyun 
5413*4882a593Smuzhiyun static const struct usb_action gc0303_50HZScale[] = {
5414*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
5415*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0003},		/* 00,83,03,aa */
5416*4882a593Smuzhiyun 	{0xaa, 0x84, 0x0054},		/* 00,84,54,aa */
5417*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
5418*4882a593Smuzhiyun 	{0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0d,cc, */
5419*4882a593Smuzhiyun 	{0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,50,cc, */
5420*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
5421*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
5422*4882a593Smuzhiyun 	{0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,8e,cc, */
5423*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
5424*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
5425*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc, */
5426*4882a593Smuzhiyun 	{0xa0, 0x48, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc, */
5427*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
5428*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
5429*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
5430*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
5431*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
5432*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc, */
5433*4882a593Smuzhiyun 	{0xa0, 0x7f, ZC3XX_R18D_YTARGET},
5434*4882a593Smuzhiyun 	{}
5435*4882a593Smuzhiyun };
5436*4882a593Smuzhiyun 
5437*4882a593Smuzhiyun static const struct usb_action gc0303_60HZ[] = {
5438*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
5439*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0000},
5440*4882a593Smuzhiyun 	{0xaa, 0x84, 0x003b},
5441*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
5442*4882a593Smuzhiyun 	{0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,05,cc, */
5443*4882a593Smuzhiyun 	{0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,88,cc, */
5444*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
5445*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
5446*4882a593Smuzhiyun 	{0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,3b,cc, */
5447*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
5448*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
5449*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc, */
5450*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc, */
5451*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
5452*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
5453*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
5454*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
5455*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
5456*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc, */
5457*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R18D_YTARGET},
5458*4882a593Smuzhiyun 	{}
5459*4882a593Smuzhiyun };
5460*4882a593Smuzhiyun 
5461*4882a593Smuzhiyun static const struct usb_action gc0303_60HZScale[] = {
5462*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
5463*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0000},
5464*4882a593Smuzhiyun 	{0xaa, 0x84, 0x0076},
5465*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
5466*4882a593Smuzhiyun 	{0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,1,0b,cc, */
5467*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,2,10,cc, */
5468*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,5,00,cc, */
5469*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,6,00,cc, */
5470*4882a593Smuzhiyun 	{0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,7,76,cc, */
5471*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,c,0e,cc, */
5472*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,f,15,cc, */
5473*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,9,10,cc, */
5474*4882a593Smuzhiyun 	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,a,24,cc, */
5475*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,d,62,cc, */
5476*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,e,90,cc, */
5477*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,f,c8,cc, */
5478*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,0,ff,cc, */
5479*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,d,58,cc, */
5480*4882a593Smuzhiyun 	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc, */
5481*4882a593Smuzhiyun 	{0xa0, 0x80, ZC3XX_R18D_YTARGET},
5482*4882a593Smuzhiyun 	{}
5483*4882a593Smuzhiyun };
5484*4882a593Smuzhiyun 
5485*4882a593Smuzhiyun static const struct usb_action gc0303_NoFliker[] = {
5486*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0c,cc, */
5487*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
5488*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0000},		/* 00,83,00,aa */
5489*4882a593Smuzhiyun 	{0xaa, 0x84, 0x0020},		/* 00,84,20,aa */
5490*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,0,00,cc, */
5491*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
5492*4882a593Smuzhiyun 	{0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},
5493*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
5494*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
5495*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,10,cc, */
5496*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
5497*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
5498*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
5499*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
5500*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
5501*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
5502*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
5503*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,03,cc */
5504*4882a593Smuzhiyun 	{}
5505*4882a593Smuzhiyun };
5506*4882a593Smuzhiyun 
5507*4882a593Smuzhiyun static const struct usb_action gc0303_NoFlikerScale[] = {
5508*4882a593Smuzhiyun 	{0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0c,cc, */
5509*4882a593Smuzhiyun 	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
5510*4882a593Smuzhiyun 	{0xaa, 0x83, 0x0000},		/* 00,83,00,aa */
5511*4882a593Smuzhiyun 	{0xaa, 0x84, 0x0020},		/* 00,84,20,aa */
5512*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
5513*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
5514*4882a593Smuzhiyun 	{0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},
5515*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
5516*4882a593Smuzhiyun 	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
5517*4882a593Smuzhiyun 	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,10,cc, */
5518*4882a593Smuzhiyun 	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
5519*4882a593Smuzhiyun 	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
5520*4882a593Smuzhiyun 	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
5521*4882a593Smuzhiyun 	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
5522*4882a593Smuzhiyun 	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
5523*4882a593Smuzhiyun 	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
5524*4882a593Smuzhiyun 	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
5525*4882a593Smuzhiyun 	{0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,03,cc */
5526*4882a593Smuzhiyun 	{}
5527*4882a593Smuzhiyun };
5528*4882a593Smuzhiyun 
reg_r(struct gspca_dev * gspca_dev,u16 index)5529*4882a593Smuzhiyun static u8 reg_r(struct gspca_dev *gspca_dev,
5530*4882a593Smuzhiyun 		u16 index)
5531*4882a593Smuzhiyun {
5532*4882a593Smuzhiyun 	int ret;
5533*4882a593Smuzhiyun 
5534*4882a593Smuzhiyun 	if (gspca_dev->usb_err < 0)
5535*4882a593Smuzhiyun 		return 0;
5536*4882a593Smuzhiyun 	ret = usb_control_msg(gspca_dev->dev,
5537*4882a593Smuzhiyun 			usb_rcvctrlpipe(gspca_dev->dev, 0),
5538*4882a593Smuzhiyun 			0xa1,
5539*4882a593Smuzhiyun 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
5540*4882a593Smuzhiyun 			0x01,			/* value */
5541*4882a593Smuzhiyun 			index, gspca_dev->usb_buf, 1,
5542*4882a593Smuzhiyun 			500);
5543*4882a593Smuzhiyun 	if (ret < 0) {
5544*4882a593Smuzhiyun 		pr_err("reg_r err %d\n", ret);
5545*4882a593Smuzhiyun 		gspca_dev->usb_err = ret;
5546*4882a593Smuzhiyun 		return 0;
5547*4882a593Smuzhiyun 	}
5548*4882a593Smuzhiyun 	return gspca_dev->usb_buf[0];
5549*4882a593Smuzhiyun }
5550*4882a593Smuzhiyun 
reg_w(struct gspca_dev * gspca_dev,u8 value,u16 index)5551*4882a593Smuzhiyun static void reg_w(struct gspca_dev *gspca_dev,
5552*4882a593Smuzhiyun 			u8 value,
5553*4882a593Smuzhiyun 			u16 index)
5554*4882a593Smuzhiyun {
5555*4882a593Smuzhiyun 	int ret;
5556*4882a593Smuzhiyun 
5557*4882a593Smuzhiyun 	if (gspca_dev->usb_err < 0)
5558*4882a593Smuzhiyun 		return;
5559*4882a593Smuzhiyun 	ret = usb_control_msg(gspca_dev->dev,
5560*4882a593Smuzhiyun 			usb_sndctrlpipe(gspca_dev->dev, 0),
5561*4882a593Smuzhiyun 			0xa0,
5562*4882a593Smuzhiyun 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
5563*4882a593Smuzhiyun 			value, index, NULL, 0,
5564*4882a593Smuzhiyun 			500);
5565*4882a593Smuzhiyun 	if (ret < 0) {
5566*4882a593Smuzhiyun 		pr_err("reg_w_i err %d\n", ret);
5567*4882a593Smuzhiyun 		gspca_dev->usb_err = ret;
5568*4882a593Smuzhiyun 	}
5569*4882a593Smuzhiyun }
5570*4882a593Smuzhiyun 
i2c_read(struct gspca_dev * gspca_dev,u8 reg)5571*4882a593Smuzhiyun static u16 i2c_read(struct gspca_dev *gspca_dev,
5572*4882a593Smuzhiyun 			u8 reg)
5573*4882a593Smuzhiyun {
5574*4882a593Smuzhiyun 	u8 retbyte;
5575*4882a593Smuzhiyun 	u16 retval;
5576*4882a593Smuzhiyun 
5577*4882a593Smuzhiyun 	if (gspca_dev->usb_err < 0)
5578*4882a593Smuzhiyun 		return 0;
5579*4882a593Smuzhiyun 	reg_w(gspca_dev, reg, 0x0092);
5580*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x02, 0x0090);			/* <- read command */
5581*4882a593Smuzhiyun 	msleep(20);
5582*4882a593Smuzhiyun 	retbyte = reg_r(gspca_dev, 0x0091);		/* read status */
5583*4882a593Smuzhiyun 	if (retbyte != 0x00)
5584*4882a593Smuzhiyun 		pr_err("i2c_r status error %02x\n", retbyte);
5585*4882a593Smuzhiyun 	retval = reg_r(gspca_dev, 0x0095);		/* read Lowbyte */
5586*4882a593Smuzhiyun 	retval |= reg_r(gspca_dev, 0x0096) << 8;	/* read Hightbyte */
5587*4882a593Smuzhiyun 	return retval;
5588*4882a593Smuzhiyun }
5589*4882a593Smuzhiyun 
i2c_write(struct gspca_dev * gspca_dev,u8 reg,u8 valL,u8 valH)5590*4882a593Smuzhiyun static u8 i2c_write(struct gspca_dev *gspca_dev,
5591*4882a593Smuzhiyun 			u8 reg,
5592*4882a593Smuzhiyun 			u8 valL,
5593*4882a593Smuzhiyun 			u8 valH)
5594*4882a593Smuzhiyun {
5595*4882a593Smuzhiyun 	u8 retbyte;
5596*4882a593Smuzhiyun 
5597*4882a593Smuzhiyun 	if (gspca_dev->usb_err < 0)
5598*4882a593Smuzhiyun 		return 0;
5599*4882a593Smuzhiyun 	reg_w(gspca_dev, reg, 0x92);
5600*4882a593Smuzhiyun 	reg_w(gspca_dev, valL, 0x93);
5601*4882a593Smuzhiyun 	reg_w(gspca_dev, valH, 0x94);
5602*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x90);		/* <- write command */
5603*4882a593Smuzhiyun 	msleep(1);
5604*4882a593Smuzhiyun 	retbyte = reg_r(gspca_dev, 0x0091);		/* read status */
5605*4882a593Smuzhiyun 	if (retbyte != 0x00)
5606*4882a593Smuzhiyun 		pr_err("i2c_w status error %02x\n", retbyte);
5607*4882a593Smuzhiyun 	return retbyte;
5608*4882a593Smuzhiyun }
5609*4882a593Smuzhiyun 
usb_exchange(struct gspca_dev * gspca_dev,const struct usb_action * action)5610*4882a593Smuzhiyun static void usb_exchange(struct gspca_dev *gspca_dev,
5611*4882a593Smuzhiyun 			const struct usb_action *action)
5612*4882a593Smuzhiyun {
5613*4882a593Smuzhiyun 	while (action->req) {
5614*4882a593Smuzhiyun 		switch (action->req) {
5615*4882a593Smuzhiyun 		case 0xa0:	/* write register */
5616*4882a593Smuzhiyun 			reg_w(gspca_dev, action->val, action->idx);
5617*4882a593Smuzhiyun 			break;
5618*4882a593Smuzhiyun 		case 0xa1:	/* read status */
5619*4882a593Smuzhiyun 			reg_r(gspca_dev, action->idx);
5620*4882a593Smuzhiyun 			break;
5621*4882a593Smuzhiyun 		case 0xaa:
5622*4882a593Smuzhiyun 			i2c_write(gspca_dev,
5623*4882a593Smuzhiyun 				  action->val,			/* reg */
5624*4882a593Smuzhiyun 				  action->idx & 0xff,		/* valL */
5625*4882a593Smuzhiyun 				  action->idx >> 8);		/* valH */
5626*4882a593Smuzhiyun 			break;
5627*4882a593Smuzhiyun 		case 0xbb:
5628*4882a593Smuzhiyun 			i2c_write(gspca_dev,
5629*4882a593Smuzhiyun 				  action->idx >> 8,		/* reg */
5630*4882a593Smuzhiyun 				  action->idx & 0xff,		/* valL */
5631*4882a593Smuzhiyun 				  action->val);			/* valH */
5632*4882a593Smuzhiyun 			break;
5633*4882a593Smuzhiyun 		default:
5634*4882a593Smuzhiyun /*		case 0xdd:	 * delay */
5635*4882a593Smuzhiyun 			msleep(action->idx);
5636*4882a593Smuzhiyun 			break;
5637*4882a593Smuzhiyun 		}
5638*4882a593Smuzhiyun 		action++;
5639*4882a593Smuzhiyun 		msleep(1);
5640*4882a593Smuzhiyun 	}
5641*4882a593Smuzhiyun }
5642*4882a593Smuzhiyun 
setmatrix(struct gspca_dev * gspca_dev)5643*4882a593Smuzhiyun static void setmatrix(struct gspca_dev *gspca_dev)
5644*4882a593Smuzhiyun {
5645*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
5646*4882a593Smuzhiyun 	int i;
5647*4882a593Smuzhiyun 	const u8 *matrix;
5648*4882a593Smuzhiyun 	static const u8 adcm2700_matrix[9] =
5649*4882a593Smuzhiyun /*		{0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; */
5650*4882a593Smuzhiyun /*ms-win*/
5651*4882a593Smuzhiyun 		{0x74, 0xed, 0xed, 0xed, 0x74, 0xed, 0xed, 0xed, 0x74};
5652*4882a593Smuzhiyun 	static const u8 gc0305_matrix[9] =
5653*4882a593Smuzhiyun 		{0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
5654*4882a593Smuzhiyun 	static const u8 ov7620_matrix[9] =
5655*4882a593Smuzhiyun 		{0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
5656*4882a593Smuzhiyun 	static const u8 pas202b_matrix[9] =
5657*4882a593Smuzhiyun 		{0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
5658*4882a593Smuzhiyun 	static const u8 po2030_matrix[9] =
5659*4882a593Smuzhiyun 		{0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
5660*4882a593Smuzhiyun 	static const u8 tas5130c_matrix[9] =
5661*4882a593Smuzhiyun 		{0x68, 0xec, 0xec, 0xec, 0x68, 0xec, 0xec, 0xec, 0x68};
5662*4882a593Smuzhiyun 	static const u8 gc0303_matrix[9] =
5663*4882a593Smuzhiyun 		{0x6c, 0xea, 0xea, 0xea, 0x6c, 0xea, 0xea, 0xea, 0x6c};
5664*4882a593Smuzhiyun 	static const u8 *matrix_tb[SENSOR_MAX] = {
5665*4882a593Smuzhiyun 		[SENSOR_ADCM2700] =	adcm2700_matrix,
5666*4882a593Smuzhiyun 		[SENSOR_CS2102] =	ov7620_matrix,
5667*4882a593Smuzhiyun 		[SENSOR_CS2102K] =	NULL,
5668*4882a593Smuzhiyun 		[SENSOR_GC0303] =	gc0303_matrix,
5669*4882a593Smuzhiyun 		[SENSOR_GC0305] =	gc0305_matrix,
5670*4882a593Smuzhiyun 		[SENSOR_HDCS2020] =	NULL,
5671*4882a593Smuzhiyun 		[SENSOR_HV7131B] =	NULL,
5672*4882a593Smuzhiyun 		[SENSOR_HV7131R] =	po2030_matrix,
5673*4882a593Smuzhiyun 		[SENSOR_ICM105A] =	po2030_matrix,
5674*4882a593Smuzhiyun 		[SENSOR_MC501CB] =	NULL,
5675*4882a593Smuzhiyun 		[SENSOR_MT9V111_1] =	gc0305_matrix,
5676*4882a593Smuzhiyun 		[SENSOR_MT9V111_3] =	gc0305_matrix,
5677*4882a593Smuzhiyun 		[SENSOR_OV7620] =	ov7620_matrix,
5678*4882a593Smuzhiyun 		[SENSOR_OV7630C] =	NULL,
5679*4882a593Smuzhiyun 		[SENSOR_PAS106] =	NULL,
5680*4882a593Smuzhiyun 		[SENSOR_PAS202B] =	pas202b_matrix,
5681*4882a593Smuzhiyun 		[SENSOR_PB0330] =	gc0305_matrix,
5682*4882a593Smuzhiyun 		[SENSOR_PO2030] =	po2030_matrix,
5683*4882a593Smuzhiyun 		[SENSOR_TAS5130C] =	tas5130c_matrix,
5684*4882a593Smuzhiyun 	};
5685*4882a593Smuzhiyun 
5686*4882a593Smuzhiyun 	matrix = matrix_tb[sd->sensor];
5687*4882a593Smuzhiyun 	if (matrix == NULL)
5688*4882a593Smuzhiyun 		return;		/* matrix already loaded */
5689*4882a593Smuzhiyun 	for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
5690*4882a593Smuzhiyun 		reg_w(gspca_dev, matrix[i], 0x010a + i);
5691*4882a593Smuzhiyun }
5692*4882a593Smuzhiyun 
setsharpness(struct gspca_dev * gspca_dev,s32 val)5693*4882a593Smuzhiyun static void setsharpness(struct gspca_dev *gspca_dev, s32 val)
5694*4882a593Smuzhiyun {
5695*4882a593Smuzhiyun 	static const u8 sharpness_tb[][2] = {
5696*4882a593Smuzhiyun 		{0x02, 0x03},
5697*4882a593Smuzhiyun 		{0x04, 0x07},
5698*4882a593Smuzhiyun 		{0x08, 0x0f},
5699*4882a593Smuzhiyun 		{0x10, 0x1e}
5700*4882a593Smuzhiyun 	};
5701*4882a593Smuzhiyun 
5702*4882a593Smuzhiyun 	reg_w(gspca_dev, sharpness_tb[val][0], 0x01c6);
5703*4882a593Smuzhiyun 	reg_r(gspca_dev, 0x01c8);
5704*4882a593Smuzhiyun 	reg_r(gspca_dev, 0x01c9);
5705*4882a593Smuzhiyun 	reg_r(gspca_dev, 0x01ca);
5706*4882a593Smuzhiyun 	reg_w(gspca_dev, sharpness_tb[val][1], 0x01cb);
5707*4882a593Smuzhiyun }
5708*4882a593Smuzhiyun 
setcontrast(struct gspca_dev * gspca_dev,s32 gamma,s32 brightness,s32 contrast)5709*4882a593Smuzhiyun static void setcontrast(struct gspca_dev *gspca_dev,
5710*4882a593Smuzhiyun 		s32 gamma, s32 brightness, s32 contrast)
5711*4882a593Smuzhiyun {
5712*4882a593Smuzhiyun 	const u8 *Tgamma;
5713*4882a593Smuzhiyun 	int g, i, adj, gp1, gp2;
5714*4882a593Smuzhiyun 	u8 gr[16];
5715*4882a593Smuzhiyun 	static const u8 delta_b[16] =		/* delta for brightness */
5716*4882a593Smuzhiyun 		{0x50, 0x38, 0x2d, 0x28, 0x24, 0x21, 0x1e, 0x1d,
5717*4882a593Smuzhiyun 		 0x1d, 0x1b, 0x1b, 0x1b, 0x19, 0x18, 0x18, 0x18};
5718*4882a593Smuzhiyun 	static const u8 delta_c[16] =		/* delta for contrast */
5719*4882a593Smuzhiyun 		{0x2c, 0x1a, 0x12, 0x0c, 0x0a, 0x06, 0x06, 0x06,
5720*4882a593Smuzhiyun 		 0x04, 0x06, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02};
5721*4882a593Smuzhiyun 	static const u8 gamma_tb[6][16] = {
5722*4882a593Smuzhiyun 		{0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
5723*4882a593Smuzhiyun 		 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff},
5724*4882a593Smuzhiyun 		{0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
5725*4882a593Smuzhiyun 		 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff},
5726*4882a593Smuzhiyun 		{0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
5727*4882a593Smuzhiyun 		 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff},
5728*4882a593Smuzhiyun 		{0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
5729*4882a593Smuzhiyun 		 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff},
5730*4882a593Smuzhiyun 		{0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
5731*4882a593Smuzhiyun 		 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff},
5732*4882a593Smuzhiyun 		{0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
5733*4882a593Smuzhiyun 		 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff},
5734*4882a593Smuzhiyun 	};
5735*4882a593Smuzhiyun 
5736*4882a593Smuzhiyun 	Tgamma = gamma_tb[gamma - 1];
5737*4882a593Smuzhiyun 
5738*4882a593Smuzhiyun 	contrast -= 128; /* -128 / 127 */
5739*4882a593Smuzhiyun 	brightness -= 128; /* -128 / 92 */
5740*4882a593Smuzhiyun 	adj = 0;
5741*4882a593Smuzhiyun 	gp1 = gp2 = 0;
5742*4882a593Smuzhiyun 	for (i = 0; i < 16; i++) {
5743*4882a593Smuzhiyun 		g = Tgamma[i] + delta_b[i] * brightness / 256
5744*4882a593Smuzhiyun 				- delta_c[i] * contrast / 256 - adj / 2;
5745*4882a593Smuzhiyun 		if (g > 0xff)
5746*4882a593Smuzhiyun 			g = 0xff;
5747*4882a593Smuzhiyun 		else if (g < 0)
5748*4882a593Smuzhiyun 			g = 0;
5749*4882a593Smuzhiyun 		reg_w(gspca_dev, g, 0x0120 + i);	/* gamma */
5750*4882a593Smuzhiyun 		if (contrast > 0)
5751*4882a593Smuzhiyun 			adj--;
5752*4882a593Smuzhiyun 		else if (contrast < 0)
5753*4882a593Smuzhiyun 			adj++;
5754*4882a593Smuzhiyun 		if (i > 1)
5755*4882a593Smuzhiyun 			gr[i - 1] = (g - gp2) / 2;
5756*4882a593Smuzhiyun 		else if (i != 0)
5757*4882a593Smuzhiyun 			gr[0] = gp1 == 0 ? 0 : (g - gp1);
5758*4882a593Smuzhiyun 		gp2 = gp1;
5759*4882a593Smuzhiyun 		gp1 = g;
5760*4882a593Smuzhiyun 	}
5761*4882a593Smuzhiyun 	gr[15] = (0xff - gp2) / 2;
5762*4882a593Smuzhiyun 	for (i = 0; i < 16; i++)
5763*4882a593Smuzhiyun 		reg_w(gspca_dev, gr[i], 0x0130 + i);	/* gradient */
5764*4882a593Smuzhiyun }
5765*4882a593Smuzhiyun 
getexposure(struct gspca_dev * gspca_dev)5766*4882a593Smuzhiyun static s32 getexposure(struct gspca_dev *gspca_dev)
5767*4882a593Smuzhiyun {
5768*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
5769*4882a593Smuzhiyun 
5770*4882a593Smuzhiyun 	switch (sd->sensor) {
5771*4882a593Smuzhiyun 	case SENSOR_HV7131R:
5772*4882a593Smuzhiyun 		return (i2c_read(gspca_dev, 0x25) << 9)
5773*4882a593Smuzhiyun 			| (i2c_read(gspca_dev, 0x26) << 1)
5774*4882a593Smuzhiyun 			| (i2c_read(gspca_dev, 0x27) >> 7);
5775*4882a593Smuzhiyun 	case SENSOR_OV7620:
5776*4882a593Smuzhiyun 		return i2c_read(gspca_dev, 0x10);
5777*4882a593Smuzhiyun 	default:
5778*4882a593Smuzhiyun 		return -1;
5779*4882a593Smuzhiyun 	}
5780*4882a593Smuzhiyun }
5781*4882a593Smuzhiyun 
setexposure(struct gspca_dev * gspca_dev,s32 val)5782*4882a593Smuzhiyun static void setexposure(struct gspca_dev *gspca_dev, s32 val)
5783*4882a593Smuzhiyun {
5784*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
5785*4882a593Smuzhiyun 
5786*4882a593Smuzhiyun 	switch (sd->sensor) {
5787*4882a593Smuzhiyun 	case SENSOR_HV7131R:
5788*4882a593Smuzhiyun 		i2c_write(gspca_dev, 0x25, val >> 9, 0x00);
5789*4882a593Smuzhiyun 		i2c_write(gspca_dev, 0x26, val >> 1, 0x00);
5790*4882a593Smuzhiyun 		i2c_write(gspca_dev, 0x27, val << 7, 0x00);
5791*4882a593Smuzhiyun 		break;
5792*4882a593Smuzhiyun 	case SENSOR_OV7620:
5793*4882a593Smuzhiyun 		i2c_write(gspca_dev, 0x10, val, 0x00);
5794*4882a593Smuzhiyun 		break;
5795*4882a593Smuzhiyun 	}
5796*4882a593Smuzhiyun }
5797*4882a593Smuzhiyun 
setquality(struct gspca_dev * gspca_dev)5798*4882a593Smuzhiyun static void setquality(struct gspca_dev *gspca_dev)
5799*4882a593Smuzhiyun {
5800*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
5801*4882a593Smuzhiyun 	jpeg_set_qual(sd->jpeg_hdr, jpeg_qual[sd->reg08 >> 1]);
5802*4882a593Smuzhiyun 	reg_w(gspca_dev, sd->reg08, ZC3XX_R008_CLOCKSETTING);
5803*4882a593Smuzhiyun }
5804*4882a593Smuzhiyun 
5805*4882a593Smuzhiyun /* Matches the sensor's internal frame rate to the lighting frequency.
5806*4882a593Smuzhiyun  * Valid frequencies are:
5807*4882a593Smuzhiyun  *	50Hz, for European and Asian lighting (default)
5808*4882a593Smuzhiyun  *	60Hz, for American lighting
5809*4882a593Smuzhiyun  *	0 = No Fliker (for outdoore usage)
5810*4882a593Smuzhiyun  */
setlightfreq(struct gspca_dev * gspca_dev,s32 val)5811*4882a593Smuzhiyun static void setlightfreq(struct gspca_dev *gspca_dev, s32 val)
5812*4882a593Smuzhiyun {
5813*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
5814*4882a593Smuzhiyun 	int i, mode;
5815*4882a593Smuzhiyun 	const struct usb_action *zc3_freq;
5816*4882a593Smuzhiyun 	static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
5817*4882a593Smuzhiyun 	[SENSOR_ADCM2700] =
5818*4882a593Smuzhiyun 		{adcm2700_NoFliker, adcm2700_NoFliker,
5819*4882a593Smuzhiyun 		 adcm2700_50HZ, adcm2700_50HZ,
5820*4882a593Smuzhiyun 		 adcm2700_60HZ, adcm2700_60HZ},
5821*4882a593Smuzhiyun 	[SENSOR_CS2102] =
5822*4882a593Smuzhiyun 		{cs2102_NoFliker, cs2102_NoFlikerScale,
5823*4882a593Smuzhiyun 		 cs2102_50HZ, cs2102_50HZScale,
5824*4882a593Smuzhiyun 		 cs2102_60HZ, cs2102_60HZScale},
5825*4882a593Smuzhiyun 	[SENSOR_CS2102K] =
5826*4882a593Smuzhiyun 		{cs2102_NoFliker, cs2102_NoFlikerScale,
5827*4882a593Smuzhiyun 		 NULL, NULL, /* currently disabled */
5828*4882a593Smuzhiyun 		 NULL, NULL},
5829*4882a593Smuzhiyun 	[SENSOR_GC0303] =
5830*4882a593Smuzhiyun 		{gc0303_NoFliker, gc0303_NoFlikerScale,
5831*4882a593Smuzhiyun 		 gc0303_50HZ, gc0303_50HZScale,
5832*4882a593Smuzhiyun 		 gc0303_60HZ, gc0303_60HZScale},
5833*4882a593Smuzhiyun 	[SENSOR_GC0305] =
5834*4882a593Smuzhiyun 		{gc0305_NoFliker, gc0305_NoFliker,
5835*4882a593Smuzhiyun 		 gc0305_50HZ, gc0305_50HZ,
5836*4882a593Smuzhiyun 		 gc0305_60HZ, gc0305_60HZ},
5837*4882a593Smuzhiyun 	[SENSOR_HDCS2020] =
5838*4882a593Smuzhiyun 		{hdcs2020_NoFliker, hdcs2020_NoFliker,
5839*4882a593Smuzhiyun 		 hdcs2020_50HZ, hdcs2020_50HZ,
5840*4882a593Smuzhiyun 		 hdcs2020_60HZ, hdcs2020_60HZ},
5841*4882a593Smuzhiyun 	[SENSOR_HV7131B] =
5842*4882a593Smuzhiyun 		{hv7131b_NoFliker, hv7131b_NoFlikerScale,
5843*4882a593Smuzhiyun 		 hv7131b_50HZ, hv7131b_50HZScale,
5844*4882a593Smuzhiyun 		 hv7131b_60HZ, hv7131b_60HZScale},
5845*4882a593Smuzhiyun 	[SENSOR_HV7131R] =
5846*4882a593Smuzhiyun 		{hv7131r_NoFliker, hv7131r_NoFlikerScale,
5847*4882a593Smuzhiyun 		 hv7131r_50HZ, hv7131r_50HZScale,
5848*4882a593Smuzhiyun 		 hv7131r_60HZ, hv7131r_60HZScale},
5849*4882a593Smuzhiyun 	[SENSOR_ICM105A] =
5850*4882a593Smuzhiyun 		{icm105a_NoFliker, icm105a_NoFlikerScale,
5851*4882a593Smuzhiyun 		 icm105a_50HZ, icm105a_50HZScale,
5852*4882a593Smuzhiyun 		 icm105a_60HZ, icm105a_60HZScale},
5853*4882a593Smuzhiyun 	[SENSOR_MC501CB] =
5854*4882a593Smuzhiyun 		{mc501cb_NoFliker, mc501cb_NoFlikerScale,
5855*4882a593Smuzhiyun 		 mc501cb_50HZ, mc501cb_50HZScale,
5856*4882a593Smuzhiyun 		 mc501cb_60HZ, mc501cb_60HZScale},
5857*4882a593Smuzhiyun 	[SENSOR_MT9V111_1] =
5858*4882a593Smuzhiyun 		{mt9v111_1_AENoFliker, mt9v111_1_AENoFlikerScale,
5859*4882a593Smuzhiyun 		 mt9v111_1_AE50HZ, mt9v111_1_AE50HZScale,
5860*4882a593Smuzhiyun 		 mt9v111_1_AE60HZ, mt9v111_1_AE60HZScale},
5861*4882a593Smuzhiyun 	[SENSOR_MT9V111_3] =
5862*4882a593Smuzhiyun 		{mt9v111_3_AENoFliker, mt9v111_3_AENoFlikerScale,
5863*4882a593Smuzhiyun 		 mt9v111_3_AE50HZ, mt9v111_3_AE50HZScale,
5864*4882a593Smuzhiyun 		 mt9v111_3_AE60HZ, mt9v111_3_AE60HZScale},
5865*4882a593Smuzhiyun 	[SENSOR_OV7620] =
5866*4882a593Smuzhiyun 		{ov7620_NoFliker, ov7620_NoFliker,
5867*4882a593Smuzhiyun 		 ov7620_50HZ, ov7620_50HZ,
5868*4882a593Smuzhiyun 		 ov7620_60HZ, ov7620_60HZ},
5869*4882a593Smuzhiyun 	[SENSOR_OV7630C] =
5870*4882a593Smuzhiyun 		{NULL, NULL,
5871*4882a593Smuzhiyun 		 NULL, NULL,
5872*4882a593Smuzhiyun 		 NULL, NULL},
5873*4882a593Smuzhiyun 	[SENSOR_PAS106] =
5874*4882a593Smuzhiyun 		{pas106b_NoFliker, pas106b_NoFliker,
5875*4882a593Smuzhiyun 		 pas106b_50HZ, pas106b_50HZ,
5876*4882a593Smuzhiyun 		 pas106b_60HZ, pas106b_60HZ},
5877*4882a593Smuzhiyun 	[SENSOR_PAS202B] =
5878*4882a593Smuzhiyun 		{pas202b_NoFliker, pas202b_NoFlikerScale,
5879*4882a593Smuzhiyun 		 pas202b_50HZ, pas202b_50HZScale,
5880*4882a593Smuzhiyun 		 pas202b_60HZ, pas202b_60HZScale},
5881*4882a593Smuzhiyun 	[SENSOR_PB0330] =
5882*4882a593Smuzhiyun 		{pb0330_NoFliker, pb0330_NoFlikerScale,
5883*4882a593Smuzhiyun 		 pb0330_50HZ, pb0330_50HZScale,
5884*4882a593Smuzhiyun 		 pb0330_60HZ, pb0330_60HZScale},
5885*4882a593Smuzhiyun 	[SENSOR_PO2030] =
5886*4882a593Smuzhiyun 		{po2030_NoFliker, po2030_NoFliker,
5887*4882a593Smuzhiyun 		 po2030_50HZ, po2030_50HZ,
5888*4882a593Smuzhiyun 		 po2030_60HZ, po2030_60HZ},
5889*4882a593Smuzhiyun 	[SENSOR_TAS5130C] =
5890*4882a593Smuzhiyun 		{tas5130c_NoFliker, tas5130c_NoFlikerScale,
5891*4882a593Smuzhiyun 		 tas5130c_50HZ, tas5130c_50HZScale,
5892*4882a593Smuzhiyun 		 tas5130c_60HZ, tas5130c_60HZScale},
5893*4882a593Smuzhiyun 	};
5894*4882a593Smuzhiyun 
5895*4882a593Smuzhiyun 	i = val * 2;
5896*4882a593Smuzhiyun 	mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
5897*4882a593Smuzhiyun 	if (mode)
5898*4882a593Smuzhiyun 		i++;			/* 320x240 */
5899*4882a593Smuzhiyun 	zc3_freq = freq_tb[sd->sensor][i];
5900*4882a593Smuzhiyun 	if (zc3_freq == NULL)
5901*4882a593Smuzhiyun 		return;
5902*4882a593Smuzhiyun 	usb_exchange(gspca_dev, zc3_freq);
5903*4882a593Smuzhiyun 	switch (sd->sensor) {
5904*4882a593Smuzhiyun 	case SENSOR_GC0305:
5905*4882a593Smuzhiyun 		if (mode		/* if 320x240 */
5906*4882a593Smuzhiyun 		    && val == 1)	/* and 50Hz */
5907*4882a593Smuzhiyun 			reg_w(gspca_dev, 0x85, 0x018d);
5908*4882a593Smuzhiyun 					/* win: 0x80, 0x018d */
5909*4882a593Smuzhiyun 		break;
5910*4882a593Smuzhiyun 	case SENSOR_OV7620:
5911*4882a593Smuzhiyun 		if (!mode) {		/* if 640x480 */
5912*4882a593Smuzhiyun 			if (val != 0)	/* and filter */
5913*4882a593Smuzhiyun 				reg_w(gspca_dev, 0x40, 0x0002);
5914*4882a593Smuzhiyun 			else
5915*4882a593Smuzhiyun 				reg_w(gspca_dev, 0x44, 0x0002);
5916*4882a593Smuzhiyun 		}
5917*4882a593Smuzhiyun 		break;
5918*4882a593Smuzhiyun 	case SENSOR_PAS202B:
5919*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x00, 0x01a7);
5920*4882a593Smuzhiyun 		break;
5921*4882a593Smuzhiyun 	}
5922*4882a593Smuzhiyun }
5923*4882a593Smuzhiyun 
setautogain(struct gspca_dev * gspca_dev,s32 val)5924*4882a593Smuzhiyun static void setautogain(struct gspca_dev *gspca_dev, s32 val)
5925*4882a593Smuzhiyun {
5926*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
5927*4882a593Smuzhiyun 
5928*4882a593Smuzhiyun 	if (sd->sensor == SENSOR_OV7620)
5929*4882a593Smuzhiyun 		i2c_write(gspca_dev, 0x13, val ? 0xa3 : 0x80, 0x00);
5930*4882a593Smuzhiyun 	else
5931*4882a593Smuzhiyun 		reg_w(gspca_dev, val ? 0x42 : 0x02, 0x0180);
5932*4882a593Smuzhiyun }
5933*4882a593Smuzhiyun 
5934*4882a593Smuzhiyun /*
5935*4882a593Smuzhiyun  * Update the transfer parameters.
5936*4882a593Smuzhiyun  * This function is executed from a work queue.
5937*4882a593Smuzhiyun  */
transfer_update(struct work_struct * work)5938*4882a593Smuzhiyun static void transfer_update(struct work_struct *work)
5939*4882a593Smuzhiyun {
5940*4882a593Smuzhiyun 	struct sd *sd = container_of(work, struct sd, work);
5941*4882a593Smuzhiyun 	struct gspca_dev *gspca_dev = &sd->gspca_dev;
5942*4882a593Smuzhiyun 	int change, good;
5943*4882a593Smuzhiyun 	u8 reg07, reg11;
5944*4882a593Smuzhiyun 
5945*4882a593Smuzhiyun 	/* reg07 gets set to 0 by sd_start before starting us */
5946*4882a593Smuzhiyun 	reg07 = 0;
5947*4882a593Smuzhiyun 
5948*4882a593Smuzhiyun 	good = 0;
5949*4882a593Smuzhiyun 	while (1) {
5950*4882a593Smuzhiyun 		msleep(100);
5951*4882a593Smuzhiyun 
5952*4882a593Smuzhiyun 		/* To protect gspca_dev->usb_buf and gspca_dev->usb_err */
5953*4882a593Smuzhiyun 		mutex_lock(&gspca_dev->usb_lock);
5954*4882a593Smuzhiyun #ifdef CONFIG_PM
5955*4882a593Smuzhiyun 		if (gspca_dev->frozen)
5956*4882a593Smuzhiyun 			break;
5957*4882a593Smuzhiyun #endif
5958*4882a593Smuzhiyun 		if (!gspca_dev->present || !gspca_dev->streaming)
5959*4882a593Smuzhiyun 			break;
5960*4882a593Smuzhiyun 
5961*4882a593Smuzhiyun 		/* Bit 0 of register 11 indicates FIFO overflow */
5962*4882a593Smuzhiyun 		gspca_dev->usb_err = 0;
5963*4882a593Smuzhiyun 		reg11 = reg_r(gspca_dev, 0x0011);
5964*4882a593Smuzhiyun 		if (gspca_dev->usb_err)
5965*4882a593Smuzhiyun 			break;
5966*4882a593Smuzhiyun 
5967*4882a593Smuzhiyun 		change = reg11 & 0x01;
5968*4882a593Smuzhiyun 		if (change) {				/* overflow */
5969*4882a593Smuzhiyun 			good = 0;
5970*4882a593Smuzhiyun 
5971*4882a593Smuzhiyun 			if (reg07 == 0) /* Bit Rate Control not enabled? */
5972*4882a593Smuzhiyun 				reg07 = 0x32; /* Allow 98 bytes / unit */
5973*4882a593Smuzhiyun 			else if (reg07 > 2)
5974*4882a593Smuzhiyun 				reg07 -= 2; /* Decrease allowed bytes / unit */
5975*4882a593Smuzhiyun 			else
5976*4882a593Smuzhiyun 				change = 0;
5977*4882a593Smuzhiyun 		} else {				/* no overflow */
5978*4882a593Smuzhiyun 			good++;
5979*4882a593Smuzhiyun 			if (good >= 10) {
5980*4882a593Smuzhiyun 				good = 0;
5981*4882a593Smuzhiyun 				if (reg07) { /* BRC enabled? */
5982*4882a593Smuzhiyun 					change = 1;
5983*4882a593Smuzhiyun 					if (reg07 < 0x32)
5984*4882a593Smuzhiyun 						reg07 += 2;
5985*4882a593Smuzhiyun 					else
5986*4882a593Smuzhiyun 						reg07 = 0;
5987*4882a593Smuzhiyun 				}
5988*4882a593Smuzhiyun 			}
5989*4882a593Smuzhiyun 		}
5990*4882a593Smuzhiyun 		if (change) {
5991*4882a593Smuzhiyun 			gspca_dev->usb_err = 0;
5992*4882a593Smuzhiyun 			reg_w(gspca_dev, reg07, 0x0007);
5993*4882a593Smuzhiyun 			if (gspca_dev->usb_err)
5994*4882a593Smuzhiyun 				break;
5995*4882a593Smuzhiyun 		}
5996*4882a593Smuzhiyun 		mutex_unlock(&gspca_dev->usb_lock);
5997*4882a593Smuzhiyun 	}
5998*4882a593Smuzhiyun 
5999*4882a593Smuzhiyun 	/* Something went wrong. Unlock and return */
6000*4882a593Smuzhiyun 	mutex_unlock(&gspca_dev->usb_lock);
6001*4882a593Smuzhiyun }
6002*4882a593Smuzhiyun 
send_unknown(struct gspca_dev * gspca_dev,int sensor)6003*4882a593Smuzhiyun static void send_unknown(struct gspca_dev *gspca_dev, int sensor)
6004*4882a593Smuzhiyun {
6005*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);		/* bridge reset */
6006*4882a593Smuzhiyun 	switch (sensor) {
6007*4882a593Smuzhiyun 	case SENSOR_PAS106:
6008*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x03, 0x003a);
6009*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x0c, 0x003b);
6010*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x08, 0x0038);
6011*4882a593Smuzhiyun 		break;
6012*4882a593Smuzhiyun 	case SENSOR_ADCM2700:
6013*4882a593Smuzhiyun 	case SENSOR_GC0305:
6014*4882a593Smuzhiyun 	case SENSOR_OV7620:
6015*4882a593Smuzhiyun 	case SENSOR_MT9V111_1:
6016*4882a593Smuzhiyun 	case SENSOR_MT9V111_3:
6017*4882a593Smuzhiyun 	case SENSOR_PB0330:
6018*4882a593Smuzhiyun 	case SENSOR_PO2030:
6019*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x0d, 0x003a);
6020*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x02, 0x003b);
6021*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x00, 0x0038);
6022*4882a593Smuzhiyun 		break;
6023*4882a593Smuzhiyun 	case SENSOR_HV7131R:
6024*4882a593Smuzhiyun 	case SENSOR_PAS202B:
6025*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x03, 0x003b);
6026*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x0c, 0x003a);
6027*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x0b, 0x0039);
6028*4882a593Smuzhiyun 		if (sensor == SENSOR_PAS202B)
6029*4882a593Smuzhiyun 			reg_w(gspca_dev, 0x0b, 0x0038);
6030*4882a593Smuzhiyun 		break;
6031*4882a593Smuzhiyun 	}
6032*4882a593Smuzhiyun }
6033*4882a593Smuzhiyun 
6034*4882a593Smuzhiyun /* start probe 2 wires */
start_2wr_probe(struct gspca_dev * gspca_dev,int sensor)6035*4882a593Smuzhiyun static void start_2wr_probe(struct gspca_dev *gspca_dev, int sensor)
6036*4882a593Smuzhiyun {
6037*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);
6038*4882a593Smuzhiyun 	reg_w(gspca_dev, sensor, 0x0010);
6039*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0001);
6040*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x03, 0x0012);
6041*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0012);
6042*4882a593Smuzhiyun /*	msleep(2); */
6043*4882a593Smuzhiyun }
6044*4882a593Smuzhiyun 
sif_probe(struct gspca_dev * gspca_dev)6045*4882a593Smuzhiyun static int sif_probe(struct gspca_dev *gspca_dev)
6046*4882a593Smuzhiyun {
6047*4882a593Smuzhiyun 	u16 checkword;
6048*4882a593Smuzhiyun 
6049*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x0f);		/* PAS106 */
6050*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x08, 0x008d);
6051*4882a593Smuzhiyun 	msleep(150);
6052*4882a593Smuzhiyun 	checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
6053*4882a593Smuzhiyun 			| ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
6054*4882a593Smuzhiyun 	gspca_dbg(gspca_dev, D_PROBE, "probe sif 0x%04x\n", checkword);
6055*4882a593Smuzhiyun 	if (checkword == 0x0007) {
6056*4882a593Smuzhiyun 		send_unknown(gspca_dev, SENSOR_PAS106);
6057*4882a593Smuzhiyun 		return 0x0f;			/* PAS106 */
6058*4882a593Smuzhiyun 	}
6059*4882a593Smuzhiyun 	return -1;
6060*4882a593Smuzhiyun }
6061*4882a593Smuzhiyun 
vga_2wr_probe(struct gspca_dev * gspca_dev)6062*4882a593Smuzhiyun static int vga_2wr_probe(struct gspca_dev *gspca_dev)
6063*4882a593Smuzhiyun {
6064*4882a593Smuzhiyun 	u16 retword;
6065*4882a593Smuzhiyun 
6066*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x00);	/* HV7131B */
6067*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6068*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x01);
6069*4882a593Smuzhiyun 	if (retword != 0)
6070*4882a593Smuzhiyun 		return 0x00;			/* HV7131B */
6071*4882a593Smuzhiyun 
6072*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x04);	/* CS2102 */
6073*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6074*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x01);
6075*4882a593Smuzhiyun 	if (retword != 0)
6076*4882a593Smuzhiyun 		return 0x04;			/* CS2102 */
6077*4882a593Smuzhiyun 
6078*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x06);	/* OmniVision */
6079*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x08, 0x008d);
6080*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
6081*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x11);
6082*4882a593Smuzhiyun 	if (retword != 0) {
6083*4882a593Smuzhiyun 		/* (should have returned 0xaa) --> Omnivision? */
6084*4882a593Smuzhiyun 		/* reg_r 0x10 -> 0x06 -->  */
6085*4882a593Smuzhiyun 		goto ov_check;
6086*4882a593Smuzhiyun 	}
6087*4882a593Smuzhiyun 
6088*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x08);	/* HDCS2020 */
6089*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x1c, 0x00, 0x00);
6090*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
6091*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x15);
6092*4882a593Smuzhiyun 	if (retword != 0)
6093*4882a593Smuzhiyun 		return 0x08;			/* HDCS2020 */
6094*4882a593Smuzhiyun 
6095*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x0a);	/* PB0330 */
6096*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
6097*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x07);
6098*4882a593Smuzhiyun 	if (retword != 0)
6099*4882a593Smuzhiyun 		return 0x0a;			/* PB0330 */
6100*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x03);
6101*4882a593Smuzhiyun 	if (retword != 0)
6102*4882a593Smuzhiyun 		return 0x0a;			/* PB0330 ?? */
6103*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x04);
6104*4882a593Smuzhiyun 	if (retword != 0)
6105*4882a593Smuzhiyun 		return 0x0a;			/* PB0330 ?? */
6106*4882a593Smuzhiyun 
6107*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x0c);	/* ICM105A */
6108*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x01, 0x11, 0x00);
6109*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x01);
6110*4882a593Smuzhiyun 	if (retword != 0)
6111*4882a593Smuzhiyun 		return 0x0c;			/* ICM105A */
6112*4882a593Smuzhiyun 
6113*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x0e);	/* PAS202BCB */
6114*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x08, 0x008d);
6115*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
6116*4882a593Smuzhiyun 	msleep(50);
6117*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x03);
6118*4882a593Smuzhiyun 	if (retword != 0) {
6119*4882a593Smuzhiyun 		send_unknown(gspca_dev, SENSOR_PAS202B);
6120*4882a593Smuzhiyun 		return 0x0e;			/* PAS202BCB */
6121*4882a593Smuzhiyun 	}
6122*4882a593Smuzhiyun 
6123*4882a593Smuzhiyun 	start_2wr_probe(gspca_dev, 0x02);	/* TAS5130C */
6124*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6125*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x01);
6126*4882a593Smuzhiyun 	if (retword != 0)
6127*4882a593Smuzhiyun 		return 0x02;			/* TAS5130C */
6128*4882a593Smuzhiyun ov_check:
6129*4882a593Smuzhiyun 	reg_r(gspca_dev, 0x0010);		/* ?? */
6130*4882a593Smuzhiyun 	reg_r(gspca_dev, 0x0010);
6131*4882a593Smuzhiyun 
6132*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);
6133*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0001);
6134*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x06, 0x0010);		/* OmniVision */
6135*4882a593Smuzhiyun 	reg_w(gspca_dev, 0xa1, 0x008b);
6136*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x08, 0x008d);
6137*4882a593Smuzhiyun 	msleep(500);
6138*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0012);
6139*4882a593Smuzhiyun 	i2c_write(gspca_dev, 0x12, 0x80, 0x00);	/* sensor reset */
6140*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x0a) << 8;
6141*4882a593Smuzhiyun 	retword |= i2c_read(gspca_dev, 0x0b);
6142*4882a593Smuzhiyun 	gspca_dbg(gspca_dev, D_PROBE, "probe 2wr ov vga 0x%04x\n", retword);
6143*4882a593Smuzhiyun 	switch (retword) {
6144*4882a593Smuzhiyun 	case 0x7631:				/* OV7630C */
6145*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x06, 0x0010);
6146*4882a593Smuzhiyun 		break;
6147*4882a593Smuzhiyun 	case 0x7620:				/* OV7620 */
6148*4882a593Smuzhiyun 	case 0x7648:				/* OV7648 */
6149*4882a593Smuzhiyun 		break;
6150*4882a593Smuzhiyun 	default:
6151*4882a593Smuzhiyun 		return -1;			/* not OmniVision */
6152*4882a593Smuzhiyun 	}
6153*4882a593Smuzhiyun 	return retword;
6154*4882a593Smuzhiyun }
6155*4882a593Smuzhiyun 
6156*4882a593Smuzhiyun struct sensor_by_chipset_revision {
6157*4882a593Smuzhiyun 	u16 revision;
6158*4882a593Smuzhiyun 	u8 internal_sensor_id;
6159*4882a593Smuzhiyun };
6160*4882a593Smuzhiyun static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
6161*4882a593Smuzhiyun 	{0xc000, 0x12},		/* TAS5130C */
6162*4882a593Smuzhiyun 	{0xc001, 0x13},		/* MT9V111 */
6163*4882a593Smuzhiyun 	{0xe001, 0x13},
6164*4882a593Smuzhiyun 	{0x8001, 0x13},
6165*4882a593Smuzhiyun 	{0x8000, 0x14},		/* CS2102K */
6166*4882a593Smuzhiyun 	{0x8400, 0x15},		/* MT9V111 */
6167*4882a593Smuzhiyun 	{0xe400, 0x15},
6168*4882a593Smuzhiyun };
6169*4882a593Smuzhiyun 
vga_3wr_probe(struct gspca_dev * gspca_dev)6170*4882a593Smuzhiyun static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6171*4882a593Smuzhiyun {
6172*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6173*4882a593Smuzhiyun 	int i;
6174*4882a593Smuzhiyun 	u16 retword;
6175*4882a593Smuzhiyun 
6176*4882a593Smuzhiyun /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
6177*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x02, 0x0010);
6178*4882a593Smuzhiyun 	reg_r(gspca_dev, 0x0010);
6179*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);
6180*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x00, 0x0010);
6181*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0001);
6182*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x91, 0x008b);
6183*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x03, 0x0012);
6184*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0012);
6185*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x05, 0x0012);
6186*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x14);
6187*4882a593Smuzhiyun 	if (retword != 0)
6188*4882a593Smuzhiyun 		return 0x11;			/* HV7131R */
6189*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x15);
6190*4882a593Smuzhiyun 	if (retword != 0)
6191*4882a593Smuzhiyun 		return 0x11;			/* HV7131R */
6192*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x16);
6193*4882a593Smuzhiyun 	if (retword != 0)
6194*4882a593Smuzhiyun 		return 0x11;			/* HV7131R */
6195*4882a593Smuzhiyun 
6196*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x02, 0x0010);
6197*4882a593Smuzhiyun 	retword = reg_r(gspca_dev, 0x000b) << 8;
6198*4882a593Smuzhiyun 	retword |= reg_r(gspca_dev, 0x000a);
6199*4882a593Smuzhiyun 	gspca_dbg(gspca_dev, D_PROBE, "probe 3wr vga 1 0x%04x\n", retword);
6200*4882a593Smuzhiyun 	reg_r(gspca_dev, 0x0010);
6201*4882a593Smuzhiyun 	if ((retword & 0xff00) == 0x6400)
6202*4882a593Smuzhiyun 		return 0x02;		/* TAS5130C */
6203*4882a593Smuzhiyun 	for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6204*4882a593Smuzhiyun 		if (chipset_revision_sensor[i].revision == retword) {
6205*4882a593Smuzhiyun 			sd->chip_revision = retword;
6206*4882a593Smuzhiyun 			send_unknown(gspca_dev, SENSOR_PB0330);
6207*4882a593Smuzhiyun 			return chipset_revision_sensor[i].internal_sensor_id;
6208*4882a593Smuzhiyun 		}
6209*4882a593Smuzhiyun 	}
6210*4882a593Smuzhiyun 
6211*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);	/* check PB0330 */
6212*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0001);
6213*4882a593Smuzhiyun 	reg_w(gspca_dev, 0xdd, 0x008b);
6214*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x0a, 0x0010);
6215*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x03, 0x0012);
6216*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0012);
6217*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x00);
6218*4882a593Smuzhiyun 	if (retword != 0) {
6219*4882a593Smuzhiyun 		gspca_dbg(gspca_dev, D_PROBE, "probe 3wr vga type 0a\n");
6220*4882a593Smuzhiyun 		return 0x0a;			/* PB0330 */
6221*4882a593Smuzhiyun 	}
6222*4882a593Smuzhiyun 
6223*4882a593Smuzhiyun 	/* probe gc0303 / gc0305 */
6224*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);
6225*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0001);
6226*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x98, 0x008b);
6227*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0010);
6228*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x03, 0x0012);
6229*4882a593Smuzhiyun 	msleep(2);
6230*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0012);
6231*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x00);
6232*4882a593Smuzhiyun 	if (retword != 0) {
6233*4882a593Smuzhiyun 		gspca_dbg(gspca_dev, D_PROBE, "probe 3wr vga type %02x\n",
6234*4882a593Smuzhiyun 			  retword);
6235*4882a593Smuzhiyun 		if (retword == 0x0011)			/* gc0303 */
6236*4882a593Smuzhiyun 			return 0x0303;
6237*4882a593Smuzhiyun 		if (retword == 0x0029)			/* gc0305 */
6238*4882a593Smuzhiyun 			send_unknown(gspca_dev, SENSOR_GC0305);
6239*4882a593Smuzhiyun 		return retword;
6240*4882a593Smuzhiyun 	}
6241*4882a593Smuzhiyun 
6242*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);	/* check OmniVision */
6243*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0001);
6244*4882a593Smuzhiyun 	reg_w(gspca_dev, 0xa1, 0x008b);
6245*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x08, 0x008d);
6246*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x06, 0x0010);
6247*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0012);
6248*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x05, 0x0012);
6249*4882a593Smuzhiyun 	if (i2c_read(gspca_dev, 0x1c) == 0x007f	/* OV7610 - manufacturer ID */
6250*4882a593Smuzhiyun 	    && i2c_read(gspca_dev, 0x1d) == 0x00a2) {
6251*4882a593Smuzhiyun 		send_unknown(gspca_dev, SENSOR_OV7620);
6252*4882a593Smuzhiyun 		return 0x06;		/* OmniVision confirm ? */
6253*4882a593Smuzhiyun 	}
6254*4882a593Smuzhiyun 
6255*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);
6256*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x00, 0x0002);
6257*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0010);
6258*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0001);
6259*4882a593Smuzhiyun 	reg_w(gspca_dev, 0xee, 0x008b);
6260*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x03, 0x0012);
6261*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0012);
6262*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x05, 0x0012);
6263*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x00) << 8;	/* ID 0 */
6264*4882a593Smuzhiyun 	retword |= i2c_read(gspca_dev, 0x01);		/* ID 1 */
6265*4882a593Smuzhiyun 	gspca_dbg(gspca_dev, D_PROBE, "probe 3wr vga 2 0x%04x\n", retword);
6266*4882a593Smuzhiyun 	if (retword == 0x2030) {
6267*4882a593Smuzhiyun 		u8 retbyte;
6268*4882a593Smuzhiyun 
6269*4882a593Smuzhiyun 		retbyte = i2c_read(gspca_dev, 0x02);	/* revision number */
6270*4882a593Smuzhiyun 		gspca_dbg(gspca_dev, D_PROBE, "sensor PO2030 rev 0x%02x\n",
6271*4882a593Smuzhiyun 			  retbyte);
6272*4882a593Smuzhiyun 
6273*4882a593Smuzhiyun 		send_unknown(gspca_dev, SENSOR_PO2030);
6274*4882a593Smuzhiyun 		return retword;
6275*4882a593Smuzhiyun 	}
6276*4882a593Smuzhiyun 
6277*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);
6278*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x0a, 0x0010);
6279*4882a593Smuzhiyun 	reg_w(gspca_dev, 0xd3, 0x008b);
6280*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0001);
6281*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x03, 0x0012);
6282*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0012);
6283*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x05, 0x0012);
6284*4882a593Smuzhiyun 	reg_w(gspca_dev, 0xd3, 0x008b);
6285*4882a593Smuzhiyun 	retword = i2c_read(gspca_dev, 0x01);
6286*4882a593Smuzhiyun 	if (retword != 0) {
6287*4882a593Smuzhiyun 		gspca_dbg(gspca_dev, D_PROBE, "probe 3wr vga type 0a ? ret: %04x\n",
6288*4882a593Smuzhiyun 			  retword);
6289*4882a593Smuzhiyun 		return 0x16;			/* adcm2700 (6100/6200) */
6290*4882a593Smuzhiyun 	}
6291*4882a593Smuzhiyun 	return -1;
6292*4882a593Smuzhiyun }
6293*4882a593Smuzhiyun 
zcxx_probeSensor(struct gspca_dev * gspca_dev)6294*4882a593Smuzhiyun static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6295*4882a593Smuzhiyun {
6296*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6297*4882a593Smuzhiyun 	int sensor;
6298*4882a593Smuzhiyun 
6299*4882a593Smuzhiyun 	switch (sd->sensor) {
6300*4882a593Smuzhiyun 	case SENSOR_MC501CB:
6301*4882a593Smuzhiyun 		return -1;		/* don't probe */
6302*4882a593Smuzhiyun 	case SENSOR_GC0303:
6303*4882a593Smuzhiyun 			/* may probe but with no write in reg 0x0010 */
6304*4882a593Smuzhiyun 		return -1;		/* don't probe */
6305*4882a593Smuzhiyun 	case SENSOR_PAS106:
6306*4882a593Smuzhiyun 		sensor =  sif_probe(gspca_dev);
6307*4882a593Smuzhiyun 		if (sensor >= 0)
6308*4882a593Smuzhiyun 			return sensor;
6309*4882a593Smuzhiyun 		break;
6310*4882a593Smuzhiyun 	}
6311*4882a593Smuzhiyun 	sensor = vga_2wr_probe(gspca_dev);
6312*4882a593Smuzhiyun 	if (sensor >= 0)
6313*4882a593Smuzhiyun 		return sensor;
6314*4882a593Smuzhiyun 	return vga_3wr_probe(gspca_dev);
6315*4882a593Smuzhiyun }
6316*4882a593Smuzhiyun 
6317*4882a593Smuzhiyun /* this function is called at probe time */
sd_config(struct gspca_dev * gspca_dev,const struct usb_device_id * id)6318*4882a593Smuzhiyun static int sd_config(struct gspca_dev *gspca_dev,
6319*4882a593Smuzhiyun 			const struct usb_device_id *id)
6320*4882a593Smuzhiyun {
6321*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6322*4882a593Smuzhiyun 
6323*4882a593Smuzhiyun 	if (id->idProduct == 0x301b)
6324*4882a593Smuzhiyun 		sd->bridge = BRIDGE_ZC301;
6325*4882a593Smuzhiyun 	else
6326*4882a593Smuzhiyun 		sd->bridge = BRIDGE_ZC303;
6327*4882a593Smuzhiyun 
6328*4882a593Smuzhiyun 	/* define some sensors from the vendor/product */
6329*4882a593Smuzhiyun 	sd->sensor = id->driver_info;
6330*4882a593Smuzhiyun 
6331*4882a593Smuzhiyun 	sd->reg08 = REG08_DEF;
6332*4882a593Smuzhiyun 
6333*4882a593Smuzhiyun 	INIT_WORK(&sd->work, transfer_update);
6334*4882a593Smuzhiyun 
6335*4882a593Smuzhiyun 	return 0;
6336*4882a593Smuzhiyun }
6337*4882a593Smuzhiyun 
zcxx_g_volatile_ctrl(struct v4l2_ctrl * ctrl)6338*4882a593Smuzhiyun static int zcxx_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
6339*4882a593Smuzhiyun {
6340*4882a593Smuzhiyun 	struct gspca_dev *gspca_dev =
6341*4882a593Smuzhiyun 		container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
6342*4882a593Smuzhiyun 	struct sd *sd = (struct sd *)gspca_dev;
6343*4882a593Smuzhiyun 
6344*4882a593Smuzhiyun 	switch (ctrl->id) {
6345*4882a593Smuzhiyun 	case V4L2_CID_AUTOGAIN:
6346*4882a593Smuzhiyun 		gspca_dev->usb_err = 0;
6347*4882a593Smuzhiyun 		if (ctrl->val && sd->exposure && gspca_dev->streaming)
6348*4882a593Smuzhiyun 			sd->exposure->val = getexposure(gspca_dev);
6349*4882a593Smuzhiyun 		return gspca_dev->usb_err;
6350*4882a593Smuzhiyun 	}
6351*4882a593Smuzhiyun 	return -EINVAL;
6352*4882a593Smuzhiyun }
6353*4882a593Smuzhiyun 
zcxx_s_ctrl(struct v4l2_ctrl * ctrl)6354*4882a593Smuzhiyun static int zcxx_s_ctrl(struct v4l2_ctrl *ctrl)
6355*4882a593Smuzhiyun {
6356*4882a593Smuzhiyun 	struct gspca_dev *gspca_dev =
6357*4882a593Smuzhiyun 		container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
6358*4882a593Smuzhiyun 	struct sd *sd = (struct sd *)gspca_dev;
6359*4882a593Smuzhiyun 	int i, qual;
6360*4882a593Smuzhiyun 
6361*4882a593Smuzhiyun 	gspca_dev->usb_err = 0;
6362*4882a593Smuzhiyun 
6363*4882a593Smuzhiyun 	if (ctrl->id == V4L2_CID_JPEG_COMPRESSION_QUALITY) {
6364*4882a593Smuzhiyun 		qual = sd->reg08 >> 1;
6365*4882a593Smuzhiyun 
6366*4882a593Smuzhiyun 		for (i = 0; i < ARRAY_SIZE(jpeg_qual); i++) {
6367*4882a593Smuzhiyun 			if (ctrl->val <= jpeg_qual[i])
6368*4882a593Smuzhiyun 				break;
6369*4882a593Smuzhiyun 		}
6370*4882a593Smuzhiyun 		if (i == ARRAY_SIZE(jpeg_qual) || (i > 0 && i == qual && ctrl->val < jpeg_qual[i]))
6371*4882a593Smuzhiyun 			i--;
6372*4882a593Smuzhiyun 
6373*4882a593Smuzhiyun 		/* With high quality settings we need max bandwidth */
6374*4882a593Smuzhiyun 		if (i >= 2 && gspca_dev->streaming &&
6375*4882a593Smuzhiyun 		    !gspca_dev->cam.needs_full_bandwidth)
6376*4882a593Smuzhiyun 			return -EBUSY;
6377*4882a593Smuzhiyun 
6378*4882a593Smuzhiyun 		sd->reg08 = (i << 1) | 1;
6379*4882a593Smuzhiyun 		ctrl->val = jpeg_qual[i];
6380*4882a593Smuzhiyun 	}
6381*4882a593Smuzhiyun 
6382*4882a593Smuzhiyun 	if (!gspca_dev->streaming)
6383*4882a593Smuzhiyun 		return 0;
6384*4882a593Smuzhiyun 
6385*4882a593Smuzhiyun 	switch (ctrl->id) {
6386*4882a593Smuzhiyun 	/* gamma/brightness/contrast cluster */
6387*4882a593Smuzhiyun 	case V4L2_CID_GAMMA:
6388*4882a593Smuzhiyun 		setcontrast(gspca_dev, sd->gamma->val,
6389*4882a593Smuzhiyun 				sd->brightness->val, sd->contrast->val);
6390*4882a593Smuzhiyun 		break;
6391*4882a593Smuzhiyun 	/* autogain/exposure cluster */
6392*4882a593Smuzhiyun 	case V4L2_CID_AUTOGAIN:
6393*4882a593Smuzhiyun 		setautogain(gspca_dev, ctrl->val);
6394*4882a593Smuzhiyun 		if (!gspca_dev->usb_err && !ctrl->val && sd->exposure)
6395*4882a593Smuzhiyun 			setexposure(gspca_dev, sd->exposure->val);
6396*4882a593Smuzhiyun 		break;
6397*4882a593Smuzhiyun 	case V4L2_CID_POWER_LINE_FREQUENCY:
6398*4882a593Smuzhiyun 		setlightfreq(gspca_dev, ctrl->val);
6399*4882a593Smuzhiyun 		break;
6400*4882a593Smuzhiyun 	case V4L2_CID_SHARPNESS:
6401*4882a593Smuzhiyun 		setsharpness(gspca_dev, ctrl->val);
6402*4882a593Smuzhiyun 		break;
6403*4882a593Smuzhiyun 	case V4L2_CID_JPEG_COMPRESSION_QUALITY:
6404*4882a593Smuzhiyun 		setquality(gspca_dev);
6405*4882a593Smuzhiyun 		break;
6406*4882a593Smuzhiyun 	}
6407*4882a593Smuzhiyun 	return gspca_dev->usb_err;
6408*4882a593Smuzhiyun }
6409*4882a593Smuzhiyun 
6410*4882a593Smuzhiyun static const struct v4l2_ctrl_ops zcxx_ctrl_ops = {
6411*4882a593Smuzhiyun 	.g_volatile_ctrl = zcxx_g_volatile_ctrl,
6412*4882a593Smuzhiyun 	.s_ctrl = zcxx_s_ctrl,
6413*4882a593Smuzhiyun };
6414*4882a593Smuzhiyun 
sd_init_controls(struct gspca_dev * gspca_dev)6415*4882a593Smuzhiyun static int sd_init_controls(struct gspca_dev *gspca_dev)
6416*4882a593Smuzhiyun {
6417*4882a593Smuzhiyun 	struct sd *sd = (struct sd *)gspca_dev;
6418*4882a593Smuzhiyun 	struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
6419*4882a593Smuzhiyun 	static const u8 gamma[SENSOR_MAX] = {
6420*4882a593Smuzhiyun 		[SENSOR_ADCM2700] =	4,
6421*4882a593Smuzhiyun 		[SENSOR_CS2102] =	4,
6422*4882a593Smuzhiyun 		[SENSOR_CS2102K] =	5,
6423*4882a593Smuzhiyun 		[SENSOR_GC0303] =	3,
6424*4882a593Smuzhiyun 		[SENSOR_GC0305] =	4,
6425*4882a593Smuzhiyun 		[SENSOR_HDCS2020] =	4,
6426*4882a593Smuzhiyun 		[SENSOR_HV7131B] =	4,
6427*4882a593Smuzhiyun 		[SENSOR_HV7131R] =	4,
6428*4882a593Smuzhiyun 		[SENSOR_ICM105A] =	4,
6429*4882a593Smuzhiyun 		[SENSOR_MC501CB] =	4,
6430*4882a593Smuzhiyun 		[SENSOR_MT9V111_1] =	4,
6431*4882a593Smuzhiyun 		[SENSOR_MT9V111_3] =	4,
6432*4882a593Smuzhiyun 		[SENSOR_OV7620] =	3,
6433*4882a593Smuzhiyun 		[SENSOR_OV7630C] =	4,
6434*4882a593Smuzhiyun 		[SENSOR_PAS106] =	4,
6435*4882a593Smuzhiyun 		[SENSOR_PAS202B] =	4,
6436*4882a593Smuzhiyun 		[SENSOR_PB0330] =	4,
6437*4882a593Smuzhiyun 		[SENSOR_PO2030] =	4,
6438*4882a593Smuzhiyun 		[SENSOR_TAS5130C] =	3,
6439*4882a593Smuzhiyun 	};
6440*4882a593Smuzhiyun 
6441*4882a593Smuzhiyun 	gspca_dev->vdev.ctrl_handler = hdl;
6442*4882a593Smuzhiyun 	v4l2_ctrl_handler_init(hdl, 8);
6443*4882a593Smuzhiyun 	sd->brightness = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6444*4882a593Smuzhiyun 			V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
6445*4882a593Smuzhiyun 	sd->contrast = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6446*4882a593Smuzhiyun 			V4L2_CID_CONTRAST, 0, 255, 1, 128);
6447*4882a593Smuzhiyun 	sd->gamma = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6448*4882a593Smuzhiyun 			V4L2_CID_GAMMA, 1, 6, 1, gamma[sd->sensor]);
6449*4882a593Smuzhiyun 	if (sd->sensor == SENSOR_HV7131R)
6450*4882a593Smuzhiyun 		sd->exposure = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6451*4882a593Smuzhiyun 			V4L2_CID_EXPOSURE, 0x30d, 0x493e, 1, 0x927);
6452*4882a593Smuzhiyun 	else if (sd->sensor == SENSOR_OV7620)
6453*4882a593Smuzhiyun 		sd->exposure = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6454*4882a593Smuzhiyun 			V4L2_CID_EXPOSURE, 0, 255, 1, 0x41);
6455*4882a593Smuzhiyun 	sd->autogain = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6456*4882a593Smuzhiyun 			V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
6457*4882a593Smuzhiyun 	if (sd->sensor != SENSOR_OV7630C)
6458*4882a593Smuzhiyun 		sd->plfreq = v4l2_ctrl_new_std_menu(hdl, &zcxx_ctrl_ops,
6459*4882a593Smuzhiyun 			V4L2_CID_POWER_LINE_FREQUENCY,
6460*4882a593Smuzhiyun 			V4L2_CID_POWER_LINE_FREQUENCY_60HZ, 0,
6461*4882a593Smuzhiyun 			V4L2_CID_POWER_LINE_FREQUENCY_DISABLED);
6462*4882a593Smuzhiyun 	sd->sharpness = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6463*4882a593Smuzhiyun 			V4L2_CID_SHARPNESS, 0, 3, 1,
6464*4882a593Smuzhiyun 			sd->sensor == SENSOR_PO2030 ? 0 : 2);
6465*4882a593Smuzhiyun 	sd->jpegqual = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
6466*4882a593Smuzhiyun 			V4L2_CID_JPEG_COMPRESSION_QUALITY,
6467*4882a593Smuzhiyun 			jpeg_qual[0], jpeg_qual[ARRAY_SIZE(jpeg_qual) - 1], 1,
6468*4882a593Smuzhiyun 			jpeg_qual[REG08_DEF >> 1]);
6469*4882a593Smuzhiyun 	if (hdl->error) {
6470*4882a593Smuzhiyun 		pr_err("Could not initialize controls\n");
6471*4882a593Smuzhiyun 		return hdl->error;
6472*4882a593Smuzhiyun 	}
6473*4882a593Smuzhiyun 	v4l2_ctrl_cluster(3, &sd->gamma);
6474*4882a593Smuzhiyun 	if (sd->sensor == SENSOR_HV7131R || sd->sensor == SENSOR_OV7620)
6475*4882a593Smuzhiyun 		v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, true);
6476*4882a593Smuzhiyun 	return 0;
6477*4882a593Smuzhiyun }
6478*4882a593Smuzhiyun 
6479*4882a593Smuzhiyun /* this function is called at probe and resume time */
sd_init(struct gspca_dev * gspca_dev)6480*4882a593Smuzhiyun static int sd_init(struct gspca_dev *gspca_dev)
6481*4882a593Smuzhiyun {
6482*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6483*4882a593Smuzhiyun 	struct cam *cam;
6484*4882a593Smuzhiyun 	int sensor;
6485*4882a593Smuzhiyun 	static const u8 mode_tb[SENSOR_MAX] = {
6486*4882a593Smuzhiyun 		[SENSOR_ADCM2700] =	2,
6487*4882a593Smuzhiyun 		[SENSOR_CS2102] =	1,
6488*4882a593Smuzhiyun 		[SENSOR_CS2102K] =	1,
6489*4882a593Smuzhiyun 		[SENSOR_GC0303] =	1,
6490*4882a593Smuzhiyun 		[SENSOR_GC0305] =	1,
6491*4882a593Smuzhiyun 		[SENSOR_HDCS2020] =	1,
6492*4882a593Smuzhiyun 		[SENSOR_HV7131B] =	1,
6493*4882a593Smuzhiyun 		[SENSOR_HV7131R] =	1,
6494*4882a593Smuzhiyun 		[SENSOR_ICM105A] =	1,
6495*4882a593Smuzhiyun 		[SENSOR_MC501CB] =	2,
6496*4882a593Smuzhiyun 		[SENSOR_MT9V111_1] =	1,
6497*4882a593Smuzhiyun 		[SENSOR_MT9V111_3] =	1,
6498*4882a593Smuzhiyun 		[SENSOR_OV7620] =	2,
6499*4882a593Smuzhiyun 		[SENSOR_OV7630C] =	1,
6500*4882a593Smuzhiyun 		[SENSOR_PAS106] =	0,
6501*4882a593Smuzhiyun 		[SENSOR_PAS202B] =	1,
6502*4882a593Smuzhiyun 		[SENSOR_PB0330] =	1,
6503*4882a593Smuzhiyun 		[SENSOR_PO2030] =	1,
6504*4882a593Smuzhiyun 		[SENSOR_TAS5130C] =	1,
6505*4882a593Smuzhiyun 	};
6506*4882a593Smuzhiyun 
6507*4882a593Smuzhiyun 	sensor = zcxx_probeSensor(gspca_dev);
6508*4882a593Smuzhiyun 	if (sensor >= 0)
6509*4882a593Smuzhiyun 		gspca_dbg(gspca_dev, D_PROBE, "probe sensor -> %04x\n", sensor);
6510*4882a593Smuzhiyun 	if ((unsigned) force_sensor < SENSOR_MAX) {
6511*4882a593Smuzhiyun 		sd->sensor = force_sensor;
6512*4882a593Smuzhiyun 		gspca_dbg(gspca_dev, D_PROBE, "sensor forced to %d\n",
6513*4882a593Smuzhiyun 			  force_sensor);
6514*4882a593Smuzhiyun 	} else {
6515*4882a593Smuzhiyun 		switch (sensor) {
6516*4882a593Smuzhiyun 		case -1:
6517*4882a593Smuzhiyun 			switch (sd->sensor) {
6518*4882a593Smuzhiyun 			case SENSOR_MC501CB:
6519*4882a593Smuzhiyun 				gspca_dbg(gspca_dev, D_PROBE, "Sensor MC501CB\n");
6520*4882a593Smuzhiyun 				break;
6521*4882a593Smuzhiyun 			case SENSOR_GC0303:
6522*4882a593Smuzhiyun 				gspca_dbg(gspca_dev, D_PROBE, "Sensor GC0303\n");
6523*4882a593Smuzhiyun 				break;
6524*4882a593Smuzhiyun 			default:
6525*4882a593Smuzhiyun 				pr_warn("Unknown sensor - set to TAS5130C\n");
6526*4882a593Smuzhiyun 				sd->sensor = SENSOR_TAS5130C;
6527*4882a593Smuzhiyun 			}
6528*4882a593Smuzhiyun 			break;
6529*4882a593Smuzhiyun 		case 0:
6530*4882a593Smuzhiyun 			/* check the sensor type */
6531*4882a593Smuzhiyun 			sensor = i2c_read(gspca_dev, 0x00);
6532*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Sensor hv7131 type %d\n",
6533*4882a593Smuzhiyun 				  sensor);
6534*4882a593Smuzhiyun 			switch (sensor) {
6535*4882a593Smuzhiyun 			case 0:			/* hv7131b */
6536*4882a593Smuzhiyun 			case 1:			/* hv7131e */
6537*4882a593Smuzhiyun 				gspca_dbg(gspca_dev, D_PROBE, "Find Sensor HV7131B\n");
6538*4882a593Smuzhiyun 				sd->sensor = SENSOR_HV7131B;
6539*4882a593Smuzhiyun 				break;
6540*4882a593Smuzhiyun 			default:
6541*4882a593Smuzhiyun /*			case 2:			 * hv7131r */
6542*4882a593Smuzhiyun 				gspca_dbg(gspca_dev, D_PROBE, "Find Sensor HV7131R\n");
6543*4882a593Smuzhiyun 				sd->sensor = SENSOR_HV7131R;
6544*4882a593Smuzhiyun 				break;
6545*4882a593Smuzhiyun 			}
6546*4882a593Smuzhiyun 			break;
6547*4882a593Smuzhiyun 		case 0x02:
6548*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Sensor TAS5130C\n");
6549*4882a593Smuzhiyun 			sd->sensor = SENSOR_TAS5130C;
6550*4882a593Smuzhiyun 			break;
6551*4882a593Smuzhiyun 		case 0x04:
6552*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor CS2102\n");
6553*4882a593Smuzhiyun 			sd->sensor = SENSOR_CS2102;
6554*4882a593Smuzhiyun 			break;
6555*4882a593Smuzhiyun 		case 0x08:
6556*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor HDCS2020\n");
6557*4882a593Smuzhiyun 			sd->sensor = SENSOR_HDCS2020;
6558*4882a593Smuzhiyun 			break;
6559*4882a593Smuzhiyun 		case 0x0a:
6560*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE,
6561*4882a593Smuzhiyun 				  "Find Sensor PB0330. Chip revision %x\n",
6562*4882a593Smuzhiyun 				  sd->chip_revision);
6563*4882a593Smuzhiyun 			sd->sensor = SENSOR_PB0330;
6564*4882a593Smuzhiyun 			break;
6565*4882a593Smuzhiyun 		case 0x0c:
6566*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor ICM105A\n");
6567*4882a593Smuzhiyun 			sd->sensor = SENSOR_ICM105A;
6568*4882a593Smuzhiyun 			break;
6569*4882a593Smuzhiyun 		case 0x0e:
6570*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor PAS202B\n");
6571*4882a593Smuzhiyun 			sd->sensor = SENSOR_PAS202B;
6572*4882a593Smuzhiyun 			break;
6573*4882a593Smuzhiyun 		case 0x0f:
6574*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor PAS106\n");
6575*4882a593Smuzhiyun 			sd->sensor = SENSOR_PAS106;
6576*4882a593Smuzhiyun 			break;
6577*4882a593Smuzhiyun 		case 0x10:
6578*4882a593Smuzhiyun 		case 0x12:
6579*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor TAS5130C\n");
6580*4882a593Smuzhiyun 			sd->sensor = SENSOR_TAS5130C;
6581*4882a593Smuzhiyun 			break;
6582*4882a593Smuzhiyun 		case 0x11:
6583*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor HV7131R\n");
6584*4882a593Smuzhiyun 			sd->sensor = SENSOR_HV7131R;
6585*4882a593Smuzhiyun 			break;
6586*4882a593Smuzhiyun 		case 0x13:
6587*4882a593Smuzhiyun 		case 0x15:
6588*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE,
6589*4882a593Smuzhiyun 				  "Sensor MT9V111. Chip revision %04x\n",
6590*4882a593Smuzhiyun 				  sd->chip_revision);
6591*4882a593Smuzhiyun 			sd->sensor = sd->bridge == BRIDGE_ZC301
6592*4882a593Smuzhiyun 					? SENSOR_MT9V111_1
6593*4882a593Smuzhiyun 					: SENSOR_MT9V111_3;
6594*4882a593Smuzhiyun 			break;
6595*4882a593Smuzhiyun 		case 0x14:
6596*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE,
6597*4882a593Smuzhiyun 				  "Find Sensor CS2102K?. Chip revision %x\n",
6598*4882a593Smuzhiyun 				  sd->chip_revision);
6599*4882a593Smuzhiyun 			sd->sensor = SENSOR_CS2102K;
6600*4882a593Smuzhiyun 			break;
6601*4882a593Smuzhiyun 		case 0x16:
6602*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor ADCM2700\n");
6603*4882a593Smuzhiyun 			sd->sensor = SENSOR_ADCM2700;
6604*4882a593Smuzhiyun 			break;
6605*4882a593Smuzhiyun 		case 0x29:
6606*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor GC0305\n");
6607*4882a593Smuzhiyun 			sd->sensor = SENSOR_GC0305;
6608*4882a593Smuzhiyun 			break;
6609*4882a593Smuzhiyun 		case 0x0303:
6610*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Sensor GC0303\n");
6611*4882a593Smuzhiyun 			sd->sensor =  SENSOR_GC0303;
6612*4882a593Smuzhiyun 			break;
6613*4882a593Smuzhiyun 		case 0x2030:
6614*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor PO2030\n");
6615*4882a593Smuzhiyun 			sd->sensor = SENSOR_PO2030;
6616*4882a593Smuzhiyun 			break;
6617*4882a593Smuzhiyun 		case 0x7620:
6618*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor OV7620\n");
6619*4882a593Smuzhiyun 			sd->sensor = SENSOR_OV7620;
6620*4882a593Smuzhiyun 			break;
6621*4882a593Smuzhiyun 		case 0x7631:
6622*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor OV7630C\n");
6623*4882a593Smuzhiyun 			sd->sensor = SENSOR_OV7630C;
6624*4882a593Smuzhiyun 			break;
6625*4882a593Smuzhiyun 		case 0x7648:
6626*4882a593Smuzhiyun 			gspca_dbg(gspca_dev, D_PROBE, "Find Sensor OV7648\n");
6627*4882a593Smuzhiyun 			sd->sensor = SENSOR_OV7620;	/* same sensor (?) */
6628*4882a593Smuzhiyun 			break;
6629*4882a593Smuzhiyun 		default:
6630*4882a593Smuzhiyun 			pr_err("Unknown sensor %04x\n", sensor);
6631*4882a593Smuzhiyun 			return -EINVAL;
6632*4882a593Smuzhiyun 		}
6633*4882a593Smuzhiyun 	}
6634*4882a593Smuzhiyun 	if (sensor < 0x20) {
6635*4882a593Smuzhiyun 		if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
6636*4882a593Smuzhiyun 			reg_w(gspca_dev, 0x02, 0x0010);
6637*4882a593Smuzhiyun 		reg_r(gspca_dev, 0x0010);
6638*4882a593Smuzhiyun 	}
6639*4882a593Smuzhiyun 
6640*4882a593Smuzhiyun 	cam = &gspca_dev->cam;
6641*4882a593Smuzhiyun 	switch (mode_tb[sd->sensor]) {
6642*4882a593Smuzhiyun 	case 0:
6643*4882a593Smuzhiyun 		cam->cam_mode = sif_mode;
6644*4882a593Smuzhiyun 		cam->nmodes = ARRAY_SIZE(sif_mode);
6645*4882a593Smuzhiyun 		break;
6646*4882a593Smuzhiyun 	case 1:
6647*4882a593Smuzhiyun 		cam->cam_mode = vga_mode;
6648*4882a593Smuzhiyun 		cam->nmodes = ARRAY_SIZE(vga_mode);
6649*4882a593Smuzhiyun 		break;
6650*4882a593Smuzhiyun 	default:
6651*4882a593Smuzhiyun /*	case 2: */
6652*4882a593Smuzhiyun 		cam->cam_mode = broken_vga_mode;
6653*4882a593Smuzhiyun 		cam->nmodes = ARRAY_SIZE(broken_vga_mode);
6654*4882a593Smuzhiyun 		break;
6655*4882a593Smuzhiyun 	}
6656*4882a593Smuzhiyun 
6657*4882a593Smuzhiyun 	/* switch off the led */
6658*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x01, 0x0000);
6659*4882a593Smuzhiyun 	return gspca_dev->usb_err;
6660*4882a593Smuzhiyun }
6661*4882a593Smuzhiyun 
sd_pre_start(struct gspca_dev * gspca_dev)6662*4882a593Smuzhiyun static int sd_pre_start(struct gspca_dev *gspca_dev)
6663*4882a593Smuzhiyun {
6664*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6665*4882a593Smuzhiyun 	gspca_dev->cam.needs_full_bandwidth = (sd->reg08 >= 4) ? 1 : 0;
6666*4882a593Smuzhiyun 	return 0;
6667*4882a593Smuzhiyun }
6668*4882a593Smuzhiyun 
sd_start(struct gspca_dev * gspca_dev)6669*4882a593Smuzhiyun static int sd_start(struct gspca_dev *gspca_dev)
6670*4882a593Smuzhiyun {
6671*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6672*4882a593Smuzhiyun 	int mode;
6673*4882a593Smuzhiyun 	static const struct usb_action *init_tb[SENSOR_MAX][2] = {
6674*4882a593Smuzhiyun 	[SENSOR_ADCM2700] =
6675*4882a593Smuzhiyun 			{adcm2700_Initial, adcm2700_InitialScale},
6676*4882a593Smuzhiyun 	[SENSOR_CS2102]	=
6677*4882a593Smuzhiyun 			{cs2102_Initial, cs2102_InitialScale},
6678*4882a593Smuzhiyun 	[SENSOR_CS2102K] =
6679*4882a593Smuzhiyun 			{cs2102K_Initial, cs2102K_InitialScale},
6680*4882a593Smuzhiyun 	[SENSOR_GC0303] =
6681*4882a593Smuzhiyun 		{gc0303_Initial, gc0303_InitialScale},
6682*4882a593Smuzhiyun 	[SENSOR_GC0305] =
6683*4882a593Smuzhiyun 			{gc0305_Initial, gc0305_InitialScale},
6684*4882a593Smuzhiyun 	[SENSOR_HDCS2020] =
6685*4882a593Smuzhiyun 			{hdcs2020_Initial, hdcs2020_InitialScale},
6686*4882a593Smuzhiyun 	[SENSOR_HV7131B] =
6687*4882a593Smuzhiyun 			{hv7131b_Initial, hv7131b_InitialScale},
6688*4882a593Smuzhiyun 	[SENSOR_HV7131R] =
6689*4882a593Smuzhiyun 			{hv7131r_Initial, hv7131r_InitialScale},
6690*4882a593Smuzhiyun 	[SENSOR_ICM105A] =
6691*4882a593Smuzhiyun 			{icm105a_Initial, icm105a_InitialScale},
6692*4882a593Smuzhiyun 	[SENSOR_MC501CB] =
6693*4882a593Smuzhiyun 			{mc501cb_Initial, mc501cb_InitialScale},
6694*4882a593Smuzhiyun 	[SENSOR_MT9V111_1] =
6695*4882a593Smuzhiyun 			{mt9v111_1_Initial, mt9v111_1_InitialScale},
6696*4882a593Smuzhiyun 	[SENSOR_MT9V111_3] =
6697*4882a593Smuzhiyun 			{mt9v111_3_Initial, mt9v111_3_InitialScale},
6698*4882a593Smuzhiyun 	[SENSOR_OV7620] =
6699*4882a593Smuzhiyun 			{ov7620_Initial, ov7620_InitialScale},
6700*4882a593Smuzhiyun 	[SENSOR_OV7630C] =
6701*4882a593Smuzhiyun 			{ov7630c_Initial, ov7630c_InitialScale},
6702*4882a593Smuzhiyun 	[SENSOR_PAS106] =
6703*4882a593Smuzhiyun 			{pas106b_Initial, pas106b_InitialScale},
6704*4882a593Smuzhiyun 	[SENSOR_PAS202B] =
6705*4882a593Smuzhiyun 			{pas202b_Initial, pas202b_InitialScale},
6706*4882a593Smuzhiyun 	[SENSOR_PB0330] =
6707*4882a593Smuzhiyun 			{pb0330_Initial, pb0330_InitialScale},
6708*4882a593Smuzhiyun 	[SENSOR_PO2030] =
6709*4882a593Smuzhiyun 			{po2030_Initial, po2030_InitialScale},
6710*4882a593Smuzhiyun 	[SENSOR_TAS5130C] =
6711*4882a593Smuzhiyun 			{tas5130c_Initial, tas5130c_InitialScale},
6712*4882a593Smuzhiyun 	};
6713*4882a593Smuzhiyun 
6714*4882a593Smuzhiyun 	/* create the JPEG header */
6715*4882a593Smuzhiyun 	jpeg_define(sd->jpeg_hdr, gspca_dev->pixfmt.height,
6716*4882a593Smuzhiyun 			gspca_dev->pixfmt.width,
6717*4882a593Smuzhiyun 			0x21);		/* JPEG 422 */
6718*4882a593Smuzhiyun 
6719*4882a593Smuzhiyun 	mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
6720*4882a593Smuzhiyun 	switch (sd->sensor) {
6721*4882a593Smuzhiyun 	case SENSOR_HV7131R:
6722*4882a593Smuzhiyun 		zcxx_probeSensor(gspca_dev);
6723*4882a593Smuzhiyun 		break;
6724*4882a593Smuzhiyun 	case SENSOR_PAS106:
6725*4882a593Smuzhiyun 		usb_exchange(gspca_dev, pas106b_Initial_com);
6726*4882a593Smuzhiyun 		break;
6727*4882a593Smuzhiyun 	}
6728*4882a593Smuzhiyun 	usb_exchange(gspca_dev, init_tb[sd->sensor][mode]);
6729*4882a593Smuzhiyun 
6730*4882a593Smuzhiyun 	switch (sd->sensor) {
6731*4882a593Smuzhiyun 	case SENSOR_ADCM2700:
6732*4882a593Smuzhiyun 	case SENSOR_GC0305:
6733*4882a593Smuzhiyun 	case SENSOR_OV7620:
6734*4882a593Smuzhiyun 	case SENSOR_PO2030:
6735*4882a593Smuzhiyun 	case SENSOR_TAS5130C:
6736*4882a593Smuzhiyun 	case SENSOR_GC0303:
6737*4882a593Smuzhiyun /*		msleep(100);			 * ?? */
6738*4882a593Smuzhiyun 		reg_r(gspca_dev, 0x0002);	/* --> 0x40 */
6739*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x09, 0x01ad);	/* (from win traces) */
6740*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x15, 0x01ae);
6741*4882a593Smuzhiyun 		if (sd->sensor == SENSOR_TAS5130C)
6742*4882a593Smuzhiyun 			break;
6743*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x0d, 0x003a);
6744*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x02, 0x003b);
6745*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x00, 0x0038);
6746*4882a593Smuzhiyun 		break;
6747*4882a593Smuzhiyun 	case SENSOR_HV7131R:
6748*4882a593Smuzhiyun 	case SENSOR_PAS202B:
6749*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x03, 0x003b);
6750*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x0c, 0x003a);
6751*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x0b, 0x0039);
6752*4882a593Smuzhiyun 		if (sd->sensor == SENSOR_HV7131R)
6753*4882a593Smuzhiyun 			reg_w(gspca_dev, 0x50, ZC3XX_R11D_GLOBALGAIN);
6754*4882a593Smuzhiyun 		break;
6755*4882a593Smuzhiyun 	}
6756*4882a593Smuzhiyun 
6757*4882a593Smuzhiyun 	setmatrix(gspca_dev);
6758*4882a593Smuzhiyun 	switch (sd->sensor) {
6759*4882a593Smuzhiyun 	case SENSOR_ADCM2700:
6760*4882a593Smuzhiyun 	case SENSOR_OV7620:
6761*4882a593Smuzhiyun 		reg_r(gspca_dev, 0x0008);
6762*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x00, 0x0008);
6763*4882a593Smuzhiyun 		break;
6764*4882a593Smuzhiyun 	case SENSOR_PAS202B:
6765*4882a593Smuzhiyun 	case SENSOR_GC0305:
6766*4882a593Smuzhiyun 	case SENSOR_HV7131R:
6767*4882a593Smuzhiyun 	case SENSOR_TAS5130C:
6768*4882a593Smuzhiyun 		reg_r(gspca_dev, 0x0008);
6769*4882a593Smuzhiyun 		fallthrough;
6770*4882a593Smuzhiyun 	case SENSOR_PO2030:
6771*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x03, 0x0008);
6772*4882a593Smuzhiyun 		break;
6773*4882a593Smuzhiyun 	}
6774*4882a593Smuzhiyun 	setsharpness(gspca_dev, v4l2_ctrl_g_ctrl(sd->sharpness));
6775*4882a593Smuzhiyun 
6776*4882a593Smuzhiyun 	/* set the gamma tables when not set */
6777*4882a593Smuzhiyun 	switch (sd->sensor) {
6778*4882a593Smuzhiyun 	case SENSOR_CS2102K:		/* gamma set in xxx_Initial */
6779*4882a593Smuzhiyun 	case SENSOR_HDCS2020:
6780*4882a593Smuzhiyun 	case SENSOR_OV7630C:
6781*4882a593Smuzhiyun 		break;
6782*4882a593Smuzhiyun 	default:
6783*4882a593Smuzhiyun 		setcontrast(gspca_dev, v4l2_ctrl_g_ctrl(sd->gamma),
6784*4882a593Smuzhiyun 				v4l2_ctrl_g_ctrl(sd->brightness),
6785*4882a593Smuzhiyun 				v4l2_ctrl_g_ctrl(sd->contrast));
6786*4882a593Smuzhiyun 		break;
6787*4882a593Smuzhiyun 	}
6788*4882a593Smuzhiyun 	setmatrix(gspca_dev);			/* one more time? */
6789*4882a593Smuzhiyun 	switch (sd->sensor) {
6790*4882a593Smuzhiyun 	case SENSOR_OV7620:
6791*4882a593Smuzhiyun 	case SENSOR_PAS202B:
6792*4882a593Smuzhiyun 		reg_r(gspca_dev, 0x0180);	/* from win */
6793*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x00, 0x0180);
6794*4882a593Smuzhiyun 		break;
6795*4882a593Smuzhiyun 	}
6796*4882a593Smuzhiyun 	setquality(gspca_dev);
6797*4882a593Smuzhiyun 	/* Start with BRC disabled, transfer_update will enable it if needed */
6798*4882a593Smuzhiyun 	reg_w(gspca_dev, 0x00, 0x0007);
6799*4882a593Smuzhiyun 	if (sd->plfreq)
6800*4882a593Smuzhiyun 		setlightfreq(gspca_dev, v4l2_ctrl_g_ctrl(sd->plfreq));
6801*4882a593Smuzhiyun 
6802*4882a593Smuzhiyun 	switch (sd->sensor) {
6803*4882a593Smuzhiyun 	case SENSOR_ADCM2700:
6804*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x09, 0x01ad);	/* (from win traces) */
6805*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x15, 0x01ae);
6806*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x02, 0x0180);
6807*4882a593Smuzhiyun 						/* ms-win + */
6808*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x40, 0x0117);
6809*4882a593Smuzhiyun 		break;
6810*4882a593Smuzhiyun 	case SENSOR_HV7131R:
6811*4882a593Smuzhiyun 		setexposure(gspca_dev, v4l2_ctrl_g_ctrl(sd->exposure));
6812*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN);
6813*4882a593Smuzhiyun 		break;
6814*4882a593Smuzhiyun 	case SENSOR_GC0305:
6815*4882a593Smuzhiyun 	case SENSOR_TAS5130C:
6816*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x09, 0x01ad);	/* (from win traces) */
6817*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x15, 0x01ae);
6818*4882a593Smuzhiyun 		fallthrough;
6819*4882a593Smuzhiyun 	case SENSOR_PAS202B:
6820*4882a593Smuzhiyun 	case SENSOR_PO2030:
6821*4882a593Smuzhiyun /*		reg_w(gspca_dev, 0x40, ZC3XX_R117_GGAIN); in win traces */
6822*4882a593Smuzhiyun 		reg_r(gspca_dev, 0x0180);
6823*4882a593Smuzhiyun 		break;
6824*4882a593Smuzhiyun 	case SENSOR_OV7620:
6825*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x09, 0x01ad);
6826*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x15, 0x01ae);
6827*4882a593Smuzhiyun 		i2c_read(gspca_dev, 0x13);	/*fixme: returns 0xa3 */
6828*4882a593Smuzhiyun 		i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
6829*4882a593Smuzhiyun 					/*fixme: returned value to send? */
6830*4882a593Smuzhiyun 		reg_w(gspca_dev, 0x40, 0x0117);
6831*4882a593Smuzhiyun 		reg_r(gspca_dev, 0x0180);
6832*4882a593Smuzhiyun 		break;
6833*4882a593Smuzhiyun 	}
6834*4882a593Smuzhiyun 
6835*4882a593Smuzhiyun 	setautogain(gspca_dev, v4l2_ctrl_g_ctrl(sd->autogain));
6836*4882a593Smuzhiyun 
6837*4882a593Smuzhiyun 	if (gspca_dev->usb_err < 0)
6838*4882a593Smuzhiyun 		return gspca_dev->usb_err;
6839*4882a593Smuzhiyun 
6840*4882a593Smuzhiyun 	/* Start the transfer parameters update thread */
6841*4882a593Smuzhiyun 	schedule_work(&sd->work);
6842*4882a593Smuzhiyun 
6843*4882a593Smuzhiyun 	return 0;
6844*4882a593Smuzhiyun }
6845*4882a593Smuzhiyun 
6846*4882a593Smuzhiyun /* called on streamoff with alt==0 and on disconnect */
6847*4882a593Smuzhiyun /* the usb_lock is held at entry - restore on exit */
sd_stop0(struct gspca_dev * gspca_dev)6848*4882a593Smuzhiyun static void sd_stop0(struct gspca_dev *gspca_dev)
6849*4882a593Smuzhiyun {
6850*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6851*4882a593Smuzhiyun 
6852*4882a593Smuzhiyun 	mutex_unlock(&gspca_dev->usb_lock);
6853*4882a593Smuzhiyun 	flush_work(&sd->work);
6854*4882a593Smuzhiyun 	mutex_lock(&gspca_dev->usb_lock);
6855*4882a593Smuzhiyun 	if (!gspca_dev->present)
6856*4882a593Smuzhiyun 		return;
6857*4882a593Smuzhiyun 	send_unknown(gspca_dev, sd->sensor);
6858*4882a593Smuzhiyun }
6859*4882a593Smuzhiyun 
sd_pkt_scan(struct gspca_dev * gspca_dev,u8 * data,int len)6860*4882a593Smuzhiyun static void sd_pkt_scan(struct gspca_dev *gspca_dev,
6861*4882a593Smuzhiyun 			u8 *data,
6862*4882a593Smuzhiyun 			int len)
6863*4882a593Smuzhiyun {
6864*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6865*4882a593Smuzhiyun 
6866*4882a593Smuzhiyun 	/* check the JPEG end of frame */
6867*4882a593Smuzhiyun 	if (len >= 3
6868*4882a593Smuzhiyun 	 && data[len - 3] == 0xff && data[len - 2] == 0xd9) {
6869*4882a593Smuzhiyun /*fixme: what does the last byte mean?*/
6870*4882a593Smuzhiyun 		gspca_frame_add(gspca_dev, LAST_PACKET,
6871*4882a593Smuzhiyun 					data, len - 1);
6872*4882a593Smuzhiyun 		return;
6873*4882a593Smuzhiyun 	}
6874*4882a593Smuzhiyun 
6875*4882a593Smuzhiyun 	/* check the JPEG start of a frame */
6876*4882a593Smuzhiyun 	if (data[0] == 0xff && data[1] == 0xd8) {
6877*4882a593Smuzhiyun 		/* put the JPEG header in the new frame */
6878*4882a593Smuzhiyun 		gspca_frame_add(gspca_dev, FIRST_PACKET,
6879*4882a593Smuzhiyun 			sd->jpeg_hdr, JPEG_HDR_SZ);
6880*4882a593Smuzhiyun 
6881*4882a593Smuzhiyun 		/* remove the webcam's header:
6882*4882a593Smuzhiyun 		 * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
6883*4882a593Smuzhiyun 		 *	- 'ss ss' is the frame sequence number (BE)
6884*4882a593Smuzhiyun 		 *	- 'ww ww' and 'hh hh' are the window dimensions (BE)
6885*4882a593Smuzhiyun 		 *	- 'pp pp' is the packet sequence number (BE)
6886*4882a593Smuzhiyun 		 */
6887*4882a593Smuzhiyun 		data += 18;
6888*4882a593Smuzhiyun 		len -= 18;
6889*4882a593Smuzhiyun 	}
6890*4882a593Smuzhiyun 	gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
6891*4882a593Smuzhiyun }
6892*4882a593Smuzhiyun 
sd_set_jcomp(struct gspca_dev * gspca_dev,const struct v4l2_jpegcompression * jcomp)6893*4882a593Smuzhiyun static int sd_set_jcomp(struct gspca_dev *gspca_dev,
6894*4882a593Smuzhiyun 			const struct v4l2_jpegcompression *jcomp)
6895*4882a593Smuzhiyun {
6896*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6897*4882a593Smuzhiyun 
6898*4882a593Smuzhiyun 	return v4l2_ctrl_s_ctrl(sd->jpegqual, jcomp->quality);
6899*4882a593Smuzhiyun }
6900*4882a593Smuzhiyun 
sd_get_jcomp(struct gspca_dev * gspca_dev,struct v4l2_jpegcompression * jcomp)6901*4882a593Smuzhiyun static int sd_get_jcomp(struct gspca_dev *gspca_dev,
6902*4882a593Smuzhiyun 			struct v4l2_jpegcompression *jcomp)
6903*4882a593Smuzhiyun {
6904*4882a593Smuzhiyun 	struct sd *sd = (struct sd *) gspca_dev;
6905*4882a593Smuzhiyun 
6906*4882a593Smuzhiyun 	memset(jcomp, 0, sizeof *jcomp);
6907*4882a593Smuzhiyun 	jcomp->quality = v4l2_ctrl_g_ctrl(sd->jpegqual);
6908*4882a593Smuzhiyun 	jcomp->jpeg_markers = V4L2_JPEG_MARKER_DHT
6909*4882a593Smuzhiyun 			| V4L2_JPEG_MARKER_DQT;
6910*4882a593Smuzhiyun 	return 0;
6911*4882a593Smuzhiyun }
6912*4882a593Smuzhiyun 
6913*4882a593Smuzhiyun #if IS_ENABLED(CONFIG_INPUT)
sd_int_pkt_scan(struct gspca_dev * gspca_dev,u8 * data,int len)6914*4882a593Smuzhiyun static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
6915*4882a593Smuzhiyun 			u8 *data,		/* interrupt packet data */
6916*4882a593Smuzhiyun 			int len)		/* interrupt packet length */
6917*4882a593Smuzhiyun {
6918*4882a593Smuzhiyun 	if (len == 8 && data[4] == 1) {
6919*4882a593Smuzhiyun 		input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
6920*4882a593Smuzhiyun 		input_sync(gspca_dev->input_dev);
6921*4882a593Smuzhiyun 		input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
6922*4882a593Smuzhiyun 		input_sync(gspca_dev->input_dev);
6923*4882a593Smuzhiyun 	}
6924*4882a593Smuzhiyun 
6925*4882a593Smuzhiyun 	return 0;
6926*4882a593Smuzhiyun }
6927*4882a593Smuzhiyun #endif
6928*4882a593Smuzhiyun 
6929*4882a593Smuzhiyun static const struct sd_desc sd_desc = {
6930*4882a593Smuzhiyun 	.name = KBUILD_MODNAME,
6931*4882a593Smuzhiyun 	.config = sd_config,
6932*4882a593Smuzhiyun 	.init = sd_init,
6933*4882a593Smuzhiyun 	.init_controls = sd_init_controls,
6934*4882a593Smuzhiyun 	.isoc_init = sd_pre_start,
6935*4882a593Smuzhiyun 	.start = sd_start,
6936*4882a593Smuzhiyun 	.stop0 = sd_stop0,
6937*4882a593Smuzhiyun 	.pkt_scan = sd_pkt_scan,
6938*4882a593Smuzhiyun 	.get_jcomp = sd_get_jcomp,
6939*4882a593Smuzhiyun 	.set_jcomp = sd_set_jcomp,
6940*4882a593Smuzhiyun #if IS_ENABLED(CONFIG_INPUT)
6941*4882a593Smuzhiyun 	.int_pkt_scan = sd_int_pkt_scan,
6942*4882a593Smuzhiyun #endif
6943*4882a593Smuzhiyun };
6944*4882a593Smuzhiyun 
6945*4882a593Smuzhiyun static const struct usb_device_id device_table[] = {
6946*4882a593Smuzhiyun 	{USB_DEVICE(0x03f0, 0x1b07)},
6947*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x041e)},
6948*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x4017)},
6949*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
6950*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x401e)},
6951*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x401f)},
6952*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x4022)},
6953*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x4029)},
6954*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
6955*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
6956*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x4036)},
6957*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x403a)},
6958*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_GC0303},
6959*4882a593Smuzhiyun 	{USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_GC0303},
6960*4882a593Smuzhiyun 	{USB_DEVICE(0x0458, 0x7007)},
6961*4882a593Smuzhiyun 	{USB_DEVICE(0x0458, 0x700c)},
6962*4882a593Smuzhiyun 	{USB_DEVICE(0x0458, 0x700f)},
6963*4882a593Smuzhiyun 	{USB_DEVICE(0x0461, 0x0a00)},
6964*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
6965*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08a0)},
6966*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08a1)},
6967*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08a2)},
6968*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08a3)},
6969*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08a6)},
6970*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08a7)},
6971*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08a9)},
6972*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08aa)},
6973*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08ac)},
6974*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08ad)},
6975*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08ae)},
6976*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08af)},
6977*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08b9)},
6978*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08d7)},
6979*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08d8)},
6980*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08d9)},
6981*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08da)},
6982*4882a593Smuzhiyun 	{USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
6983*4882a593Smuzhiyun 	{USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
6984*4882a593Smuzhiyun 	{USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
6985*4882a593Smuzhiyun 	{USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
6986*4882a593Smuzhiyun 	{USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
6987*4882a593Smuzhiyun 	{USB_DEVICE(0x055f, 0xc005)},
6988*4882a593Smuzhiyun 	{USB_DEVICE(0x055f, 0xd003)},
6989*4882a593Smuzhiyun 	{USB_DEVICE(0x055f, 0xd004)},
6990*4882a593Smuzhiyun 	{USB_DEVICE(0x0698, 0x2003)},
6991*4882a593Smuzhiyun 	{USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
6992*4882a593Smuzhiyun 	{USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},
6993*4882a593Smuzhiyun 	{USB_DEVICE(0x0ac8, 0x301b)},
6994*4882a593Smuzhiyun 	{USB_DEVICE(0x0ac8, 0x303b)},
6995*4882a593Smuzhiyun 	{USB_DEVICE(0x0ac8, 0x305b)},
6996*4882a593Smuzhiyun 	{USB_DEVICE(0x0ac8, 0x307b)},
6997*4882a593Smuzhiyun 	{USB_DEVICE(0x10fd, 0x0128)},
6998*4882a593Smuzhiyun 	{USB_DEVICE(0x10fd, 0x804d)},
6999*4882a593Smuzhiyun 	{USB_DEVICE(0x10fd, 0x8050)},
7000*4882a593Smuzhiyun 	{}			/* end of entry */
7001*4882a593Smuzhiyun };
7002*4882a593Smuzhiyun MODULE_DEVICE_TABLE(usb, device_table);
7003*4882a593Smuzhiyun 
7004*4882a593Smuzhiyun /* -- device connect -- */
sd_probe(struct usb_interface * intf,const struct usb_device_id * id)7005*4882a593Smuzhiyun static int sd_probe(struct usb_interface *intf,
7006*4882a593Smuzhiyun 			const struct usb_device_id *id)
7007*4882a593Smuzhiyun {
7008*4882a593Smuzhiyun 	return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
7009*4882a593Smuzhiyun 				THIS_MODULE);
7010*4882a593Smuzhiyun }
7011*4882a593Smuzhiyun 
7012*4882a593Smuzhiyun /* USB driver */
7013*4882a593Smuzhiyun static struct usb_driver sd_driver = {
7014*4882a593Smuzhiyun 	.name = KBUILD_MODNAME,
7015*4882a593Smuzhiyun 	.id_table = device_table,
7016*4882a593Smuzhiyun 	.probe = sd_probe,
7017*4882a593Smuzhiyun 	.disconnect = gspca_disconnect,
7018*4882a593Smuzhiyun #ifdef CONFIG_PM
7019*4882a593Smuzhiyun 	.suspend = gspca_suspend,
7020*4882a593Smuzhiyun 	.resume = gspca_resume,
7021*4882a593Smuzhiyun 	.reset_resume = gspca_resume,
7022*4882a593Smuzhiyun #endif
7023*4882a593Smuzhiyun };
7024*4882a593Smuzhiyun 
7025*4882a593Smuzhiyun module_usb_driver(sd_driver);
7026*4882a593Smuzhiyun 
7027*4882a593Smuzhiyun module_param(force_sensor, int, 0644);
7028*4882a593Smuzhiyun MODULE_PARM_DESC(force_sensor,
7029*4882a593Smuzhiyun 	"Force sensor. Only for experts!!!");
7030