zc3xx.c 279.0 KB
Newer Older
1 2 3 4 5
/*
 *	Z-Star/Vimicro zc301/zc302p/vc30x library
 *	Copyright (C) 2004 2005 2006 Michel Xhaard
 *		mxhaard@magic.fr
 *
6
 * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#define MODULE_NAME "zc3xx"

#include "gspca.h"

MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, "
		"Serge A. Suchkov <Serge.A.S@tochka.ru>");
MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
MODULE_LICENSE("GPL");

static int force_sensor = -1;

34
#define QUANT_VAL 1		/* quantization table */
35
#include "jpeg.h"
36
#include "zc3xx-reg.h"
37 38 39 40 41

/* specific webcam descriptor */
struct sd {
	struct gspca_dev gspca_dev;	/* !! must be the first item */

42 43 44 45 46 47
	__u8 brightness;
	__u8 contrast;
	__u8 gamma;
	__u8 autogain;
	__u8 lightfreq;
	__u8 sharpness;
48

49
	signed char sensor;		/* Type of image sensor chip */
50
/* !! values used in different tables */
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#define SENSOR_ADCM2700 0
#define SENSOR_CS2102 1
#define SENSOR_CS2102K 2
#define SENSOR_GC0305 3
#define SENSOR_HDCS2020b 4
#define SENSOR_HV7131B 5
#define SENSOR_HV7131C 6
#define SENSOR_ICM105A 7
#define SENSOR_MC501CB 8
#define SENSOR_OV7620 9
/*#define SENSOR_OV7648 9 - same values */
#define SENSOR_OV7630C 10
#define SENSOR_PAS106 11
#define SENSOR_PAS202B 12
#define SENSOR_PB0330 13
#define SENSOR_PO2030 14
#define SENSOR_TAS5130CK 15
#define SENSOR_TAS5130CXX 16
#define SENSOR_TAS5130C_VF0250 17
#define SENSOR_MAX 18
71 72 73 74 75 76 77 78 79 80
	unsigned short chip_revision;
};

/* V4L2 controls supported by the driver */
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
81
static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val);
82
static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val);
83 84 85 86
static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
87 88

static struct ctrl sd_ctrls[] = {
89
#define BRIGHTNESS_IDX 0
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
#define SD_BRIGHTNESS 0
	{
	    {
		.id      = V4L2_CID_BRIGHTNESS,
		.type    = V4L2_CTRL_TYPE_INTEGER,
		.name    = "Brightness",
		.minimum = 0,
		.maximum = 255,
		.step    = 1,
		.default_value = 128,
	    },
	    .set = sd_setbrightness,
	    .get = sd_getbrightness,
	},
#define SD_CONTRAST 1
	{
	    {
		.id      = V4L2_CID_CONTRAST,
		.type    = V4L2_CTRL_TYPE_INTEGER,
		.name    = "Contrast",
		.minimum = 0,
		.maximum = 256,
		.step    = 1,
		.default_value = 128,
	    },
	    .set = sd_setcontrast,
	    .get = sd_getcontrast,
	},
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
#define SD_GAMMA 2
	{
	    {
		.id      = V4L2_CID_GAMMA,
		.type    = V4L2_CTRL_TYPE_INTEGER,
		.name    = "Gamma",
		.minimum = 1,
		.maximum = 6,
		.step    = 1,
		.default_value = 4,
	    },
	    .set = sd_setgamma,
	    .get = sd_getgamma,
	},
#define SD_AUTOGAIN 3
133 134 135 136 137 138 139 140 141 142 143 144 145
	{
	    {
		.id      = V4L2_CID_AUTOGAIN,
		.type    = V4L2_CTRL_TYPE_BOOLEAN,
		.name    = "Auto Gain",
		.minimum = 0,
		.maximum = 1,
		.step    = 1,
		.default_value = 1,
	    },
	    .set = sd_setautogain,
	    .get = sd_getautogain,
	},
146
#define LIGHTFREQ_IDX 4
147
#define SD_FREQ 4
148 149
	{
	    {
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
		.id	 = V4L2_CID_POWER_LINE_FREQUENCY,
		.type    = V4L2_CTRL_TYPE_MENU,
		.name    = "Light frequency filter",
		.minimum = 0,
		.maximum = 2,	/* 0: 0, 1: 50Hz, 2:60Hz */
		.step    = 1,
		.default_value = 1,
	    },
	    .set = sd_setfreq,
	    .get = sd_getfreq,
	},
#define SD_SHARPNESS 5
	{
	    {
		.id	 = V4L2_CID_SHARPNESS,
165
		.type    = V4L2_CTRL_TYPE_INTEGER,
166 167 168
		.name    = "Sharpness",
		.minimum = 0,
		.maximum = 3,
169
		.step    = 1,
170
		.default_value = 2,
171
	    },
172 173
	    .set = sd_setsharpness,
	    .get = sd_getsharpness,
174 175 176
	},
};

177
static const struct v4l2_pix_format vga_mode[] = {
178 179 180 181 182 183 184 185 186 187
	{320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 320,
		.sizeimage = 320 * 240 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 1},
	{640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 640,
		.sizeimage = 640 * 480 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 0},
188 189
};

190
static const struct v4l2_pix_format sif_mode[] = {
191 192 193 194 195 196 197 198 199 200
	{176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 176,
		.sizeimage = 176 * 144 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 1},
	{352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 352,
		.sizeimage = 352 * 288 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 0},
201 202 203 204 205 206 207 208 209
};

/* usb exchanges */
struct usb_action {
	__u8	req;
	__u8	val;
	__u16	idx;
};

210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
static const struct usb_action adcm2700_Initial[] = {
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc */
	{0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},		/* 00,02,04,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},		/* 00,08,03,cc */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,d3,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
	{0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,d8,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,00,cc */
	{0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,de,cc */
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,86,cc */
	{0xbb, 0x00, 0x0400},				/* 04,00,00,bb */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xbb, 0x0f, 0x140f},				/* 14,0f,0f,bb */
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,37,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},		/* 01,89,06,cc */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc */
	{0xa0, 0x58, ZC3XX_R116_RGAIN},			/* 01,16,58,cc */
	{0xa0, 0x5a, ZC3XX_R118_BGAIN},			/* 01,18,5a,cc */
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,02,cc */
	{0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,d3,cc */
	{0xbb, 0x00, 0x0408},				/* 04,00,08,bb */
	{0xdd, 0x00, 0x0200},				/* 00,02,00,dd */
	{0xbb, 0x00, 0x0400},				/* 04,00,00,bb */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xbb, 0x0f, 0x140f},				/* 14,0f,0f,bb */
	{0xbb, 0xe0, 0x0c2e},				/* 0c,e0,2e,bb */
	{0xbb, 0x01, 0x2000},				/* 20,01,00,bb */
	{0xbb, 0x96, 0x2400},				/* 24,96,00,bb */
	{0xbb, 0x06, 0x1006},				/* 10,06,06,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xbb, 0x5f, 0x2090},				/* 20,5f,90,bb */
	{0xbb, 0x01, 0x8000},				/* 80,01,00,bb */
	{0xbb, 0x09, 0x8400},				/* 84,09,00,bb */
	{0xbb, 0x86, 0x0002},				/* 00,86,02,bb */
	{0xbb, 0xe6, 0x0401},				/* 04,e6,01,bb */
	{0xbb, 0x86, 0x0802},				/* 08,86,02,bb */
	{0xbb, 0xe6, 0x0c01},				/* 0c,e6,01,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xaa, 0xfe, 0x0000},				/* 00,fe,00,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0020},				/* 00,fe,20,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xaa, 0xfe, 0x0000},				/* 00,fe,00,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xbb, 0x04, 0x0400},				/* 04,04,00,bb */
	{0xdd, 0x00, 0x0100},				/* 00,01,00,dd */
	{0xbb, 0x01, 0x0400},				/* 04,01,00,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xbb, 0x41, 0x2803},				/* 28,41,03,bb */
	{0xbb, 0x40, 0x2c03},				/* 2c,40,03,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
	{}
};
static const struct usb_action adcm2700_InitialScale[] = {
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc */
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},		/* 00,02,10,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},		/* 00,08,03,cc */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,d3,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
	{0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,d0,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,00,cc */
	{0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,d8,cc */
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,88,cc */
	{0xbb, 0x00, 0x0400},				/* 04,00,00,bb */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xbb, 0x0f, 0x140f},				/* 14,0f,0f,bb */
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,37,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},		/* 01,89,06,cc */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc */
	{0xa0, 0x58, ZC3XX_R116_RGAIN},			/* 01,16,58,cc */
	{0xa0, 0x5a, ZC3XX_R118_BGAIN},			/* 01,18,5a,cc */
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,02,cc */
	{0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,d3,cc */
	{0xbb, 0x00, 0x0408},				/* 04,00,08,bb */
	{0xdd, 0x00, 0x0200},				/* 00,02,00,dd */
	{0xbb, 0x00, 0x0400},				/* 04,00,00,bb */
	{0xdd, 0x00, 0x0050},				/* 00,00,50,dd */
	{0xbb, 0x0f, 0x140f},				/* 14,0f,0f,bb */
	{0xbb, 0xe0, 0x0c2e},				/* 0c,e0,2e,bb */
	{0xbb, 0x01, 0x2000},				/* 20,01,00,bb */
	{0xbb, 0x96, 0x2400},				/* 24,96,00,bb */
	{0xbb, 0x06, 0x1006},				/* 10,06,06,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xbb, 0x5f, 0x2090},				/* 20,5f,90,bb */
	{0xbb, 0x01, 0x8000},				/* 80,01,00,bb */
	{0xbb, 0x09, 0x8400},				/* 84,09,00,bb */
	{0xbb, 0x88, 0x0002},				/* 00,88,02,bb */
	{0xbb, 0xe6, 0x0401},				/* 04,e6,01,bb */
	{0xbb, 0x88, 0x0802},				/* 08,88,02,bb */
	{0xbb, 0xe6, 0x0c01},				/* 0c,e6,01,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xaa, 0xfe, 0x0000},				/* 00,fe,00,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0020},				/* 00,fe,20,aa */
	/*******/
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xaa, 0xfe, 0x0000},				/* 00,fe,00,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xdd, 0x00, 0x0010},				/* 00,00,10,dd */
	{0xbb, 0x04, 0x0400},				/* 04,04,00,bb */
	{0xdd, 0x00, 0x0100},				/* 00,01,00,dd */
	{0xbb, 0x01, 0x0400},				/* 04,01,00,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xbb, 0x41, 0x2803},				/* 28,41,03,bb */
	{0xbb, 0x40, 0x2c03},				/* 2c,40,03,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
	{}
};
static const struct usb_action adcm2700_50HZ[] = {
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xbb, 0x05, 0x8400},				/* 84,05,00,bb */
	{0xbb, 0xd0, 0xb007},				/* b0,d0,07,bb */
	{0xbb, 0xa0, 0xb80f},				/* b8,a0,0f,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
	{0xaa, 0x26, 0x00d0},				/* 00,26,d0,aa */
	{0xaa, 0x28, 0x0002},				/* 00,28,02,aa */
	{}
};
static const struct usb_action adcm2700_60HZ[] = {
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xbb, 0x07, 0x8400},				/* 84,07,00,bb */
	{0xbb, 0x82, 0xb006},				/* b0,82,06,bb */
	{0xbb, 0x04, 0xb80d},				/* b8,04,0d,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
	{0xaa, 0x26, 0x0057},				/* 00,26,57,aa */
	{0xaa, 0x28, 0x0002},				/* 00,28,02,aa */
	{}
};
static const struct usb_action adcm2700_NoFliker[] = {
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0002},				/* 00,fe,02,aa */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0a,cc */
	{0xbb, 0x07, 0x8400},				/* 84,07,00,bb */
	{0xbb, 0x05, 0xb000},				/* b0,05,00,bb */
	{0xbb, 0xa0, 0xb801},				/* b8,a0,01,bb */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xaa, 0xfe, 0x0010},				/* 00,fe,10,aa */
	{}
};
408
static const struct usb_action cs2102_Initial[] = {
409 410
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0008},
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
	{0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
	{0xa0, 0x30, ZC3XX_R083_RGAINADDR},
	{0xa0, 0x31, ZC3XX_R084_GGAINADDR},
	{0xa0, 0x32, ZC3XX_R085_BGAINADDR},
	{0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
	{0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
	{0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
435 436 437 438 439 440 441 442 443 444 445 446
	{0xaa, 0x02, 0x0008},
	{0xaa, 0x03, 0x0000},
	{0xaa, 0x11, 0x0000},
	{0xaa, 0x12, 0x0089},
	{0xaa, 0x13, 0x0000},
	{0xaa, 0x14, 0x00e9},
	{0xaa, 0x20, 0x0000},
	{0xaa, 0x22, 0x0000},
	{0xaa, 0x0b, 0x0004},
	{0xaa, 0x30, 0x0030},
	{0xaa, 0x31, 0x0030},
	{0xaa, 0x32, 0x0030},
447 448 449 450 451 452 453
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
454
	{0xa0, 0x10, 0x01ae},
455 456 457
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x68, ZC3XX_R18D_YTARGET},
458 459 460
	{0xa0, 0x00, 0x01ad},
	{0xa1, 0x01, 0x0002},
	{0xa1, 0x01, 0x0008},
461 462
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
463 464 465
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x24, ZC3XX_R120_GAMMA00},	/* gamma 5 */
	{0xa0, 0x44, ZC3XX_R121_GAMMA01},
	{0xa0, 0x64, ZC3XX_R122_GAMMA02},
	{0xa0, 0x84, ZC3XX_R123_GAMMA03},
	{0xa0, 0x9d, ZC3XX_R124_GAMMA04},
	{0xa0, 0xb2, ZC3XX_R125_GAMMA05},
	{0xa0, 0xc4, ZC3XX_R126_GAMMA06},
	{0xa0, 0xd3, ZC3XX_R127_GAMMA07},
	{0xa0, 0xe0, ZC3XX_R128_GAMMA08},
	{0xa0, 0xeb, ZC3XX_R129_GAMMA09},
	{0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x18, ZC3XX_R130_GAMMA10},
	{0xa0, 0x20, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0e, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
	{0xa0, 0x58, ZC3XX_R10E_RGB11},
	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
	{0xa0, 0xf4, ZC3XX_R110_RGB20},
	{0xa0, 0xf4, ZC3XX_R111_RGB21},
	{0xa0, 0x58, ZC3XX_R112_RGB22},
508
	{0xa1, 0x01, 0x0180},
509 510
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
511 512 513 514
	{0xaa, 0x23, 0x0001},
	{0xaa, 0x24, 0x0055},
	{0xaa, 0x25, 0x00cc},
	{0xaa, 0x21, 0x003f},
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529
	{0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
530
	{0xa1, 0x01, 0x0180},
531 532 533 534
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
535
	{}
536 537
};

538
static const struct usb_action cs2102_InitialScale[] = {
539 540
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0008},
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
	{0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
	{0xa0, 0x30, ZC3XX_R083_RGAINADDR},
	{0xa0, 0x31, ZC3XX_R084_GGAINADDR},
	{0xa0, 0x32, ZC3XX_R085_BGAINADDR},
	{0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
	{0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
	{0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
565 566 567 568 569 570 571 572 573 574 575 576
	{0xaa, 0x02, 0x0008},
	{0xaa, 0x03, 0x0000},
	{0xaa, 0x11, 0x0001},
	{0xaa, 0x12, 0x0087},
	{0xaa, 0x13, 0x0001},
	{0xaa, 0x14, 0x00e7},
	{0xaa, 0x20, 0x0000},
	{0xaa, 0x22, 0x0000},
	{0xaa, 0x0b, 0x0004},
	{0xaa, 0x30, 0x0030},
	{0xaa, 0x31, 0x0030},
	{0xaa, 0x32, 0x0030},
577 578 579 580 581 582 583
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
584
	{0xa0, 0x15, 0x01ae},
585 586 587
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x68, ZC3XX_R18D_YTARGET},
588 589 590
	{0xa0, 0x00, 0x01ad},
	{0xa1, 0x01, 0x0002},
	{0xa1, 0x01, 0x0008},
591 592
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
593 594 595
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x24, ZC3XX_R120_GAMMA00},	/* gamma 5 */
	{0xa0, 0x44, ZC3XX_R121_GAMMA01},
	{0xa0, 0x64, ZC3XX_R122_GAMMA02},
	{0xa0, 0x84, ZC3XX_R123_GAMMA03},
	{0xa0, 0x9d, ZC3XX_R124_GAMMA04},
	{0xa0, 0xb2, ZC3XX_R125_GAMMA05},
	{0xa0, 0xc4, ZC3XX_R126_GAMMA06},
	{0xa0, 0xd3, ZC3XX_R127_GAMMA07},
	{0xa0, 0xe0, ZC3XX_R128_GAMMA08},
	{0xa0, 0xeb, ZC3XX_R129_GAMMA09},
	{0xa0, 0xf4, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xfb, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x18, ZC3XX_R130_GAMMA10},
	{0xa0, 0x20, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0e, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
	{0xa0, 0x58, ZC3XX_R10E_RGB11},
	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
	{0xa0, 0xf4, ZC3XX_R110_RGB20},
	{0xa0, 0xf4, ZC3XX_R111_RGB21},
	{0xa0, 0x58, ZC3XX_R112_RGB22},
638
	{0xa1, 0x01, 0x0180},
639 640
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
641 642 643 644
	{0xaa, 0x23, 0x0000},
	{0xaa, 0x24, 0x00aa},
	{0xaa, 0x25, 0x00e6},
	{0xaa, 0x21, 0x003f},
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659
	{0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
660
	{0xa1, 0x01, 0x0180},
661 662 663 664
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
665
	{}
666
};
667
static const struct usb_action cs2102_50HZ[] = {
668
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
669 670 671 672 673 674 675 676
	{0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */
	{0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
	{0xaa, 0x04, 0x00ac}, /* 00,04,ac,aa */
	{0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
	{0xaa, 0x11, 0x00ac}, /* 00,11,ac,aa */
	{0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
	{0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
	{0xaa, 0x1d, 0x00ac}, /* 00,1d,ac,aa */
677 678 679 680 681 682 683 684 685 686 687 688 689
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x42, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,42,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
	{0xa0, 0x8c, ZC3XX_R01D_HSYNC_0}, /* 00,1d,8c,cc */
	{0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
	{0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
690
	{}
691
};
692
static const struct usb_action cs2102_50HZScale[] = {
693
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
694 695 696 697 698 699 700 701
	{0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */
	{0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
	{0xaa, 0x04, 0x00a1}, /* 00,04,a1,aa */
	{0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
	{0xaa, 0x11, 0x00a1}, /* 00,11,a1,aa */
	{0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
	{0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
	{0xaa, 0x1d, 0x00a1}, /* 00,1d,a1,aa */
702 703 704 705 706 707 708 709 710 711 712 713 714
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
	{0xa0, 0xf7, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f7,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
	{0xa0, 0x93, ZC3XX_R01D_HSYNC_0}, /* 00,1d,93,cc */
	{0xa0, 0xb0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,b0,cc */
	{0xa0, 0xd0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,d0,cc */
715
	{}
716
};
717
static const struct usb_action cs2102_60HZ[] = {
718
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
719 720 721 722 723 724 725 726
	{0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */
	{0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
	{0xaa, 0x04, 0x00aa}, /* 00,04,aa,aa */
	{0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
	{0xaa, 0x11, 0x00aa}, /* 00,11,aa,aa */
	{0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
	{0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
	{0xaa, 0x1d, 0x00aa}, /* 00,1d,aa,aa */
727 728 729 730 731 732 733 734 735 736 737 738
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
	{0xa0, 0xe4, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e4,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3a,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
	{0xa0, 0x5d, ZC3XX_R01D_HSYNC_0}, /* 00,1d,5d,cc */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
739
	{0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */
740
	{}
741
};
742
static const struct usb_action cs2102_60HZScale[] = {
743
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
744 745 746 747 748 749 750 751
	{0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */
	{0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
	{0xaa, 0x04, 0x00be}, /* 00,04,be,aa */
	{0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
	{0xaa, 0x11, 0x00be}, /* 00,11,be,aa */
	{0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
	{0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
	{0xaa, 0x1d, 0x00be}, /* 00,1d,be,aa */
752 753 754 755 756 757 758 759 760 761 762 763 764
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
	{0xa0, 0xfc, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,fc,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x69, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,69,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
	{0xa0, 0xb7, ZC3XX_R01D_HSYNC_0}, /* 00,1d,b7,cc */
	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
	{0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
765
	{}
766
};
767
static const struct usb_action cs2102_NoFliker[] = {
768
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
769 770 771 772 773 774 775 776
	{0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
	{0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
	{0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
	{0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
	{0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
	{0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
	{0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
	{0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
777 778 779 780 781 782 783 784 785 786 787 788 789
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
790
	{}
791
};
792
static const struct usb_action cs2102_NoFlikerScale[] = {
793
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
794 795 796 797 798 799 800 801
	{0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */
	{0xaa, 0x03, 0x0005}, /* 00,03,05,aa */
	{0xaa, 0x04, 0x0080}, /* 00,04,80,aa */
	{0xaa, 0x10, 0x0005}, /* 00,10,05,aa */
	{0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
	{0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa */
	{0xaa, 0x1c, 0x0005}, /* 00,1c,05,aa */
	{0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
802 803 804 805 806 807 808 809 810 811 812 813 814
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x3f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,3f,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0x59, ZC3XX_R01D_HSYNC_0}, /* 00,1d,59,cc */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
815
	{}
816 817 818
};

/* CS2102_KOCOM */
819
static const struct usb_action cs2102K_Initial[] = {
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919
	{0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
	{0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
920 921
	{0xa0, 0x00, 0x01ad},
	{0xa0, 0x01, 0x01b1},
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x60, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x4c, ZC3XX_R118_BGAIN},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
	{0xa0, 0x58, ZC3XX_R10E_RGB11},
	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
	{0xa0, 0xf4, ZC3XX_R110_RGB20},
	{0xa0, 0xf4, ZC3XX_R111_RGB21},
	{0xa0, 0x58, ZC3XX_R112_RGB22},
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
	{0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x60, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x4c, ZC3XX_R118_BGAIN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1075
	{}
1076 1077
};

1078
static const struct usb_action cs2102K_InitialScale[] = {
1079
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1096
/*fixme: next sequence = i2c exchanges*/
1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180
	{0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1181 1182
	{0xa0, 0x00, 0x01ad},
	{0xa0, 0x01, 0x01b1},
1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x60, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x4c, ZC3XX_R118_BGAIN},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
	{0xa0, 0x58, ZC3XX_R10E_RGB11},
	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
	{0xa0, 0xf4, ZC3XX_R110_RGB20},
	{0xa0, 0xf4, ZC3XX_R111_RGB21},
	{0xa0, 0x58, ZC3XX_R112_RGB22},
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
	{0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x60, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x4c, ZC3XX_R118_BGAIN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
1336
/*fixme:what does the next sequence?*/
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
1453
	{}
1454 1455
};

1456
static const struct usb_action gc0305_Initial[] = {	/* 640x480 */
1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},	/* 00,00,01,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00,08,03,cc */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},	/* 00,02,04,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},	/* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},	/* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},	/* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},	/* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},	/* 01,1c,00,cc */
	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},	/* 00,9c,e6,cc */
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},	/* 00,9e,86,cc */
	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},	/* 00,8b,98,cc */
1475 1476 1477 1478 1479 1480 1481 1482 1483
	{0xaa, 0x13, 0x0002},	/* 00,13,02,aa */
	{0xaa, 0x15, 0x0003},	/* 00,15,03,aa */
	{0xaa, 0x01, 0x0000},	/* 00,01,00,aa */
	{0xaa, 0x02, 0x0000},	/* 00,02,00,aa */
	{0xaa, 0x1a, 0x0000},	/* 00,1a,00,aa */
	{0xaa, 0x1c, 0x0017},	/* 00,1c,17,aa */
	{0xaa, 0x1d, 0x0080},	/* 00,1d,80,aa */
	{0xaa, 0x1f, 0x0008},	/* 00,1f,08,aa */
	{0xaa, 0x21, 0x0012},	/* 00,21,12,aa */
1484 1485 1486
	{0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},	/* 00,86,82,cc */
	{0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},	/* 00,87,83,cc */
	{0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},	/* 00,88,84,cc */
1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501
	{0xaa, 0x05, 0x0000},	/* 00,05,00,aa */
	{0xaa, 0x0a, 0x0000},	/* 00,0a,00,aa */
	{0xaa, 0x0b, 0x00b0},	/* 00,0b,b0,aa */
	{0xaa, 0x0c, 0x0000},	/* 00,0c,00,aa */
	{0xaa, 0x0d, 0x00b0},	/* 00,0d,b0,aa */
	{0xaa, 0x0e, 0x0000},	/* 00,0e,00,aa */
	{0xaa, 0x0f, 0x00b0},	/* 00,0f,b0,aa */
	{0xaa, 0x10, 0x0000},	/* 00,10,00,aa */
	{0xaa, 0x11, 0x00b0},	/* 00,11,b0,aa */
	{0xaa, 0x16, 0x0001},	/* 00,16,01,aa */
	{0xaa, 0x17, 0x00e6},	/* 00,17,e6,aa */
	{0xaa, 0x18, 0x0002},	/* 00,18,02,aa */
	{0xaa, 0x19, 0x0086},	/* 00,19,86,aa */
	{0xaa, 0x20, 0x0000},	/* 00,20,00,aa */
	{0xaa, 0x1b, 0x0020},	/* 00,1b,20,aa */
1502 1503 1504 1505
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},	/* 01,00,0d,cc */
	{0xa0, 0x76, ZC3XX_R189_AWBSTATUS},	/* 01,89,76,cc */
1506
	{0xa0, 0x09, 0x01ad},	/* 01,ad,09,cc */
1507 1508 1509 1510 1511 1512
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},	/* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},	/* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},	/* 03,01,08,cc */
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},	/* 01,a8,60,cc */
	{0xa0, 0x85, ZC3XX_R18D_YTARGET},	/* 01,8d,85,cc */
1513
	{0xa0, 0x00, 0x011e},	/* 01,1e,00,cc */
1514 1515 1516 1517
	{0xa0, 0x52, ZC3XX_R116_RGAIN},	/* 01,16,52,cc */
	{0xa0, 0x40, ZC3XX_R117_GGAIN},	/* 01,17,40,cc */
	{0xa0, 0x52, ZC3XX_R118_BGAIN},	/* 01,18,52,cc */
	{0xa0, 0x03, ZC3XX_R113_RGB03},	/* 01,13,03,cc */
1518
	{}
1519
};
1520
static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},	/* 00,00,01,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00,08,03,cc */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc */
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},	/* 00,02,10,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},	/* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},	/* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},	/* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},	/* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},	/* 01,1c,00,cc */
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},	/* 00,9c,e8,cc */
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},	/* 00,9e,88,cc */
	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},	/* 00,8b,98,cc */
1539 1540 1541 1542 1543 1544 1545 1546 1547
	{0xaa, 0x13, 0x0000},	/* 00,13,00,aa */
	{0xaa, 0x15, 0x0001},	/* 00,15,01,aa */
	{0xaa, 0x01, 0x0000},	/* 00,01,00,aa */
	{0xaa, 0x02, 0x0000},	/* 00,02,00,aa */
	{0xaa, 0x1a, 0x0000},	/* 00,1a,00,aa */
	{0xaa, 0x1c, 0x0017},	/* 00,1c,17,aa */
	{0xaa, 0x1d, 0x0080},	/* 00,1d,80,aa */
	{0xaa, 0x1f, 0x0008},	/* 00,1f,08,aa */
	{0xaa, 0x21, 0x0012},	/* 00,21,12,aa */
1548 1549 1550
	{0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},	/* 00,86,82,cc */
	{0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},	/* 00,87,83,cc */
	{0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},	/* 00,88,84,cc */
1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565
	{0xaa, 0x05, 0x0000},	/* 00,05,00,aa */
	{0xaa, 0x0a, 0x0000},	/* 00,0a,00,aa */
	{0xaa, 0x0b, 0x00b0},	/* 00,0b,b0,aa */
	{0xaa, 0x0c, 0x0000},	/* 00,0c,00,aa */
	{0xaa, 0x0d, 0x00b0},	/* 00,0d,b0,aa */
	{0xaa, 0x0e, 0x0000},	/* 00,0e,00,aa */
	{0xaa, 0x0f, 0x00b0},	/* 00,0f,b0,aa */
	{0xaa, 0x10, 0x0000},	/* 00,10,00,aa */
	{0xaa, 0x11, 0x00b0},	/* 00,11,b0,aa */
	{0xaa, 0x16, 0x0001},	/* 00,16,01,aa */
	{0xaa, 0x17, 0x00e8},	/* 00,17,e8,aa */
	{0xaa, 0x18, 0x0002},	/* 00,18,02,aa */
	{0xaa, 0x19, 0x0088},	/* 00,19,88,aa */
	{0xaa, 0x20, 0x0000},	/* 00,20,00,aa */
	{0xaa, 0x1b, 0x0020},	/* 00,1b,20,aa */
1566 1567 1568 1569
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},	/* 01,00,0d,cc */
	{0xa0, 0x76, ZC3XX_R189_AWBSTATUS},	/* 01,89,76,cc */
1570
	{0xa0, 0x09, 0x01ad},	/* 01,ad,09,cc */
1571 1572 1573 1574 1575
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},	/* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},	/* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},	/* 03,01,08,cc */
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},	/* 01,a8,60,cc */
1576
	{0xa0, 0x00, 0x011e},	/* 01,1e,00,cc */
1577 1578 1579 1580
	{0xa0, 0x52, ZC3XX_R116_RGAIN},	/* 01,16,52,cc */
	{0xa0, 0x40, ZC3XX_R117_GGAIN},	/* 01,17,40,cc */
	{0xa0, 0x52, ZC3XX_R118_BGAIN},	/* 01,18,52,cc */
	{0xa0, 0x03, ZC3XX_R113_RGB03},	/* 01,13,03,cc */
1581
	{}
1582
};
1583
static const struct usb_action gc0305_50HZ[] = {
1584 1585 1586
	{0xaa, 0x82, 0x0000},	/* 00,82,00,aa */
	{0xaa, 0x83, 0x0002},	/* 00,83,02,aa */
	{0xaa, 0x84, 0x0038},	/* 00,84,38,aa */	/* win: 00,84,ec */
1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0b,cc */
	{0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,18,cc */
							/* win: 01,92,10 */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,8e,cc */
							/* win: 01,97,ec */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0e,cc */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,15,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},	/* 00,1d,62,cc */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},	/* 00,1e,90,cc */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},	/* 00,1f,c8,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},	/* 00,20,ff,cc */
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},	/* 01,1d,60,cc */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc */
/*	{0xa0, 0x85, ZC3XX_R18D_YTARGET},	 * 01,8d,85,cc *
						 * if 640x480 */
1607
	{}
1608
};
1609
static const struct usb_action gc0305_60HZ[] = {
1610 1611 1612
	{0xaa, 0x82, 0x0000},	/* 00,82,00,aa */
	{0xaa, 0x83, 0x0000},	/* 00,83,00,aa */
	{0xaa, 0x84, 0x00ec},	/* 00,84,ec,aa */
1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0b,cc */
	{0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,10,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,ec,cc */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0e,cc */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,15,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},	/* 00,1d,62,cc */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},	/* 00,1e,90,cc */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},	/* 00,1f,c8,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},	/* 00,20,ff,cc */
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},	/* 01,1d,60,cc */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc */
	{0xa0, 0x80, ZC3XX_R18D_YTARGET},	/* 01,8d,80,cc */
1630
	{}
1631 1632
};

1633
static const struct usb_action gc0305_NoFliker[] = {
1634
	{0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},	/* 01,00,0c,cc */
1635 1636 1637
	{0xaa, 0x82, 0x0000},	/* 00,82,00,aa */
	{0xaa, 0x83, 0x0000},	/* 00,83,00,aa */
	{0xaa, 0x84, 0x0020},	/* 00,84,20,aa */
1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,00,cc */
	{0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,48,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,10,cc */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0e,cc */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,15,cc */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},	/* 00,1d,62,cc */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},	/* 00,1e,90,cc */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},	/* 00,1f,c8,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},	/* 00,20,ff,cc */
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},	/* 01,1d,60,cc */
	{0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,03,cc */
	{0xa0, 0x80, ZC3XX_R18D_YTARGET},	/* 01,8d,80,cc */
1653
	{}
1654 1655
};

1656
static const struct usb_action hdcs2020xb_Initial[] = {
1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* qtable 0x05 */
	{0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690
	{0xaa, 0x1c, 0x0000},
	{0xaa, 0x0a, 0x0001},
	{0xaa, 0x0b, 0x0006},
	{0xaa, 0x0c, 0x007b},
	{0xaa, 0x0d, 0x00a7},
	{0xaa, 0x03, 0x00fb},
	{0xaa, 0x05, 0x0000},
	{0xaa, 0x06, 0x0003},
	{0xaa, 0x09, 0x0008},

	{0xaa, 0x0f, 0x0018},	/* set sensor gain */
	{0xaa, 0x10, 0x0018},
	{0xaa, 0x11, 0x0018},
	{0xaa, 0x12, 0x0018},

	{0xaa, 0x15, 0x004e},
	{0xaa, 0x1c, 0x0004},
1691 1692 1693 1694 1695 1696 1697 1698 1699
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x70, ZC3XX_R18D_YTARGET},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1700 1701 1702
	{0xa1, 0x01, 0x0002},
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0180},
1703 1704 1705 1706
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
1707
	{0xa1, 0x01, 0x0008},
1708 1709
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
1710 1711 1712
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},

	{0xa0, 0x66, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xed, ZC3XX_R10B_RGB01},
	{0xa0, 0xed, ZC3XX_R10C_RGB02},
	{0xa0, 0xed, ZC3XX_R10D_RGB10},
	{0xa0, 0x66, ZC3XX_R10E_RGB11},
	{0xa0, 0xed, ZC3XX_R10F_RGB12},
	{0xa0, 0xed, ZC3XX_R110_RGB20},
	{0xa0, 0xed, ZC3XX_R111_RGB21},
	{0xa0, 0x66, ZC3XX_R112_RGB22},
1756 1757

	{0xa1, 0x01, 0x0180},
1758 1759
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1760 1761 1762 1763
	{0xaa, 0x13, 0x0031},
	{0xaa, 0x14, 0x0001},
	{0xaa, 0x0e, 0x0004},
	{0xaa, 0x19, 0x00cd},
1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},

	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 0x14 */
	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0x41, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1781
	{0xa1, 0x01, 0x0180},
1782 1783 1784 1785
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
1786
	{}
1787
};
1788
static const struct usb_action hdcs2020xb_InitialScale[] = {
1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820
	{0xaa, 0x1c, 0x0000},
	{0xaa, 0x0a, 0x0001},
	{0xaa, 0x0b, 0x0006},
	{0xaa, 0x0c, 0x007a},
	{0xaa, 0x0d, 0x00a7},
	{0xaa, 0x03, 0x00fb},
	{0xaa, 0x05, 0x0000},
	{0xaa, 0x06, 0x0003},
	{0xaa, 0x09, 0x0008},
	{0xaa, 0x0f, 0x0018},	/* original setting */
	{0xaa, 0x10, 0x0018},
	{0xaa, 0x11, 0x0018},
	{0xaa, 0x12, 0x0018},
	{0xaa, 0x15, 0x004e},
	{0xaa, 0x1c, 0x0004},
1821 1822 1823 1824 1825 1826 1827 1828 1829
	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x70, ZC3XX_R18D_YTARGET},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1830 1831 1832
	{0xa1, 0x01, 0x0002},
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0180},
1833 1834 1835 1836
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
1837
	{0xa1, 0x01, 0x0008},
1838 1839
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
1840 1841 1842
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x66, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xed, ZC3XX_R10B_RGB01},
	{0xa0, 0xed, ZC3XX_R10C_RGB02},
	{0xa0, 0xed, ZC3XX_R10D_RGB10},
	{0xa0, 0x66, ZC3XX_R10E_RGB11},
	{0xa0, 0xed, ZC3XX_R10F_RGB12},
	{0xa0, 0xed, ZC3XX_R110_RGB20},
	{0xa0, 0xed, ZC3XX_R111_RGB21},
	{0xa0, 0x66, ZC3XX_R112_RGB22},
1885
	{0xa1, 0x01, 0x0180},
1886 1887
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1888 1889 1890 1891 1892
 /**** set exposure ***/
	{0xaa, 0x13, 0x0031},
	{0xaa, 0x14, 0x0001},
	{0xaa, 0x0e, 0x0004},
	{0xaa, 0x19, 0x00cd},
1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0x41, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1909
	{0xa1, 0x01, 0x0180},
1910 1911 1912 1913
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
1914
	{}
1915
};
1916
static const struct usb_action hdcs2020b_50HZ[] = {
1917
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1918 1919 1920 1921
	{0xaa, 0x13, 0x0018},			/* 00,13,18,aa */
	{0xaa, 0x14, 0x0001},			/* 00,14,01,aa */
	{0xaa, 0x0e, 0x0005},			/* 00,0e,05,aa */
	{0xaa, 0x19, 0x001f},			/* 00,19,1f,aa */
1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
	{0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
	{0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
	{0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
	{0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
1935
	{}
1936
};
1937
static const struct usb_action hdcs2020b_60HZ[] = {
1938
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1939 1940 1941 1942
	{0xaa, 0x13, 0x0031},			/* 00,13,31,aa */
	{0xaa, 0x14, 0x0001},			/* 00,14,01,aa */
	{0xaa, 0x0e, 0x0004},			/* 00,0e,04,aa */
	{0xaa, 0x19, 0x00cd},			/* 00,19,cd,aa */
1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
	{0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
	{0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
	{0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
1956
	{}
1957
};
1958
static const struct usb_action hdcs2020b_NoFliker[] = {
1959
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1960 1961 1962 1963
	{0xaa, 0x13, 0x0010},			/* 00,13,10,aa */
	{0xaa, 0x14, 0x0001},			/* 00,14,01,aa */
	{0xaa, 0x0e, 0x0004},			/* 00,0e,04,aa */
	{0xaa, 0x19, 0x0000},			/* 00,19,00,aa */
1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
	{0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
	{0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
	{0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
1977
	{}
1978 1979
};

1980
static const struct usb_action hv7131bxx_Initial[] = {		/* 320x240 */
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
1997 1998 1999 2000 2001 2002 2003
	{0xaa, 0x30, 0x002d},
	{0xaa, 0x01, 0x0005},
	{0xaa, 0x11, 0x0000},
	{0xaa, 0x13, 0x0001},	/* {0xaa, 0x13, 0x0000}, */
	{0xaa, 0x14, 0x0001},
	{0xaa, 0x15, 0x00e8},
	{0xaa, 0x16, 0x0002},
2004
	{0xaa, 0x17, 0x0086},		/* 00,17,88,aa */
2005 2006 2007 2008
	{0xaa, 0x31, 0x0038},
	{0xaa, 0x32, 0x0038},
	{0xaa, 0x33, 0x0038},
	{0xaa, 0x5b, 0x0001},
2009 2010 2011 2012 2013
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x68, ZC3XX_R18D_YTARGET},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2014 2015 2016
	{0xa0, 0x00, 0x01ad},
	{0xa0, 0xc0, 0x019b},
	{0xa0, 0xa0, 0x019c},
2017 2018 2019 2020 2021 2022
	{0xa0, 0x02, ZC3XX_R188_MINGAIN},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2023
	{0xaa, 0x02, 0x0090},			/* 00,02,80,aa */
2024
	{}
2025 2026
};

2027
static const struct usb_action hv7131bxx_InitialScale[] = {	/* 640x480*/
2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055
	{0xaa, 0x30, 0x002d},
	{0xaa, 0x01, 0x0005},
	{0xaa, 0x11, 0x0001},
	{0xaa, 0x13, 0x0000},	/* {0xaa, 0x13, 0x0001}; */
	{0xaa, 0x14, 0x0001},
	{0xaa, 0x15, 0x00e6},
	{0xaa, 0x16, 0x0002},
	{0xaa, 0x17, 0x0086},
	{0xaa, 0x31, 0x0038},
	{0xaa, 0x32, 0x0038},
	{0xaa, 0x33, 0x0038},
	{0xaa, 0x5b, 0x0001},
2056 2057 2058 2059 2060
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x70, ZC3XX_R18D_YTARGET},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
2061 2062 2063
	{0xa0, 0x00, 0x01ad},
	{0xa0, 0xc0, 0x019b},
	{0xa0, 0xa0, 0x019c},
2064 2065 2066 2067 2068 2069
	{0xa0, 0x02, ZC3XX_R188_MINGAIN},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2070
	{0xaa, 0x02, 0x0090},	/* {0xaa, 0x02, 0x0080}, */
2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081
	{}
};
static const struct usb_action hv7131b_50HZ[] = {	/* 640x480*/
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
	{0xaa, 0x25, 0x0007},			/* 00,25,07,aa */
	{0xaa, 0x26, 0x0053},			/* 00,26,53,aa */
	{0xaa, 0x27, 0x0000},			/* 00,27,00,aa */
	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
	{0xaa, 0x21, 0x0050},			/* 00,21,50,aa */
	{0xaa, 0x22, 0x001b},			/* 00,22,1b,aa */
	{0xaa, 0x23, 0x00fc},			/* 00,23,fc,aa */
2082 2083 2084 2085 2086 2087
	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
	{0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,9b,cc */
	{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,80,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,ea,cc */
	{0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,60,cc */
2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106
	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0c,cc */
	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,18,cc */
	{0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,18,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
	{0xa0, 0x50, ZC3XX_R01E_HSYNC_1},	/* 00,1e,50,cc */
	{0xa0, 0x1b, ZC3XX_R01F_HSYNC_2},	/* 00,1f,1b,cc */
	{0xa0, 0xfc, ZC3XX_R020_HSYNC_3},	/* 00,20,fc,cc */
	{}
};
static const struct usb_action hv7131b_50HZScale[] = {	/* 320x240 */
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
	{0xaa, 0x25, 0x0007},			/* 00,25,07,aa */
	{0xaa, 0x26, 0x0053},			/* 00,26,53,aa */
	{0xaa, 0x27, 0x0000},			/* 00,27,00,aa */
	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
	{0xaa, 0x21, 0x0050},			/* 00,21,50,aa */
	{0xaa, 0x22, 0x0012},			/* 00,22,12,aa */
	{0xaa, 0x23, 0x0080},			/* 00,23,80,aa */
2107 2108 2109 2110 2111 2112
	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
	{0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,9b,cc */
	{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,80,cc */
	{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,01,cc */
	{0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,d4,cc */
	{0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,c0,cc */
2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131
	{0xa0, 0x07, ZC3XX_R18C_AEFREEZE},	/* 01,8c,07,cc */
	{0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,0f,cc */
	{0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,18,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
	{0xa0, 0x50, ZC3XX_R01E_HSYNC_1},	/* 00,1e,50,cc */
	{0xa0, 0x12, ZC3XX_R01F_HSYNC_2},	/* 00,1f,12,cc */
	{0xa0, 0x80, ZC3XX_R020_HSYNC_3},	/* 00,20,80,cc */
	{}
};
static const struct usb_action hv7131b_60HZ[] = {	/* 640x480*/
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
	{0xaa, 0x25, 0x0007},			/* 00,25,07,aa */
	{0xaa, 0x26, 0x00a1},			/* 00,26,a1,aa */
	{0xaa, 0x27, 0x0020},			/* 00,27,20,aa */
	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
	{0xaa, 0x21, 0x0040},			/* 00,21,40,aa */
	{0xaa, 0x22, 0x0013},			/* 00,22,13,aa */
	{0xaa, 0x23, 0x004c},			/* 00,23,4c,aa */
2132 2133 2134 2135 2136 2137
	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
	{0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,4d,cc */
	{0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,60,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,c3,cc */
	{0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,50,cc */
2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156
	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},	/* 01,8c,0c,cc */
	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,18,cc */
	{0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,18,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
	{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},	/* 00,1e,40,cc */
	{0xa0, 0x13, ZC3XX_R01F_HSYNC_2},	/* 00,1f,13,cc */
	{0xa0, 0x4c, ZC3XX_R020_HSYNC_3},	/* 00,20,4c,cc */
	{}
};
static const struct usb_action hv7131b_60HZScale[] = {	/* 320x240 */
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
	{0xaa, 0x25, 0x0007},			/* 00,25,07,aa */
	{0xaa, 0x26, 0x00a1},			/* 00,26,a1,aa */
	{0xaa, 0x27, 0x0020},			/* 00,27,20,aa */
	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
	{0xaa, 0x21, 0x00a0},			/* 00,21,a0,aa */
	{0xaa, 0x22, 0x0016},			/* 00,22,16,aa */
	{0xaa, 0x23, 0x0040},			/* 00,23,40,aa */
2157 2158 2159 2160 2161 2162
	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
	{0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,4d,cc */
	{0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,60,cc */
	{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,01,cc */
	{0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,86,cc */
	{0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,a0,cc */
2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181
	{0xa0, 0x07, ZC3XX_R18C_AEFREEZE},	/* 01,8c,07,cc */
	{0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,0f,cc */
	{0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,18,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
	{0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},	/* 00,1e,a0,cc */
	{0xa0, 0x16, ZC3XX_R01F_HSYNC_2},	/* 00,1f,16,cc */
	{0xa0, 0x40, ZC3XX_R020_HSYNC_3},	/* 00,20,40,cc */
	{}
};
static const struct usb_action hv7131b_NoFliker[] = {	/* 640x480*/
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
	{0xaa, 0x25, 0x0003},			/* 00,25,03,aa */
	{0xaa, 0x26, 0x0000},			/* 00,26,00,aa */
	{0xaa, 0x27, 0x0000},			/* 00,27,00,aa */
	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
	{0xaa, 0x21, 0x0010},			/* 00,21,10,aa */
	{0xaa, 0x22, 0x0000},			/* 00,22,00,aa */
	{0xaa, 0x23, 0x0003},			/* 00,23,03,aa */
2182 2183 2184 2185 2186 2187
	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
	{0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,f8,cc */
	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,00,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,02,cc */
	{0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,00,cc */
2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,00,cc */
	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
	{0xa0, 0x10, ZC3XX_R01E_HSYNC_1},	/* 00,1e,10,cc */
	{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},	/* 00,1f,00,cc */
	{0xa0, 0x03, ZC3XX_R020_HSYNC_3},	/* 00,20,03,cc */
	{}
};
static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00,19,00,cc */
	{0xaa, 0x25, 0x0003},			/* 00,25,03,aa */
	{0xaa, 0x26, 0x0000},			/* 00,26,00,aa */
	{0xaa, 0x27, 0x0000},			/* 00,27,00,aa */
	{0xaa, 0x20, 0x0000},			/* 00,20,00,aa */
	{0xaa, 0x21, 0x00a0},			/* 00,21,a0,aa */
	{0xaa, 0x22, 0x0016},			/* 00,22,16,aa */
	{0xaa, 0x23, 0x0040},			/* 00,23,40,aa */
2207 2208 2209 2210 2211 2212
	{0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,2f,cc */
	{0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,f8,cc */
	{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,00,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,02,cc */
	{0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,00,cc */
2213 2214 2215 2216 2217 2218 2219 2220
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,00,cc */
	{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},	/* 00,1d,00,cc */
	{0xa0, 0xa0, ZC3XX_R01E_HSYNC_1},	/* 00,1e,a0,cc */
	{0xa0, 0x16, ZC3XX_R01F_HSYNC_2},	/* 00,1f,16,cc */
	{0xa0, 0x40, ZC3XX_R020_HSYNC_3},	/* 00,20,40,cc */
2221
	{}
2222 2223
};

2224
static const struct usb_action hv7131cxx_Initial[] = {
2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2246 2247 2248 2249 2250 2251 2252 2253
	{0xaa, 0x01, 0x000c},
	{0xaa, 0x11, 0x0000},
	{0xaa, 0x13, 0x0000},
	{0xaa, 0x14, 0x0001},
	{0xaa, 0x15, 0x00e8},
	{0xaa, 0x16, 0x0002},
	{0xaa, 0x17, 0x0088},

2254 2255 2256 2257
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x89, ZC3XX_R18D_YTARGET},
	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2258 2259 2260
	{0xa0, 0x00, 0x01ad},
	{0xa0, 0xc0, 0x019b},
	{0xa0, 0xa0, 0x019c},
2261 2262 2263 2264 2265
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2266
	{0xa1, 0x01, 0x0002},
2267 2268
	{0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2269 2270 2271 2272 2273
	{0xa1, 0x01, 0x0091},
	{0xa1, 0x01, 0x0095},
	{0xa1, 0x01, 0x0096},

	{0xa1, 0x01, 0x0008},
2274 2275
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
2276 2277 2278
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */

	{0xa0, 0x60, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf0, ZC3XX_R10B_RGB01},
	{0xa0, 0xf0, ZC3XX_R10C_RGB02},
	{0xa0, 0xf0, ZC3XX_R10D_RGB10},
	{0xa0, 0x60, ZC3XX_R10E_RGB11},
	{0xa0, 0xf0, ZC3XX_R10F_RGB12},
	{0xa0, 0xf0, ZC3XX_R110_RGB20},
	{0xa0, 0xf0, ZC3XX_R111_RGB21},
	{0xa0, 0x60, ZC3XX_R112_RGB22},
2290
	{0xa1, 0x01, 0x0180},
2291 2292
	{0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2293 2294 2295 2296
	{0xaa, 0x25, 0x0007},
	{0xaa, 0x26, 0x0053},
	{0xaa, 0x27, 0x0000},

2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307
	{0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 2f */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},	/* 9b */
	{0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},	/* 80 */
	{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
2308 2309 2310 2311
	{0xa1, 0x01, 0x001d},
	{0xa1, 0x01, 0x001e},
	{0xa1, 0x01, 0x001f},
	{0xa1, 0x01, 0x0020},
2312
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2313
	{0xa1, 0x01, 0x0180},
2314
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2315
	{}
2316 2317
};

2318
static const struct usb_action hv7131cxx_InitialScale[] = {
2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},

	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},	/* diff */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},

	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},

	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 1e0 */

	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
2344 2345 2346 2347 2348 2349 2350 2351
	{0xaa, 0x01, 0x000c},
	{0xaa, 0x11, 0x0000},
	{0xaa, 0x13, 0x0000},
	{0xaa, 0x14, 0x0001},
	{0xaa, 0x15, 0x00e8},
	{0xaa, 0x16, 0x0002},
	{0xaa, 0x17, 0x0088},

2352
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},	/* 00 */
2353

2354 2355 2356
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x89, ZC3XX_R18D_YTARGET},
	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
2357 2358 2359
	{0xa0, 0x00, 0x01ad},
	{0xa0, 0xc0, 0x019b},
	{0xa0, 0xa0, 0x019c},
2360 2361 2362 2363 2364
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2365
	{0xa1, 0x01, 0x0002},
2366 2367 2368
	{0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
						/* read the i2c chips ident */
	{0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
2369 2370 2371 2372 2373
	{0xa1, 0x01, 0x0091},
	{0xa1, 0x01, 0x0095},
	{0xa1, 0x01, 0x0096},

	{0xa1, 0x01, 0x0008},
2374 2375
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
2376 2377 2378
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */

	{0xa0, 0x60, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf0, ZC3XX_R10B_RGB01},
	{0xa0, 0xf0, ZC3XX_R10C_RGB02},
	{0xa0, 0xf0, ZC3XX_R10D_RGB10},
	{0xa0, 0x60, ZC3XX_R10E_RGB11},
	{0xa0, 0xf0, ZC3XX_R10F_RGB12},
	{0xa0, 0xf0, ZC3XX_R110_RGB20},
	{0xa0, 0xf0, ZC3XX_R111_RGB21},
	{0xa0, 0x60, ZC3XX_R112_RGB22},
2390
	{0xa1, 0x01, 0x0180},
2391 2392
	{0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2393 2394 2395 2396
	{0xaa, 0x25, 0x0007},
	{0xaa, 0x26, 0x0053},
	{0xaa, 0x27, 0x0000},

2397 2398 2399
	{0xa0, 0x10, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 2f */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},	/* 9b */
	{0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW},	/* 80 */
2400

2401 2402 2403
	{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
2404

2405 2406 2407 2408 2409
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x13, ZC3XX_R1AA_DIGITALGAINSTEP},
2410 2411 2412 2413
	{0xa1, 0x01, 0x001d},
	{0xa1, 0x01, 0x001e},
	{0xa1, 0x01, 0x001f},
	{0xa1, 0x01, 0x0020},
2414
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
2415
	{0xa1, 0x01, 0x0180},
2416
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2417
	{}
2418 2419
};

2420
static const struct usb_action icm105axx_Initial[] = {
2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
	{0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
	{0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527
	{0xaa, 0x01, 0x0010},
	{0xaa, 0x03, 0x0000},
	{0xaa, 0x04, 0x0001},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x0001},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0001},
	{0xaa, 0x04, 0x0011},
	{0xaa, 0x05, 0x00a0},
	{0xaa, 0x06, 0x0001},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0002},
	{0xaa, 0x04, 0x0013},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x0001},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0003},
	{0xaa, 0x04, 0x0015},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0004},
	{0xaa, 0x04, 0x0017},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x000d},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0005},
	{0xaa, 0x04, 0x0019},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0006},
	{0xaa, 0x04, 0x0017},
	{0xaa, 0x05, 0x0026},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0007},
	{0xaa, 0x04, 0x0019},
	{0xaa, 0x05, 0x0022},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0008},
	{0xaa, 0x04, 0x0021},
	{0xaa, 0x05, 0x00aa},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0009},
	{0xaa, 0x04, 0x0023},
	{0xaa, 0x05, 0x00aa},
	{0xaa, 0x06, 0x000d},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x000a},
	{0xaa, 0x04, 0x0025},
	{0xaa, 0x05, 0x00aa},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x000b},
	{0xaa, 0x04, 0x00ec},
	{0xaa, 0x05, 0x002e},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x000c},
	{0xaa, 0x04, 0x00fa},
	{0xaa, 0x05, 0x002a},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x07, 0x000d},
	{0xaa, 0x01, 0x0005},
	{0xaa, 0x94, 0x0002},
	{0xaa, 0x90, 0x0000},
	{0xaa, 0x91, 0x001f},
	{0xaa, 0x10, 0x0064},
	{0xaa, 0x9b, 0x00f0},
	{0xaa, 0x9c, 0x0002},
	{0xaa, 0x14, 0x001a},
	{0xaa, 0x20, 0x0080},
	{0xaa, 0x22, 0x0080},
	{0xaa, 0x24, 0x0080},
	{0xaa, 0x26, 0x0080},
	{0xaa, 0x00, 0x0084},
2528 2529
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2530 2531 2532 2533
	{0xaa, 0xa8, 0x00c0},
	{0xa1, 0x01, 0x0002},
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0180},
2534 2535 2536 2537
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
2538 2539
	{0xa1, 0x01, 0x0008},

2540 2541
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
2542 2543 2544
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
2545 2546 2547 2548 2549 2550 2551 2552 2553 2554
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x52, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf7, ZC3XX_R10B_RGB01},
	{0xa0, 0xf7, ZC3XX_R10C_RGB02},
	{0xa0, 0xf7, ZC3XX_R10D_RGB10},
	{0xa0, 0x52, ZC3XX_R10E_RGB11},
	{0xa0, 0xf7, ZC3XX_R10F_RGB12},
	{0xa0, 0xf7, ZC3XX_R110_RGB20},
	{0xa0, 0xf7, ZC3XX_R111_RGB21},
	{0xa0, 0x52, ZC3XX_R112_RGB22},
2555
	{0xa1, 0x01, 0x0180},
2556 2557
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568
	{0xaa, 0x0d, 0x0003},
	{0xaa, 0x0c, 0x008c},
	{0xaa, 0x0e, 0x0095},
	{0xaa, 0x0f, 0x0002},
	{0xaa, 0x1c, 0x0094},
	{0xaa, 0x1d, 0x0002},
	{0xaa, 0x20, 0x0080},
	{0xaa, 0x22, 0x0080},
	{0xaa, 0x24, 0x0080},
	{0xaa, 0x26, 0x0080},
	{0xaa, 0x00, 0x0084},
2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588
	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
	{0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2589
	{0xa1, 0x01, 0x0180},
2590 2591 2592 2593
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
2594
	{}
2595 2596
};

2597
static const struct usb_action icm105axx_InitialScale[] = {
2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
	{0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
	{0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651
	{0xaa, 0x01, 0x0010},
	{0xaa, 0x03, 0x0000},
	{0xaa, 0x04, 0x0001},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x0001},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0001},
	{0xaa, 0x04, 0x0011},
	{0xaa, 0x05, 0x00a0},
	{0xaa, 0x06, 0x0001},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0002},
	{0xaa, 0x04, 0x0013},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x0001},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0003},
	{0xaa, 0x04, 0x0015},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0004},
	{0xaa, 0x04, 0x0017},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x000d},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0005},
2652 2653 2654
	{0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707
	{0xa1, 0x01, 0x0091},
	{0xaa, 0x05, 0x0020},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0006},
	{0xaa, 0x04, 0x0017},
	{0xaa, 0x05, 0x0026},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0007},
	{0xaa, 0x04, 0x0019},
	{0xaa, 0x05, 0x0022},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0008},
	{0xaa, 0x04, 0x0021},
	{0xaa, 0x05, 0x00aa},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x0009},
	{0xaa, 0x04, 0x0023},
	{0xaa, 0x05, 0x00aa},
	{0xaa, 0x06, 0x000d},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x000a},
	{0xaa, 0x04, 0x0025},
	{0xaa, 0x05, 0x00aa},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x000b},
	{0xaa, 0x04, 0x00ec},
	{0xaa, 0x05, 0x002e},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x03, 0x000c},
	{0xaa, 0x04, 0x00fa},
	{0xaa, 0x05, 0x002a},
	{0xaa, 0x06, 0x0005},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x07, 0x000d},
	{0xaa, 0x01, 0x0005},
	{0xaa, 0x94, 0x0002},
	{0xaa, 0x90, 0x0000},
	{0xaa, 0x91, 0x0010},
	{0xaa, 0x10, 0x0064},
	{0xaa, 0x9b, 0x00f0},
	{0xaa, 0x9c, 0x0002},
	{0xaa, 0x14, 0x001a},
	{0xaa, 0x20, 0x0080},
	{0xaa, 0x22, 0x0080},
	{0xaa, 0x24, 0x0080},
	{0xaa, 0x26, 0x0080},
	{0xaa, 0x00, 0x0084},
2708 2709
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
2710
	{0xaa, 0xa8, 0x0080},
2711
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
2712 2713 2714
	{0xa1, 0x01, 0x0002},
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0180},
2715 2716 2717 2718
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
2719 2720
	{0xa1, 0x01, 0x0008},

2721 2722
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
2723 2724 2725
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */

	{0xa0, 0x52, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf7, ZC3XX_R10B_RGB01},
	{0xa0, 0xf7, ZC3XX_R10C_RGB02},
	{0xa0, 0xf7, ZC3XX_R10D_RGB10},
	{0xa0, 0x52, ZC3XX_R10E_RGB11},
	{0xa0, 0xf7, ZC3XX_R10F_RGB12},
	{0xa0, 0xf7, ZC3XX_R110_RGB20},
	{0xa0, 0xf7, ZC3XX_R111_RGB21},
	{0xa0, 0x52, ZC3XX_R112_RGB22},
2737
	{0xa1, 0x01, 0x0180},
2738 2739
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750
	{0xaa, 0x0d, 0x0003},
	{0xaa, 0x0c, 0x0020},
	{0xaa, 0x0e, 0x000e},
	{0xaa, 0x0f, 0x0002},
	{0xaa, 0x1c, 0x000d},
	{0xaa, 0x1d, 0x0002},
	{0xaa, 0x20, 0x0080},
	{0xaa, 0x22, 0x0080},
	{0xaa, 0x24, 0x0080},
	{0xaa, 0x26, 0x0080},
	{0xaa, 0x00, 0x0084},
2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768
	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
	{0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
2769
	{0xa1, 0x01, 0x0180},
2770 2771 2772 2773
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
2774
	{}
2775
};
2776
static const struct usb_action icm105a_50HZ[] = {
2777
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788
	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
	{0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
	{0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
	{0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804
	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
	{0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
	{0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
	{0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
	{0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2805
	{}
2806
};
2807
static const struct usb_action icm105a_50HZScale[] = {
2808
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819
	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
	{0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
	{0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
	{0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837
	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
	{0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
	{0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
	{0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
	{0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
	{0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2838
	{}
2839
};
2840
static const struct usb_action icm105a_60HZ[] = {
2841
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852
	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
	{0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
	{0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
	{0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868
	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
	{0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
	{0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
	{0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
	{0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
	{0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2869
	{}
2870
};
2871
static const struct usb_action icm105a_60HZScale[] = {
2872
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883
	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
	{0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
	{0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
	{0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901
	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
	{0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
	{0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
	{0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
	{0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
	{0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2902
	{}
2903
};
2904
static const struct usb_action icm105a_NoFliker[] = {
2905
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916
	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
	{0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
	{0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
	{0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932
	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
	{0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
	{0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
	{0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
2933
	{}
2934
};
2935
static const struct usb_action icm105a_NoFlikerScale[] = {
2936
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947
	{0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
	{0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
	{0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
	{0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
	{0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
	{0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
	{0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
	{0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
	{0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
	{0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965
	{0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
	{0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
	{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
	{0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
	{0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
	{0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
2966
	{}
2967 2968
};

2969
static const struct usb_action MC501CB_InitialScale[] = {
2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
	{0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
	{0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
	{0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
	{0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
	{0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
	{0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028
	{0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
	{0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
	{0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
	{0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
	{0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
	{0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
	{0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
	{0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
	{0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
	{0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
	{0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
	{0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
	{0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
	{0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
	{0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
	{0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
	{0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
	{0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
	{0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
	{0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
	{0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
	{0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
	{0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
	{0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
	{0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
	{0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
	{0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
	{0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
	{0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
	{0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
	{0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
	{0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
	{0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
	{0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
	{0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3029
	{0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060
	{0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
	{0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
	{0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
	{0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
	{0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
	{0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
	{0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
	{0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
	{0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
	{0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
	{0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
	{0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
	{0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
	{0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
	{0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
	{0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
	{0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
	{0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
	{0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
	{0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
	{0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
	{0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
	{0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
	{0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
	{0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
	{0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
	{0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
	{0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
	{0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3061 3062 3063 3064 3065 3066 3067 3068 3069
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085
	{0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
	{0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
	{0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
	{0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
	{0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
	{0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
	{0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
	{0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */

	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
	{0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
	{0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3086
	{}
3087 3088
};

3089
static const struct usb_action MC501CB_Initial[] = {	 /* 320x240 */
3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
	{0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
	{0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
	{0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
	{0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
	{0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
	{0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148
	{0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
	{0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
	{0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
	{0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
	{0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
	{0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
	{0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
	{0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
	{0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
	{0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
	{0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
	{0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
	{0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
	{0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
	{0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
	{0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
	{0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
	{0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
	{0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
	{0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
	{0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
	{0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
	{0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
	{0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
	{0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
	{0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
	{0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
	{0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
	{0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
	{0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
	{0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
	{0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
	{0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
	{0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
	{0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3149
	{0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */
3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180
	{0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
	{0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
	{0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
	{0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
	{0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
	{0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
	{0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
	{0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
	{0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
	{0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
	{0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
	{0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
	{0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
	{0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
	{0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
	{0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
	{0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
	{0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
	{0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
	{0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
	{0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
	{0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
	{0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
	{0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
	{0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
	{0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
	{0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
	{0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
	{0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
3181 3182 3183 3184 3185 3186 3187 3188 3189
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204
	{0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
	{0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
	{0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
	{0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
	{0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
	{0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
	{0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
	{0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
	{0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
	{0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
3205
	{}
3206 3207
};

3208
static const struct usb_action MC501CB_50HZ[] = {
3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
	{0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
	{0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
	{0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
	{0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
	{0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
	{0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
	{0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
3222
	{}
3223 3224
};

3225
static const struct usb_action MC501CB_50HZScale[] = {
3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
	{0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
	{0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
	{0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
	{0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
	{0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
	{0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
	{0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3239
	{}
3240 3241
};

3242
static const struct usb_action MC501CB_60HZ[] = {
3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
	{0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
	{0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
	{0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
	{0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
	{0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
	{0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
	{0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3256
	{}
3257 3258
};

3259
static const struct usb_action MC501CB_60HZScale[] = {
3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
	{0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
	{0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
	{0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
	{0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
	{0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
	{0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
	{0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
3273
	{}
3274 3275
};

3276
static const struct usb_action MC501CB_NoFliker[] = {
3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
	{0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
	{0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
	{0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
	{0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
	{0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
	{0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
	{0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
3290
	{}
3291 3292
};

3293
static const struct usb_action MC501CB_NoFlikerScale[] = {
3294 3295 3296 3297 3298 3299 3300 3301
	{0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
	{0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
	{0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
	{0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
	{0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
	{0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
	{0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
	{0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
3302
	{}
3303 3304 3305
};

/* from zs211.inf - HKR,%OV7620%,Initial - 640x480 */
3306
static const struct usb_action OV7620_mode0[] = {
3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
	{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
	{0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
	{0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
	{0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
	{0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
	{0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
	{0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
	{0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
	{0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
	{0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358
	{0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
	{0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
	{0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
	{0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
	{0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
	{0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
	{0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
	{0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
	{0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
	{0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
	{0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
	{0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
	{0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
	{0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
	{0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
	{0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
	{0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
	{0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
	{0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
	{0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
	{0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
	{0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
	{0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
	{0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
	{0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
	{0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
	{0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
	{0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3359 3360 3361 3362
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
3363
	{0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
3364 3365 3366 3367 3368 3369 3370 3371 3372
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
	{0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
	{0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
	{0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
3373
	{}
3374 3375 3376
};

/* from zs211.inf - HKR,%OV7620%,InitialScale - 320x240 */
3377
static const struct usb_action OV7620_mode1[] = {
3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
	{0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},	/* 00,02,50,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00,08,00,cc */
						/* mx change? */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
	{0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
	{0xa0, 0x02, ZC3XX_R083_RGAINADDR},	/* 00,83,02,cc */
	{0xa0, 0x01, ZC3XX_R085_BGAINADDR},	/* 00,85,01,cc */
	{0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH},	/* 00,86,80,cc */
	{0xa0, 0x81, ZC3XX_R087_EXPTIMEMID},	/* 00,87,81,cc */
	{0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},	/* 00,88,10,cc */
	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
	{0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},	/* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},	/* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},	/* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},	/* 01,1c,00,cc */
	{0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW},	/* 00,9c,d6,cc */
						/* OV7648 00,9c,d8,cc */
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},	/* 00,9e,88,cc */
3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431
	{0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
	{0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
	{0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
	{0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
	{0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
	{0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
	{0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
	{0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
	{0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
	{0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
	{0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
	{0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
	{0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
	{0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
	{0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
	{0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
	{0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
	{0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
	{0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
	{0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
	{0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
	{0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
	{0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
	{0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
	{0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
	{0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
	{0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
	{0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},	/* 01,89,06,cc */
	{0xa0, 0x00, 0x01ad},			/* 01,ad,00,cc */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},	/* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},	/* 03,01,08,cc */
	{0xa0, 0x68, ZC3XX_R116_RGAIN},		/* 01,16,68,cc */
	{0xa0, 0x52, ZC3XX_R118_BGAIN},		/* 01,18,52,cc */
	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},	/* 01,1d,50,cc */
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
	{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},	/* 01,a8,50,cc */
3446
	{}
3447 3448 3449
};

/* from zs211.inf - HKR,%OV7620%\AE,50HZ */
3450
static const struct usb_action OV7620_50HZ[] = {
3451 3452 3453 3454 3455
	{0xaa, 0x13, 0x00a3},	/* 00,13,a3,aa */
	{0xdd, 0x00, 0x0100},	/* 00,01,00,dd */
	{0xaa, 0x2b, 0x0096},	/* 00,2b,96,aa */
	{0xaa, 0x75, 0x008a},	/* 00,75,8a,aa */
	{0xaa, 0x2d, 0x0005},	/* 00,2d,05,aa */
3456 3457 3458 3459 3460 3461 3462 3463 3464 3465
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,04,cc */
	{0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,18,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,83,cc */
	{0xaa, 0x10, 0x0082},				/* 00,10,82,aa */
	{0xaa, 0x76, 0x0003},				/* 00,76,03,aa */
/*	{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},		 * 00,02,40,cc
							 if mode0 (640x480) */
3466
	{}
3467 3468 3469
};

/* from zs211.inf - HKR,%OV7620%\AE,60HZ */
3470
static const struct usb_action OV7620_60HZ[] = {
3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486
	{0xaa, 0x13, 0x00a3},			/* 00,13,a3,aa */
						/* (bug in zs211.inf) */
	{0xdd, 0x00, 0x0100},			/* 00,01,00,dd */
	{0xaa, 0x2b, 0x0000},			/* 00,2b,00,aa */
	{0xaa, 0x75, 0x008a},			/* 00,75,8a,aa */
	{0xaa, 0x2d, 0x0005},			/* 00,2d,05,aa */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
	{0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
	{0xaa, 0x10, 0x0020},			/* 00,10,20,aa */
	{0xaa, 0x76, 0x0003},			/* 00,76,03,aa */
/*	{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},	 * 00,02,40,cc
						 * if mode0 (640x480) */
3487 3488 3489
/* ?? in gspca v1, it was
	{0xa0, 0x00, 0x0039},  * 00,00,00,dd *
	{0xa1, 0x01, 0x0037},		*/
3490
	{}
3491 3492 3493
};

/* from zs211.inf - HKR,%OV7620%\AE,NoFliker */
3494
static const struct usb_action OV7620_NoFliker[] = {
3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508
	{0xaa, 0x13, 0x00a3},			/* 00,13,a3,aa */
						/* (bug in zs211.inf) */
	{0xdd, 0x00, 0x0100},			/* 00,01,00,dd */
	{0xaa, 0x2b, 0x0000},			/* 00,2b,00,aa */
	{0xaa, 0x75, 0x008e},			/* 00,75,8e,aa */
	{0xaa, 0x2d, 0x0001},			/* 00,2d,01,aa */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
	{0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
/*	{0xa0, 0x44, ZC3XX_R002_CLOCKSELECT},	 * 00,02,44,cc
						 - if mode1 (320x240) */
3509 3510 3511
/* ?? was
	{0xa0, 0x00, 0x0039},  * 00,00,00,dd *
	{0xa1, 0x01, 0x0037},		*/
3512
	{}
3513 3514
};

3515
static const struct usb_action ov7630c_Initial[] = {
3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3530
	{0xaa, 0x12, 0x0080},
3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541
	{0xa0, 0x02, ZC3XX_R083_RGAINADDR},
	{0xa0, 0x01, ZC3XX_R085_BGAINADDR},
	{0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
	{0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572
	{0xaa, 0x12, 0x0069},
	{0xaa, 0x04, 0x0020},
	{0xaa, 0x06, 0x0050},
	{0xaa, 0x13, 0x0083},
	{0xaa, 0x14, 0x0000},
	{0xaa, 0x15, 0x0024},
	{0xaa, 0x17, 0x0018},
	{0xaa, 0x18, 0x00ba},
	{0xaa, 0x19, 0x0002},
	{0xaa, 0x1a, 0x00f6},
	{0xaa, 0x1b, 0x0002},
	{0xaa, 0x20, 0x00c2},
	{0xaa, 0x24, 0x0060},
	{0xaa, 0x25, 0x0040},
	{0xaa, 0x26, 0x0030},
	{0xaa, 0x27, 0x00ea},
	{0xaa, 0x28, 0x00a0},
	{0xaa, 0x21, 0x0000},
	{0xaa, 0x2a, 0x0081},
	{0xaa, 0x2b, 0x0096},
	{0xaa, 0x2d, 0x0094},
	{0xaa, 0x2f, 0x003d},
	{0xaa, 0x30, 0x0024},
	{0xaa, 0x60, 0x0000},
	{0xaa, 0x61, 0x0040},
	{0xaa, 0x68, 0x007c},
	{0xaa, 0x6f, 0x0015},
	{0xaa, 0x75, 0x0088},
	{0xaa, 0x77, 0x00b5},
	{0xaa, 0x01, 0x0060},
	{0xaa, 0x02, 0x0060},
3573 3574 3575 3576 3577
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3578
	{0xa0, 0x00, 0x01ad},
3579 3580 3581 3582 3583 3584 3585
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x60, ZC3XX_R116_RGAIN},
	{0xa0, 0x46, ZC3XX_R118_BGAIN},
	{0xa0, 0x04, ZC3XX_R113_RGB03},
3586 3587
/* 0x10, */
	{0xa1, 0x01, 0x0002},
3588 3589 3590 3591 3592 3593 3594 3595 3596
	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
3597 3598
/* 0x03, */
	{0xa1, 0x01, 0x0008},
3599 3600
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
3601 3602 3603
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x01, ZC3XX_R120_GAMMA00},	/* gamma 2 ?*/
	{0xa0, 0x0c, ZC3XX_R121_GAMMA01},
	{0xa0, 0x1f, ZC3XX_R122_GAMMA02},
	{0xa0, 0x3a, ZC3XX_R123_GAMMA03},
	{0xa0, 0x53, ZC3XX_R124_GAMMA04},
	{0xa0, 0x6d, ZC3XX_R125_GAMMA05},
	{0xa0, 0x85, ZC3XX_R126_GAMMA06},
	{0xa0, 0x9c, ZC3XX_R127_GAMMA07},
	{0xa0, 0xb0, ZC3XX_R128_GAMMA08},
	{0xa0, 0xc2, ZC3XX_R129_GAMMA09},
	{0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x05, ZC3XX_R130_GAMMA10},
	{0xa0, 0x0f, ZC3XX_R131_GAMMA11},
	{0xa0, 0x16, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1a, ZC3XX_R133_GAMMA13},
	{0xa0, 0x19, ZC3XX_R134_GAMMA14},
	{0xa0, 0x19, ZC3XX_R135_GAMMA15},
	{0xa0, 0x17, ZC3XX_R136_GAMMA16},
	{0xa0, 0x15, ZC3XX_R137_GAMMA17},
	{0xa0, 0x12, ZC3XX_R138_GAMMA18},
	{0xa0, 0x10, ZC3XX_R139_GAMMA19},
	{0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
3646 3647

	{0xa1, 0x01, 0x0180},
3648
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3649 3650 3651 3652
	{0xaa, 0x10, 0x001b},
	{0xaa, 0x76, 0x0002},
	{0xaa, 0x2a, 0x0081},
	{0xaa, 0x2b, 0x0000},
3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3666 3667
	{0xaa, 0x13, 0x0083},	/* 40 */
	{0xa1, 0x01, 0x0180},
3668
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3669
	{}
3670 3671
};

3672
static const struct usb_action ov7630c_InitialScale[] = {
3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3685 3686

	{0xaa, 0x12, 0x0080},
3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697
	{0xa0, 0x02, ZC3XX_R083_RGAINADDR},
	{0xa0, 0x01, ZC3XX_R085_BGAINADDR},
	{0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
	{0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728
	{0xaa, 0x12, 0x0069},	/* i2c */
	{0xaa, 0x04, 0x0020},
	{0xaa, 0x06, 0x0050},
	{0xaa, 0x13, 0x00c3},
	{0xaa, 0x14, 0x0000},
	{0xaa, 0x15, 0x0024},
	{0xaa, 0x19, 0x0003},
	{0xaa, 0x1a, 0x00f6},
	{0xaa, 0x1b, 0x0002},
	{0xaa, 0x20, 0x00c2},
	{0xaa, 0x24, 0x0060},
	{0xaa, 0x25, 0x0040},
	{0xaa, 0x26, 0x0030},
	{0xaa, 0x27, 0x00ea},
	{0xaa, 0x28, 0x00a0},
	{0xaa, 0x21, 0x0000},
	{0xaa, 0x2a, 0x0081},
	{0xaa, 0x2b, 0x0096},
	{0xaa, 0x2d, 0x0084},
	{0xaa, 0x2f, 0x003d},
	{0xaa, 0x30, 0x0024},
	{0xaa, 0x60, 0x0000},
	{0xaa, 0x61, 0x0040},
	{0xaa, 0x68, 0x007c},
	{0xaa, 0x6f, 0x0015},
	{0xaa, 0x75, 0x0088},
	{0xaa, 0x77, 0x00b5},
	{0xaa, 0x01, 0x0060},
	{0xaa, 0x02, 0x0060},
	{0xaa, 0x17, 0x0018},
	{0xaa, 0x18, 0x00ba},
3729 3730 3731 3732 3733
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
3734
	{0xa0, 0x00, 0x01ad},
3735 3736 3737 3738 3739 3740 3741
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x60, ZC3XX_R116_RGAIN},
	{0xa0, 0x46, ZC3XX_R118_BGAIN},
	{0xa0, 0x04, ZC3XX_R113_RGB03},
3742 3743

	{0xa1, 0x01, 0x0002},
3744 3745 3746 3747 3748 3749 3750 3751 3752
	{0xa0, 0x4e, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xfe, ZC3XX_R10B_RGB01},
	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
	{0xa0, 0xf7, ZC3XX_R10D_RGB10},
	{0xa0, 0x4d, ZC3XX_R10E_RGB11},
	{0xa0, 0xfc, ZC3XX_R10F_RGB12},
	{0xa0, 0x00, ZC3XX_R110_RGB20},
	{0xa0, 0xf6, ZC3XX_R111_RGB21},
	{0xa0, 0x4a, ZC3XX_R112_RGB22},
3753 3754

	{0xa1, 0x01, 0x0008},
3755 3756
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
3757 3758 3759
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x16, ZC3XX_R120_GAMMA00},	/* gamma ~4 */
	{0xa0, 0x3a, ZC3XX_R121_GAMMA01},
	{0xa0, 0x5b, ZC3XX_R122_GAMMA02},
	{0xa0, 0x7c, ZC3XX_R123_GAMMA03},
	{0xa0, 0x94, ZC3XX_R124_GAMMA04},
	{0xa0, 0xa9, ZC3XX_R125_GAMMA05},
	{0xa0, 0xbb, ZC3XX_R126_GAMMA06},
	{0xa0, 0xca, ZC3XX_R127_GAMMA07},
	{0xa0, 0xd7, ZC3XX_R128_GAMMA08},
	{0xa0, 0xe1, ZC3XX_R129_GAMMA09},
	{0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x20, ZC3XX_R130_GAMMA10},
	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x4e, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xfe, ZC3XX_R10B_RGB01},
	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
	{0xa0, 0xf7, ZC3XX_R10D_RGB10},
	{0xa0, 0x4d, ZC3XX_R10E_RGB11},
	{0xa0, 0xfc, ZC3XX_R10F_RGB12},
	{0xa0, 0x00, ZC3XX_R110_RGB20},
	{0xa0, 0xf6, ZC3XX_R111_RGB21},
	{0xa0, 0x4a, ZC3XX_R112_RGB22},
3802 3803

	{0xa1, 0x01, 0x0180},
3804
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3805 3806 3807 3808
	{0xaa, 0x10, 0x000d},
	{0xaa, 0x76, 0x0002},
	{0xaa, 0x2a, 0x0081},
	{0xaa, 0x2b, 0x0000},
3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3822 3823 3824
	{0xaa, 0x13, 0x00c3},

	{0xa1, 0x01, 0x0180},
3825
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3826
	{}
3827 3828
};

3829
static const struct usb_action pas106b_Initial_com[] = {
3830 3831 3832
/* Sream and Sensor specific */
	{0xa1, 0x01, 0x0010},	/* CMOSSensorSelect */
/* System */
3833 3834
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},	/* SystemControl */
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},	/* SystemControl */
3835
/* Picture size */
3836
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},	/* ClockSelect */
3837 3838 3839
	{0xa0, 0x03, 0x003a},
	{0xa0, 0x0c, 0x003b},
	{0xa0, 0x04, 0x0038},
3840
	{}
3841 3842
};

3843
static const struct usb_action pas106b_Initial[] = {	/* 176x144 */
3844
/* JPEG control */
3845
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3846
/* Sream and Sensor specific */
3847
	{0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
3848
/* Picture size */
3849 3850 3851 3852
	{0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
3853
/* System */
3854
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3855
/* Sream and Sensor specific */
3856 3857
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3858
/* Sensor Interface */
3859
	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3860
/* Window inside sensor array */
3861 3862 3863 3864 3865
	{0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877
/* Init the sensor */
	{0xaa, 0x02, 0x0004},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x09, 0x0005},
	{0xaa, 0x0a, 0x0002},
	{0xaa, 0x0b, 0x0002},
	{0xaa, 0x0c, 0x0005},
	{0xaa, 0x0d, 0x0000},
	{0xaa, 0x0e, 0x0002},
	{0xaa, 0x14, 0x0081},

/* Other registors */
3878
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
3879
/* Frame retreiving */
3880
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
3881
/* Gains */
3882
	{0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
3883 3884 3885
/* Unknown */
	{0xa0, 0x00, 0x01ad},
/* Sharpness */
3886 3887
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
3888
/* Other registors */
3889
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3890
/* Auto exposure and white balance */
3891
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3892
/*Dead pixels */
3893
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3894
/* EEPROM */
3895
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3896
/* JPEG control */
3897 3898 3899
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3900
/* Other registers */
3901
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
3902
/* Auto exposure and white balance */
3903
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
3904
/*Dead pixels */
3905
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
3906
/* EEPROM */
3907
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
3908
/* JPEG control */
3909 3910 3911
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
3912 3913 3914 3915 3916 3917 3918 3919 3920 3921

	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
	{0xa0, 0x58, ZC3XX_R10E_RGB11},
	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
	{0xa0, 0xf4, ZC3XX_R110_RGB20},
	{0xa0, 0xf4, ZC3XX_R111_RGB21},
	{0xa0, 0x58, ZC3XX_R112_RGB22},
3922
/* Auto correction */
3923 3924 3925 3926 3927 3928 3929
	{0xa0, 0x03, ZC3XX_R181_WINXSTART},
	{0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
	{0xa0, 0x16, ZC3XX_R183_WINXCENTER},
	{0xa0, 0x03, ZC3XX_R184_WINYSTART},
	{0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
	{0xa0, 0x14, ZC3XX_R186_WINYCENTER},
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
3930 3931

/* Auto exposure and white balance */
3932 3933 3934 3935 3936 3937 3938 3939
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
3940 3941 3942 3943 3944 3945
/* sensor on */
	{0xaa, 0x07, 0x00b1},
	{0xaa, 0x05, 0x0003},
	{0xaa, 0x04, 0x0001},
	{0xaa, 0x03, 0x003b},
/* Gains */
3946 3947 3948 3949
	{0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
3950
/* Auto correction */
3951
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
3952
	{0xa1, 0x01, 0x0180},				/* AutoCorrectEnable */
3953
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
3954
/* Gains */
3955 3956 3957
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
3958
	{}
3959 3960
};

3961
static const struct usb_action pas106b_InitialScale[] = {	/* 352x288 */
3962
/* JPEG control */
3963
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
3964
/* Sream and Sensor specific */
3965
	{0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
3966
/* Picture size */
3967 3968 3969 3970
	{0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
3971
/* System */
3972
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
3973
/* Sream and Sensor specific */
3974 3975
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
3976
/* Sensor Interface */
3977
	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
3978
/* Window inside sensor array */
3979 3980 3981 3982 3983
	{0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995
/* Init the sensor */
	{0xaa, 0x02, 0x0004},
	{0xaa, 0x08, 0x0000},
	{0xaa, 0x09, 0x0005},
	{0xaa, 0x0a, 0x0002},
	{0xaa, 0x0b, 0x0002},
	{0xaa, 0x0c, 0x0005},
	{0xaa, 0x0d, 0x0000},
	{0xaa, 0x0e, 0x0002},
	{0xaa, 0x14, 0x0081},

/* Other registors */
3996
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
3997
/* Frame retreiving */
3998
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
3999
/* Gains */
4000
	{0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
4001 4002 4003
/* Unknown */
	{0xa0, 0x00, 0x01ad},
/* Sharpness */
4004 4005
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4006
/* Other registors */
4007
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4008
/* Auto exposure and white balance */
4009 4010
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x80, ZC3XX_R18D_YTARGET},
4011
/*Dead pixels */
4012
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4013
/* EEPROM */
4014
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4015
/* JPEG control */
4016 4017 4018
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4019
/* Other registers */
4020
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4021
/* Auto exposure and white balance */
4022
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4023
/*Dead pixels */
4024
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4025
/* EEPROM */
4026
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4027
/* JPEG control */
4028 4029 4030
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4031 4032 4033 4034 4035 4036 4037 4038 4039 4040

	{0xa0, 0x58, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf4, ZC3XX_R10B_RGB01},
	{0xa0, 0xf4, ZC3XX_R10C_RGB02},
	{0xa0, 0xf4, ZC3XX_R10D_RGB10},
	{0xa0, 0x58, ZC3XX_R10E_RGB11},
	{0xa0, 0xf4, ZC3XX_R10F_RGB12},
	{0xa0, 0xf4, ZC3XX_R110_RGB20},
	{0xa0, 0xf4, ZC3XX_R111_RGB21},
	{0xa0, 0x58, ZC3XX_R112_RGB22},
4041
/* Auto correction */
4042 4043 4044 4045 4046 4047 4048
	{0xa0, 0x03, ZC3XX_R181_WINXSTART},
	{0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
	{0xa0, 0x16, ZC3XX_R183_WINXCENTER},
	{0xa0, 0x03, ZC3XX_R184_WINYSTART},
	{0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
	{0xa0, 0x14, ZC3XX_R186_WINYCENTER},
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4049 4050

/* Auto exposure and white balance */
4051 4052 4053
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
4054

4055 4056 4057
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
4058

4059 4060
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4061 4062 4063 4064 4065 4066
/* sensor on */
	{0xaa, 0x07, 0x00b1},
	{0xaa, 0x05, 0x0003},
	{0xaa, 0x04, 0x0001},
	{0xaa, 0x03, 0x003b},
/* Gains */
4067 4068 4069 4070
	{0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4071
/* Auto correction */
4072
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4073
	{0xa1, 0x01, 0x0180},				/* AutoCorrectEnable */
4074
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4075
/* Gains */
4076 4077 4078
	{0xa0, 0x40, ZC3XX_R116_RGAIN},
	{0xa0, 0x40, ZC3XX_R117_GGAIN},
	{0xa0, 0x40, ZC3XX_R118_BGAIN},
4079

4080 4081
	{0xa0, 0x00, 0x0007},			/* AutoCorrectEnable */
	{0xa0, 0xff, ZC3XX_R018_FRAMELOST},	/* Frame adjust */
4082
	{}
4083
};
4084
static const struct usb_action pas106b_50HZ[] = {
4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
	{0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
	{0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,30,cc */
	{0xaa, 0x03, 0x0021},			/* 00,03,21,aa */
	{0xaa, 0x04, 0x000c},			/* 00,04,0c,aa */
	{0xaa, 0x05, 0x0002},			/* 00,05,02,aa */
	{0xaa, 0x07, 0x001c},			/* 00,07,1c,aa */
	{0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
4098
	{}
4099
};
4100
static const struct usb_action pas106b_60HZ[] = {
4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
	{0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
	{0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,30,cc */
	{0xaa, 0x03, 0x001c},			/* 00,03,1c,aa */
	{0xaa, 0x04, 0x0004},			/* 00,04,04,aa */
	{0xaa, 0x05, 0x0001},			/* 00,05,01,aa */
	{0xaa, 0x07, 0x00c4},			/* 00,07,c4,aa */
	{0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
4114
	{}
4115
};
4116
static const struct usb_action pas106b_NoFliker[] = {
4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
	{0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,20,cc */
	{0xaa, 0x03, 0x0013},			/* 00,03,13,aa */
	{0xaa, 0x04, 0x0000},			/* 00,04,00,aa */
	{0xaa, 0x05, 0x0001},			/* 00,05,01,aa */
	{0xaa, 0x07, 0x0030},			/* 00,07,30,aa */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
4130
	{}
4131 4132
};

4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396
/* from usbvm31b.inf */
static const struct usb_action pas202b_Initial[] = {	/* 640x480 */
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc */
	{0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},		/* 00,08,00,cc */
	{0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0e,cc */
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},		/* 00,02,00,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},	/* 00,8d,08,cc */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc */
	{0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,03,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc */
	{0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,03,cc */
	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},		/* 00,9b,01,cc */
	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,e6,cc */
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},		/* 00,9d,02,cc */
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,86,cc */
	{0xaa, 0x02, 0x0002},			/* 00,02,04,aa --> 02 */
	{0xaa, 0x07, 0x0006},				/* 00,07,06,aa */
	{0xaa, 0x08, 0x0002},				/* 00,08,02,aa */
	{0xaa, 0x09, 0x0006},				/* 00,09,06,aa */
	{0xaa, 0x0a, 0x0001},				/* 00,0a,01,aa */
	{0xaa, 0x0b, 0x0001},				/* 00,0b,01,aa */
	{0xaa, 0x0c, 0x0008},				/* 00,0c,08,aa */
	{0xaa, 0x0d, 0x0000},				/* 00,0d,00,aa */
	{0xaa, 0x10, 0x0000},				/* 00,10,00,aa */
	{0xaa, 0x12, 0x0005},				/* 00,12,05,aa */
	{0xaa, 0x13, 0x0063},				/* 00,13,63,aa */
	{0xaa, 0x15, 0x0070},				/* 00,15,70,aa */
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},		/* 01,89,06,cc */
	{0xa0, 0x00, 0x01ad},				/* 01,ad,00,cc */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc */
	{0xa0, 0x70, ZC3XX_R18D_YTARGET},		/* 01,8d,70,cc */
	{}
};
static const struct usb_action pas202b_InitialScale[] = {	/* 320x240 */
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc */
	{0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},		/* 00,08,00,cc */
	{0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,0e,cc */
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},		/* 00,02,10,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc */
	{0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,d0,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc */
	{0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},	/* 00,8d,08,cc */
	{0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,08,cc */
	{0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,02,cc */
	{0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,08,cc */
	{0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,02,cc */
	{0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},		/* 00,9b,01,cc */
	{0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,d8,cc */
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},		/* 00,9d,02,cc */
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,88,cc */
	{0xaa, 0x02, 0x0002},				/* 00,02,02,aa */
	{0xaa, 0x07, 0x0006},				/* 00,07,06,aa */
	{0xaa, 0x08, 0x0002},				/* 00,08,02,aa */
	{0xaa, 0x09, 0x0006},				/* 00,09,06,aa */
	{0xaa, 0x0a, 0x0001},				/* 00,0a,01,aa */
	{0xaa, 0x0b, 0x0001},				/* 00,0b,01,aa */
	{0xaa, 0x0c, 0x0008},				/* 00,0c,08,aa */
	{0xaa, 0x0d, 0x0000},				/* 00,0d,00,aa */
	{0xaa, 0x10, 0x0000},				/* 00,10,00,aa */
	{0xaa, 0x12, 0x0005},				/* 00,12,05,aa */
	{0xaa, 0x13, 0x0063},				/* 00,13,63,aa */
	{0xaa, 0x15, 0x0070},				/* 00,15,70,aa */
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,37,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},		/* 01,89,06,cc */
	{0xa0, 0x00, 0x01ad},				/* 01,ad,00,cc */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc */
	{0xa0, 0x70, ZC3XX_R18D_YTARGET},		/* 01,8d,70,cc */
	{}
};
static const struct usb_action pas202b_50HZ[] = {
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
	{0xaa, 0x21, 0x0068},				/* 00,21,68,aa */
	{0xaa, 0x03, 0x0044},				/* 00,03,44,aa */
	{0xaa, 0x04, 0x0009},				/* 00,04,09,aa */
	{0xaa, 0x05, 0x0028},				/* 00,05,28,aa */
	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,14,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,07,cc */
	{0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,d2,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,4d,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},		/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,20,cc */
	{0xa0, 0x44, ZC3XX_R01D_HSYNC_0},		/* 00,1d,44,cc */
	{0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},		/* 00,1e,6f,cc */
	{0xa0, 0xad, ZC3XX_R01F_HSYNC_2},		/* 00,1f,ad,cc */
	{0xa0, 0xeb, ZC3XX_R020_HSYNC_3},		/* 00,20,eb,cc */
	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
	{}
};
static const struct usb_action pas202b_50HZScale[] = {
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
	{0xaa, 0x21, 0x006c},				/* 00,21,6c,aa */
	{0xaa, 0x03, 0x0041},				/* 00,03,41,aa */
	{0xaa, 0x04, 0x0009},				/* 00,04,09,aa */
	{0xaa, 0x05, 0x002c},				/* 00,05,2c,aa */
	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,14,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0f,cc */
	{0xa0, 0xbe, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,be,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,9b,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},		/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,20,cc */
	{0xa0, 0x41, ZC3XX_R01D_HSYNC_0},		/* 00,1d,41,cc */
	{0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},		/* 00,1e,6f,cc */
	{0xa0, 0xad, ZC3XX_R01F_HSYNC_2},		/* 00,1f,ad,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc */
	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
	{}
};
static const struct usb_action pas202b_60HZ[] = {
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
	{0xaa, 0x21, 0x0000},				/* 00,21,00,aa */
	{0xaa, 0x03, 0x0045},				/* 00,03,45,aa */
	{0xaa, 0x04, 0x0008},				/* 00,04,08,aa */
	{0xaa, 0x05, 0x0000},				/* 00,05,00,aa */
	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,14,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,07,cc */
	{0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,c0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,40,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},		/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,20,cc */
	{0xa0, 0x45, ZC3XX_R01D_HSYNC_0},		/* 00,1d,45,cc */
	{0xa0, 0x8e, ZC3XX_R01E_HSYNC_1},		/* 00,1e,8e,cc */
	{0xa0, 0xc1, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c1,cc */
	{0xa0, 0xf5, ZC3XX_R020_HSYNC_3},		/* 00,20,f5,cc */
	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
	{}
};
static const struct usb_action pas202b_60HZScale[] = {
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
	{0xaa, 0x21, 0x0004},				/* 00,21,04,aa */
	{0xaa, 0x03, 0x0042},				/* 00,03,42,aa */
	{0xaa, 0x04, 0x0008},				/* 00,04,08,aa */
	{0xaa, 0x05, 0x0004},				/* 00,05,04,aa */
	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,14,cc */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0f,cc */
	{0xa0, 0x9f, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,9f,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,81,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},		/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,20,cc */
	{0xa0, 0x42, ZC3XX_R01D_HSYNC_0},		/* 00,1d,42,cc */
	{0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},		/* 00,1e,6f,cc */
	{0xa0, 0xaf, ZC3XX_R01F_HSYNC_2},		/* 00,1f,af,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc */
	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
	{}
};
static const struct usb_action pas202b_NoFliker[] = {
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
	{0xaa, 0x21, 0x0020},				/* 00,21,20,aa */
	{0xaa, 0x03, 0x0040},				/* 00,03,40,aa */
	{0xaa, 0x04, 0x0008},				/* 00,04,08,aa */
	{0xaa, 0x05, 0x0020},				/* 00,05,20,aa */
	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,07,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,02,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},		/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,00,cc */
	{0xa0, 0x40, ZC3XX_R01D_HSYNC_0},		/* 00,1d,40,cc */
	{0xa0, 0x60, ZC3XX_R01E_HSYNC_1},		/* 00,1e,60,cc */
	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},		/* 00,1f,90,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc */
	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
	{}
};
static const struct usb_action pas202b_NoFlikerScale[] = {
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},		/* 00,19,00,cc */
	{0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},		/* 00,87,20,cc */
	{0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},		/* 00,88,21,cc */
	{0xaa, 0x20, 0x0002},				/* 00,20,02,aa */
	{0xaa, 0x21, 0x0010},				/* 00,21,10,aa */
	{0xaa, 0x03, 0x0040},				/* 00,03,40,aa */
	{0xaa, 0x04, 0x0008},				/* 00,04,08,aa */
	{0xaa, 0x05, 0x0010},				/* 00,05,10,aa */
	{0xaa, 0x0e, 0x0001},				/* 00,0e,01,aa */
	{0xaa, 0x0f, 0x0000},				/* 00,0f,00,aa */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc */
	{0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0f,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc */
	{0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,02,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},		/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,00,cc */
	{0xa0, 0x40, ZC3XX_R01D_HSYNC_0},		/* 00,1d,40,cc */
	{0xa0, 0x60, ZC3XX_R01E_HSYNC_1},		/* 00,1e,60,cc */
	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},		/* 00,1f,90,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc */
	{0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},		/* 00,87,0f,cc */
	{0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},		/* 00,88,0e,cc */
	{}
};

4397
static const struct usb_action pb03303x_Initial[] = {
4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},	/* 8b -> dc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433
	{0xaa, 0x01, 0x0001},
	{0xaa, 0x06, 0x0000},
	{0xaa, 0x08, 0x0483},
	{0xaa, 0x01, 0x0004},
	{0xaa, 0x08, 0x0006},
	{0xaa, 0x02, 0x0011},
	{0xaa, 0x03, 0x01e7},
	{0xaa, 0x04, 0x0287},
	{0xaa, 0x07, 0x3002},
	{0xaa, 0x20, 0x1100},
	{0xaa, 0x35, 0x0050},
	{0xaa, 0x30, 0x0005},
	{0xaa, 0x31, 0x0000},
	{0xaa, 0x58, 0x0078},
	{0xaa, 0x62, 0x0411},
	{0xaa, 0x2b, 0x0028},
	{0xaa, 0x2c, 0x0030},
	{0xaa, 0x2d, 0x0030},
	{0xaa, 0x2e, 0x0028},
4434 4435 4436 4437 4438
	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4439
	{0xa0, 0x00, 0x01ad},
4440 4441 4442 4443 4444 4445 4446 4447
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
	{0xa0, 0x61, ZC3XX_R116_RGAIN},
	{0xa0, 0x65, ZC3XX_R118_BGAIN},
4448 4449 4450 4451 4452 4453 4454

	{0xa1, 0x01, 0x0002},
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
	{0xa0, 0x0d, 0x003a},
	{0xa0, 0x02, 0x003b},
	{0xa0, 0x00, 0x0038},
4455 4456 4457 4458 4459 4460 4461 4462 4463
	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
4464 4465

	{0xa1, 0x01, 0x0008},
4466 4467
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4468 4469 4470
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
4513 4514

	{0xa1, 0x01, 0x0180},
4515 4516 4517
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4518 4519
	{0xaa, 0x05, 0x0009},
	{0xaa, 0x09, 0x0134},
4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4535 4536
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
4537
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4538
	{0xa1, 0x01, 0x0180},
4539
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4540
	{}
4541 4542
};

4543
static const struct usb_action pb03303x_InitialScale[] = {
4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},	/* 8b -> dc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579
	{0xaa, 0x01, 0x0001},
	{0xaa, 0x06, 0x0000},
	{0xaa, 0x08, 0x0483},
	{0xaa, 0x01, 0x0004},
	{0xaa, 0x08, 0x0006},
	{0xaa, 0x02, 0x0011},
	{0xaa, 0x03, 0x01e7},
	{0xaa, 0x04, 0x0287},
	{0xaa, 0x07, 0x3002},
	{0xaa, 0x20, 0x1100},
	{0xaa, 0x35, 0x0050},
	{0xaa, 0x30, 0x0005},
	{0xaa, 0x31, 0x0000},
	{0xaa, 0x58, 0x0078},
	{0xaa, 0x62, 0x0411},
	{0xaa, 0x2b, 0x0028},
	{0xaa, 0x2c, 0x0030},
	{0xaa, 0x2d, 0x0030},
	{0xaa, 0x2e, 0x0028},
4580 4581 4582 4583 4584
	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4585
	{0xa0, 0x00, 0x01ad},
4586 4587 4588 4589 4590 4591 4592 4593
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},
	{0xa0, 0x61, ZC3XX_R116_RGAIN},
	{0xa0, 0x65, ZC3XX_R118_BGAIN},
4594 4595 4596 4597 4598 4599 4600 4601 4602

	{0xa1, 0x01, 0x0002},

	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},

	{0xa0, 0x0d, 0x003a},
	{0xa0, 0x02, 0x003b},
	{0xa0, 0x00, 0x0038},
4603 4604 4605 4606 4607 4608 4609 4610 4611
	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
4612 4613

	{0xa1, 0x01, 0x0008},
4614 4615
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
4616 4617 4618
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */

	{0xa0, 0x13, ZC3XX_R120_GAMMA00},	/* gamma 4 */
	{0xa0, 0x38, ZC3XX_R121_GAMMA01},
	{0xa0, 0x59, ZC3XX_R122_GAMMA02},
	{0xa0, 0x79, ZC3XX_R123_GAMMA03},
	{0xa0, 0x92, ZC3XX_R124_GAMMA04},
	{0xa0, 0xa7, ZC3XX_R125_GAMMA05},
	{0xa0, 0xb9, ZC3XX_R126_GAMMA06},
	{0xa0, 0xc8, ZC3XX_R127_GAMMA07},
	{0xa0, 0xd4, ZC3XX_R128_GAMMA08},
	{0xa0, 0xdf, ZC3XX_R129_GAMMA09},
	{0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x26, ZC3XX_R130_GAMMA10},
	{0xa0, 0x22, ZC3XX_R131_GAMMA11},
	{0xa0, 0x20, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1c, ZC3XX_R133_GAMMA13},
	{0xa0, 0x16, ZC3XX_R134_GAMMA14},
	{0xa0, 0x13, ZC3XX_R135_GAMMA15},
	{0xa0, 0x10, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
4662 4663

	{0xa1, 0x01, 0x0180},
4664 4665 4666
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4667 4668
	{0xaa, 0x05, 0x0009},
	{0xaa, 0x09, 0x0134},
4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4684 4685
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
4686
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4687
	{0xa1, 0x01, 0x0180},
4688
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4689
	{}
4690
};
4691
static const struct usb_action pb0330xx_Initial[] = {
4692 4693
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0008},
4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725
	{0xaa, 0x01, 0x0006},
	{0xaa, 0x02, 0x0011},
	{0xaa, 0x03, 0x01e7},
	{0xaa, 0x04, 0x0287},
	{0xaa, 0x06, 0x0003},
	{0xaa, 0x07, 0x3002},
	{0xaa, 0x20, 0x1100},
	{0xaa, 0x2f, 0xf7b0},
	{0xaa, 0x30, 0x0005},
	{0xaa, 0x31, 0x0000},
	{0xaa, 0x34, 0x0100},
	{0xaa, 0x35, 0x0060},
	{0xaa, 0x3d, 0x068f},
	{0xaa, 0x40, 0x01e0},
	{0xaa, 0x58, 0x0078},
	{0xaa, 0x62, 0x0411},
4726 4727 4728 4729 4730
	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4731
	{0xa0, 0x00, 0x01ad},
4732 4733 4734 4735 4736 4737
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4738 4739 4740
	{0xa1, 0x01, 0x0002},
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
4741 4742
	{0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
4743 4744 4745
	{0xa1, 0x01, 0x0091},
	{0xa1, 0x01, 0x0095},
	{0xa1, 0x01, 0x0096},
4746 4747 4748 4749 4750 4751 4752 4753 4754
	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
4755
	{0xa1, 0x01, 0x0008},
4756 4757
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
4758 4759 4760
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */

	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
4772
	{0xa1, 0x01, 0x0180},
4773 4774
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4775 4776 4777 4778
	{0xaa, 0x05, 0x0066},
	{0xaa, 0x09, 0x02b2},
	{0xaa, 0x10, 0x0002},

4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4794 4795
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
4796
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4797
	{0xa1, 0x01, 0x0180},
4798
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4799 4800 4801 4802
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0007},
/*	{0xa0, 0x30, 0x0007}, */
/*	{0xa0, 0x00, 0x0007}, */
4803
	{}
4804 4805
};

4806
static const struct usb_action pb0330xx_InitialScale[] = {
4807 4808
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0008},
4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* 00 */
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},	/* 10 */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840
	{0xaa, 0x01, 0x0006},
	{0xaa, 0x02, 0x0011},
	{0xaa, 0x03, 0x01e7},
	{0xaa, 0x04, 0x0287},
	{0xaa, 0x06, 0x0003},
	{0xaa, 0x07, 0x3002},
	{0xaa, 0x20, 0x1100},
	{0xaa, 0x2f, 0xf7b0},
	{0xaa, 0x30, 0x0005},
	{0xaa, 0x31, 0x0000},
	{0xaa, 0x34, 0x0100},
	{0xaa, 0x35, 0x0060},
	{0xaa, 0x3d, 0x068f},
	{0xaa, 0x40, 0x01e0},
	{0xaa, 0x58, 0x0078},
	{0xaa, 0x62, 0x0411},
4841 4842 4843 4844 4845
	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4846
	{0xa0, 0x00, 0x01ad},
4847 4848 4849 4850 4851 4852
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0x6c, ZC3XX_R18D_YTARGET},
4853 4854 4855
	{0xa1, 0x01, 0x0002},
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
4856 4857
	{0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
4858 4859 4860
	{0xa1, 0x01, 0x0091},
	{0xa1, 0x01, 0x0095},
	{0xa1, 0x01, 0x0096},
4861 4862 4863 4864 4865 4866 4867 4868 4869
	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
4870
	{0xa1, 0x01, 0x0008},
4871 4872
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
4873 4874 4875
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */

	{0xa0, 0x50, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf8, ZC3XX_R10B_RGB01},
	{0xa0, 0xf8, ZC3XX_R10C_RGB02},
	{0xa0, 0xf8, ZC3XX_R10D_RGB10},
	{0xa0, 0x50, ZC3XX_R10E_RGB11},
	{0xa0, 0xf8, ZC3XX_R10F_RGB12},
	{0xa0, 0xf8, ZC3XX_R110_RGB20},
	{0xa0, 0xf8, ZC3XX_R111_RGB21},
	{0xa0, 0x50, ZC3XX_R112_RGB22},
4887
	{0xa1, 0x01, 0x0180},
4888 4889
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4890 4891 4892
	{0xaa, 0x05, 0x0066},
	{0xaa, 0x09, 0x02b2},
	{0xaa, 0x10, 0x0002},
4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
4908 4909
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
4910
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4911
	{0xa1, 0x01, 0x0180},
4912
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4913 4914 4915 4916
	{0xa1, 0x01, 0x0008},
	{0xa1, 0x01, 0x0007},
/*	{0xa0, 0x30, 0x0007}, */
/*	{0xa0, 0x00, 0x0007}, */
4917
	{}
4918
};
4919
static const struct usb_action pb0330_50HZ[] = {
4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
	{0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,ee,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
	{0xa0, 0x68, ZC3XX_R01D_HSYNC_0}, /* 00,1d,68,cc */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
4933
	{}
4934
};
4935
static const struct usb_action pb0330_50HZScale[] = {
4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
	{0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
	{0xa0, 0xe5, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e5,cc */
	{0xa0, 0xf0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f0,cc */
	{0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
4950
	{}
4951
};
4952
static const struct usb_action pb0330_60HZ[] = {
4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
	{0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,dd,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
	{0xa0, 0x43, ZC3XX_R01D_HSYNC_0}, /* 00,1d,43,cc */
	{0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4967
	{}
4968
};
4969
static const struct usb_action pb0330_60HZScale[] = {
4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
	{0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,a0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x7a, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7a,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
	{0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
	{0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4984
	{}
4985
};
4986
static const struct usb_action pb0330_NoFliker[] = {
4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0x09, ZC3XX_R01D_HSYNC_0}, /* 00,1d,09,cc */
	{0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
5001
	{}
5002
};
5003
static const struct usb_action pb0330_NoFlikerScale[] = {
5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},	/* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},	/* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0x09, ZC3XX_R01D_HSYNC_0},	/* 00,1d,09,cc */
	{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},	/* 00,1e,40,cc */
	{0xa0, 0x90, ZC3XX_R01F_HSYNC_2},	/* 00,1f,90,cc */
5018
	{}
5019 5020 5021
};

/* from oem9.inf - HKR,%PO2030%,Initial - 640x480 - (close to CS2102) */
5022
static const struct usb_action PO2030_mode0[] = {
5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
	{0xa0, 0x04, ZC3XX_R002_CLOCKSELECT},	/* 00,02,04,cc */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
	{0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
	{0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
	{0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
	{0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
	{0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
	{0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
	{0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
	{0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
	{0xaa, 0x8d, 0x0008},			/* 00,8d,08,aa */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},	/* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},	/* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},	/* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},	/* 01,1c,00,cc */
	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},	/* 00,9c,e6,cc */
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},	/* 00,9e,86,cc */
5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083
	{0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
	{0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
	{0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
	{0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
	{0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
	{0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
	{0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
	{0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
	{0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
	{0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
	{0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
	{0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
	{0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
	{0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
	{0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
	{0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
	{0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
	{0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
	{0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
	{0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
	{0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
	{0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
	{0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
	{0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
	{0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
	{0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
	{0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
	{0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
	{0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
	{0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
	{0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
	{0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
	{0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5084 5085 5086 5087
	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
5088
	{0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5089 5090 5091 5092 5093 5094
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
	{0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
	{0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
5095
	{}
5096 5097 5098
};

/* from oem9.inf - HKR,%PO2030%,InitialScale - 320x240 */
5099
static const struct usb_action PO2030_mode1[] = {
5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
	{0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
	{0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
	{0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
	{0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
	{0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
	{0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
	{0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
	{0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
	{0xaa, 0x8d, 0x0008},			/* 00,8d,08,aa */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160
	{0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
	{0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
	{0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
	{0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
	{0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
	{0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
	{0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
	{0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
	{0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
	{0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
	{0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
	{0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
	{0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
	{0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
	{0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
	{0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
	{0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
	{0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
	{0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
	{0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
	{0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
	{0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
	{0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
	{0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
	{0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
	{0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
	{0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
	{0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
	{0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
	{0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
	{0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
	{0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
	{0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
	{0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
5161 5162 5163 5164
	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
5165
	{0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
5166 5167 5168 5169 5170 5171
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
	{0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
	{0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
5172
	{}
5173 5174
};

5175
static const struct usb_action PO2030_50HZ[] = {
5176 5177 5178 5179
	{0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
	{0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
	{0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
	{0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193
	{0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
	{0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
	{0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
	{0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
	{0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
5194
	{}
5195 5196
};

5197
static const struct usb_action PO2030_60HZ[] = {
5198 5199 5200 5201
	{0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
	{0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
	{0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
	{0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216
	{0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
	{0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
	{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
	{0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
	{0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,22,cc */
	{0xa0, 0x88, ZC3XX_R18D_YTARGET},		/* 01,8d,88,cc */
							/* win: 01,8d,80 */
	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc */
5217
	{}
5218 5219
};

5220
static const struct usb_action PO2030_NoFliker[] = {
5221
	{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
5222 5223 5224 5225 5226 5227
	{0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
	{0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
	{0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
	{0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
	{0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
	{0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
5228
	{}
5229 5230 5231
};

/* TEST */
5232
static const struct usb_action tas5130CK_Initial[] = {
5233
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5234 5235 5236 5237 5238 5239
	{0xa0, 0x01, 0x003b},
	{0xa0, 0x0e, 0x003a},
	{0xa0, 0x01, 0x0038},
	{0xa0, 0x0b, 0x0039},
	{0xa0, 0x00, 0x0038},
	{0xa0, 0x0b, 0x0039},
5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xE7, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x87, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x2c, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5338
	{0xa0, 0x09, 0x01ad},
5339 5340 5341 5342 5343 5344 5345 5346
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0x6c, ZC3XX_R18D_YTARGET},
	{0xa0, 0x61, ZC3XX_R116_RGAIN},
	{0xa0, 0x65, ZC3XX_R118_BGAIN},
5347 5348
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427
	{0xa0, 0x4c, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf1, ZC3XX_R10B_RGB01},
	{0xa0, 0x03, ZC3XX_R10C_RGB02},
	{0xa0, 0xfe, ZC3XX_R10D_RGB10},
	{0xa0, 0x51, ZC3XX_R10E_RGB11},
	{0xa0, 0xf1, ZC3XX_R10F_RGB12},
	{0xa0, 0xec, ZC3XX_R110_RGB20},
	{0xa0, 0x03, ZC3XX_R111_RGB21},
	{0xa0, 0x51, ZC3XX_R112_RGB22},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x38, ZC3XX_R120_GAMMA00},	/* gamma > 5 */
	{0xa0, 0x51, ZC3XX_R121_GAMMA01},
	{0xa0, 0x6e, ZC3XX_R122_GAMMA02},
	{0xa0, 0x8c, ZC3XX_R123_GAMMA03},
	{0xa0, 0xa2, ZC3XX_R124_GAMMA04},
	{0xa0, 0xb6, ZC3XX_R125_GAMMA05},
	{0xa0, 0xc8, ZC3XX_R126_GAMMA06},
	{0xa0, 0xd6, ZC3XX_R127_GAMMA07},
	{0xa0, 0xe2, ZC3XX_R128_GAMMA08},
	{0xa0, 0xed, ZC3XX_R129_GAMMA09},
	{0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x12, ZC3XX_R130_GAMMA10},
	{0xa0, 0x1b, ZC3XX_R131_GAMMA11},
	{0xa0, 0x1d, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1a, ZC3XX_R133_GAMMA13},
	{0xa0, 0x15, ZC3XX_R134_GAMMA14},
	{0xa0, 0x12, ZC3XX_R135_GAMMA15},
	{0xa0, 0x0f, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x4c, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf1, ZC3XX_R10B_RGB01},
	{0xa0, 0x03, ZC3XX_R10C_RGB02},
	{0xa0, 0xfe, ZC3XX_R10D_RGB10},
	{0xa0, 0x51, ZC3XX_R10E_RGB11},
	{0xa0, 0xf1, ZC3XX_R10F_RGB12},
	{0xa0, 0xec, ZC3XX_R110_RGB20},
	{0xa0, 0x03, ZC3XX_R111_RGB21},
	{0xa0, 0x51, ZC3XX_R112_RGB22},
	{0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x09, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x34, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5428 5429
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
5430 5431
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5432
	{}
5433 5434
};

5435
static const struct usb_action tas5130CK_InitialScale[] = {
5436
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
5437 5438 5439 5440 5441 5442
	{0xa0, 0x01, 0x003b},
	{0xa0, 0x0e, 0x003a},
	{0xa0, 0x01, 0x0038},
	{0xa0, 0x0b, 0x0039},
	{0xa0, 0x00, 0x0038},
	{0xa0, 0x0b, 0x0039},
5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x83, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x01, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x08, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x06, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x02, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xe5, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x85, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x02, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x07, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x30, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x51, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x35, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x50, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x30, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x05, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x31, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x58, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x78, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x62, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x11, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x04, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x2B, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x2C, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7F, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x2D, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x2e, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x7f, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
5541
	{0xa0, 0x09, 0x01ad},
5542 5543 5544 5545 5546 5547 5548 5549
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
	{0xa0, 0x6c, ZC3XX_R18D_YTARGET},
	{0xa0, 0x61, ZC3XX_R116_RGAIN},
	{0xa0, 0x65, ZC3XX_R118_BGAIN},
5550 5551
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631
	{0xa0, 0x4c, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf1, ZC3XX_R10B_RGB01},
	{0xa0, 0x03, ZC3XX_R10C_RGB02},
	{0xa0, 0xfe, ZC3XX_R10D_RGB10},
	{0xa0, 0x51, ZC3XX_R10E_RGB11},
	{0xa0, 0xf1, ZC3XX_R10F_RGB12},
	{0xa0, 0xec, ZC3XX_R110_RGB20},
	{0xa0, 0x03, ZC3XX_R111_RGB21},
	{0xa0, 0x51, ZC3XX_R112_RGB22},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */
	{0xa0, 0x38, ZC3XX_R120_GAMMA00},	/* gamma > 5 */
	{0xa0, 0x51, ZC3XX_R121_GAMMA01},
	{0xa0, 0x6e, ZC3XX_R122_GAMMA02},
	{0xa0, 0x8c, ZC3XX_R123_GAMMA03},
	{0xa0, 0xa2, ZC3XX_R124_GAMMA04},
	{0xa0, 0xb6, ZC3XX_R125_GAMMA05},
	{0xa0, 0xc8, ZC3XX_R126_GAMMA06},
	{0xa0, 0xd6, ZC3XX_R127_GAMMA07},
	{0xa0, 0xe2, ZC3XX_R128_GAMMA08},
	{0xa0, 0xed, ZC3XX_R129_GAMMA09},
	{0xa0, 0xf5, ZC3XX_R12A_GAMMA0A},
	{0xa0, 0xfc, ZC3XX_R12B_GAMMA0B},
	{0xa0, 0xff, ZC3XX_R12C_GAMMA0C},
	{0xa0, 0xff, ZC3XX_R12D_GAMMA0D},
	{0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
	{0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
	{0xa0, 0x12, ZC3XX_R130_GAMMA10},
	{0xa0, 0x1b, ZC3XX_R131_GAMMA11},
	{0xa0, 0x1d, ZC3XX_R132_GAMMA12},
	{0xa0, 0x1a, ZC3XX_R133_GAMMA13},
	{0xa0, 0x15, ZC3XX_R134_GAMMA14},
	{0xa0, 0x12, ZC3XX_R135_GAMMA15},
	{0xa0, 0x0f, ZC3XX_R136_GAMMA16},
	{0xa0, 0x0d, ZC3XX_R137_GAMMA17},
	{0xa0, 0x0b, ZC3XX_R138_GAMMA18},
	{0xa0, 0x09, ZC3XX_R139_GAMMA19},
	{0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
	{0xa0, 0x05, ZC3XX_R13B_GAMMA1B},
	{0xa0, 0x00, ZC3XX_R13C_GAMMA1C},
	{0xa0, 0x00, ZC3XX_R13D_GAMMA1D},
	{0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
	{0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
	{0xa0, 0x4c, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xf1, ZC3XX_R10B_RGB01},
	{0xa0, 0x03, ZC3XX_R10C_RGB02},
	{0xa0, 0xfe, ZC3XX_R10D_RGB10},
	{0xa0, 0x51, ZC3XX_R10E_RGB11},
	{0xa0, 0xf1, ZC3XX_R10F_RGB12},
	{0xa0, 0xec, ZC3XX_R110_RGB20},
	{0xa0, 0x03, ZC3XX_R111_RGB21},
	{0xa0, 0x51, ZC3XX_R112_RGB22},
	{0xa0, 0x10, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
	{0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0x62, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
	{0xa0, 0xaa, ZC3XX_R093_I2CSETVALUE},
	{0xa0, 0x01, ZC3XX_R094_I2CWRITEACK},
	{0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5632 5633
	{0xa0, 0x09, 0x01ad},
	{0xa0, 0x15, 0x01ae},
5634 5635
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5636
	{0xa0, 0x30, 0x0007},
5637
	{0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
5638
	{0xa0, 0x00, 0x0007},
5639
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5640
	{}
5641 5642
};

5643
static const struct usb_action tas5130cxx_Initial[] = {
5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
	{0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
	{0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},

	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},

	{0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
	{0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
	{0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x68, ZC3XX_R18D_YTARGET},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5674
	{0xa0, 0x00, 0x01ad},
5675 5676 5677 5678
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5679 5680
	{0xa1, 0x01, 0x0002},
	{0xa1, 0x01, 0x0008},
5681 5682
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},	/* clock ? */
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
5683 5684 5685
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */

	{0xa0, 0x68, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xec, ZC3XX_R10B_RGB01},
	{0xa0, 0xec, ZC3XX_R10C_RGB02},
	{0xa0, 0xec, ZC3XX_R10D_RGB10},
	{0xa0, 0x68, ZC3XX_R10E_RGB11},
	{0xa0, 0xec, ZC3XX_R10F_RGB12},
	{0xa0, 0xec, ZC3XX_R110_RGB20},
	{0xa0, 0xec, ZC3XX_R111_RGB21},
	{0xa0, 0x68, ZC3XX_R112_RGB22},
5697 5698

	{0xa1, 0x01, 0x018d},
5699
	{0xa0, 0x90, ZC3XX_R18D_YTARGET},	/* 90 */
5700
	{0xa1, 0x01, 0x0180},
5701 5702
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5703 5704 5705

	{0xaa, 0xa3, 0x0001},
	{0xaa, 0xa4, 0x0077},
5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
	{0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW},

	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 00 */
	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},	/* 03 */
	{0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW},	/* e8 */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 0 */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 0 */
	{0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW},	/* 7d */

	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 08 */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 24 */
	{0xa0, 0xf0, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
	{0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},	/* 50 */
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5728
	{0xa1, 0x01, 0x0180},
5729
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5730
	{}
5731
};
5732
static const struct usb_action tas5130cxx_InitialScale[] = {
5733
/*??	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, */
5734 5735
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
	{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
5736

5737
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5738 5739
	{0xa1, 0x01, 0x0008},

5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764
	{0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
	{0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
	{0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
	{0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
	{0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
	{0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
	{0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
	{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
	{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
	{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
	{0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
	{0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
	{0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
	{0xa0, 0x68, ZC3XX_R18D_YTARGET},
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
5765
	{0xa0, 0x00, 0x01ad},
5766 5767 5768 5769
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
5770 5771 5772
	{0xa1, 0x01, 0x0002},
	{0xa1, 0x01, 0x0008},

5773
	{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
5774
	{0xa1, 0x01, 0x0008},	/* clock ? */
5775
	{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},	/* sharpness+ */
5776 5777 5778
	{0xa1, 0x01, 0x01c8},
	{0xa1, 0x01, 0x01c9},
	{0xa1, 0x01, 0x01ca},
5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789
	{0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},	/* sharpness- */

	{0xa0, 0x68, ZC3XX_R10A_RGB00},	/* matrix */
	{0xa0, 0xec, ZC3XX_R10B_RGB01},
	{0xa0, 0xec, ZC3XX_R10C_RGB02},
	{0xa0, 0xec, ZC3XX_R10D_RGB10},
	{0xa0, 0x68, ZC3XX_R10E_RGB11},
	{0xa0, 0xec, ZC3XX_R10F_RGB12},
	{0xa0, 0xec, ZC3XX_R110_RGB20},
	{0xa0, 0xec, ZC3XX_R111_RGB21},
	{0xa0, 0x68, ZC3XX_R112_RGB22},
5790 5791

	{0xa1, 0x01, 0x018d},
5792
	{0xa0, 0x90, ZC3XX_R18D_YTARGET},
5793
	{0xa1, 0x01, 0x0180},
5794 5795
	{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
5796 5797
	{0xaa, 0xa3, 0x0001},
	{0xaa, 0xa4, 0x0063},
5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
	{0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW},
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
	{0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW},
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
	{0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
	{0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
	{0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
	{0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
	{0xa0, 0xd3, ZC3XX_R01D_HSYNC_0},
	{0xa0, 0xda, ZC3XX_R01E_HSYNC_1},
	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH},
	{0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
	{0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
	{0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
5818
	{0xa1, 0x01, 0x0180},
5819
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
5820
	{}
5821
};
5822
static const struct usb_action tas5130cxx_50HZ[] = {
5823
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5824 5825
	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
	{0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
	{0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
	{0xa0, 0x38, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,38,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
	{0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
	{0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
	{0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5843
	{}
5844
};
5845
static const struct usb_action tas5130cxx_50HZScale[] = {
5846
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5847 5848
	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
	{0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
	{0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
	{0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
	{0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
	{0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
	{0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
	{0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5866
	{}
5867
};
5868
static const struct usb_action tas5130cxx_60HZ[] = {
5869
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5870 5871
	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
	{0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
	{0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
	{0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
	{0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5889
	{}
5890
};
5891
static const struct usb_action tas5130cxx_60HZScale[] = {
5892
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5893 5894
	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
	{0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
	{0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
	{0xa0, 0xe8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,e8,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
	{0xa0, 0x14, ZC3XX_R18C_AEFREEZE}, /* 01,8c,14,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
	{0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,26,cc */
	{0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
	{0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
5912
	{}
5913
};
5914
static const struct usb_action tas5130cxx_NoFliker[] = {
5915
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5916 5917
	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
	{0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
	{0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,01,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
	{0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5935
	{}
5936 5937
};

5938
static const struct usb_action tas5130cxx_NoFlikerScale[] = {
5939
	{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
5940 5941
	{0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
	{0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958
	{0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
	{0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
	{0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,03,cc */
	{0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
	{0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
	{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
	{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
	{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
	{0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
	{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
	{0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
	{0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
5959
	{}
5960 5961
};

5962
static const struct usb_action tas5130c_vf0250_Initial[] = {
5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc, */
	{0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},		/* 00,08,02,cc, */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc, */
	{0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},		/* 00,02,00,cc,
							 * 0<->10 */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc, */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc, */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc, */
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc, */
	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,98,cc, */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc, */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc, */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc, */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc, */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,00,cc, */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc, */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,00,cc, */
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,e6,cc,
							 * 6<->8 */
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,86,cc,
							 * 6<->8 */
	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},		/* 00,87,10,cc, */
	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,98,cc, */
5986 5987 5988 5989 5990
	{0xaa, 0x1b, 0x0024},		/* 00,1b,24,aa, */
	{0xdd, 0x00, 0x0080},		/* 00,00,80,dd, */
	{0xaa, 0x1b, 0x0000},		/* 00,1b,00,aa, */
	{0xaa, 0x13, 0x0002},		/* 00,13,02,aa, */
	{0xaa, 0x15, 0x0004},		/* 00,15,04,aa */
5991
/*??	{0xaa, 0x01, 0x0000}, */
5992 5993 5994
	{0xaa, 0x01, 0x0000},
	{0xaa, 0x1a, 0x0000},		/* 00,1a,00,aa, */
	{0xaa, 0x1c, 0x0017},		/* 00,1c,17,aa, */
5995 5996 5997
	{0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},		/* 00,86,82,cc, */
	{0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},		/* 00,87,83,cc, */
	{0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},		/* 00,88,84,cc, */
5998 5999 6000 6001 6002 6003 6004 6005 6006
	{0xaa, 0x05, 0x0010},		/* 00,05,10,aa, */
	{0xaa, 0x0a, 0x0000},		/* 00,0a,00,aa, */
	{0xaa, 0x0b, 0x00a0},		/* 00,0b,a0,aa, */
	{0xaa, 0x0c, 0x0000},		/* 00,0c,00,aa, */
	{0xaa, 0x0d, 0x00a0},		/* 00,0d,a0,aa, */
	{0xaa, 0x0e, 0x0000},		/* 00,0e,00,aa, */
	{0xaa, 0x0f, 0x00a0},		/* 00,0f,a0,aa, */
	{0xaa, 0x10, 0x0000},		/* 00,10,00,aa, */
	{0xaa, 0x11, 0x00a0},		/* 00,11,a0,aa, */
6007 6008
/*??	{0xa0, 0x00, 0x0039},
	{0xa1, 0x01, 0x0037}, */
6009 6010 6011 6012 6013
	{0xaa, 0x16, 0x0001},		/* 00,16,01,aa, */
	{0xaa, 0x17, 0x00e8},		/* 00,17,e6,aa, (e6 -> e8) */
	{0xaa, 0x18, 0x0002},		/* 00,18,02,aa, */
	{0xaa, 0x19, 0x0088},		/* 00,19,86,aa, */
	{0xaa, 0x20, 0x0020},		/* 00,20,20,aa, */
6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc, */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc, */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc, */
	{0xa0, 0x76, ZC3XX_R189_AWBSTATUS},		/* 01,89,76,cc, */
	{0xa0, 0x09, 0x01ad},				/* 01,ad,09,cc, */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc, */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc, */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc, */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc, */
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},		/* 01,a8,60,cc, */
	{0xa0, 0x61, ZC3XX_R116_RGAIN},			/* 01,16,61,cc, */
	{0xa0, 0x65, ZC3XX_R118_BGAIN},			/* 01,18,65,cc */
6026
	{}
6027 6028
};

6029
static const struct usb_action tas5130c_vf0250_InitialScale[] = {
6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051
	{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},		/* 00,00,01,cc, */
	{0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},		/* 00,08,02,cc, */
	{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},	/* 00,10,01,cc, */
	{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},		/* 00,02,10,cc, */
	{0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},	/* 00,03,02,cc, */
	{0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},		/* 00,04,80,cc, */
	{0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},	/* 00,05,01,cc, */
	{0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},	/* 00,06,e0,cc, */
	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,98,cc, */
	{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},	/* 00,01,01,cc, */
	{0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,03,cc, */
	{0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,01,cc, */
	{0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},		/* 00,98,00,cc, */
	{0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},		/* 00,9a,00,cc, */
	{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},		/* 01,1a,00,cc, */
	{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},		/* 01,1c,00,cc, */
	{0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},		/* 00,9c,e8,cc,
							 * 8<->6 */
	{0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},		/* 00,9e,88,cc,
							 * 8<->6 */
	{0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},		/* 00,87,10,cc, */
	{0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR},		/* 00,8b,98,cc, */
6052 6053 6054 6055 6056
	{0xaa, 0x1b, 0x0024},		/* 00,1b,24,aa, */
	{0xdd, 0x00, 0x0080},		/* 00,00,80,dd, */
	{0xaa, 0x1b, 0x0000},		/* 00,1b,00,aa, */
	{0xaa, 0x13, 0x0002},		/* 00,13,02,aa, */
	{0xaa, 0x15, 0x0004},		/* 00,15,04,aa */
6057
/*??	{0xaa, 0x01, 0x0000}, */
6058 6059 6060
	{0xaa, 0x01, 0x0000},
	{0xaa, 0x1a, 0x0000},		/* 00,1a,00,aa, */
	{0xaa, 0x1c, 0x0017},		/* 00,1c,17,aa, */
6061 6062 6063
	{0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH},	/* 00,86,82,cc, */
	{0xa0, 0x83, ZC3XX_R087_EXPTIMEMID},	/* 00,87,83,cc, */
	{0xa0, 0x84, ZC3XX_R088_EXPTIMELOW},	/* 00,88,84,cc, */
6064 6065 6066 6067 6068 6069 6070 6071 6072
	{0xaa, 0x05, 0x0010},		/* 00,05,10,aa, */
	{0xaa, 0x0a, 0x0000},		/* 00,0a,00,aa, */
	{0xaa, 0x0b, 0x00a0},		/* 00,0b,a0,aa, */
	{0xaa, 0x0c, 0x0000},		/* 00,0c,00,aa, */
	{0xaa, 0x0d, 0x00a0},		/* 00,0d,a0,aa, */
	{0xaa, 0x0e, 0x0000},		/* 00,0e,00,aa, */
	{0xaa, 0x0f, 0x00a0},		/* 00,0f,a0,aa, */
	{0xaa, 0x10, 0x0000},		/* 00,10,00,aa, */
	{0xaa, 0x11, 0x00a0},		/* 00,11,a0,aa, */
6073 6074
/*??	{0xa0, 0x00, 0x0039},
	{0xa1, 0x01, 0x0037}, */
6075 6076 6077 6078 6079
	{0xaa, 0x16, 0x0001},		/* 00,16,01,aa, */
	{0xaa, 0x17, 0x00e8},		/* 00,17,e6,aa (e6 -> e8) */
	{0xaa, 0x18, 0x0002},		/* 00,18,02,aa, */
	{0xaa, 0x19, 0x0088},		/* 00,19,88,aa, */
	{0xaa, 0x20, 0x0020},		/* 00,20,20,aa, */
6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091
	{0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},	/* 01,01,b7,cc, */
	{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},	/* 00,12,05,cc, */
	{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0d,cc, */
	{0xa0, 0x76, ZC3XX_R189_AWBSTATUS},		/* 01,89,76,cc, */
	{0xa0, 0x09, 0x01ad},				/* 01,ad,09,cc, */
	{0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},		/* 01,c5,03,cc, */
	{0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},		/* 01,cb,13,cc, */
	{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},	/* 02,50,08,cc, */
	{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},		/* 03,01,08,cc, */
	{0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},		/* 01,a8,60,cc, */
	{0xa0, 0x61, ZC3XX_R116_RGAIN},		/* 01,16,61,cc, */
	{0xa0, 0x65, ZC3XX_R118_BGAIN},		/* 01,18,65,cc */
6092
	{}
6093 6094
};
/* "50HZ" light frequency banding filter */
6095
static const struct usb_action tas5130c_vf0250_50HZ[] = {
6096 6097 6098
	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
	{0xaa, 0x83, 0x0001},		/* 00,83,01,aa */
	{0xaa, 0x84, 0x00aa},		/* 00,84,aa,aa */
6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
	{0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0d,cc, */
	{0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,50,cc, */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
	{0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,47,cc, */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc, */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc, */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc, */
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},		/* 01,8d,78,cc */
6116
	{}
6117 6118 6119
};

/* "50HZScale" light frequency banding filter */
6120
static const struct usb_action tas5130c_vf0250_50HZScale[] = {
6121 6122 6123
	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
	{0xaa, 0x83, 0x0003},		/* 00,83,03,aa */
	{0xaa, 0x84, 0x0054},		/* 00,84,54,aa */
6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
	{0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0d,cc, */
	{0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,50,cc, */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
	{0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,8e,cc, */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc, */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc, */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc, */
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},		/* 01,8d,78,cc */
6141
	{}
6142 6143 6144
};

/* "60HZ" light frequency banding filter */
6145
static const struct usb_action tas5130c_vf0250_60HZ[] = {
6146 6147 6148
	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
	{0xaa, 0x83, 0x0001},		/* 00,83,01,aa */
	{0xaa, 0x84, 0x0062},		/* 00,84,62,aa */
6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
	{0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,05,cc, */
	{0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,88,cc, */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
	{0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,3b,cc, */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,a9,10,cc, */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,aa,24,cc, */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc, */
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},		/* 01,8d,78,cc */
6166
	{}
6167 6168 6169
};

/* "60HZScale" light frequency banding ilter */
6170
static const struct usb_action tas5130c_vf0250_60HZScale[] = {
6171 6172 6173
	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
	{0xaa, 0x83, 0x0002},		/* 00,83,02,aa */
	{0xaa, 0x84, 0x00c4},		/* 00,84,c4,aa */
6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
	{0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,1,0b,cc, */
	{0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,2,10,cc, */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,5,00,cc, */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,6,00,cc, */
	{0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,7,76,cc, */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,c,0e,cc, */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,f,15,cc, */
	{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},	/* 01,9,10,cc, */
	{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},	/* 01,a,24,cc, */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,d,62,cc, */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,e,90,cc, */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,f,c8,cc, */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,0,ff,cc, */
	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,d,58,cc, */
	{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,42,cc, */
	{0xa0, 0x78, ZC3XX_R18D_YTARGET},		/* 01,d,78,cc */
6191
	{}
6192 6193 6194
};

/* "NoFliker" light frequency banding flter */
6195
static const struct usb_action tas5130c_vf0250_NoFliker[] = {
6196
	{0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0c,cc, */
6197 6198 6199
	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
	{0xaa, 0x83, 0x0000},		/* 00,83,00,aa */
	{0xaa, 0x84, 0x0020},		/* 00,84,20,aa */
6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,0,00,cc, */
	{0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,05,cc, */
	{0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,88,cc, */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,10,cc, */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
	{0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,03,cc */
6214
	{}
6215 6216 6217
};

/* "NoFlikerScale" light frequency banding filter */
6218
static const struct usb_action tas5130c_vf0250_NoFlikerScale[] = {
6219
	{0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE},		/* 01,00,0c,cc, */
6220 6221 6222
	{0xaa, 0x82, 0x0000},		/* 00,82,00,aa */
	{0xaa, 0x83, 0x0000},		/* 00,83,00,aa */
	{0xaa, 0x84, 0x0020},		/* 00,84,20,aa */
6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236
	{0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},	/* 01,90,00,cc, */
	{0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID},	/* 01,91,0b,cc, */
	{0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW},	/* 01,92,10,cc, */
	{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},	/* 01,95,00,cc, */
	{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},	/* 01,96,00,cc, */
	{0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW},	/* 01,97,10,cc, */
	{0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},		/* 01,8c,0e,cc, */
	{0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE},		/* 01,8f,15,cc, */
	{0xa0, 0x62, ZC3XX_R01D_HSYNC_0},		/* 00,1d,62,cc, */
	{0xa0, 0x90, ZC3XX_R01E_HSYNC_1},		/* 00,1e,90,cc, */
	{0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},		/* 00,1f,c8,cc, */
	{0xa0, 0xff, ZC3XX_R020_HSYNC_3},		/* 00,20,ff,cc, */
	{0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN},		/* 01,1d,58,cc, */
	{0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE},	/* 01,80,03,cc */
6237
	{}
6238 6239
};

6240
static u8 reg_r_i(struct gspca_dev *gspca_dev,
6241
		__u16 index)
6242
{
6243 6244
	usb_control_msg(gspca_dev->dev,
			usb_rcvctrlpipe(gspca_dev->dev, 0),
6245 6246 6247
			0xa1,
			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
			0x01,			/* value */
6248
			index, gspca_dev->usb_buf, 1,
6249
			500);
6250
	return gspca_dev->usb_buf[0];
6251 6252
}

6253
static u8 reg_r(struct gspca_dev *gspca_dev,
6254
		__u16 index)
6255
{
6256
	u8 ret;
6257 6258 6259 6260

	ret = reg_r_i(gspca_dev, index);
	PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
	return ret;
6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278
}

static void reg_w_i(struct usb_device *dev,
			__u8 value,
			__u16 index)
{
	usb_control_msg(dev,
			usb_sndctrlpipe(dev, 0),
			0xa0,
			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
			value, index, NULL, 0,
			500);
}

static void reg_w(struct usb_device *dev,
			__u8 value,
			__u16 index)
{
6279
	PDEBUG(D_USBO, "reg w [%04x] = %02x", index, value);
6280 6281 6282
	reg_w_i(dev, value, index);
}

6283 6284
static __u16 i2c_read(struct gspca_dev *gspca_dev,
			__u8 reg)
6285 6286
{
	__u8 retbyte;
6287
	__u16 retval;
6288

6289 6290
	reg_w_i(gspca_dev->dev, reg, 0x0092);
	reg_w_i(gspca_dev->dev, 0x02, 0x0090);		/* <- read command */
6291
	msleep(25);
6292
	retbyte = reg_r_i(gspca_dev, 0x0091);		/* read status */
6293 6294 6295 6296 6297
	retval = reg_r_i(gspca_dev, 0x0095);		/* read Lowbyte */
	retval |= reg_r_i(gspca_dev, 0x0096) << 8;	/* read Hightbyte */
	PDEBUG(D_USBO, "i2c r [%02x] -> %04x (%02x)",
			reg, retval, retbyte);
	return retval;
6298 6299
}

6300
static __u8 i2c_write(struct gspca_dev *gspca_dev,
6301 6302 6303 6304 6305 6306
			__u8 reg,
			__u8 valL,
			__u8 valH)
{
	__u8 retbyte;

6307 6308 6309 6310
	reg_w_i(gspca_dev->dev, reg, 0x92);
	reg_w_i(gspca_dev->dev, valL, 0x93);
	reg_w_i(gspca_dev->dev, valH, 0x94);
	reg_w_i(gspca_dev->dev, 0x01, 0x90);		/* <- write command */
6311
	msleep(15);
6312
	retbyte = reg_r_i(gspca_dev, 0x0091);		/* read status */
6313
	PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
6314 6315 6316 6317
			reg, valH, valL, retbyte);
	return retbyte;
}

6318
static void usb_exchange(struct gspca_dev *gspca_dev,
6319
			const struct usb_action *action)
6320 6321 6322 6323
{
	while (action->req) {
		switch (action->req) {
		case 0xa0:	/* write register */
6324
			reg_w(gspca_dev->dev, action->val, action->idx);
6325 6326
			break;
		case 0xa1:	/* read status */
6327
			reg_r(gspca_dev, action->idx);
6328 6329
			break;
		case 0xaa:
6330
			i2c_write(gspca_dev,
6331 6332 6333 6334
				  action->val,			/* reg */
				  action->idx & 0xff,		/* valL */
				  action->idx >> 8);		/* valH */
			break;
6335 6336 6337 6338 6339 6340
		case 0xbb:
			i2c_write(gspca_dev,
				  action->idx >> 8,		/* reg */
				  action->idx & 0xff,		/* valL */
				  action->val);			/* valH */
			break;
6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354
		default:
/*		case 0xdd:	 * delay */
			msleep(action->val / 64 + 10);
			break;
		}
		action++;
/*		msleep(1); */
	}
}

static void setmatrix(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	int i;
6355
	const __u8 *matrix;
6356 6357
	static const u8 adcm2700_matrix[9] =
		{0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66};
6358
	static const __u8 gc0305_matrix[9] =
6359
		{0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
6360
	static const __u8 ov7620_matrix[9] =
6361
		{0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
6362 6363
	static const __u8 pas202b_matrix[9] =
		{0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
6364
	static const __u8 po2030_matrix[9] =
6365
		{0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
6366 6367
	static const __u8 vf0250_matrix[9] =
		{0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
6368
	static const __u8 *matrix_tb[SENSOR_MAX] = {
6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386
		adcm2700_matrix, /* SENSOR_ADCM2700 0 */
		NULL,		/* SENSOR_CS2102 1 */
		NULL,		/* SENSOR_CS2102K 2 */
		gc0305_matrix,	/* SENSOR_GC0305 3 */
		NULL,		/* SENSOR_HDCS2020b 4 */
		NULL,		/* SENSOR_HV7131B 5 */
		NULL,		/* SENSOR_HV7131C 6 */
		NULL,		/* SENSOR_ICM105A 7 */
		NULL,		/* SENSOR_MC501CB 8 */
		ov7620_matrix,	/* SENSOR_OV7620 9 */
		NULL,		/* SENSOR_OV7630C 10 */
		NULL,		/* SENSOR_PAS106 11 */
		pas202b_matrix,	/* SENSOR_PAS202B 12 */
		NULL,		/* SENSOR_PB0330 13 */
		po2030_matrix,	/* SENSOR_PO2030 14 */
		NULL,		/* SENSOR_TAS5130CK 15 */
		NULL,		/* SENSOR_TAS5130CXX 16 */
		vf0250_matrix,	/* SENSOR_TAS5130C_VF0250 17 */
6387
	};
6388

6389 6390 6391
	matrix = matrix_tb[sd->sensor];
	if (matrix == NULL)
		return;		/* matrix already loaded */
6392 6393 6394 6395 6396 6397 6398 6399 6400 6401
	for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
		reg_w(gspca_dev->dev, matrix[i], 0x010a + i);
}

static void setbrightness(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	__u8 brightness;

	switch (sd->sensor) {
6402
	case SENSOR_ADCM2700:
6403 6404 6405 6406 6407
	case SENSOR_GC0305:
	case SENSOR_OV7620:
	case SENSOR_PO2030:
		return;
	}
6408
/*fixme: is it really write to 011d and 018d for all other sensors? */
6409 6410
	brightness = sd->brightness;
	reg_w(gspca_dev->dev, brightness, 0x011d);
6411 6412
	if (sd->sensor == SENSOR_HV7131B)
		return;
6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424
	if (brightness < 0x70)
		brightness += 0x10;
	else
		brightness = 0x80;
	reg_w(gspca_dev->dev, brightness, 0x018d);
}

static void setsharpness(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	struct usb_device *dev = gspca_dev->dev;
	int sharpness;
6425
	static const __u8 sharpness_tb[][2] = {
6426 6427 6428 6429 6430 6431
		{0x02, 0x03},
		{0x04, 0x07},
		{0x08, 0x0f},
		{0x10, 0x1e}
	};

6432
	sharpness = sd->sharpness;
6433
	reg_w(dev, sharpness_tb[sharpness][0], 0x01c6);
6434 6435 6436
	reg_r(gspca_dev, 0x01c8);
	reg_r(gspca_dev, 0x01c9);
	reg_r(gspca_dev, 0x01ca);
6437 6438 6439 6440 6441 6442 6443
	reg_w(dev, sharpness_tb[sharpness][1], 0x01cb);
}

static void setcontrast(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	struct usb_device *dev = gspca_dev->dev;
6444
	const __u8 *Tgamma, *Tgradient;
6445
	int g, i, k;
6446
	static const __u8 kgamma_tb[16] =	/* delta for contrast */
6447 6448
		{0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08,
		 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
6449
	static const __u8 kgrad_tb[16] =
6450 6451
		{0x1b, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00,
		 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x04};
6452
	static const __u8 Tgamma_1[16] =
6453 6454
		{0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
		 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff};
6455
	static const __u8 Tgradient_1[16] =
6456 6457
		{0x00, 0x01, 0x05, 0x0b, 0x10, 0x15, 0x18, 0x1a,
		 0x1a, 0x18, 0x16, 0x14, 0x12, 0x0f, 0x0d, 0x06};
6458
	static const __u8 Tgamma_2[16] =
6459 6460
		{0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
		 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff};
6461
	static const __u8 Tgradient_2[16] =
6462 6463
		{0x05, 0x0f, 0x16, 0x1a, 0x19, 0x19, 0x17, 0x15,
		 0x12, 0x10, 0x0e, 0x0b, 0x09, 0x08, 0x06, 0x03};
6464
	static const __u8 Tgamma_3[16] =
6465 6466
		{0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
		 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff};
6467
	static const __u8 Tgradient_3[16] =
6468 6469
		{0x0c, 0x16, 0x1b, 0x1c, 0x19, 0x18, 0x15, 0x12,
		 0x10, 0x0d, 0x0b, 0x09, 0x08, 0x06, 0x05, 0x03};
6470
	static const __u8 Tgamma_4[16] =
6471 6472
		{0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
		 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff};
6473
	static const __u8 Tgradient_4[16] =
6474 6475
		{0x26, 0x22, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0d,
		 0x0b, 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02};
6476
	static const __u8 Tgamma_5[16] =
6477 6478
		{0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
		 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff};
6479
	static const __u8 Tgradient_5[16] =
6480 6481
		{0x37, 0x26, 0x20, 0x1a, 0x14, 0x10, 0x0e, 0x0b,
		 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x02};
6482
	static const __u8 Tgamma_6[16] =		/* ?? was gamma 5 */
6483 6484
		{0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
		 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff};
6485
	static const __u8 Tgradient_6[16] =
6486 6487
		{0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
		 0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
6488
	static const __u8 *gamma_tb[] = {
6489
		NULL, Tgamma_1, Tgamma_2,
6490 6491
		Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
	};
6492
	static const __u8 *gradient_tb[] = {
6493
		NULL, Tgradient_1, Tgradient_2,
6494 6495
		Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
	};
6496
#ifdef GSPCA_DEBUG
6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513
	__u8 v[16];
#endif

	Tgamma = gamma_tb[sd->gamma];
	Tgradient = gradient_tb[sd->gamma];

	k = (sd->contrast - 128)		/* -128 / 128 */
			* Tgamma[0];
	PDEBUG(D_CONF, "gamma:%d contrast:%d gamma coeff: %d/128",
		sd->gamma, sd->contrast, k);
	for (i = 0; i < 16; i++) {
		g = Tgamma[i] + kgamma_tb[i] * k / 128;
		if (g > 0xff)
			g = 0xff;
		else if (g <= 0)
			g = 1;
		reg_w(dev, g, 0x0120 + i);	/* gamma */
6514
#ifdef GSPCA_DEBUG
6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533
		if (gspca_debug & D_CONF)
			v[i] = g;
#endif
	}
	PDEBUG(D_CONF, "tb: %02x %02x %02x %02x %02x %02x %02x %02x",
		v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
	PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
		v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
	for (i = 0; i < 16; i++) {
		g = Tgradient[i] - kgrad_tb[i] * k / 128;
		if (g > 0xff)
			g = 0xff;
		else if (g <= 0) {
			if (i != 15)
				g = 0;
			else
				g = 1;
		}
		reg_w(dev, g, 0x0130 + i);	/* gradient */
6534
#ifdef GSPCA_DEBUG
6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552
		if (gspca_debug & D_CONF)
			v[i] = g;
#endif
	}
	PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
		v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
	PDEBUG(D_CONF, "    %02x %02x %02x %02x %02x %02x %02x %02x",
		v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]);
}

static void setquality(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	struct usb_device *dev = gspca_dev->dev;
	__u8 frxt;

	switch (sd->sensor) {
	case SENSOR_GC0305:
6553
	case SENSOR_HV7131B:
6554 6555 6556 6557 6558
	case SENSOR_OV7620:
	case SENSOR_PO2030:
		return;
	}
/*fixme: is it really 0008 0007 0018 for all other sensors? */
6559
	reg_w(dev, QUANT_VAL, 0x0008);
6560 6561
	frxt = 0x30;
	reg_w(dev, frxt, 0x0007);
6562 6563 6564 6565 6566 6567 6568 6569 6570
#if QUANT_VAL == 0 || QUANT_VAL == 1 || QUANT_VAL == 2
	frxt = 0xff;
#elif QUANT_VAL == 3
	frxt = 0xf0;
#elif QUANT_VAL == 4
	frxt = 0xe0;
#else
	frxt = 0x20;
#endif
6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584
	reg_w(dev, frxt, 0x0018);
}

/* Matches the sensor's internal frame rate to the lighting frequency.
 * Valid frequencies are:
 *	50Hz, for European and Asian lighting (default)
 *	60Hz, for American lighting
 *	0 = No Fliker (for outdoore usage)
 * Returns: 0 for success
 */
static int setlightfreq(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	int i, mode;
6585 6586
	const struct usb_action *zc3_freq;
	static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
6587
/* SENSOR_ADCM2700 0 */
6588 6589 6590
		{adcm2700_NoFliker, adcm2700_NoFliker,
		 adcm2700_50HZ, adcm2700_50HZ,
		 adcm2700_60HZ, adcm2700_60HZ},
6591
/* SENSOR_CS2102 1 */
6592 6593 6594
		{cs2102_NoFliker, cs2102_NoFlikerScale,
		 cs2102_50HZ, cs2102_50HZScale,
		 cs2102_60HZ, cs2102_60HZScale},
6595
/* SENSOR_CS2102K 2 */
6596
		{cs2102_NoFliker, cs2102_NoFlikerScale,
6597 6598
		 NULL, NULL, /* currently disabled */
		 NULL, NULL},
6599
/* SENSOR_GC0305 3 */
6600 6601 6602
		{gc0305_NoFliker, gc0305_NoFliker,
		 gc0305_50HZ, gc0305_50HZ,
		 gc0305_60HZ, gc0305_60HZ},
6603
/* SENSOR_HDCS2020b 4 */
6604 6605 6606
		{hdcs2020b_NoFliker, hdcs2020b_NoFliker,
		 hdcs2020b_50HZ, hdcs2020b_50HZ,
		 hdcs2020b_60HZ, hdcs2020b_60HZ},
6607
/* SENSOR_HV7131B 5 */
6608 6609 6610
		{hv7131b_NoFlikerScale, hv7131b_NoFliker,
		 hv7131b_50HZScale, hv7131b_50HZ,
		 hv7131b_60HZScale, hv7131b_60HZ},
6611
/* SENSOR_HV7131C 6 */
6612 6613 6614
		{NULL, NULL,
		 NULL, NULL,
		 NULL, NULL},
6615
/* SENSOR_ICM105A 7 */
6616 6617 6618
		{icm105a_NoFliker, icm105a_NoFlikerScale,
		 icm105a_50HZ, icm105a_50HZScale,
		 icm105a_60HZ, icm105a_60HZScale},
6619
/* SENSOR_MC501CB 8 */
6620 6621 6622
		{MC501CB_NoFliker, MC501CB_NoFlikerScale,
		 MC501CB_50HZ, MC501CB_50HZScale,
		 MC501CB_60HZ, MC501CB_60HZScale},
6623
/* SENSOR_OV7620 9 */
6624 6625 6626
		{OV7620_NoFliker, OV7620_NoFliker,
		 OV7620_50HZ, OV7620_50HZ,
		 OV7620_60HZ, OV7620_60HZ},
6627
/* SENSOR_OV7630C 10 */
6628 6629 6630
		{NULL, NULL,
		 NULL, NULL,
		 NULL, NULL},
6631
/* SENSOR_PAS106 11 */
6632 6633 6634
		{pas106b_NoFliker, pas106b_NoFliker,
		 pas106b_50HZ, pas106b_50HZ,
		 pas106b_60HZ, pas106b_60HZ},
6635
/* SENSOR_PAS202B 12 */
6636 6637 6638
		{pas202b_NoFlikerScale, pas202b_NoFliker,
		 pas202b_50HZScale, pas202b_50HZ,
		 pas202b_60HZScale, pas202b_60HZ},
6639
/* SENSOR_PB0330 13 */
6640 6641 6642
		{pb0330_NoFliker, pb0330_NoFlikerScale,
		 pb0330_50HZ, pb0330_50HZScale,
		 pb0330_60HZ, pb0330_60HZScale},
6643
/* SENSOR_PO2030 14 */
6644 6645 6646
		{PO2030_NoFliker, PO2030_NoFliker,
		 PO2030_50HZ, PO2030_50HZ,
		 PO2030_60HZ, PO2030_60HZ},
6647
/* SENSOR_TAS5130CK 15 */
6648 6649 6650
		{tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
		 tas5130cxx_50HZ, tas5130cxx_50HZScale,
		 tas5130cxx_60HZ, tas5130cxx_60HZScale},
6651
/* SENSOR_TAS5130CXX 16 */
6652 6653 6654
		{tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
		 tas5130cxx_50HZ, tas5130cxx_50HZScale,
		 tas5130cxx_60HZ, tas5130cxx_60HZScale},
6655
/* SENSOR_TAS5130C_VF0250 17 */
6656 6657 6658
		{tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale,
		 tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale,
		 tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale},
6659 6660
	};

6661
	i = sd->lightfreq * 2;
6662
	mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
6663 6664 6665
	if (!mode)
		i++;			/* 640x480 */
	zc3_freq = freq_tb[(int) sd->sensor][i];
6666
	if (zc3_freq != NULL) {
6667
		usb_exchange(gspca_dev, zc3_freq);
6668 6669 6670
		switch (sd->sensor) {
		case SENSOR_GC0305:
			if (mode			/* if 320x240 */
6671
			    && sd->lightfreq == 1)	/* and 50Hz */
6672 6673 6674 6675 6676
				reg_w(gspca_dev->dev, 0x85, 0x018d);
						/* win: 0x80, 0x018d */
			break;
		case SENSOR_OV7620:
			if (!mode) {			/* if 640x480 */
6677
				if (sd->lightfreq != 0)	/* and 50 or 60 Hz */
6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701
					reg_w(gspca_dev->dev, 0x40, 0x0002);
				else
					reg_w(gspca_dev->dev, 0x44, 0x0002);
			}
			break;
		}
	}
	return 0;
}

static void setautogain(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	__u8 autoval;

	if (sd->autogain)
		autoval = 0x42;
	else
		autoval = 0x02;
	reg_w(gspca_dev->dev, autoval, 0x0180);
}

static void send_unknown(struct usb_device *dev, int sensor)
{
6702
	reg_w(dev, 0x01, 0x0000);		/* led off */
6703 6704 6705 6706 6707 6708
	switch (sensor) {
	case SENSOR_PAS106:
		reg_w(dev, 0x03, 0x003a);
		reg_w(dev, 0x0c, 0x003b);
		reg_w(dev, 0x08, 0x0038);
		break;
6709
	case SENSOR_ADCM2700:
6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731
	case SENSOR_GC0305:
	case SENSOR_OV7620:
	case SENSOR_PB0330:
	case SENSOR_PO2030:
		reg_w(dev, 0x0d, 0x003a);
		reg_w(dev, 0x02, 0x003b);
		reg_w(dev, 0x00, 0x0038);
		break;
	}
}

/* start probe 2 wires */
static void start_2wr_probe(struct usb_device *dev, int sensor)
{
	reg_w(dev, 0x01, 0x0000);
	reg_w(dev, sensor, 0x0010);
	reg_w(dev, 0x01, 0x0001);
	reg_w(dev, 0x03, 0x0012);
	reg_w(dev, 0x01, 0x0012);
/*	msleep(2); */
}

6732
static int sif_probe(struct gspca_dev *gspca_dev)
6733 6734 6735
{
	__u16 checkword;

6736 6737
	start_2wr_probe(gspca_dev->dev, 0x0f);		/* PAS106 */
	reg_w(gspca_dev->dev, 0x08, 0x008d);
6738
	msleep(150);
6739 6740
	checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
			| ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
6741 6742
	PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
	if (checkword == 0x0007) {
6743
		send_unknown(gspca_dev->dev, SENSOR_PAS106);
6744 6745 6746 6747 6748
		return 0x0f;			/* PAS106 */
	}
	return -1;
}

6749
static int vga_2wr_probe(struct gspca_dev *gspca_dev)
6750
{
6751
	struct usb_device *dev = gspca_dev->dev;
6752
	u16 retword;
6753 6754

	start_2wr_probe(dev, 0x00);		/* HV7131B */
6755
	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6756 6757
	retword = i2c_read(gspca_dev, 0x01);
	if (retword != 0)
6758 6759 6760
		return 0x00;			/* HV7131B */

	start_2wr_probe(dev, 0x04);		/* CS2102 */
6761
	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6762 6763
	retword = i2c_read(gspca_dev, 0x01);
	if (retword != 0)
6764 6765 6766
		return 0x04;			/* CS2102 */

	start_2wr_probe(dev, 0x06);		/* OmniVision */
6767
	reg_w(dev, 0x08, 0x008d);
6768
	i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
6769 6770
	retword = i2c_read(gspca_dev, 0x11);
	if (retword != 0) {
6771 6772 6773 6774 6775 6776
		/* (should have returned 0xaa) --> Omnivision? */
		/* reg_r 0x10 -> 0x06 -->  */
		goto ov_check;
	}

	start_2wr_probe(dev, 0x08);		/* HDCS2020 */
6777
	i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
6778 6779
	retword = i2c_read(gspca_dev, 0x15);
	if (retword != 0)
6780 6781 6782
		return 0x08;			/* HDCS2020 */

	start_2wr_probe(dev, 0x0a);		/* PB0330 */
6783
	i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
6784 6785
	retword = i2c_read(gspca_dev, 0x07);
	if (retword != 0)
6786
		return 0x0a;			/* PB0330 */
6787 6788
	retword = i2c_read(gspca_dev, 0x03);
	if (retword != 0)
6789
		return 0x0a;			/* PB0330 ?? */
6790 6791
	retword = i2c_read(gspca_dev, 0x04);
	if (retword != 0)
6792 6793 6794
		return 0x0a;			/* PB0330 ?? */

	start_2wr_probe(dev, 0x0c);		/* ICM105A */
6795
	i2c_write(gspca_dev, 0x01, 0x11, 0x00);
6796 6797
	retword = i2c_read(gspca_dev, 0x01);
	if (retword != 0)
6798 6799 6800
		return 0x0c;			/* ICM105A */

	start_2wr_probe(dev, 0x0e);		/* PAS202BCB */
6801
	reg_w(dev, 0x08, 0x008d);
6802
	i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
6803
	msleep(500);
6804 6805
	retword = i2c_read(gspca_dev, 0x03);
	if (retword != 0)
6806 6807 6808
		return 0x0e;			/* PAS202BCB */

	start_2wr_probe(dev, 0x02);		/* ?? */
6809
	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
6810 6811
	retword = i2c_read(gspca_dev, 0x01);
	if (retword != 0)
6812 6813
		return 0x02;			/* ?? */
ov_check:
6814 6815
	reg_r(gspca_dev, 0x0010);		/* ?? */
	reg_r(gspca_dev, 0x0010);
6816 6817 6818 6819 6820 6821 6822 6823

	reg_w(dev, 0x01, 0x0000);
	reg_w(dev, 0x01, 0x0001);
	reg_w(dev, 0x06, 0x0010);		/* OmniVision */
	reg_w(dev, 0xa1, 0x008b);
	reg_w(dev, 0x08, 0x008d);
	msleep(500);
	reg_w(dev, 0x01, 0x0012);
6824
	i2c_write(gspca_dev, 0x12, 0x80, 0x00);	/* sensor reset */
6825 6826 6827 6828
	retword = i2c_read(gspca_dev, 0x0a) << 8;
	retword |= i2c_read(gspca_dev, 0x0b);
	PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", retword);
	switch (retword) {
6829 6830 6831 6832 6833 6834 6835 6836 6837
	case 0x7631:				/* OV7630C */
		reg_w(dev, 0x06, 0x0010);
		break;
	case 0x7620:				/* OV7620 */
	case 0x7648:				/* OV7648 */
		break;
	default:
		return -1;			/* not OmniVision */
	}
6838
	return retword;
6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850
}

struct sensor_by_chipset_revision {
	__u16 revision;
	__u8 internal_sensor_id;
};
static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
	{0xc001, 0x13},		/* MI0360 */
	{0xe001, 0x13},
	{0x8001, 0x13},
	{0x8000, 0x14},		/* CS2102K */
	{0x8400, 0x15},		/* TAS5130K */
6851
	{0x4001, 0x16},		/* ADCM2700 */
6852 6853 6854 6855 6856 6857 6858 6859
};

static int vga_3wr_probe(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	struct usb_device *dev = gspca_dev->dev;
	int i;
	__u8 retbyte;
6860
	u16 retword;
6861 6862 6863

/*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
	reg_w(dev, 0x02, 0x0010);
6864
	reg_r(gspca_dev, 0x0010);
6865 6866 6867 6868 6869 6870 6871
	reg_w(dev, 0x01, 0x0000);
	reg_w(dev, 0x00, 0x0010);
	reg_w(dev, 0x01, 0x0001);
	reg_w(dev, 0x91, 0x008b);
	reg_w(dev, 0x03, 0x0012);
	reg_w(dev, 0x01, 0x0012);
	reg_w(dev, 0x05, 0x0012);
6872 6873
	retword = i2c_read(gspca_dev, 0x14);
	if (retword != 0)
6874
		return 0x11;			/* HV7131R */
6875 6876
	retword = i2c_read(gspca_dev, 0x15);
	if (retword != 0)
6877
		return 0x11;			/* HV7131R */
6878 6879
	retword = i2c_read(gspca_dev, 0x16);
	if (retword != 0)
6880 6881 6882
		return 0x11;			/* HV7131R */

	reg_w(dev, 0x02, 0x0010);
6883 6884 6885
	retword = reg_r(gspca_dev, 0x000b) << 8;
	retword |= reg_r(gspca_dev, 0x000a);
	PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword);
6886
	reg_r(gspca_dev, 0x0010);
6887
	/* this is tested only once anyway */
6888
	for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6889 6890
		if (chipset_revision_sensor[i].revision == retword) {
			sd->chip_revision = retword;
6891 6892 6893 6894 6895
			send_unknown(dev, SENSOR_PB0330);
			return chipset_revision_sensor[i].internal_sensor_id;
		}
	}

6896
	reg_w(dev, 0x01, 0x0000);	/* check ?? */
6897 6898 6899 6900 6901
	reg_w(dev, 0x01, 0x0001);
	reg_w(dev, 0xdd, 0x008b);
	reg_w(dev, 0x0a, 0x0010);
	reg_w(dev, 0x03, 0x0012);
	reg_w(dev, 0x01, 0x0012);
6902 6903
	retword = i2c_read(gspca_dev, 0x00);
	if (retword != 0) {
6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914
		PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
		return 0x0a;			/* ?? */
	}

	reg_w(dev, 0x01, 0x0000);
	reg_w(dev, 0x01, 0x0001);
	reg_w(dev, 0x98, 0x008b);
	reg_w(dev, 0x01, 0x0010);
	reg_w(dev, 0x03, 0x0012);
	msleep(2);
	reg_w(dev, 0x01, 0x0012);
6915 6916 6917 6918
	retword = i2c_read(gspca_dev, 0x00);
	if (retword != 0) {
		PDEBUG(D_PROBE, "probe 3wr vga type %02x", retword);
		if (retword == 0x0011)			/* VF0250 */
6919
			return 0x0250;
6920
		if (retword == 0x0029)			/* gc0305 */
6921
			send_unknown(dev, SENSOR_GC0305);
6922
		return retword;
6923 6924 6925 6926 6927 6928 6929 6930 6931
	}

	reg_w(dev, 0x01, 0x0000);	/* check OmniVision */
	reg_w(dev, 0x01, 0x0001);
	reg_w(dev, 0xa1, 0x008b);
	reg_w(dev, 0x08, 0x008d);
	reg_w(dev, 0x06, 0x0010);
	reg_w(dev, 0x01, 0x0012);
	reg_w(dev, 0x05, 0x0012);
6932 6933
	if (i2c_read(gspca_dev, 0x1c) == 0x007f	/* OV7610 - manufacturer ID */
	    && i2c_read(gspca_dev, 0x1d) == 0x00a2) {
6934 6935 6936 6937
		send_unknown(dev, SENSOR_OV7620);
		return 0x06;		/* OmniVision confirm ? */
	}

6938 6939 6940 6941 6942 6943
	reg_w(dev, 0x01, 0x0000);
	reg_w(dev, 0x00, 0x0002);
	reg_w(dev, 0x01, 0x0010);
	reg_w(dev, 0x01, 0x0001);
	reg_w(dev, 0xee, 0x008b);
	reg_w(dev, 0x03, 0x0012);
6944
/*	msleep(150); */
6945 6946
	reg_w(dev, 0x01, 0x0012);
	reg_w(dev, 0x05, 0x0012);
6947 6948 6949 6950
	retword = i2c_read(gspca_dev, 0x00) << 8;	/* ID 0 */
	retword |= i2c_read(gspca_dev, 0x01);		/* ID 1 */
	PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", retword);
	if (retword == 0x2030) {
6951
		retbyte = i2c_read(gspca_dev, 0x02);	/* revision number */
6952 6953
		PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
		send_unknown(dev, SENSOR_PO2030);
6954
		return retword;
6955 6956
	}

6957 6958 6959 6960 6961 6962 6963 6964
	reg_w(dev, 0x01, 0x0000);
	reg_w(dev, 0x0a, 0x0010);
	reg_w(dev, 0xd3, 0x008b);
	reg_w(dev, 0x01, 0x0001);
	reg_w(dev, 0x03, 0x0012);
	reg_w(dev, 0x01, 0x0012);
	reg_w(dev, 0x05, 0x0001);
	reg_w(dev, 0xd3, 0x008b);
6965 6966 6967
	retword = i2c_read(gspca_dev, 0x01);
	if (retword != 0) {
		PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword);
6968
		return retword;
6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979
	}
	return -1;
}

static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
	int sensor, sensor2;

	switch (sd->sensor) {
	case SENSOR_MC501CB:
6980
		return -1;		/* don't probe */
6981
	case SENSOR_TAS5130C_VF0250:
6982
			/* may probe but with no write in reg 0x0010 */
6983
		return -1;		/* don't probe */
6984 6985 6986 6987 6988
	case SENSOR_PAS106:
		sensor =  sif_probe(gspca_dev);
		if (sensor >= 0)
			return sensor;
		break;
6989
	}
6990
	sensor = vga_2wr_probe(gspca_dev);
6991 6992 6993 6994 6995 6996
	if (sensor >= 0) {
		if (sensor < 0x7600)
			return sensor;
		/* next probe is needed for OmniVision ? */
	}
	sensor2 = vga_3wr_probe(gspca_dev);
6997 6998 6999 7000
	if (sensor2 >= 0
	    && sensor >= 0)
		return sensor;
	return sensor2;
7001 7002 7003 7004 7005 7006 7007 7008 7009 7010
}

/* this function is called at probe time */
static int sd_config(struct gspca_dev *gspca_dev,
			const struct usb_device_id *id)
{
	struct sd *sd = (struct sd *) gspca_dev;
	struct cam *cam;
	int sensor;
	int vga = 1;		/* 1: vga, 0: sif */
7011
	static const __u8 gamma[SENSOR_MAX] = {
7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029
		4,	/* SENSOR_ADCM2700 0 */
		5,	/* SENSOR_CS2102 1 */
		5,	/* SENSOR_CS2102K 2 */
		4,	/* SENSOR_GC0305 3 */
		4,	/* SENSOR_HDCS2020b 4 */
		4,	/* SENSOR_HV7131B 5 */
		4,	/* SENSOR_HV7131C 6 */
		4,	/* SENSOR_ICM105A 7 */
		4,	/* SENSOR_MC501CB 8 */
		3,	/* SENSOR_OV7620 9 */
		4,	/* SENSOR_OV7630C 10 */
		4,	/* SENSOR_PAS106 11 */
		4,	/* SENSOR_PAS202B 12 */
		4,	/* SENSOR_PB0330 13 */
		4,	/* SENSOR_PO2030 14 */
		4,	/* SENSOR_TAS5130CK 15 */
		4,	/* SENSOR_TAS5130CXX 16 */
		3,	/* SENSOR_TAS5130C_VF0250 17 */
7030 7031 7032
	};

	/* define some sensors from the vendor/product */
7033
	sd->sharpness = 2;
7034
	sd->sensor = id->driver_info;
7035 7036
	sensor = zcxx_probeSensor(gspca_dev);
	if (sensor >= 0)
7037
		PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079
	if ((unsigned) force_sensor < SENSOR_MAX) {
		sd->sensor = force_sensor;
		PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
	} else {
		switch (sensor) {
		case -1:
			switch (sd->sensor) {
			case SENSOR_MC501CB:
				PDEBUG(D_PROBE, "Sensor MC501CB");
				break;
			case SENSOR_TAS5130C_VF0250:
				PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
				break;
			default:
				PDEBUG(D_PROBE,
					"Sensor UNKNOW_0 force Tas5130");
				sd->sensor = SENSOR_TAS5130CXX;
			}
			break;
		case 0:
			PDEBUG(D_PROBE, "Find Sensor HV7131B");
			sd->sensor = SENSOR_HV7131B;
			break;
		case 0x04:
			PDEBUG(D_PROBE, "Find Sensor CS2102");
			sd->sensor = SENSOR_CS2102;
			break;
		case 0x08:
			PDEBUG(D_PROBE, "Find Sensor HDCS2020(b)");
			sd->sensor = SENSOR_HDCS2020b;
			break;
		case 0x0a:
			PDEBUG(D_PROBE,
				"Find Sensor PB0330. Chip revision %x",
				sd->chip_revision);
			sd->sensor = SENSOR_PB0330;
			break;
		case 0x0c:
			PDEBUG(D_PROBE, "Find Sensor ICM105A");
			sd->sensor = SENSOR_ICM105A;
			break;
		case 0x0e:
7080 7081
			PDEBUG(D_PROBE, "Find Sensor PAS202B");
			sd->sensor = SENSOR_PAS202B;
7082
			sd->sharpness = 1;
7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115
			break;
		case 0x0f:
			PDEBUG(D_PROBE, "Find Sensor PAS106");
			sd->sensor = SENSOR_PAS106;
			vga = 0;		/* SIF */
			break;
		case 0x10:
		case 0x12:
			PDEBUG(D_PROBE, "Find Sensor TAS5130");
			sd->sensor = SENSOR_TAS5130CXX;
			break;
		case 0x11:
			PDEBUG(D_PROBE, "Find Sensor HV7131R(c)");
			sd->sensor = SENSOR_HV7131C;
			break;
		case 0x13:
			PDEBUG(D_PROBE,
				"Find Sensor MI0360. Chip revision %x",
				sd->chip_revision);
			sd->sensor = SENSOR_PB0330;
			break;
		case 0x14:
			PDEBUG(D_PROBE,
				"Find Sensor CS2102K?. Chip revision %x",
				sd->chip_revision);
			sd->sensor = SENSOR_CS2102K;
			break;
		case 0x15:
			PDEBUG(D_PROBE,
				"Find Sensor TAS5130CK?. Chip revision %x",
				sd->chip_revision);
			sd->sensor = SENSOR_TAS5130CK;
			break;
7116 7117 7118 7119
		case 0x16:
			PDEBUG(D_PROBE, "Find Sensor ADCM2700");
			sd->sensor = SENSOR_ADCM2700;
			break;
7120 7121 7122 7123
		case 0x29:
			PDEBUG(D_PROBE, "Find Sensor GC0305");
			sd->sensor = SENSOR_GC0305;
			break;
7124 7125 7126 7127
		case 0x0250:
			PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
			sd->sensor =  SENSOR_TAS5130C_VF0250;
			break;
7128 7129 7130
		case 0x2030:
			PDEBUG(D_PROBE, "Find Sensor PO2030");
			sd->sensor = SENSOR_PO2030;
7131
			sd->sharpness = 0;		/* from win traces */
7132 7133 7134 7135 7136 7137 7138 7139 7140 7141
			break;
		case 0x7620:
			PDEBUG(D_PROBE, "Find Sensor OV7620");
			sd->sensor = SENSOR_OV7620;
			break;
		case 0x7648:
			PDEBUG(D_PROBE, "Find Sensor OV7648");
			sd->sensor = SENSOR_OV7620;	/* same sensor (?) */
			break;
		default:
7142
			PDEBUG(D_ERR|D_PROBE, "Unknown sensor %04x", sensor);
7143 7144 7145 7146 7147 7148 7149 7150
			return -EINVAL;
		}
	}
	if (sensor < 0x20) {
		if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
			reg_w(gspca_dev->dev, 0x02, 0x0010);
		else
			reg_w(gspca_dev->dev, sensor & 0x0f, 0x0010);
7151
		reg_r(gspca_dev, 0x0010);
7152 7153 7154 7155 7156 7157 7158
	}

	cam = &gspca_dev->cam;
/*fixme:test*/
	gspca_dev->nbalt--;
	if (vga) {
		cam->cam_mode = vga_mode;
7159
		cam->nmodes = ARRAY_SIZE(vga_mode);
7160 7161
	} else {
		cam->cam_mode = sif_mode;
7162
		cam->nmodes = ARRAY_SIZE(sif_mode);
7163 7164 7165 7166
	}
	sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
	sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value;
	sd->gamma = gamma[(int) sd->sensor];
7167 7168
	sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value;
	sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value;
7169

7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182
	switch (sd->sensor) {
	case SENSOR_GC0305:
	case SENSOR_OV7620:
	case SENSOR_PO2030:
		gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX);
		break;
	case SENSOR_HV7131B:
	case SENSOR_HV7131C:
	case SENSOR_OV7630C:
		gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
		break;
	}

7183
	/* switch the led off */
7184
	reg_w(gspca_dev->dev, 0x01, 0x0000);
7185 7186 7187
	return 0;
}

7188 7189
/* this function is called at probe and resume time */
static int sd_init(struct gspca_dev *gspca_dev)
7190 7191 7192 7193 7194
{
	reg_w(gspca_dev->dev, 0x01, 0x0000);
	return 0;
}

7195
static int sd_start(struct gspca_dev *gspca_dev)
7196 7197 7198
{
	struct sd *sd = (struct sd *) gspca_dev;
	struct usb_device *dev = gspca_dev->dev;
7199
	const struct usb_action *zc3_init;
7200
	int mode;
7201
	static const struct usb_action *init_tb[SENSOR_MAX][2] = {
7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215
		{adcm2700_Initial, adcm2700_InitialScale},	/* 0 */
		{cs2102_InitialScale, cs2102_Initial},		/* 1 */
		{cs2102K_InitialScale, cs2102K_Initial},	/* 2 */
		{gc0305_Initial, gc0305_InitialScale},		/* 3 */
		{hdcs2020xb_InitialScale, hdcs2020xb_Initial},	/* 4 */
		{hv7131bxx_InitialScale, hv7131bxx_Initial},	/* 5 */
		{hv7131cxx_InitialScale, hv7131cxx_Initial},	/* 6 */
		{icm105axx_InitialScale, icm105axx_Initial},	/* 7 */
		{MC501CB_InitialScale, MC501CB_Initial},	/* 8 */
		{OV7620_mode0, OV7620_mode1},			/* 9 */
		{ov7630c_InitialScale, ov7630c_Initial},	/* 10 */
		{pas106b_InitialScale, pas106b_Initial},	/* 11 */
		{pas202b_Initial, pas202b_InitialScale},	/* 12 */
		{pb0330xx_InitialScale, pb0330xx_Initial},	/* 13 */
7216
/* or		{pb03303x_InitialScale, pb03303x_Initial}, */
7217 7218 7219
		{PO2030_mode0, PO2030_mode1},			/* 14 */
		{tas5130CK_InitialScale, tas5130CK_Initial},	/* 15 */
		{tas5130cxx_InitialScale, tas5130cxx_Initial},	/* 16 */
7220
		{tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial},
7221
								/* 17 */
7222 7223
	};

7224
	mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
7225 7226 7227 7228 7229 7230
	zc3_init = init_tb[(int) sd->sensor][mode];
	switch (sd->sensor) {
	case SENSOR_HV7131C:
		zcxx_probeSensor(gspca_dev);
		break;
	case SENSOR_PAS106:
7231
		usb_exchange(gspca_dev, pas106b_Initial_com);
7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246
		break;
	case SENSOR_PB0330:
		if (mode) {
			if (sd->chip_revision == 0xc001
			    || sd->chip_revision == 0xe001
			    || sd->chip_revision == 0x8001)
				zc3_init = pb03303x_Initial;
		} else {
			if (sd->chip_revision == 0xc001
			    || sd->chip_revision == 0xe001
			    || sd->chip_revision == 0x8001)
				zc3_init = pb03303x_InitialScale;
		}
		break;
	}
7247
	usb_exchange(gspca_dev, zc3_init);
7248 7249

	switch (sd->sensor) {
7250
	case SENSOR_ADCM2700:
7251 7252 7253
	case SENSOR_GC0305:
	case SENSOR_OV7620:
	case SENSOR_PO2030:
7254
	case SENSOR_TAS5130C_VF0250:
7255
/*		msleep(100);			 * ?? */
7256
		reg_r(gspca_dev, 0x0002);	/* --> 0x40 */
7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267
		reg_w(dev, 0x09, 0x01ad);	/* (from win traces) */
		reg_w(dev, 0x15, 0x01ae);
		reg_w(dev, 0x0d, 0x003a);
		reg_w(dev, 0x02, 0x003b);
		reg_w(dev, 0x00, 0x0038);
		break;
	}

	setmatrix(gspca_dev);
	setbrightness(gspca_dev);
	switch (sd->sensor) {
7268
	case SENSOR_ADCM2700:
7269
	case SENSOR_OV7620:
7270
		reg_r(gspca_dev, 0x0008);
7271 7272
		reg_w(dev, 0x00, 0x0008);
		break;
7273
	case SENSOR_PAS202B:
7274
	case SENSOR_GC0305:
7275
		reg_r(gspca_dev, 0x0008);
7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297
		/* fall thru */
	case SENSOR_PO2030:
		reg_w(dev, 0x03, 0x0008);
		break;
	}
	setsharpness(gspca_dev);

	/* set the gamma tables when not set */
	switch (sd->sensor) {
	case SENSOR_CS2102:		/* gamma set in xxx_Initial */
	case SENSOR_CS2102K:
	case SENSOR_HDCS2020b:
	case SENSOR_PB0330:		/* pb with chip_revision - see above */
	case SENSOR_OV7630C:
	case SENSOR_TAS5130CK:
		break;
	default:
		setcontrast(gspca_dev);
		break;
	}
	setmatrix(gspca_dev);			/* one more time? */
	switch (sd->sensor) {
7298 7299
	case SENSOR_ADCM2700:
		break;
7300
	case SENSOR_OV7620:
7301
	case SENSOR_PAS202B:
7302
		reg_r(gspca_dev, 0x0180);	/* from win */
7303 7304 7305 7306 7307 7308 7309 7310 7311
		reg_w(dev, 0x00, 0x0180);
		break;
	default:
		setquality(gspca_dev);
		break;
	}
	setlightfreq(gspca_dev);

	switch (sd->sensor) {
7312 7313 7314 7315 7316 7317 7318
	case SENSOR_ADCM2700:
		reg_w(dev, 0x09, 0x01ad);	/* (from win traces) */
		reg_w(dev, 0x15, 0x01ae);
		reg_w(dev, 0x02, 0x0180);
						/* ms-win + */
		reg_w(dev, 0x40, 0x0117);
		break;
7319 7320 7321
	case SENSOR_GC0305:
		reg_w(dev, 0x09, 0x01ad);	/* (from win traces) */
		reg_w(dev, 0x15, 0x01ae);
7322 7323
		/* fall thru */
	case SENSOR_PAS202B:
7324
	case SENSOR_PO2030:
7325
/*		reg_w(dev, 0x40, ZC3XX_R117_GGAIN);  * (from win traces) */
7326
		reg_r(gspca_dev, 0x0180);
7327 7328
		break;
	case SENSOR_OV7620:
7329 7330
		reg_w(dev, 0x09, 0x01ad);
		reg_w(dev, 0x15, 0x01ae);
7331 7332 7333
		i2c_read(gspca_dev, 0x13);	/*fixme: returns 0xa3 */
		i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
					 /*fixme: returned value to send? */
7334
		reg_w(dev, 0x40, 0x0117);
7335
		reg_r(gspca_dev, 0x0180);
7336 7337 7338 7339 7340 7341 7342
		break;
	}

	setautogain(gspca_dev);
	switch (sd->sensor) {
	case SENSOR_PAS202B:
		reg_w(dev, 0x00, 0x0007);	/* (from win traces) */
7343 7344 7345
		break;
	case SENSOR_PO2030:
		msleep(500);
7346 7347
		reg_r(gspca_dev, 0x0008);
		reg_r(gspca_dev, 0x0007);
7348 7349 7350 7351
		reg_w(dev, 0x00, 0x0007);	/* (from win traces) */
		reg_w(dev, 0x02, 0x0008);
		break;
	}
7352 7353
	if (sd->sensor == SENSOR_PAS202B)
		reg_w(dev, 0x02, ZC3XX_R008_CLOCKSETTING);
7354
	return 0;
7355 7356
}

7357
/* called on streamoff with alt 0 and on disconnect */
7358 7359 7360 7361
static void sd_stop0(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;

7362 7363
	if (!gspca_dev->present)
		return;
7364 7365 7366 7367 7368
	send_unknown(gspca_dev->dev, sd->sensor);
}

static void sd_pkt_scan(struct gspca_dev *gspca_dev,
			struct gspca_frame *frame,
7369
			__u8 *data,
7370 7371 7372 7373 7374 7375 7376
			int len)
{

	if (data[0] == 0xff && data[1] == 0xd8) {	/* start of frame */
		frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
					data, 0);
		/* put the JPEG header in the new frame */
7377
		jpeg_put_header(gspca_dev, frame, 0x21);
7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443
		/* remove the webcam's header:
		 * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
		 *	- 'ss ss' is the frame sequence number (BE)
		 * 	- 'ww ww' and 'hh hh' are the window dimensions (BE)
		 *	- 'pp pp' is the packet sequence number (BE)
		 */
		data += 18;
		len -= 18;
	}
	gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
}

static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	sd->brightness = val;
	if (gspca_dev->streaming)
		setbrightness(gspca_dev);
	return 0;
}

static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	*val = sd->brightness;
	return 0;
}

static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	sd->contrast = val;
	if (gspca_dev->streaming)
		setcontrast(gspca_dev);
	return 0;
}

static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	*val = sd->contrast;
	return 0;
}

static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	sd->autogain = val;
	if (gspca_dev->streaming)
		setautogain(gspca_dev);
	return 0;
}

static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	*val = sd->autogain;
	return 0;
}

7444 7445 7446 7447 7448 7449 7450 7451 7452 7453
static int sd_setgamma(struct gspca_dev *gspca_dev, __s32 val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	sd->gamma = val;
	if (gspca_dev->streaming)
		setcontrast(gspca_dev);
	return 0;
}

7454 7455 7456 7457 7458 7459 7460 7461
static int sd_getgamma(struct gspca_dev *gspca_dev, __s32 *val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	*val = sd->gamma;
	return 0;
}

7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504
static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	sd->lightfreq = val;
	if (gspca_dev->streaming)
		setlightfreq(gspca_dev);
	return 0;
}

static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	*val = sd->lightfreq;
	return 0;
}

static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	sd->sharpness = val;
	if (gspca_dev->streaming)
		setsharpness(gspca_dev);
	return 0;
}

static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
{
	struct sd *sd = (struct sd *) gspca_dev;

	*val = sd->sharpness;
	return 0;
}

static int sd_querymenu(struct gspca_dev *gspca_dev,
			struct v4l2_querymenu *menu)
{
	switch (menu->id) {
	case V4L2_CID_POWER_LINE_FREQUENCY:
		switch (menu->index) {
		case 0:		/* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
7505
			strcpy((char *) menu->name, "NoFliker");
7506 7507
			return 0;
		case 1:		/* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
7508
			strcpy((char *) menu->name, "50 Hz");
7509 7510
			return 0;
		case 2:		/* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
7511
			strcpy((char *) menu->name, "60 Hz");
7512 7513 7514 7515 7516 7517 7518
			return 0;
		}
		break;
	}
	return -EINVAL;
}

7519
static const struct sd_desc sd_desc = {
7520 7521 7522 7523
	.name = MODULE_NAME,
	.ctrls = sd_ctrls,
	.nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
	.config = sd_config,
7524
	.init = sd_init,
7525 7526 7527
	.start = sd_start,
	.stop0 = sd_stop0,
	.pkt_scan = sd_pkt_scan,
7528
	.querymenu = sd_querymenu,
7529 7530
};

7531
static const __devinitdata struct usb_device_id device_table[] = {
7532 7533
	{USB_DEVICE(0x041e, 0x041e)},
	{USB_DEVICE(0x041e, 0x4017)},
7534
	{USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
7535 7536
	{USB_DEVICE(0x041e, 0x401e)},
	{USB_DEVICE(0x041e, 0x401f)},
7537
	{USB_DEVICE(0x041e, 0x4022)},
7538
	{USB_DEVICE(0x041e, 0x4029)},
7539 7540
	{USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
	{USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
7541 7542
	{USB_DEVICE(0x041e, 0x4036)},
	{USB_DEVICE(0x041e, 0x403a)},
7543 7544
	{USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250},
	{USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250},
7545 7546 7547 7548
	{USB_DEVICE(0x0458, 0x7007)},
	{USB_DEVICE(0x0458, 0x700c)},
	{USB_DEVICE(0x0458, 0x700f)},
	{USB_DEVICE(0x0461, 0x0a00)},
7549
	{USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
7550 7551 7552 7553 7554 7555 7556 7557 7558 7559
	{USB_DEVICE(0x046d, 0x08a0)},
	{USB_DEVICE(0x046d, 0x08a1)},
	{USB_DEVICE(0x046d, 0x08a2)},
	{USB_DEVICE(0x046d, 0x08a3)},
	{USB_DEVICE(0x046d, 0x08a6)},
	{USB_DEVICE(0x046d, 0x08a7)},
	{USB_DEVICE(0x046d, 0x08a9)},
	{USB_DEVICE(0x046d, 0x08aa)},
	{USB_DEVICE(0x046d, 0x08ac)},
	{USB_DEVICE(0x046d, 0x08ad)},
7560
#if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
7561
	{USB_DEVICE(0x046d, 0x08ae)},
7562
#endif
7563 7564 7565 7566 7567 7568
	{USB_DEVICE(0x046d, 0x08af)},
	{USB_DEVICE(0x046d, 0x08b9)},
	{USB_DEVICE(0x046d, 0x08d7)},
	{USB_DEVICE(0x046d, 0x08d9)},
	{USB_DEVICE(0x046d, 0x08d8)},
	{USB_DEVICE(0x046d, 0x08da)},
7569 7570 7571 7572 7573
	{USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
	{USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
	{USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
	{USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
	{USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
7574 7575 7576 7577
	{USB_DEVICE(0x055f, 0xc005)},
	{USB_DEVICE(0x055f, 0xd003)},
	{USB_DEVICE(0x055f, 0xd004)},
	{USB_DEVICE(0x0698, 0x2003)},
7578
	{USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
7579 7580 7581
	{USB_DEVICE(0x0ac8, 0x0302)},
	{USB_DEVICE(0x0ac8, 0x301b)},
	{USB_DEVICE(0x0ac8, 0x303b)},
7582
	{USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250},
7583 7584
	{USB_DEVICE(0x0ac8, 0x307b)},
	{USB_DEVICE(0x10fd, 0x0128)},
7585
	{USB_DEVICE(0x10fd, 0x804d)},
7586
	{USB_DEVICE(0x10fd, 0x8050)},
7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605
	{}			/* end of entry */
};
#undef DVNAME
MODULE_DEVICE_TABLE(usb, device_table);

/* -- device connect -- */
static int sd_probe(struct usb_interface *intf,
			const struct usb_device_id *id)
{
	return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
				THIS_MODULE);
}

/* USB driver */
static struct usb_driver sd_driver = {
	.name = MODULE_NAME,
	.id_table = device_table,
	.probe = sd_probe,
	.disconnect = gspca_disconnect,
7606 7607 7608 7609
#ifdef CONFIG_PM
	.suspend = gspca_suspend,
	.resume = gspca_resume,
#endif
7610 7611 7612 7613
};

static int __init sd_mod_init(void)
{
7614 7615 7616
	int ret;
	ret = usb_register(&sd_driver);
	if (ret < 0)
7617
		return ret;
7618
	PDEBUG(D_PROBE, "registered");
7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633
	return 0;
}

static void __exit sd_mod_exit(void)
{
	usb_deregister(&sd_driver);
	PDEBUG(D_PROBE, "deregistered");
}

module_init(sd_mod_init);
module_exit(sd_mod_exit);

module_param(force_sensor, int, 0644);
MODULE_PARM_DESC(force_sensor,
	"Force sensor. Only for experts!!!");