V4L/DVB (13866): gspca - main: Add the cam flag 'no_urb_create'.
[safe/jmp/linux-2.6] / drivers / media / video / gspca / zc3xx.c
index c32477d..1a800fc 100644 (file)
@@ -23,6 +23,7 @@
 #define MODULE_NAME "zc3xx"
 
 #include "gspca.h"
+#include "jpeg.h"
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, "
                "Serge A. Suchkov <Serge.A.S@tochka.ru>");
@@ -31,7 +32,7 @@ MODULE_LICENSE("GPL");
 
 static int force_sensor = -1;
 
-#include "jpeg.h"
+#define QUANT_VAL 1            /* quantization table */
 #include "zc3xx-reg.h"
 
 /* specific webcam descriptor */
@@ -44,30 +45,37 @@ struct sd {
        __u8 autogain;
        __u8 lightfreq;
        __u8 sharpness;
+       u8 quality;                     /* image quality */
+#define QUALITY_MIN 40
+#define QUALITY_MAX 60
+#define QUALITY_DEF 50
 
-       char qindex;
        signed char sensor;             /* Type of image sensor chip */
 /* !! values used in different tables */
-#define SENSOR_CS2102 0
-#define SENSOR_CS2102K 1
-#define SENSOR_GC0305 2
-#define SENSOR_HDCS2020b 3
-#define SENSOR_HV7131B 4
-#define SENSOR_HV7131C 5
-#define SENSOR_ICM105A 6
-#define SENSOR_MC501CB 7
-#define SENSOR_OV7620 8
-/*#define SENSOR_OV7648 8 - same values */
-#define SENSOR_OV7630C 9
-#define SENSOR_PAS106 10
-#define SENSOR_PAS202B 11
-#define SENSOR_PB0330 12
-#define SENSOR_PO2030 13
-#define SENSOR_TAS5130CK 14
-#define SENSOR_TAS5130CXX 15
-#define SENSOR_TAS5130C_VF0250 16
-#define SENSOR_MAX 17
+#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_MI0360SOC 9
+#define SENSOR_OV7620 10
+/*#define SENSOR_OV7648 10 - same values */
+#define SENSOR_OV7630C 11
+#define SENSOR_PAS106 12
+#define SENSOR_PAS202B 13
+#define SENSOR_PB0330 14       /* (MI0360) */
+#define SENSOR_PO2030 15
+#define SENSOR_TAS5130CK 16
+#define SENSOR_TAS5130CXX 17
+#define SENSOR_TAS5130C_VF0250 18
+#define SENSOR_MAX 19
        unsigned short chip_revision;
+
+       u8 *jpeg_hdr;
 };
 
 /* V4L2 controls supported by the driver */
@@ -206,9 +214,214 @@ struct usb_action {
        __u16   idx;
 };
 
-static const struct usb_action cs2102_Initial[] = {
-       {0xa1, 0x01, 0x0008},
-       {0xa1, 0x01, 0x0008},
+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_Initial[] = {    /* 320x240 */
        {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
        {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
@@ -257,88 +470,10 @@ static const struct usb_action cs2102_Initial[] = {
        {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
        {0xa0, 0x68, ZC3XX_R18D_YTARGET},
        {0xa0, 0x00, 0x01ad},
-       {0xa1, 0x01, 0x0002},
-       {0xa1, 0x01, 0x0008},
-       {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
-       {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
-       {0xa1, 0x01, 0x01c8},
-       {0xa1, 0x01, 0x01c9},
-       {0xa1, 0x01, 0x01ca},
-       {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},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
-       {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},
-       {0xa0, 0x40, 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 cs2102_InitialScale[] = {
-       {0xa1, 0x01, 0x0008},
-       {0xa1, 0x01, 0x0008},
+static const struct usb_action cs2102_InitialScale[] = {       /* 640x480 */
        {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
        {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
@@ -387,57 +522,75 @@ static const struct usb_action cs2102_InitialScale[] = {
        {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
        {0xa0, 0x68, ZC3XX_R18D_YTARGET},
        {0xa0, 0x00, 0x01ad},
-       {0xa1, 0x01, 0x0002},
-       {0xa1, 0x01, 0x0008},
-       {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
-       {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
-       {0xa1, 0x01, 0x01c8},
-       {0xa1, 0x01, 0x01c9},
-       {0xa1, 0x01, 0x01ca},
-       {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},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
+       {}
+};
+static const struct usb_action cs2102_50HZ[] = {
+       {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_50HZScale[] = {
+       {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_60HZ[] = {
+       {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_60HZScale[] = {
        {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
        {0xaa, 0x23, 0x0000},
        {0xaa, 0x24, 0x00aa},
@@ -457,162 +610,50 @@ static const struct usb_action cs2102_InitialScale[] = {
        {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
        {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
        {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
-       {0xa0, 0x40, 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 cs2102_50HZ[] = {
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
-       {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 */
-       {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 */
-       {}
-};
-static const struct usb_action cs2102_50HZScale[] = {
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
-       {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 */
-       {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 */
-       {}
-};
-static const struct usb_action cs2102_60HZ[] = {
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
-       {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 */
-       {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 */
-       {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */
-       {}
-};
-static const struct usb_action cs2102_60HZScale[] = {
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
-       {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 */
-       {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 */
-       {}
-};
-static const struct usb_action cs2102_NoFliker[] = {
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
-       {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 */
-       {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 */
+static const struct usb_action cs2102_NoFliker[] = {
+       {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_NoFlikerScale[] = {
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
-       {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 */
-       {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 */
+       {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},
        {}
 };
 
@@ -877,7 +918,7 @@ static const struct usb_action cs2102K_Initial[] = {
 };
 
 static const struct usb_action cs2102K_InitialScale[] = {
-       {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
+       {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
        {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
        {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
@@ -894,6 +935,7 @@ static const struct usb_action cs2102K_InitialScale[] = {
        {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},
@@ -1077,207 +1119,6 @@ static const struct usb_action cs2102K_InitialScale[] = {
        {0xa0, 0x60, ZC3XX_R116_RGAIN},
        {0xa0, 0x40, ZC3XX_R117_GGAIN},
        {0xa0, 0x4c, ZC3XX_R118_BGAIN},
-       {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
-       {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},
-       {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},
@@ -1334,6 +1175,7 @@ static const struct usb_action cs2102K_InitialScale[] = {
        {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},
@@ -4394,170 +4236,80 @@ static const struct usb_action pas202b_NoFlikerScale[] = {
        {}
 };
 
-static const struct usb_action pb03303x_Initial[] = {
+/* mi0360soc and pb0330 from vm30x.inf for 0ac8:301b and 0ac8:303b 07/02/13 */
+static const struct usb_action mi0360soc_Initial[] = { /* 640x480 */
        {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
        {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
-       {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
+       {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, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
        {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
-       {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
-       {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
+       {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},      /*jfm: was 03*/
+/*     {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},
+       {0xdd, 0x00, 0x0200},
        {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, 0x03, 0x01e5},                   /*jfm: was 01e7*/
+       {0xaa, 0x04, 0x0285},                   /*jfm: was 0287*/
        {0xaa, 0x07, 0x3002},
-       {0xaa, 0x20, 0x1100},
-       {0xaa, 0x35, 0x0050},
+       {0xaa, 0x20, 0x5100},                   /*jfm: was 1100*/
+       {0xaa, 0x35, 0x507f},                   /*jfm: was 0050*/
        {0xaa, 0x30, 0x0005},
        {0xaa, 0x31, 0x0000},
        {0xaa, 0x58, 0x0078},
        {0xaa, 0x62, 0x0411},
        {0xaa, 0x2b, 0x0028},
-       {0xaa, 0x2c, 0x0030},
-       {0xaa, 0x2d, 0x0030},
-       {0xaa, 0x2e, 0x0028},
+       {0xaa, 0x2c, 0x007f},                   /*jfm: was 0030*/
+       {0xaa, 0x2d, 0x007f},                   /*jfm: was 0030*/
+       {0xaa, 0x2e, 0x007f},                   /*jfm: was 0030*/
        {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
-       {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
+       {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /*jfm: was 37*/
        {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
        {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
        {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
-       {0xa0, 0x00, 0x01ad},
+       {0xa0, 0x09, 0x01ad},                   /*jfm: was 00*/
        {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, 0x6c, ZC3XX_R18D_YTARGET},       /* jfm: was 78 */
        {0xa0, 0x61, ZC3XX_R116_RGAIN},
        {0xa0, 0x65, ZC3XX_R118_BGAIN},
-
-       {0xa1, 0x01, 0x0002},
-       {0xa0, 0x09, 0x01ad},
-       {0xa0, 0x15, 0x01ae},
-       {0xa0, 0x0d, 0x003a},
-       {0xa0, 0x02, 0x003b},
-       {0xa0, 0x00, 0x0038},
-       {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},
-
-       {0xa1, 0x01, 0x0008},
-       {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
-       {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
-       {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, 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},
-
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
-       {0xaa, 0x05, 0x0009},
-       {0xaa, 0x09, 0x0134},
-       {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},
-       {0xa0, 0x09, 0x01ad},
-       {0xa0, 0x15, 0x01ae},
-       {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
        {}
 };
-
-static const struct usb_action pb03303x_InitialScale[] = {
+static const struct usb_action mi0360soc_InitialScale[] = {    /* 320x240 */
        {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
        {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
-       {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
+       {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, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
        {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
-       {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
-       {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
+       {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},      /*jfm: was 03*/
+/*     {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},
+       {0xdd, 0x00, 0x0200},
        {0xaa, 0x01, 0x0001},
        {0xaa, 0x06, 0x0000},
        {0xaa, 0x08, 0x0483},
@@ -4567,111 +4319,111 @@ static const struct usb_action pb03303x_InitialScale[] = {
        {0xaa, 0x03, 0x01e7},
        {0xaa, 0x04, 0x0287},
        {0xaa, 0x07, 0x3002},
-       {0xaa, 0x20, 0x1100},
-       {0xaa, 0x35, 0x0050},
+       {0xaa, 0x20, 0x5100},                   /*jfm: was 1100*/
+       {0xaa, 0x35, 0x007f},                   /*jfm: was 0050*/
        {0xaa, 0x30, 0x0005},
        {0xaa, 0x31, 0x0000},
        {0xaa, 0x58, 0x0078},
        {0xaa, 0x62, 0x0411},
-       {0xaa, 0x2b, 0x0028},
-       {0xaa, 0x2c, 0x0030},
-       {0xaa, 0x2d, 0x0030},
-       {0xaa, 0x2e, 0x0028},
+       {0xaa, 0x2b, 0x007f},                   /*jfm: was 28*/
+       {0xaa, 0x2c, 0x007f},                   /*jfm: was 30*/
+       {0xaa, 0x2d, 0x007f},                   /*jfm: was 30*/
+       {0xaa, 0x2e, 0x007f},                   /*jfm: was 28*/
        {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
-       {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
+       {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},      /*jfm: was 37*/
        {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
        {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
        {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
-       {0xa0, 0x00, 0x01ad},
+       {0xa0, 0x09, 0x01ad},                   /*jfm: was 00*/
        {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, 0x6c, ZC3XX_R18D_YTARGET},       /*jfm: was 78*/
        {0xa0, 0x61, ZC3XX_R116_RGAIN},
        {0xa0, 0x65, ZC3XX_R118_BGAIN},
-
-       {0xa1, 0x01, 0x0002},
-
-       {0xa0, 0x09, 0x01ad},
-       {0xa0, 0x15, 0x01ae},
-
-       {0xa0, 0x0d, 0x003a},
-       {0xa0, 0x02, 0x003b},
-       {0xa0, 0x00, 0x0038},
-       {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},
-
-       {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, 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},
-
-       {0xa1, 0x01, 0x0180},
+       {}
+};
+static const struct usb_action mi360soc_AE50HZ[] = {
+       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x0562},
+       {0xbb, 0x01, 0x09aa},
+       {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},
+       {}
+};
+static const struct usb_action mi360soc_AE50HZScale[] = {
        {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x0509},
+       {0xbb, 0x01, 0x0934},
+       {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},
+       {}
+};
+static const struct usb_action mi360soc_AE60HZ[] = {
+       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x053d},
+       {0xbb, 0x01, 0x096e},
+       {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
+       {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x24, 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},
+       {}
+};
+static const struct usb_action mi360soc_AE60HZScale[] = {
        {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
        {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
-       {0xaa, 0x05, 0x0009},
-       {0xaa, 0x09, 0x0134},
+       {0xbb, 0x00, 0x0509},
+       {0xbb, 0x01, 0x0983},
        {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
        {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
-       {0xa0, 0xec, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
        {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
        {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
-       {0xa0, 0x9c, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
        {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
        {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
        {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
@@ -4681,20 +4433,60 @@ static const struct usb_action pb03303x_InitialScale[] = {
        {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
        {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
        {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa0, 0x09, 0x01ad},
-       {0xa0, 0x15, 0x01ae},
-       {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa1, 0x01, 0x0180},
+       {}
+};
+static const struct usb_action mi360soc_AENoFliker[] = {
+       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x0509},
+       {0xbb, 0x01, 0x0960},
+       {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
+       {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
+       {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
+       {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
+       {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
+       {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
+       {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
        {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
        {}
 };
-static const struct usb_action pb0330xx_Initial[] = {
-       {0xa1, 0x01, 0x0008},
-       {0xa1, 0x01, 0x0008},
+static const struct usb_action mi360soc_AENoFlikerScale[] = {
+       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x0534},
+       {0xbb, 0x02, 0x0960},
+       {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
+       {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
+       {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
+       {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
+       {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
+       {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
+       {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
+       {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
+       {}
+};
+
+static const struct usb_action pb0330_Initial[] = {    /* 640x480 */
        {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
        {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
-       {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
+       {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
        {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
        {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
        {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
@@ -4706,11 +4498,12 @@ static const struct usb_action pb0330xx_Initial[] = {
        {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
        {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
        {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
+       {0xdd, 0x00, 0x0200},
        {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
        {0xaa, 0x01, 0x0006},
        {0xaa, 0x02, 0x0011},
-       {0xaa, 0x03, 0x01e7},
-       {0xaa, 0x04, 0x0287},
+       {0xaa, 0x03, 0x01e5},                   /*jfm: was 1e7*/
+       {0xaa, 0x04, 0x0285},                   /*jfm: was 0287*/
        {0xaa, 0x06, 0x0003},
        {0xaa, 0x07, 0x3002},
        {0xaa, 0x20, 0x1100},
@@ -4728,88 +4521,21 @@ static const struct usb_action pb0330xx_Initial[] = {
        {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
        {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
        {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
-       {0xa0, 0x00, 0x01ad},
+       {0xa0, 0x09, 0x01ad},                   /*jfm: was 00 */
+       {0xa0, 0x15, 0x01ae},
        {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},
-       {0xa1, 0x01, 0x0002},
-       {0xa0, 0x09, 0x01ad},
-       {0xa0, 0x15, 0x01ae},
-       {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
-       {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
-       {0xa1, 0x01, 0x0091},
-       {0xa1, 0x01, 0x0095},
-       {0xa1, 0x01, 0x0096},
-       {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},
-       {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, 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},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
-       {0xaa, 0x05, 0x0066},
-       {0xaa, 0x09, 0x02b2},
-       {0xaa, 0x10, 0x0002},
-
-       {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},
-       {0xa0, 0x09, 0x01ad},
-       {0xa0, 0x15, 0x01ae},
-       {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa1, 0x01, 0x0008},
-       {0xa1, 0x01, 0x0007},
-/*     {0xa0, 0x30, 0x0007}, */
-/*     {0xa0, 0x00, 0x0007}, */
+       {0xa0, 0x78, ZC3XX_R18D_YTARGET},       /*jfm: was 6c*/
        {}
 };
-
-static const struct usb_action pb0330xx_InitialScale[] = {
-       {0xa1, 0x01, 0x0008},
-       {0xa1, 0x01, 0x0008},
+static const struct usb_action pb0330_InitialScale[] = {       /* 320x240 */
        {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},  /* 00 */
        {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
-       {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},   /* 10 */
+       {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
        {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
        {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
        {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
@@ -4821,6 +4547,7 @@ static const struct usb_action pb0330xx_InitialScale[] = {
        {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
        {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
        {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
+       {0xdd, 0x00, 0x0200},
        {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
        {0xaa, 0x01, 0x0006},
        {0xaa, 0x02, 0x0011},
@@ -4843,53 +4570,43 @@ static const struct usb_action pb0330xx_InitialScale[] = {
        {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
        {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
        {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
-       {0xa0, 0x00, 0x01ad},
+       {0xa0, 0x09, 0x01ad},
+       {0xa0, 0x15, 0x01ae},
        {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},
-       {0xa1, 0x01, 0x0002},
-       {0xa0, 0x09, 0x01ad},
-       {0xa0, 0x15, 0x01ae},
-       {0xa0, 0x00, ZC3XX_R092_I2CADDRESSSELECT},
-       {0xa0, 0x02, ZC3XX_R090_I2CCOMMAND},
-       {0xa1, 0x01, 0x0091},
-       {0xa1, 0x01, 0x0095},
-       {0xa1, 0x01, 0x0096},
-       {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},
-       {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, 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},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
+       {0xa0, 0x78, ZC3XX_R18D_YTARGET},       /*jfm: was 6c*/
+       {}
+};
+static const struct usb_action pb0330_50HZ[] = {
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x055c},
+       {0xbb, 0x01, 0x09aa},
+       {0xbb, 0x00, 0x1001},
+       {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
+       {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
+       {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xc4, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
+       {0xa0, 0x5c, ZC3XX_R01D_HSYNC_0},
+       {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
+       {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
+       {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
+       {}
+};
+static const struct usb_action pb0330_50HZScale[] = {
        {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
-       {0xaa, 0x05, 0x0066},
-       {0xaa, 0x09, 0x02b2},
-       {0xaa, 0x10, 0x0002},
+       {0xbb, 0x00, 0x0566},
+       {0xbb, 0x02, 0x09b2},
+       {0xbb, 0x00, 0x1002},
        {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
        {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
        {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
@@ -4897,124 +4614,102 @@ static const struct usb_action pb0330xx_InitialScale[] = {
        {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, 0x0e, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
        {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
-       {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
+       {0xa0, 0x66, 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},
-       {0xa0, 0x09, 0x01ad},
-       {0xa0, 0x15, 0x01ae},
-       {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa1, 0x01, 0x0008},
-       {0xa1, 0x01, 0x0007},
-/*     {0xa0, 0x30, 0x0007}, */
-/*     {0xa0, 0x00, 0x0007}, */
-       {}
-};
-static const struct usb_action pb0330_50HZ[] = {
-       {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 */
-       {}
-};
-static const struct usb_action pb0330_50HZScale[] = {
-       {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 */
        {}
 };
 static const struct usb_action pb0330_60HZ[] = {
-       {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 */
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x0535},
+       {0xbb, 0x01, 0x0974},
+       {0xbb, 0x00, 0x1001},
+       {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
+       {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
+       {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
+       {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
+       {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
+       {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
+       {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
        {}
 };
 static const struct usb_action pb0330_60HZScale[] = {
-       {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 */
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x0535},
+       {0xbb, 0x02, 0x096c},
+       {0xbb, 0x00, 0x1002},
+       {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
+       {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
+       {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x7c, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
+       {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
+       {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
+       {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
+       {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
        {}
 };
 static const struct usb_action pb0330_NoFliker[] = {
-       {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 */
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x0509},
+       {0xbb, 0x02, 0x0940},
+       {0xbb, 0x00, 0x1002},
+       {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
+       {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
+       {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
+       {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
+       {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
+       {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
+       {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
        {}
 };
 static const struct usb_action pb0330_NoFlikerScale[] = {
-       {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 */
+       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
+       {0xbb, 0x00, 0x0535},
+       {0xbb, 0x01, 0x0980},
+       {0xbb, 0x00, 0x1001},
+       {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
+       {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
+       {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
+       {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
+       {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
+       {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
+       {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
        {}
 };
 
@@ -5640,7 +5335,7 @@ static const struct usb_action tas5130CK_InitialScale[] = {
        {}
 };
 
-static const struct usb_action tas5130cxx_Initial[] = {
+static const struct usb_action tas5130cxx_InitialScale[] = {   /* 320x240 */
        {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
        {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
@@ -5650,9 +5345,6 @@ static const struct usb_action tas5130cxx_Initial[] = {
        {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},
@@ -5669,82 +5361,27 @@ static const struct usb_action tas5130cxx_Initial[] = {
        {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},
+       {0xa0, 0x70, ZC3XX_R18D_YTARGET},
+       {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
        {0xa0, 0x00, 0x01ad},
        {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},
-       {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, 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},
-
-       {0xa1, 0x01, 0x018d},
-       {0xa0, 0x90, ZC3XX_R18D_YTARGET},       /* 90 */
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
-
-       {0xaa, 0xa3, 0x0001},
-       {0xaa, 0xa4, 0x0077},
-       {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},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
+       {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
+       {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
        {}
 };
-static const struct usb_action tas5130cxx_InitialScale[] = {
-/*??   {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, */
+static const struct usb_action tas5130cxx_Initial[] = {        /* 640x480 */
        {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
        {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
-
-       {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
-       {0xa1, 0x01, 0x0008},
-
+       {0xa0, 0x00, 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},
@@ -5760,63 +5397,15 @@ static const struct usb_action tas5130cxx_InitialScale[] = {
        {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},
+       {0xa0, 0x70, ZC3XX_R18D_YTARGET},
+       {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
        {0xa0, 0x00, 0x01ad},
        {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},
-
-       {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
-       {0xa1, 0x01, 0x0008},   /* clock ? */
-       {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},   /* sharpness+ */
-       {0xa1, 0x01, 0x01c8},
-       {0xa1, 0x01, 0x01c9},
-       {0xa1, 0x01, 0x01ca},
-       {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},
-
-       {0xa1, 0x01, 0x018d},
-       {0xa0, 0x90, ZC3XX_R18D_YTARGET},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
-       {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
-       {0xaa, 0xa3, 0x0001},
-       {0xaa, 0xa4, 0x0063},
-       {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},
-       {0xa1, 0x01, 0x0180},
-       {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
+       {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
+       {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
        {}
 };
 static const struct usb_action tas5130cxx_50HZ[] = {
@@ -5826,20 +5415,22 @@ static const struct usb_action tas5130cxx_50HZ[] = {
        {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, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
        {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, 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}, /* 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 */
+       {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
+       {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
        {}
 };
 static const struct usb_action tas5130cxx_50HZScale[] = {
@@ -5849,20 +5440,22 @@ static const struct usb_action tas5130cxx_50HZScale[] = {
        {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, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xd0, ZC3XX_R192_EXPOSURELIMITLOW},
        {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, 0x0c, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
        {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 */
+       {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
+       {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
        {}
 };
 static const struct usb_action tas5130cxx_60HZ[] = {
@@ -5872,20 +5465,22 @@ static const struct usb_action tas5130cxx_60HZ[] = {
        {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, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW},
        {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, 0x0c, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
        {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 */
+       {0xa0, 0x28, ZC3XX_R0A0_MAXXLOW},
+       {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
        {}
 };
 static const struct usb_action tas5130cxx_60HZScale[] = {
@@ -5895,20 +5490,22 @@ static const struct usb_action tas5130cxx_60HZScale[] = {
        {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, 0x09, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0x47, ZC3XX_R192_EXPOSURELIMITLOW},
        {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, 0x0c, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
+       {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
+       {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
        {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 */
+       {0xa0, 0x20, ZC3XX_R0A0_MAXXLOW},
+       {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
        {}
 };
 static const struct usb_action tas5130cxx_NoFliker[] = {
@@ -5918,13 +5515,13 @@ static const struct usb_action tas5130cxx_NoFliker[] = {
        {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, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
        {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 */
@@ -5932,6 +5529,8 @@ static const struct usb_action tas5130cxx_NoFliker[] = {
        {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 */
+       {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
+       {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
        {}
 };
 
@@ -5942,13 +5541,13 @@ static const struct usb_action tas5130cxx_NoFlikerScale[] = {
        {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, 0x0a, ZC3XX_R191_EXPOSURELIMITMID},
+       {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
+       {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
+       {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
+       {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
+       {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
+       {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
        {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 */
@@ -5956,6 +5555,8 @@ static const struct usb_action tas5130cxx_NoFlikerScale[] = {
        {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 */
+       {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
+       {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
        {}
 };
 
@@ -6237,7 +5838,7 @@ static const struct usb_action tas5130c_vf0250_NoFlikerScale[] = {
        {}
 };
 
-static int reg_r_i(struct gspca_dev *gspca_dev,
+static u8 reg_r_i(struct gspca_dev *gspca_dev,
                __u16 index)
 {
        usb_control_msg(gspca_dev->dev,
@@ -6250,10 +5851,10 @@ static int reg_r_i(struct gspca_dev *gspca_dev,
        return gspca_dev->usb_buf[0];
 }
 
-static int reg_r(struct gspca_dev *gspca_dev,
+static u8 reg_r(struct gspca_dev *gspca_dev,
                __u16 index)
 {
-       int ret;
+       u8 ret;
 
        ret = reg_r_i(gspca_dev, index);
        PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
@@ -6286,13 +5887,15 @@ static __u16 i2c_read(struct gspca_dev *gspca_dev,
        __u8 retbyte;
        __u16 retval;
 
-       reg_w_i(gspca_dev->dev, reg, 0x92);
-       reg_w_i(gspca_dev->dev, 0x02, 0x90);            /* <- read command */
-       msleep(25);
+       reg_w_i(gspca_dev->dev, reg, 0x0092);
+       reg_w_i(gspca_dev->dev, 0x02, 0x0090);          /* <- read command */
+       msleep(20);
        retbyte = reg_r_i(gspca_dev, 0x0091);           /* read status */
+       if (retbyte != 0x00)
+               err("i2c_r status error %02x", retbyte);
        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)",
+       PDEBUG(D_USBI, "i2c r [%02x] -> %04x (%02x)",
                        reg, retval, retbyte);
        return retval;
 }
@@ -6308,8 +5911,10 @@ static __u8 i2c_write(struct gspca_dev *gspca_dev,
        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 */
-       msleep(15);
+       msleep(1);
        retbyte = reg_r_i(gspca_dev, 0x0091);           /* read status */
+       if (retbyte != 0x00)
+               err("i2c_w status error %02x", retbyte);
        PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
                        reg, valH, valL, retbyte);
        return retbyte;
@@ -6332,13 +5937,19 @@ static void usb_exchange(struct gspca_dev *gspca_dev,
                                  action->idx & 0xff,           /* valL */
                                  action->idx >> 8);            /* valH */
                        break;
+               case 0xbb:
+                       i2c_write(gspca_dev,
+                                 action->idx >> 8,             /* reg */
+                                 action->idx & 0xff,           /* valL */
+                                 action->val);                 /* valH */
+                       break;
                default:
 /*             case 0xdd:       * delay */
                        msleep(action->val / 64 + 10);
                        break;
                }
                action++;
-/*             msleep(1); */
+               msleep(1);
        }
 }
 
@@ -6347,6 +5958,10 @@ static void setmatrix(struct gspca_dev *gspca_dev)
        struct sd *sd = (struct sd *) gspca_dev;
        int i;
        const __u8 *matrix;
+       static const u8 adcm2700_matrix[9] =
+/*             {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; */
+/*ms-win*/
+               {0x74, 0xed, 0xed, 0xed, 0x74, 0xed, 0xed, 0xed, 0x74};
        static const __u8 gc0305_matrix[9] =
                {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
        static const __u8 ov7620_matrix[9] =
@@ -6355,26 +5970,30 @@ static void setmatrix(struct gspca_dev *gspca_dev)
                {0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
        static const __u8 po2030_matrix[9] =
                {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
+       static const u8 tas5130c_matrix[9] =
+               {0x68, 0xec, 0xec, 0xec, 0x68, 0xec, 0xec, 0xec, 0x68};
        static const __u8 vf0250_matrix[9] =
                {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
        static const __u8 *matrix_tb[SENSOR_MAX] = {
-               NULL,           /* SENSOR_CS2102 0 */
-               NULL,           /* SENSOR_CS2102K 1 */
-               gc0305_matrix,  /* SENSOR_GC0305 2 */
-               NULL,           /* SENSOR_HDCS2020b 3 */
-               NULL,           /* SENSOR_HV7131B 4 */
-               NULL,           /* SENSOR_HV7131C 5 */
-               NULL,           /* SENSOR_ICM105A 6 */
-               NULL,           /* SENSOR_MC501CB 7 */
-               ov7620_matrix,  /* SENSOR_OV7620 8 */
-               NULL,           /* SENSOR_OV7630C 9 */
-               NULL,           /* SENSOR_PAS106 10 */
-               pas202b_matrix, /* SENSOR_PAS202B 11 */
-               NULL,           /* SENSOR_PB0330 12 */
-               po2030_matrix,  /* SENSOR_PO2030 13 */
-               NULL,           /* SENSOR_TAS5130CK 14 */
-               NULL,           /* SENSOR_TAS5130CXX 15 */
-               vf0250_matrix,  /* SENSOR_TAS5130C_VF0250 16 */
+               adcm2700_matrix, /* SENSOR_ADCM2700 0 */
+               ov7620_matrix,  /* 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 */
+               gc0305_matrix,  /* SENSOR_MI0360SOC 9 */
+               ov7620_matrix,  /* SENSOR_OV7620 10 */
+               NULL,           /* SENSOR_OV7630C 11 */
+               NULL,           /* SENSOR_PAS106 12 */
+               pas202b_matrix, /* SENSOR_PAS202B 13 */
+               gc0305_matrix,  /* SENSOR_PB0330 14 */
+               po2030_matrix,  /* SENSOR_PO2030 15 */
+               NULL,           /* SENSOR_TAS5130CK 16 */
+               tas5130c_matrix, /* SENSOR_TAS5130CXX 17 */
+               vf0250_matrix,  /* SENSOR_TAS5130C_VF0250 18 */
        };
 
        matrix = matrix_tb[sd->sensor];
@@ -6398,8 +6017,11 @@ static void setbrightness(struct gspca_dev *gspca_dev)
 /*fixme: is it really write to 011d and 018d for all other sensors? */
        brightness = sd->brightness;
        reg_w(gspca_dev->dev, brightness, 0x011d);
-       if (sd->sensor == SENSOR_HV7131B)
+       switch (sd->sensor) {
+       case SENSOR_ADCM2700:
+       case SENSOR_HV7131B:
                return;
+       }
        if (brightness < 0x70)
                brightness += 0x10;
        else
@@ -6536,10 +6158,10 @@ static void setquality(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
        struct usb_device *dev = gspca_dev->dev;
-       __u8 quality;
        __u8 frxt;
 
        switch (sd->sensor) {
+       case SENSOR_ADCM2700:
        case SENSOR_GC0305:
        case SENSOR_HV7131B:
        case SENSOR_OV7620:
@@ -6547,26 +6169,18 @@ static void setquality(struct gspca_dev *gspca_dev)
                return;
        }
 /*fixme: is it really 0008 0007 0018 for all other sensors? */
-       quality = sd->qindex;
-       reg_w(dev, quality, 0x0008);
+       reg_w(dev, QUANT_VAL, 0x0008);
        frxt = 0x30;
        reg_w(dev, frxt, 0x0007);
-       switch (quality) {
-       case 0:
-       case 1:
-       case 2:
-               frxt = 0xff;
-               break;
-       case 3:
-               frxt = 0xf0;
-               break;
-       case 4:
-               frxt = 0xe0;
-               break;
-       case 5:
-               frxt = 0x20;
-               break;
-       }
+#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
        reg_w(dev, frxt, 0x0018);
 }
 
@@ -6583,71 +6197,79 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
        int i, mode;
        const struct usb_action *zc3_freq;
        static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
-/* SENSOR_CS2102 0 */
+/* SENSOR_ADCM2700 0 */
+               {adcm2700_NoFliker, adcm2700_NoFliker,
+                adcm2700_50HZ, adcm2700_50HZ,
+                adcm2700_60HZ, adcm2700_60HZ},
+/* SENSOR_CS2102 1 */
                {cs2102_NoFliker, cs2102_NoFlikerScale,
                 cs2102_50HZ, cs2102_50HZScale,
                 cs2102_60HZ, cs2102_60HZScale},
-/* SENSOR_CS2102K 1 */
+/* SENSOR_CS2102K 2 */
                {cs2102_NoFliker, cs2102_NoFlikerScale,
                 NULL, NULL, /* currently disabled */
                 NULL, NULL},
-/* SENSOR_GC0305 2 */
+/* SENSOR_GC0305 3 */
                {gc0305_NoFliker, gc0305_NoFliker,
                 gc0305_50HZ, gc0305_50HZ,
                 gc0305_60HZ, gc0305_60HZ},
-/* SENSOR_HDCS2020b 3 */
+/* SENSOR_HDCS2020b 4 */
                {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
                 hdcs2020b_50HZ, hdcs2020b_50HZ,
                 hdcs2020b_60HZ, hdcs2020b_60HZ},
-/* SENSOR_HV7131B 4 */
+/* SENSOR_HV7131B 5 */
                {hv7131b_NoFlikerScale, hv7131b_NoFliker,
                 hv7131b_50HZScale, hv7131b_50HZ,
                 hv7131b_60HZScale, hv7131b_60HZ},
-/* SENSOR_HV7131C 5 */
+/* SENSOR_HV7131C 6 */
                {NULL, NULL,
                 NULL, NULL,
                 NULL, NULL},
-/* SENSOR_ICM105A 6 */
+/* SENSOR_ICM105A 7 */
                {icm105a_NoFliker, icm105a_NoFlikerScale,
                 icm105a_50HZ, icm105a_50HZScale,
                 icm105a_60HZ, icm105a_60HZScale},
-/* SENSOR_MC501CB 7 */
+/* SENSOR_MC501CB 8 */
                {MC501CB_NoFliker, MC501CB_NoFlikerScale,
                 MC501CB_50HZ, MC501CB_50HZScale,
                 MC501CB_60HZ, MC501CB_60HZScale},
-/* SENSOR_OV7620 8 */
+/* SENSOR_MI0360SOC 9 */
+               {mi360soc_AENoFlikerScale, mi360soc_AENoFliker,
+                mi360soc_AE50HZScale, mi360soc_AE50HZ,
+                mi360soc_AE60HZScale, mi360soc_AE60HZ},
+/* SENSOR_OV7620 10 */
                {OV7620_NoFliker, OV7620_NoFliker,
                 OV7620_50HZ, OV7620_50HZ,
                 OV7620_60HZ, OV7620_60HZ},
-/* SENSOR_OV7630C 9 */
+/* SENSOR_OV7630C 11 */
                {NULL, NULL,
                 NULL, NULL,
                 NULL, NULL},
-/* SENSOR_PAS106 10 */
+/* SENSOR_PAS106 12 */
                {pas106b_NoFliker, pas106b_NoFliker,
                 pas106b_50HZ, pas106b_50HZ,
                 pas106b_60HZ, pas106b_60HZ},
-/* SENSOR_PAS202B 11 */
+/* SENSOR_PAS202B 13 */
                {pas202b_NoFlikerScale, pas202b_NoFliker,
                 pas202b_50HZScale, pas202b_50HZ,
                 pas202b_60HZScale, pas202b_60HZ},
-/* SENSOR_PB0330 12 */
-               {pb0330_NoFliker, pb0330_NoFlikerScale,
-                pb0330_50HZ, pb0330_50HZScale,
-                pb0330_60HZ, pb0330_60HZScale},
-/* SENSOR_PO2030 13 */
+/* SENSOR_PB0330 14 */
+               {pb0330_NoFlikerScale, pb0330_NoFliker,
+                pb0330_50HZScale, pb0330_50HZ,
+                pb0330_60HZScale, pb0330_60HZ},
+/* SENSOR_PO2030 15 */
                {PO2030_NoFliker, PO2030_NoFliker,
                 PO2030_50HZ, PO2030_50HZ,
                 PO2030_60HZ, PO2030_60HZ},
-/* SENSOR_TAS5130CK 14 */
-               {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
-                tas5130cxx_50HZ, tas5130cxx_50HZScale,
-                tas5130cxx_60HZ, tas5130cxx_60HZScale},
-/* SENSOR_TAS5130CXX 15 */
-               {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale,
-                tas5130cxx_50HZ, tas5130cxx_50HZScale,
-                tas5130cxx_60HZ, tas5130cxx_60HZScale},
-/* SENSOR_TAS5130C_VF0250 16 */
+/* SENSOR_TAS5130CK 16 */
+               {tas5130cxx_NoFlikerScale, tas5130cxx_NoFliker,
+                tas5130cxx_50HZScale, tas5130cxx_50HZ,
+                tas5130cxx_60HZScale, tas5130cxx_60HZ},
+/* SENSOR_TAS5130CXX 17 */
+               {tas5130cxx_NoFlikerScale, tas5130cxx_NoFliker,
+                tas5130cxx_50HZScale, tas5130cxx_50HZ,
+                tas5130cxx_60HZScale, tas5130cxx_60HZ},
+/* SENSOR_TAS5130C_VF0250 18 */
                {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale,
                 tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale,
                 tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale},
@@ -6701,8 +6323,10 @@ static void send_unknown(struct usb_device *dev, int sensor)
                reg_w(dev, 0x0c, 0x003b);
                reg_w(dev, 0x08, 0x0038);
                break;
+       case SENSOR_ADCM2700:
        case SENSOR_GC0305:
        case SENSOR_OV7620:
+       case SENSOR_MI0360SOC:
        case SENSOR_PB0330:
        case SENSOR_PO2030:
                reg_w(dev, 0x0d, 0x003a);
@@ -6743,26 +6367,25 @@ static int sif_probe(struct gspca_dev *gspca_dev)
 static int vga_2wr_probe(struct gspca_dev *gspca_dev)
 {
        struct usb_device *dev = gspca_dev->dev;
-       __u8 retbyte;
-       __u16 checkword;
+       u16 retword;
 
        start_2wr_probe(dev, 0x00);             /* HV7131B */
        i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
-       retbyte = i2c_read(gspca_dev, 0x01);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x01);
+       if (retword != 0)
                return 0x00;                    /* HV7131B */
 
        start_2wr_probe(dev, 0x04);             /* CS2102 */
        i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
-       retbyte = i2c_read(gspca_dev, 0x01);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x01);
+       if (retword != 0)
                return 0x04;                    /* CS2102 */
 
        start_2wr_probe(dev, 0x06);             /* OmniVision */
        reg_w(dev, 0x08, 0x008d);
        i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
-       retbyte = i2c_read(gspca_dev, 0x11);
-       if (retbyte != 0) {
+       retword = i2c_read(gspca_dev, 0x11);
+       if (retword != 0) {
                /* (should have returned 0xaa) --> Omnivision? */
                /* reg_r 0x10 -> 0x06 -->  */
                goto ov_check;
@@ -6770,41 +6393,41 @@ static int vga_2wr_probe(struct gspca_dev *gspca_dev)
 
        start_2wr_probe(dev, 0x08);             /* HDCS2020 */
        i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
-       retbyte = i2c_read(gspca_dev, 0x15);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x15);
+       if (retword != 0)
                return 0x08;                    /* HDCS2020 */
 
        start_2wr_probe(dev, 0x0a);             /* PB0330 */
        i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
-       retbyte = i2c_read(gspca_dev, 0x07);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x07);
+       if (retword != 0)
                return 0x0a;                    /* PB0330 */
-       retbyte = i2c_read(gspca_dev, 0x03);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x03);
+       if (retword != 0)
                return 0x0a;                    /* PB0330 ?? */
-       retbyte = i2c_read(gspca_dev, 0x04);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x04);
+       if (retword != 0)
                return 0x0a;                    /* PB0330 ?? */
 
        start_2wr_probe(dev, 0x0c);             /* ICM105A */
        i2c_write(gspca_dev, 0x01, 0x11, 0x00);
-       retbyte = i2c_read(gspca_dev, 0x01);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x01);
+       if (retword != 0)
                return 0x0c;                    /* ICM105A */
 
        start_2wr_probe(dev, 0x0e);             /* PAS202BCB */
        reg_w(dev, 0x08, 0x008d);
        i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
-       msleep(500);
-       retbyte = i2c_read(gspca_dev, 0x03);
-       if (retbyte != 0)
+       msleep(50);
+       retword = i2c_read(gspca_dev, 0x03);
+       if (retword != 0)
                return 0x0e;                    /* PAS202BCB */
 
-       start_2wr_probe(dev, 0x02);             /* ?? */
+       start_2wr_probe(dev, 0x02);             /* TAS5130C */
        i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
-       retbyte = i2c_read(gspca_dev, 0x01);
-       if (retbyte != 0)
-               return 0x02;                    /* ?? */
+       retword = i2c_read(gspca_dev, 0x01);
+       if (retword != 0)
+               return 0x02;                    /* TAS5130C */
 ov_check:
        reg_r(gspca_dev, 0x0010);               /* ?? */
        reg_r(gspca_dev, 0x0010);
@@ -6817,12 +6440,10 @@ ov_check:
        msleep(500);
        reg_w(dev, 0x01, 0x0012);
        i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
-       retbyte = i2c_read(gspca_dev, 0x0a);
-       checkword = retbyte << 8;
-       retbyte = i2c_read(gspca_dev, 0x0b);
-       checkword |= retbyte;
-       PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", checkword);
-       switch (checkword) {
+       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) {
        case 0x7631:                            /* OV7630C */
                reg_w(dev, 0x06, 0x0010);
                break;
@@ -6832,7 +6453,7 @@ ov_check:
        default:
                return -1;                      /* not OmniVision */
        }
-       return checkword;
+       return retword;
 }
 
 struct sensor_by_chipset_revision {
@@ -6840,7 +6461,8 @@ struct sensor_by_chipset_revision {
        __u8 internal_sensor_id;
 };
 static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
-       {0xc001, 0x13},         /* MI0360 */
+       {0xc000, 0x12},         /* TAS5130C */
+       {0xc001, 0x13},         /* MI0360SOC */
        {0xe001, 0x13},
        {0x8001, 0x13},
        {0x8000, 0x14},         /* CS2102K */
@@ -6853,7 +6475,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
        struct usb_device *dev = gspca_dev->dev;
        int i;
        __u8 retbyte;
-       __u16 checkword;
+       u16 retword;
 
 /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
        reg_w(dev, 0x02, 0x0010);
@@ -6865,42 +6487,45 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
        reg_w(dev, 0x03, 0x0012);
        reg_w(dev, 0x01, 0x0012);
        reg_w(dev, 0x05, 0x0012);
-       retbyte = i2c_read(gspca_dev, 0x14);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x14);
+       if (retword != 0)
                return 0x11;                    /* HV7131R */
-       retbyte = i2c_read(gspca_dev, 0x15);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x15);
+       if (retword != 0)
                return 0x11;                    /* HV7131R */
-       retbyte = i2c_read(gspca_dev, 0x16);
-       if (retbyte != 0)
+       retword = i2c_read(gspca_dev, 0x16);
+       if (retword != 0)
                return 0x11;                    /* HV7131R */
 
        reg_w(dev, 0x02, 0x0010);
-       retbyte = reg_r(gspca_dev, 0x000b);
-       checkword = retbyte << 8;
-       retbyte = reg_r(gspca_dev, 0x000a);
-       checkword |= retbyte;
-       PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword);
+       retword = reg_r(gspca_dev, 0x000b) << 8;
+       retword |= reg_r(gspca_dev, 0x000a);
+       PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword);
        reg_r(gspca_dev, 0x0010);
-       /* this is tested only once anyway */
-       for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
-               if (chipset_revision_sensor[i].revision == checkword) {
-                       sd->chip_revision = checkword;
-                       send_unknown(dev, SENSOR_PB0330);
-                       return chipset_revision_sensor[i].internal_sensor_id;
+       /* value 0x4001 is meaningless */
+       if (retword != 0x4001) {
+               if ((retword & 0xff00) == 0x6400)
+                       return 0x02;            /* TAS5130C */
+               for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
+                       if (chipset_revision_sensor[i].revision == retword) {
+                               sd->chip_revision = retword;
+                               send_unknown(dev, SENSOR_PB0330);
+                               return chipset_revision_sensor[i]
+                                                       .internal_sensor_id;
+                       }
                }
        }
 
-       reg_w(dev, 0x01, 0x0000);       /* check ?? */
+       reg_w(dev, 0x01, 0x0000);       /* check PB0330 */
        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);
-       retbyte = i2c_read(gspca_dev, 0x00);
-       if (retbyte != 0) {
+       retword = i2c_read(gspca_dev, 0x00);
+       if (retword != 0) {
                PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
-               return 0x0a;                    /* ?? */
+               return 0x0a;                    /* PB0330 */
        }
 
        reg_w(dev, 0x01, 0x0000);
@@ -6910,14 +6535,14 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
        reg_w(dev, 0x03, 0x0012);
        msleep(2);
        reg_w(dev, 0x01, 0x0012);
-       retbyte = i2c_read(gspca_dev, 0x00);
-       if (retbyte != 0) {
-               PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte);
-               if (retbyte == 0x11)                    /* VF0250 */
+       retword = i2c_read(gspca_dev, 0x00);
+       if (retword != 0) {
+               PDEBUG(D_PROBE, "probe 3wr vga type %02x", retword);
+               if (retword == 0x0011)                  /* VF0250 */
                        return 0x0250;
-               if (retbyte == 0x29)                    /* gc0305 */
+               if (retword == 0x0029)                  /* gc0305 */
                        send_unknown(dev, SENSOR_GC0305);
-               return retbyte;
+               return retword;
        }
 
        reg_w(dev, 0x01, 0x0000);       /* check OmniVision */
@@ -6927,8 +6552,8 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
        reg_w(dev, 0x06, 0x0010);
        reg_w(dev, 0x01, 0x0012);
        reg_w(dev, 0x05, 0x0012);
-       if (i2c_read(gspca_dev, 0x1c) == 0x7f   /* OV7610 - manufacturer ID */
-           && i2c_read(gspca_dev, 0x1d) == 0xa2) {
+       if (i2c_read(gspca_dev, 0x1c) == 0x007f /* OV7610 - manufacturer ID */
+           && i2c_read(gspca_dev, 0x1d) == 0x00a2) {
                send_unknown(dev, SENSOR_OV7620);
                return 0x06;            /* OmniVision confirm ? */
        }
@@ -6939,19 +6564,16 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
        reg_w(dev, 0x01, 0x0001);
        reg_w(dev, 0xee, 0x008b);
        reg_w(dev, 0x03, 0x0012);
-/*     msleep(150); */
        reg_w(dev, 0x01, 0x0012);
        reg_w(dev, 0x05, 0x0012);
-       retbyte = i2c_read(gspca_dev, 0x0000);          /* ID 0 */
-       checkword = retbyte << 8;
-       retbyte = i2c_read(gspca_dev, 0x0001);          /* ID 1 */
-       checkword |= retbyte;
-       PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword);
-       if (checkword == 0x2030) {
+       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) {
                retbyte = i2c_read(gspca_dev, 0x02);    /* revision number */
                PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
                send_unknown(dev, SENSOR_PO2030);
-               return checkword;
+               return retword;
        }
 
        reg_w(dev, 0x01, 0x0000);
@@ -6960,12 +6582,12 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
        reg_w(dev, 0x01, 0x0001);
        reg_w(dev, 0x03, 0x0012);
        reg_w(dev, 0x01, 0x0012);
-       reg_w(dev, 0x05, 0x0001);
+       reg_w(dev, 0x05, 0x0012);
        reg_w(dev, 0xd3, 0x008b);
-       retbyte = i2c_read(gspca_dev, 0x01);
-       if (retbyte != 0) {
-               PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
-               return 0x0a;                    /* ?? */
+       retword = i2c_read(gspca_dev, 0x01);
+       if (retword != 0) {
+               PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword);
+               return 0x16;                    /* adcm2700 (6100/6200) */
        }
        return -1;
 }
@@ -6973,7 +6595,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
 static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
-       int sensor, sensor2;
+       int sensor;
 
        switch (sd->sensor) {
        case SENSOR_MC501CB:
@@ -6988,16 +6610,9 @@ static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
                break;
        }
        sensor = vga_2wr_probe(gspca_dev);
-       if (sensor >= 0) {
-               if (sensor < 0x7600)
-                       return sensor;
-               /* next probe is needed for OmniVision ? */
-       }
-       sensor2 = vga_3wr_probe(gspca_dev);
-       if (sensor2 >= 0
-           && sensor >= 0)
+       if (sensor >= 0)
                return sensor;
-       return sensor2;
+       return vga_3wr_probe(gspca_dev);
 }
 
 /* this function is called at probe time */
@@ -7009,23 +6624,25 @@ static int sd_config(struct gspca_dev *gspca_dev,
        int sensor;
        int vga = 1;            /* 1: vga, 0: sif */
        static const __u8 gamma[SENSOR_MAX] = {
-               5,      /* SENSOR_CS2102 0 */
-               5,      /* SENSOR_CS2102K 1 */
-               4,      /* SENSOR_GC0305 2 */
-               4,      /* SENSOR_HDCS2020b 3 */
-               4,      /* SENSOR_HV7131B 4 */
-               4,      /* SENSOR_HV7131C 5 */
-               4,      /* SENSOR_ICM105A 6 */
-               4,      /* SENSOR_MC501CB 7 */
-               3,      /* SENSOR_OV7620 8 */
-               4,      /* SENSOR_OV7630C 9 */
-               4,      /* SENSOR_PAS106 10 */
-               4,      /* SENSOR_PAS202B 11 */
-               4,      /* SENSOR_PB0330 12 */
-               4,      /* SENSOR_PO2030 13 */
-               4,      /* SENSOR_TAS5130CK 14 */
-               4,      /* SENSOR_TAS5130CXX 15 */
-               3,      /* SENSOR_TAS5130C_VF0250 16 */
+               4,      /* SENSOR_ADCM2700 0 */
+               4,      /* 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 */
+               4,      /* SENSOR_MI0360SOC 9 */
+               3,      /* SENSOR_OV7620 10 */
+               4,      /* SENSOR_OV7630C 11 */
+               4,      /* SENSOR_PAS106 12 */
+               4,      /* SENSOR_PAS202B 13 */
+               4,      /* SENSOR_PB0330 14 */
+               4,      /* SENSOR_PO2030 15 */
+               4,      /* SENSOR_TAS5130CK 16 */
+               3,      /* SENSOR_TAS5130CXX 17 */
+               3,      /* SENSOR_TAS5130C_VF0250 18 */
        };
 
        /* define some sensors from the vendor/product */
@@ -7033,7 +6650,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
        sd->sensor = id->driver_info;
        sensor = zcxx_probeSensor(gspca_dev);
        if (sensor >= 0)
-               PDEBUG(D_PROBE, "probe sensor -> %02x", sensor);
+               PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
        if ((unsigned) force_sensor < SENSOR_MAX) {
                sd->sensor = force_sensor;
                PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
@@ -7049,7 +6666,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
                                break;
                        default:
                                PDEBUG(D_PROBE,
-                                       "Sensor UNKNOW_0 force Tas5130");
+                                       "Sensor UNKNOWN_0 force Tas5130");
                                sd->sensor = SENSOR_TAS5130CXX;
                        }
                        break;
@@ -7057,6 +6674,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
                        PDEBUG(D_PROBE, "Find Sensor HV7131B");
                        sd->sensor = SENSOR_HV7131B;
                        break;
+               case 0x02:
+                       PDEBUG(D_PROBE, "Sensor TAS5130C");
+                       sd->sensor = SENSOR_TAS5130CXX;
+                       break;
                case 0x04:
                        PDEBUG(D_PROBE, "Find Sensor CS2102");
                        sd->sensor = SENSOR_CS2102;
@@ -7087,7 +6708,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
                        break;
                case 0x10:
                case 0x12:
-                       PDEBUG(D_PROBE, "Find Sensor TAS5130");
+                       PDEBUG(D_PROBE, "Find Sensor TAS5130C");
                        sd->sensor = SENSOR_TAS5130CXX;
                        break;
                case 0x11:
@@ -7096,9 +6717,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
                        break;
                case 0x13:
                        PDEBUG(D_PROBE,
-                               "Find Sensor MI0360. Chip revision %x",
+                               "Find Sensor MI0360SOC. Chip revision %x",
                                sd->chip_revision);
-                       sd->sensor = SENSOR_PB0330;
+                       sd->sensor = SENSOR_MI0360SOC;
                        break;
                case 0x14:
                        PDEBUG(D_PROBE,
@@ -7112,6 +6733,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
                                sd->chip_revision);
                        sd->sensor = SENSOR_TAS5130CK;
                        break;
+               case 0x16:
+                       PDEBUG(D_PROBE, "Find Sensor ADCM2700");
+                       sd->sensor = SENSOR_ADCM2700;
+                       break;
                case 0x29:
                        PDEBUG(D_PROBE, "Find Sensor GC0305");
                        sd->sensor = SENSOR_GC0305;
@@ -7129,12 +6754,16 @@ static int sd_config(struct gspca_dev *gspca_dev,
                        PDEBUG(D_PROBE, "Find Sensor OV7620");
                        sd->sensor = SENSOR_OV7620;
                        break;
+               case 0x7631:
+                       PDEBUG(D_PROBE, "Find Sensor OV7630C");
+                       sd->sensor = SENSOR_OV7630C;
+                       break;
                case 0x7648:
                        PDEBUG(D_PROBE, "Find Sensor OV7648");
                        sd->sensor = SENSOR_OV7620;     /* same sensor (?) */
                        break;
                default:
-                       PDEBUG(D_ERR|D_PROBE, "Unknown sensor %02x", sensor);
+                       PDEBUG(D_ERR|D_PROBE, "Unknown sensor %04x", sensor);
                        return -EINVAL;
                }
        }
@@ -7156,12 +6785,12 @@ static int sd_config(struct gspca_dev *gspca_dev,
                cam->cam_mode = sif_mode;
                cam->nmodes = ARRAY_SIZE(sif_mode);
        }
-       sd->qindex = 1;
        sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
        sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value;
        sd->gamma = gamma[(int) sd->sensor];
        sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value;
        sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value;
+       sd->quality = QUALITY_DEF;
 
        switch (sd->sensor) {
        case SENSOR_GC0305:
@@ -7195,27 +6824,36 @@ static int sd_start(struct gspca_dev *gspca_dev)
        const struct usb_action *zc3_init;
        int mode;
        static const struct usb_action *init_tb[SENSOR_MAX][2] = {
-               {cs2102_InitialScale, cs2102_Initial},          /* 0 */
-               {cs2102K_InitialScale, cs2102K_Initial},        /* 1 */
-               {gc0305_Initial, gc0305_InitialScale},          /* 2 */
-               {hdcs2020xb_InitialScale, hdcs2020xb_Initial},  /* 3 */
-               {hv7131bxx_InitialScale, hv7131bxx_Initial},    /* 4 */
-               {hv7131cxx_InitialScale, hv7131cxx_Initial},    /* 5 */
-               {icm105axx_InitialScale, icm105axx_Initial},    /* 6 */
-               {MC501CB_InitialScale, MC501CB_Initial},        /* 7 */
-               {OV7620_mode0, OV7620_mode1},                   /* 8 */
-               {ov7630c_InitialScale, ov7630c_Initial},        /* 9 */
-               {pas106b_InitialScale, pas106b_Initial},        /* 10 */
-               {pas202b_Initial, pas202b_InitialScale},        /* 11 */
-               {pb0330xx_InitialScale, pb0330xx_Initial},      /* 12 */
-/* or          {pb03303x_InitialScale, pb03303x_Initial}, */
-               {PO2030_mode0, PO2030_mode1},                   /* 13 */
-               {tas5130CK_InitialScale, tas5130CK_Initial},    /* 14 */
-               {tas5130cxx_InitialScale, tas5130cxx_Initial},  /* 15 */
+               {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 */
+               {mi0360soc_Initial, mi0360soc_InitialScale},    /* 9 */
+               {OV7620_mode0, OV7620_mode1},                   /* 10 */
+               {ov7630c_InitialScale, ov7630c_Initial},        /* 11 */
+               {pas106b_InitialScale, pas106b_Initial},        /* 12 */
+               {pas202b_Initial, pas202b_InitialScale},        /* 13 */
+               {pb0330_Initial, pb0330_InitialScale},          /* 14 */
+               {PO2030_mode0, PO2030_mode1},                   /* 15 */
+               {tas5130CK_InitialScale, tas5130CK_Initial},    /* 16 */
+               {tas5130cxx_Initial, tas5130cxx_InitialScale},  /* 17 */
                {tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial},
-                                                               /* 16 */
+                                                               /* 18 */
        };
 
+       /* create the JPEG header */
+       sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
+       if (!sd->jpeg_hdr)
+               return -ENOMEM;
+       jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
+                       0x21);          /* JPEG 422 */
+       jpeg_set_qual(sd->jpeg_hdr, sd->quality);
+
        mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
        zc3_init = init_tb[(int) sd->sensor][mode];
        switch (sd->sensor) {
@@ -7225,31 +6863,22 @@ static int sd_start(struct gspca_dev *gspca_dev)
        case SENSOR_PAS106:
                usb_exchange(gspca_dev, pas106b_Initial_com);
                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;
        }
        usb_exchange(gspca_dev, zc3_init);
 
        switch (sd->sensor) {
+       case SENSOR_ADCM2700:
        case SENSOR_GC0305:
        case SENSOR_OV7620:
        case SENSOR_PO2030:
+       case SENSOR_TAS5130CXX:
        case SENSOR_TAS5130C_VF0250:
-               msleep(100);                    /* ?? */
+/*             msleep(100);                     * ?? */
                reg_r(gspca_dev, 0x0002);       /* --> 0x40 */
                reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
                reg_w(dev, 0x15, 0x01ae);
+               if (sd->sensor == SENSOR_TAS5130CXX)
+                       break;
                reg_w(dev, 0x0d, 0x003a);
                reg_w(dev, 0x02, 0x003b);
                reg_w(dev, 0x00, 0x0038);
@@ -7259,12 +6888,14 @@ static int sd_start(struct gspca_dev *gspca_dev)
        setmatrix(gspca_dev);
        setbrightness(gspca_dev);
        switch (sd->sensor) {
+       case SENSOR_ADCM2700:
        case SENSOR_OV7620:
                reg_r(gspca_dev, 0x0008);
                reg_w(dev, 0x00, 0x0008);
                break;
        case SENSOR_PAS202B:
        case SENSOR_GC0305:
+       case SENSOR_TAS5130CXX:
                reg_r(gspca_dev, 0x0008);
                /* fall thru */
        case SENSOR_PO2030:
@@ -7275,10 +6906,8 @@ static int sd_start(struct gspca_dev *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_CS2102K:            /* gamma set in xxx_Initial */
        case SENSOR_HDCS2020b:
-       case SENSOR_PB0330:             /* pb with chip_revision - see above */
        case SENSOR_OV7630C:
        case SENSOR_TAS5130CK:
                break;
@@ -7300,7 +6929,15 @@ static int sd_start(struct gspca_dev *gspca_dev)
        setlightfreq(gspca_dev);
 
        switch (sd->sensor) {
+       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;
        case SENSOR_GC0305:
+       case SENSOR_TAS5130CXX:
                reg_w(dev, 0x09, 0x01ad);       /* (from win traces) */
                reg_w(dev, 0x15, 0x01ae);
                /* fall thru */
@@ -7322,19 +6959,16 @@ static int sd_start(struct gspca_dev *gspca_dev)
 
        setautogain(gspca_dev);
        switch (sd->sensor) {
-       case SENSOR_PAS202B:
-               reg_w(dev, 0x00, 0x0007);       /* (from win traces) */
-               break;
        case SENSOR_PO2030:
-               msleep(500);
+               msleep(50);
                reg_r(gspca_dev, 0x0008);
                reg_r(gspca_dev, 0x0007);
+               /*fall thru*/
+       case SENSOR_PAS202B:
                reg_w(dev, 0x00, 0x0007);       /* (from win traces) */
-               reg_w(dev, 0x02, 0x0008);
+               reg_w(dev, 0x02, ZC3XX_R008_CLOCKSETTING);
                break;
        }
-       if (sd->sensor == SENSOR_PAS202B)
-               reg_w(dev, 0x02, ZC3XX_R008_CLOCKSETTING);
        return 0;
 }
 
@@ -7343,24 +6977,25 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
 
+       kfree(sd->jpeg_hdr);
        if (!gspca_dev->present)
                return;
        send_unknown(gspca_dev->dev, sd->sensor);
 }
 
 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
-                       struct gspca_frame *frame,
-                       __u8 *data,
+                       u8 *data,
                        int len)
 {
+       struct sd *sd = (struct sd *) gspca_dev;
 
        if (data[0] == 0xff && data[1] == 0xd8) {       /* start of frame */
-               frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
-                                       data, 0);
+               gspca_frame_add(gspca_dev, LAST_PACKET,
+                                       NULL, 0);
                /* put the JPEG header in the new frame */
-               jpeg_put_header(gspca_dev, frame,
-                               ((struct sd *) gspca_dev)->qindex,
-                               0x21);
+               gspca_frame_add(gspca_dev, FIRST_PACKET,
+                       sd->jpeg_hdr, JPEG_HDR_SZ);
+
                /* 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)
@@ -7370,7 +7005,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
                data += 18;
                len -= 18;
        }
-       gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
+       gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
 }
 
 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
@@ -7502,16 +7137,46 @@ static int sd_querymenu(struct gspca_dev *gspca_dev,
        return -EINVAL;
 }
 
+static int sd_set_jcomp(struct gspca_dev *gspca_dev,
+                       struct v4l2_jpegcompression *jcomp)
+{
+       struct sd *sd = (struct sd *) gspca_dev;
+
+       if (jcomp->quality < QUALITY_MIN)
+               sd->quality = QUALITY_MIN;
+       else if (jcomp->quality > QUALITY_MAX)
+               sd->quality = QUALITY_MAX;
+       else
+               sd->quality = jcomp->quality;
+       if (gspca_dev->streaming)
+               jpeg_set_qual(sd->jpeg_hdr, sd->quality);
+       return 0;
+}
+
+static int sd_get_jcomp(struct gspca_dev *gspca_dev,
+                       struct v4l2_jpegcompression *jcomp)
+{
+       struct sd *sd = (struct sd *) gspca_dev;
+
+       memset(jcomp, 0, sizeof *jcomp);
+       jcomp->quality = sd->quality;
+       jcomp->jpeg_markers = V4L2_JPEG_MARKER_DHT
+                       | V4L2_JPEG_MARKER_DQT;
+       return 0;
+}
+
 static const struct sd_desc sd_desc = {
        .name = MODULE_NAME,
        .ctrls = sd_ctrls,
-       .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
+       .nctrls = ARRAY_SIZE(sd_ctrls),
        .config = sd_config,
        .init = sd_init,
        .start = sd_start,
        .stop0 = sd_stop0,
        .pkt_scan = sd_pkt_scan,
        .querymenu = sd_querymenu,
+       .get_jcomp = sd_get_jcomp,
+       .set_jcomp = sd_set_jcomp,
 };
 
 static const __devinitdata struct usb_device_id device_table[] = {
@@ -7562,12 +7227,10 @@ static const __devinitdata struct usb_device_id device_table[] = {
        {USB_DEVICE(0x055f, 0xd004)},
        {USB_DEVICE(0x0698, 0x2003)},
        {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
-       {USB_DEVICE(0x0ac8, 0x0302)},
+       {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},
        {USB_DEVICE(0x0ac8, 0x301b)},
-#if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
        {USB_DEVICE(0x0ac8, 0x303b)},
-#endif
-       {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250},
+       {USB_DEVICE(0x0ac8, 0x305b)},
        {USB_DEVICE(0x0ac8, 0x307b)},
        {USB_DEVICE(0x10fd, 0x0128)},
        {USB_DEVICE(0x10fd, 0x804d)},
@@ -7599,8 +7262,10 @@ static struct usb_driver sd_driver = {
 
 static int __init sd_mod_init(void)
 {
-       if (usb_register(&sd_driver) < 0)
-               return -1;
+       int ret;
+       ret = usb_register(&sd_driver);
+       if (ret < 0)
+               return ret;
        PDEBUG(D_PROBE, "registered");
        return 0;
 }