blob: cf21991e3d99f614b84ef92010b9f4e9b32da7c2 [file] [log] [blame]
/*
* Z-Star/Vimicro zc301/zc302p/vc30x driver
*
* Copyright (C) 2009-2012 Jean-Francois Moine <http://moinejf.free.fr>
* Copyright (C) 2004 2005 2006 Michel Xhaard mxhaard@magic.fr
*
* 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.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/input.h>
#include "gspca.h"
#include "jpeg.h"
MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>, Serge A. Suchkov <Serge.A.S@tochka.ru>");
MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
MODULE_LICENSE("GPL");
static int force_sensor = -1;
#define REG08_DEF 3 /* default JPEG compression (75%) */
#include "zc3xx-reg.h"
/* specific webcam descriptor */
struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
struct { /* gamma/brightness/contrast control cluster */
struct v4l2_ctrl *gamma;
struct v4l2_ctrl *brightness;
struct v4l2_ctrl *contrast;
};
struct { /* autogain/exposure control cluster */
struct v4l2_ctrl *autogain;
struct v4l2_ctrl *exposure;
};
struct v4l2_ctrl *plfreq;
struct v4l2_ctrl *sharpness;
struct v4l2_ctrl *jpegqual;
struct work_struct work;
u8 reg08; /* webcam compression quality */
u8 bridge;
u8 sensor; /* Type of image sensor chip */
u16 chip_revision;
u8 jpeg_hdr[JPEG_HDR_SZ];
};
enum bridges {
BRIDGE_ZC301,
BRIDGE_ZC303,
};
enum sensors {
SENSOR_ADCM2700,
SENSOR_CS2102,
SENSOR_CS2102K,
SENSOR_GC0303,
SENSOR_GC0305,
SENSOR_HDCS2020,
SENSOR_HV7131B,
SENSOR_HV7131R,
SENSOR_ICM105A,
SENSOR_MC501CB,
SENSOR_MT9V111_1, /* (mi360soc) zc301 */
SENSOR_MT9V111_3, /* (mi360soc) zc303 */
SENSOR_OV7620, /* OV7648 - same values */
SENSOR_OV7630C,
SENSOR_PAS106,
SENSOR_PAS202B,
SENSOR_PB0330,
SENSOR_PO2030,
SENSOR_TAS5130C,
SENSOR_MAX
};
static const struct v4l2_pix_format vga_mode[] = {
{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},
};
static const struct v4l2_pix_format broken_vga_mode[] = {
{320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 320,
.sizeimage = 320 * 232 * 4 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 1},
{640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 640,
.sizeimage = 640 * 472 * 3 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 0},
};
static const struct v4l2_pix_format sif_mode[] = {
{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},
};
/*
* Bridge reg08 bits 1-2 -> JPEG quality conversion table. Note the highest
* quality setting is not usable as USB 1 does not have enough bandwidth.
*/
static u8 jpeg_qual[] = {50, 75, 87, /* 94 */};
/* usb exchanges */
struct usb_action {
u8 req;
u8 val;
u16 idx;
};
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, 0x00, 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, 0xb7, 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 */
/*mswin+*/
{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
{0xaa, 0xfe, 0x0002},
{0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
{0xaa, 0xb4, 0xcd37},
{0xaa, 0xa4, 0x0004},
{0xaa, 0xa8, 0x0007},
{0xaa, 0xac, 0x0004},
/*mswin-*/
{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, 0x00, 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, 0xb7, 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, 0x86, 0x0002}, /* 00,88,02,bb */
{0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
{0xbb, 0x86, 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 */
{}
};
static const struct usb_action cs2102_InitialScale[] = { /* 320x240 */
{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},
{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},
{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},
{0xa0, 0x10, 0x01ae},
{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
{0xa0, 0x68, ZC3XX_R18D_YTARGET},
{0xa0, 0x00, 0x01ad},
{}
};
static const struct usb_action cs2102_Initial[] = { /* 640x480 */
{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},
{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},
{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},
{0xa0, 0x15, 0x01ae},
{0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
{0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
{0xa0, 0x68, ZC3XX_R18D_YTARGET},
{0xa0, 0x00, 0x01ad},
{}
};
static const struct usb_action cs2102_50HZScale[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xaa, 0x23, 0x0001},
{0xaa, 0x24, 0x005f},
{0xaa, 0x25, 0x0090},
{0xaa, 0x21, 0x00dd},
{0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
{0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
{0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
{0xa0, 0x3a, ZC3XX_R196_ANTIFLICKERMID},
{0xa0, 0x98, ZC3XX_R197_ANTIFLICKERLOW},
{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
{0xa0, 0xdd, ZC3XX_R01D_HSYNC_0},
{0xa0, 0xe4, ZC3XX_R01E_HSYNC_1},
{0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
{}
};
static const struct usb_action cs2102_50HZ[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xaa, 0x23, 0x0000},
{0xaa, 0x24, 0x00af},
{0xaa, 0x25, 0x00c8},
{0xaa, 0x21, 0x0068},
{0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
{0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
{0xa0, 0x90, ZC3XX_R192_EXPOSURELIMITLOW},
{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
{0xa0, 0x1d, ZC3XX_R196_ANTIFLICKERMID},
{0xa0, 0x4c, ZC3XX_R197_ANTIFLICKERLOW},
{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
{0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
{0xa0, 0x68, ZC3XX_R01D_HSYNC_0},
{0xa0, 0xe3, ZC3XX_R01E_HSYNC_1},
{0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
{}
};
static const struct usb_action cs2102_60HZScale[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xaa, 0x23, 0x0001},
{0xaa, 0x24, 0x0055},
{0xaa, 0x25, 0x00cc},
{0xaa, 0x21, 0x003f},
{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},
{}
};
static const struct usb_action cs2102_60HZ[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xaa, 0x23, 0x0000},
{0xaa, 0x24, 0x00aa},
{0xaa, 0x25, 0x00e6},
{0xaa, 0x21, 0x003f},
{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},
{}
};
static const struct usb_action cs2102_NoFlikerScale[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xaa, 0x23, 0x0001},
{0xaa, 0x24, 0x005f},
{0xaa, 0x25, 0x0000},
{0xaa, 0x21, 0x0001},
{0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
{0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
{0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
{0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
{0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
{0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
{}
};
static const struct usb_action cs2102_NoFliker[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xaa, 0x23, 0x0000},
{0xaa, 0x24, 0x00af},
{0xaa, 0x25, 0x0080},
{0xaa, 0x21, 0x0001},
{0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
{0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
{0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
{0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
{0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
{0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
{0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
{0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
{0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
{0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
{0xa0, 0xff, ZC3XX_R020_HSYNC_3},
{}
};
/* CS2102_KOCOM */
static const struct usb_action cs2102K_InitialScale[] = {
{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},
{0xa0, 0x00, 0x01ad},
{0xa0, 0x01, 0x01b1},
{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},
{}
};
static const struct usb_action cs2102K_Initial[] = {
{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},
/*fixme: next sequence = i2c exchanges*/
{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},
{0xa0, 0x00, 0x01ad},
{0xa0, 0x01, 0x01b1},
{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},
/*fixme:what does the next sequence?*/
{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},
{}
};
static const struct usb_action gc0305_Initial[] = { /* 640x480 */
{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 */
{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 */
{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 */
{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 */
{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, 0x85, ZC3XX_R18D_YTARGET}, /* 01,8d,85,cc */
{0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
{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 */
{}
};
static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
{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 */
{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 */
{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 */
{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 */
{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, 0x00, 0x011e}, /* 01,1e,00,cc */
{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 */
{}
};
static const struct usb_action gc0305_50HZ[] = {
{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 */
{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 */
{}
};
static const struct usb_action gc0305_60HZ[] = {
{0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
{0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
{0xaa, 0x84, 0x00ec}, /* 00,84,ec,aa */
{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 */
{}
};
static const struct usb_action gc0305_NoFliker[] = {
{0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
{0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
{0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
{0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
{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 */
{}
};
static const struct usb_action hdcs2020_InitialScale[] = {
{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},
{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},
{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},
{0xa1, 0x01, 0x0002},
{0xa1, 0x01, 0x0008},
{0xa1, 0x01, 0x0180},
{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
{0xa0, 0x40, ZC3XX_R116_RGAIN},
{0xa0, 0x40, ZC3XX_R117_GGAIN},
{0xa0, 0x40, ZC3XX_R118_BGAIN},
{0xa1, 0x01, 0x0008},
{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
{0xa1, 0x01, 0x01c8},
{0xa1, 0x01, 0x01c9},
{0xa1, 0x01, 0x01ca},
{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},
{0xa1, 0x01, 0x0180},
{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xaa, 0x13, 0x0031},
{0xaa, 0x14, 0x0001},
{0xaa, 0x0e, 0x0004},
{0xaa, 0x19, 0x00cd},
{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},
{0xa1, 0x01, 0x0180},
{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
{0xa0, 0x40, ZC3XX_R116_RGAIN},
{0xa0, 0x40, ZC3XX_R117_GGAIN},
{0xa0, 0x40, ZC3XX_R118_BGAIN},
{}
};
static const struct usb_action hdcs2020_Initial[] = {
{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},
{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},
{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},
{0xa1, 0x01, 0x0002},
{0xa1, 0x01, 0x0008},
{0xa1, 0x01, 0x0180},
{0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
{0xa0, 0x40, ZC3XX_R116_RGAIN},
{0xa0, 0x40, ZC3XX_R117_GGAIN},
{0xa0, 0x40, ZC3XX_R118_BGAIN},
{0xa1, 0x01, 0x0008},
{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
{0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
{0xa1, 0x01, 0x01c8},
{0xa1, 0x01, 0x01c9},
{0xa1, 0x01, 0x01ca},
{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},
{0xa1, 0x01, 0x0180},
{0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
/**** set exposure ***/
{0xaa, 0x13, 0x0031},
{0xaa, 0x14, 0x0001},
{0xaa, 0x0e, 0x0004},
{0xaa, 0x19, 0x00cd},
{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},
{0xa1, 0x01, 0x0180},
{0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
{0xa0, 0x40, ZC3XX_R116_RGAIN},
{0xa0, 0x40, ZC3XX_R117_GGAIN},
{0xa0, 0x40, ZC3XX_R118_BGAIN},
{}
};
static const struct usb_action hdcs2020_50HZ[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
{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 */
{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 */
{}
};
static const struct usb_action hdcs2020_60HZ[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
{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 */
{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 */
{}
};
static const struct usb_action hdcs2020_NoFliker[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
{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 */
{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 */
{}
};
static const struct usb_action hv7131b_InitialScale[] = { /* 320x240 */
{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},
{0xaa, 0x30, 0x002d},
{0xaa, 0x01, 0x0005},
{0xaa, 0x11, 0x0000},
{0xaa, 0x13, 0x0001}, /* {0xaa, 0x13, 0x0000}, */
{0xaa, 0x14, 0x0001},
{0xaa, 0x15, 0x00e8},
{0xaa, 0x16, 0x0002},
{0xaa, 0x17, 0x0086}, /* 00,17,88,aa */
{0xaa, 0x31, 0x0038},
{0xaa, 0x32, 0x0038},
{0xaa, 0x33, 0x0038},
{0xaa, 0x5b, 0x0001},
{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},
{0xa0, 0x00, 0x01ad},
{0xa0, 0xc0, 0x019b},
{0xa0, 0xa0, 0x019c},
{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},
{0xaa, 0x02, 0x0090}, /* 00,02,80,aa */
{}
};
static const struct usb_action hv7131b_Initial[] = { /* 640x480*/
{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},
{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},
{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},
{0xa0, 0x00, 0x01ad},
{0xa0, 0xc0, 0x019b},
{0xa0, 0xa0, 0x019c},
{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},
{0xaa, 0x02, 0x0090}, /* {0xaa, 0x02, 0x0080}, */
{}
};
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 */
{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 */
{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 */
{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 */
{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 */
{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 */
{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 */
{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 */
{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 */
{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 */
{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 */
{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 */
{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 */
{}
};
/* from lPEPI264v.inf (hv7131b!) */
static const struct usb_action hv7131r_InitialScale[] = {
{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, 0x07, 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, 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, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
{0xdd, 0x00, 0x0200},
{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
{0xaa, 0x01, 0x000c},
{0xaa, 0x11, 0x0000},
{0xaa, 0x13, 0x0000},
{0xaa, 0x14, 0x0001},
{0xaa, 0x15, 0x00e8},
{0xaa, 0x16, 0x0002},
{0xaa, 0x17, 0x0088},
{0xaa, 0x30, 0x000b},
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
{0xa0, 0x78, ZC3XX_R18D_YTARGET},
{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
{0xa0, 0x00, 0x01ad},
{0xa0, 0xc0, 0x019b},
{0xa0, 0xa0, 0x019c},
{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},
{}
};
static const struct usb_action hv7131r_Initial[] = {
{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
{0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
{0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
{0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
{0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
{0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
{0xa0, 0x07, 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, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
{0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
{0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
{0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
{0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
{0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
{0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
{0xdd, 0x00, 0x0200},
{0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
{0xaa, 0x01, 0x000c},
{0xaa, 0x11, 0x0000},
{0xaa, 0x13, 0x0000},
{0xaa, 0x14, 0x0001},
{0xaa, 0x15, 0x00e6},
{0xaa, 0x16, 0x0002},
{0xaa, 0x17, 0x0086},
{0xaa, 0x30, 0x000b},
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
{0xa0, 0x78, ZC3XX_R18D_YTARGET},
{0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
{0xa0, 0x00, 0x01ad},
{0xa0, 0xc0, 0x019b},
{0xa0, 0xa0, 0x019c},
{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},
{}
};
static const struct usb_action hv7131r_50HZ[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
{0xa0, 0x68, ZC3XX_R191_EXPOSURELIMITMID},
{0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
{0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},
{0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},
{0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
{0xa0, 0x08, ZC3XX_R020_HSYNC_3},
{}
};
static const struct usb_action hv7131r_50HZScale[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
{0xa0, 0xd1, ZC3XX_R191_EXPOSURELIMITMID},
{0xa0, 0x40, ZC3XX_R192_EXPOSURELIMITLOW},
{0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
{0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
{0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
{0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
{0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
{0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
{0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
{0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
{0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
{0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
{0xa0, 0x08, ZC3XX_R020_HSYNC_3},
{}
};
static const struct usb_action hv7131r_60HZ[] = {
{0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
{0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
{0xa0, 0x1a, ZC3XX_R191_EXPOSURELIMITMID},
{0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
{0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
{0xa0</