Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * SPCA501 chip based cameras initialization data
0004  *
0005  * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
0006  */
0007 
0008 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
0009 
0010 #define MODULE_NAME "spca501"
0011 
0012 #include "gspca.h"
0013 
0014 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
0015 MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver");
0016 MODULE_LICENSE("GPL");
0017 
0018 /* specific webcam descriptor */
0019 struct sd {
0020     struct gspca_dev gspca_dev; /* !! must be the first item */
0021 
0022     unsigned short contrast;
0023     __u8 brightness;
0024     __u8 colors;
0025     __u8 blue_balance;
0026     __u8 red_balance;
0027 
0028     char subtype;
0029 #define Arowana300KCMOSCamera 0
0030 #define IntelCreateAndShare 1
0031 #define KodakDVC325 2
0032 #define MystFromOriUnknownCamera 3
0033 #define SmileIntlCamera 4
0034 #define ThreeComHomeConnectLite 5
0035 #define ViewQuestM318B 6
0036 };
0037 
0038 static const struct v4l2_pix_format vga_mode[] = {
0039     {160, 120, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
0040         .bytesperline = 160,
0041         .sizeimage = 160 * 120 * 3 / 2,
0042         .colorspace = V4L2_COLORSPACE_SRGB,
0043         .priv = 2},
0044     {320, 240, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
0045         .bytesperline = 320,
0046         .sizeimage = 320 * 240 * 3 / 2,
0047         .colorspace = V4L2_COLORSPACE_SRGB,
0048         .priv = 1},
0049     {640, 480, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
0050         .bytesperline = 640,
0051         .sizeimage = 640 * 480 * 3 / 2,
0052         .colorspace = V4L2_COLORSPACE_SRGB,
0053         .priv = 0},
0054 };
0055 
0056 #define SPCA50X_REG_USB 0x2 /* spca505 501 */
0057 /*
0058  * Data to initialize a SPCA501. From a capture file provided by Bill Roehl
0059  * With SPCA501 chip description
0060  */
0061 #define CCDSP_SET       /* set CCDSP parameters */
0062 #define TG_SET          /* set time generator set */
0063 #undef DSPWIN_SET       /* set DSP windows parameters */
0064 #undef ALTER_GAMA   /* Set alternate set to YUV transform coeffs. */
0065 #define SPCA501_SNAPBIT 0x80
0066 #define SPCA501_SNAPCTRL 0x10
0067 /* Frame packet header offsets for the spca501 */
0068 #define SPCA501_OFFSET_GPIO   1
0069 #define SPCA501_OFFSET_TYPE   2
0070 #define SPCA501_OFFSET_TURN3A 3
0071 #define SPCA501_OFFSET_FRAMSEQ 4
0072 #define SPCA501_OFFSET_COMPRESS 5
0073 #define SPCA501_OFFSET_QUANT 6
0074 #define SPCA501_OFFSET_QUANT2 7
0075 #define SPCA501_OFFSET_DATA 8
0076 
0077 #define SPCA501_PROP_COMP_ENABLE(d) ((d) & 1)
0078 #define SPCA501_PROP_SNAP(d) ((d) & 0x40)
0079 #define SPCA501_PROP_SNAP_CTRL(d) ((d) & 0x10)
0080 #define SPCA501_PROP_COMP_THRESH(d) (((d) & 0x0e) >> 1)
0081 #define SPCA501_PROP_COMP_QUANT(d) (((d) & 0x70) >> 4)
0082 
0083 /* SPCA501 CCDSP control */
0084 #define SPCA501_REG_CCDSP 0x01
0085 /* SPCA501 control/status registers */
0086 #define SPCA501_REG_CTLRL 0x02
0087 
0088 /* registers for color correction and YUV transformation */
0089 #define SPCA501_A11 0x08
0090 #define SPCA501_A12 0x09
0091 #define SPCA501_A13 0x0A
0092 #define SPCA501_A21 0x0B
0093 #define SPCA501_A22 0x0C
0094 #define SPCA501_A23 0x0D
0095 #define SPCA501_A31 0x0E
0096 #define SPCA501_A32 0x0F
0097 #define SPCA501_A33 0x10
0098 
0099 /* Data for video camera initialization before capturing */
0100 static const __u16 spca501_open_data[][3] = {
0101     /* bmRequest,value,index */
0102 
0103     {0x2, 0x50, 0x00},  /* C/S enable soft reset */
0104     {0x2, 0x40, 0x00},  /* C/S disable soft reset */
0105     {0x2, 0x02, 0x05},  /* C/S general purpose I/O data */
0106     {0x2, 0x03, 0x05},  /* C/S general purpose I/O data */
0107 
0108 #ifdef CCDSP_SET
0109     {0x1, 0x38, 0x01},  /* CCDSP options */
0110     {0x1, 0x05, 0x02}, /* CCDSP Optical black level for user settings */
0111     {0x1, 0xC0, 0x03},  /* CCDSP Optical black settings */
0112 
0113     {0x1, 0x67, 0x07},
0114     {0x1, 0x63, 0x3f},  /* CCDSP CCD gamma enable */
0115     {0x1, 0x03, 0x56},  /* Add gamma correction */
0116 
0117     {0x1, 0xFF, 0x15},  /* CCDSP High luminance for white balance */
0118     {0x1, 0x01, 0x16},  /* CCDSP Low luminance for white balance */
0119 
0120 /* Color correction and RGB-to-YUV transformation coefficients changing */
0121 #ifdef ALTER_GAMA
0122     {0x0, 0x00, 0x08},  /* A11 */
0123     {0x0, 0x00, 0x09},  /* A12 */
0124     {0x0, 0x90, 0x0A},  /* A13 */
0125     {0x0, 0x12, 0x0B},  /* A21 */
0126     {0x0, 0x00, 0x0C},  /* A22 */
0127     {0x0, 0x00, 0x0D},  /* A23 */
0128     {0x0, 0x00, 0x0E},  /* A31 */
0129     {0x0, 0x02, 0x0F},  /* A32 */
0130     {0x0, 0x00, 0x10},  /* A33 */
0131 #else
0132     {0x1, 0x2a, 0x08},  /* A11 0x31 */
0133     {0x1, 0xf8, 0x09},  /* A12 f8 */
0134     {0x1, 0xf8, 0x0A},  /* A13 f8 */
0135     {0x1, 0xf8, 0x0B},  /* A21 f8 */
0136     {0x1, 0x14, 0x0C},  /* A22 0x14 */
0137     {0x1, 0xf8, 0x0D},  /* A23 f8 */
0138     {0x1, 0xf8, 0x0E},  /* A31 f8 */
0139     {0x1, 0xf8, 0x0F},  /* A32 f8 */
0140     {0x1, 0x20, 0x10},  /* A33 0x20 */
0141 #endif
0142     {0x1, 0x00, 0x11},  /* R offset */
0143     {0x1, 0x00, 0x12},  /* G offset */
0144     {0x1, 0x00, 0x13},  /* B offset */
0145     {0x1, 0x00, 0x14},  /* GB offset */
0146 
0147 #endif
0148 
0149 #ifdef TG_SET
0150     /* Time generator manipulations */
0151     {0x0, 0xfc, 0x0},   /* Set up high bits of shutter speed */
0152     {0x0, 0x01, 0x1},   /* Set up low bits of shutter speed */
0153 
0154     {0x0, 0xe4, 0x04},  /* DCLK*2 clock phase adjustment */
0155     {0x0, 0x08, 0x05},  /* ADCK phase adjustment, inv. ext. VB */
0156     {0x0, 0x03, 0x06},  /* FR phase adjustment */
0157     {0x0, 0x01, 0x07},  /* FCDS phase adjustment */
0158     {0x0, 0x39, 0x08},  /* FS phase adjustment */
0159     {0x0, 0x88, 0x0a},  /* FH1 phase and delay adjustment */
0160     {0x0, 0x03, 0x0f},  /* pixel identification */
0161     {0x0, 0x00, 0x11},  /* clock source selection (default) */
0162 
0163     /*VERY strange manipulations with
0164      * select DMCLP or OBPX to be ADCLP output (0x0C)
0165      * OPB always toggle or not (0x0D) but they allow
0166      * us to set up brightness
0167      */
0168     {0x0, 0x01, 0x0c},
0169     {0x0, 0xe0, 0x0d},
0170     /* Done */
0171 #endif
0172 
0173 #ifdef DSPWIN_SET
0174     {0x1, 0xa0, 0x01},  /* Setting image processing parameters */
0175     {0x1, 0x1c, 0x17},  /* Changing Windows positions X1 */
0176     {0x1, 0xe2, 0x19},  /* X2 */
0177     {0x1, 0x1c, 0x1b},  /* X3 */
0178     {0x1, 0xe2, 0x1d},  /* X4 */
0179     {0x1, 0x5f, 0x1f},  /* X5 */
0180     {0x1, 0x32, 0x20},  /* Y5 */
0181     {0x1, 0x01, 0x10},  /* Changing A33 */
0182 #endif
0183 
0184     {0x2, 0x204a, 0x07},/* Setting video compression & resolution 160x120 */
0185     {0x2, 0x94, 0x06},  /* Setting video no compression */
0186     {}
0187 };
0188 
0189 /*
0190    The SPCAxxx docs from Sunplus document these values
0191    in tables, one table per register number.  In the data
0192    below, dmRequest is the register number, index is the Addr,
0193    and value is a combination of Bit values.
0194    Bit  Value (hex)
0195    0    01
0196    1    02
0197    2    04
0198    3    08
0199    4    10
0200    5    20
0201    6    40
0202    7    80
0203  */
0204 
0205 /* Data for chip initialization (set default values) */
0206 static const __u16 spca501_init_data[][3] = {
0207     /* Set all the values to powerup defaults */
0208     /* bmRequest,value,index */
0209     {0x0, 0xAA, 0x00},
0210     {0x0, 0x02, 0x01},
0211     {0x0, 0x01, 0x02},
0212     {0x0, 0x02, 0x03},
0213     {0x0, 0xCE, 0x04},
0214     {0x0, 0x00, 0x05},
0215     {0x0, 0x00, 0x06},
0216     {0x0, 0x00, 0x07},
0217     {0x0, 0x00, 0x08},
0218     {0x0, 0x00, 0x09},
0219     {0x0, 0x90, 0x0A},
0220     {0x0, 0x12, 0x0B},
0221     {0x0, 0x00, 0x0C},
0222     {0x0, 0x00, 0x0D},
0223     {0x0, 0x00, 0x0E},
0224     {0x0, 0x02, 0x0F},
0225     {0x0, 0x00, 0x10},
0226     {0x0, 0x00, 0x11},
0227     {0x0, 0x00, 0x12},
0228     {0x0, 0x00, 0x13},
0229     {0x0, 0x00, 0x14},
0230     {0x0, 0x00, 0x15},
0231     {0x0, 0x00, 0x16},
0232     {0x0, 0x00, 0x17},
0233     {0x0, 0x00, 0x18},
0234     {0x0, 0x00, 0x19},
0235     {0x0, 0x00, 0x1A},
0236     {0x0, 0x00, 0x1B},
0237     {0x0, 0x00, 0x1C},
0238     {0x0, 0x00, 0x1D},
0239     {0x0, 0x00, 0x1E},
0240     {0x0, 0x00, 0x1F},
0241     {0x0, 0x00, 0x20},
0242     {0x0, 0x00, 0x21},
0243     {0x0, 0x00, 0x22},
0244     {0x0, 0x00, 0x23},
0245     {0x0, 0x00, 0x24},
0246     {0x0, 0x00, 0x25},
0247     {0x0, 0x00, 0x26},
0248     {0x0, 0x00, 0x27},
0249     {0x0, 0x00, 0x28},
0250     {0x0, 0x00, 0x29},
0251     {0x0, 0x00, 0x2A},
0252     {0x0, 0x00, 0x2B},
0253     {0x0, 0x00, 0x2C},
0254     {0x0, 0x00, 0x2D},
0255     {0x0, 0x00, 0x2E},
0256     {0x0, 0x00, 0x2F},
0257     {0x0, 0x00, 0x30},
0258     {0x0, 0x00, 0x31},
0259     {0x0, 0x00, 0x32},
0260     {0x0, 0x00, 0x33},
0261     {0x0, 0x00, 0x34},
0262     {0x0, 0x00, 0x35},
0263     {0x0, 0x00, 0x36},
0264     {0x0, 0x00, 0x37},
0265     {0x0, 0x00, 0x38},
0266     {0x0, 0x00, 0x39},
0267     {0x0, 0x00, 0x3A},
0268     {0x0, 0x00, 0x3B},
0269     {0x0, 0x00, 0x3C},
0270     {0x0, 0x00, 0x3D},
0271     {0x0, 0x00, 0x3E},
0272     {0x0, 0x00, 0x3F},
0273     {0x0, 0x00, 0x40},
0274     {0x0, 0x00, 0x41},
0275     {0x0, 0x00, 0x42},
0276     {0x0, 0x00, 0x43},
0277     {0x0, 0x00, 0x44},
0278     {0x0, 0x00, 0x45},
0279     {0x0, 0x00, 0x46},
0280     {0x0, 0x00, 0x47},
0281     {0x0, 0x00, 0x48},
0282     {0x0, 0x00, 0x49},
0283     {0x0, 0x00, 0x4A},
0284     {0x0, 0x00, 0x4B},
0285     {0x0, 0x00, 0x4C},
0286     {0x0, 0x00, 0x4D},
0287     {0x0, 0x00, 0x4E},
0288     {0x0, 0x00, 0x4F},
0289     {0x0, 0x00, 0x50},
0290     {0x0, 0x00, 0x51},
0291     {0x0, 0x00, 0x52},
0292     {0x0, 0x00, 0x53},
0293     {0x0, 0x00, 0x54},
0294     {0x0, 0x00, 0x55},
0295     {0x0, 0x00, 0x56},
0296     {0x0, 0x00, 0x57},
0297     {0x0, 0x00, 0x58},
0298     {0x0, 0x00, 0x59},
0299     {0x0, 0x00, 0x5A},
0300     {0x0, 0x00, 0x5B},
0301     {0x0, 0x00, 0x5C},
0302     {0x0, 0x00, 0x5D},
0303     {0x0, 0x00, 0x5E},
0304     {0x0, 0x00, 0x5F},
0305     {0x0, 0x00, 0x60},
0306     {0x0, 0x00, 0x61},
0307     {0x0, 0x00, 0x62},
0308     {0x0, 0x00, 0x63},
0309     {0x0, 0x00, 0x64},
0310     {0x0, 0x00, 0x65},
0311     {0x0, 0x00, 0x66},
0312     {0x0, 0x00, 0x67},
0313     {0x0, 0x00, 0x68},
0314     {0x0, 0x00, 0x69},
0315     {0x0, 0x00, 0x6A},
0316     {0x0, 0x00, 0x6B},
0317     {0x0, 0x00, 0x6C},
0318     {0x0, 0x00, 0x6D},
0319     {0x0, 0x00, 0x6E},
0320     {0x0, 0x00, 0x6F},
0321     {0x0, 0x00, 0x70},
0322     {0x0, 0x00, 0x71},
0323     {0x0, 0x00, 0x72},
0324     {0x0, 0x00, 0x73},
0325     {0x0, 0x00, 0x74},
0326     {0x0, 0x00, 0x75},
0327     {0x0, 0x00, 0x76},
0328     {0x0, 0x00, 0x77},
0329     {0x0, 0x00, 0x78},
0330     {0x0, 0x00, 0x79},
0331     {0x0, 0x00, 0x7A},
0332     {0x0, 0x00, 0x7B},
0333     {0x0, 0x00, 0x7C},
0334     {0x0, 0x00, 0x7D},
0335     {0x0, 0x00, 0x7E},
0336     {0x0, 0x00, 0x7F},
0337     {0x0, 0x00, 0x80},
0338     {0x0, 0x00, 0x81},
0339     {0x0, 0x00, 0x82},
0340     {0x0, 0x00, 0x83},
0341     {0x0, 0x00, 0x84},
0342     {0x0, 0x00, 0x85},
0343     {0x0, 0x00, 0x86},
0344     {0x0, 0x00, 0x87},
0345     {0x0, 0x00, 0x88},
0346     {0x0, 0x00, 0x89},
0347     {0x0, 0x00, 0x8A},
0348     {0x0, 0x00, 0x8B},
0349     {0x0, 0x00, 0x8C},
0350     {0x0, 0x00, 0x8D},
0351     {0x0, 0x00, 0x8E},
0352     {0x0, 0x00, 0x8F},
0353     {0x0, 0x00, 0x90},
0354     {0x0, 0x00, 0x91},
0355     {0x0, 0x00, 0x92},
0356     {0x0, 0x00, 0x93},
0357     {0x0, 0x00, 0x94},
0358     {0x0, 0x00, 0x95},
0359     {0x0, 0x00, 0x96},
0360     {0x0, 0x00, 0x97},
0361     {0x0, 0x00, 0x98},
0362     {0x0, 0x00, 0x99},
0363     {0x0, 0x00, 0x9A},
0364     {0x0, 0x00, 0x9B},
0365     {0x0, 0x00, 0x9C},
0366     {0x0, 0x00, 0x9D},
0367     {0x0, 0x00, 0x9E},
0368     {0x0, 0x00, 0x9F},
0369     {0x0, 0x00, 0xA0},
0370     {0x0, 0x00, 0xA1},
0371     {0x0, 0x00, 0xA2},
0372     {0x0, 0x00, 0xA3},
0373     {0x0, 0x00, 0xA4},
0374     {0x0, 0x00, 0xA5},
0375     {0x0, 0x00, 0xA6},
0376     {0x0, 0x00, 0xA7},
0377     {0x0, 0x00, 0xA8},
0378     {0x0, 0x00, 0xA9},
0379     {0x0, 0x00, 0xAA},
0380     {0x0, 0x00, 0xAB},
0381     {0x0, 0x00, 0xAC},
0382     {0x0, 0x00, 0xAD},
0383     {0x0, 0x00, 0xAE},
0384     {0x0, 0x00, 0xAF},
0385     {0x0, 0x00, 0xB0},
0386     {0x0, 0x00, 0xB1},
0387     {0x0, 0x00, 0xB2},
0388     {0x0, 0x00, 0xB3},
0389     {0x0, 0x00, 0xB4},
0390     {0x0, 0x00, 0xB5},
0391     {0x0, 0x00, 0xB6},
0392     {0x0, 0x00, 0xB7},
0393     {0x0, 0x00, 0xB8},
0394     {0x0, 0x00, 0xB9},
0395     {0x0, 0x00, 0xBA},
0396     {0x0, 0x00, 0xBB},
0397     {0x0, 0x00, 0xBC},
0398     {0x0, 0x00, 0xBD},
0399     {0x0, 0x00, 0xBE},
0400     {0x0, 0x00, 0xBF},
0401     {0x0, 0x00, 0xC0},
0402     {0x0, 0x00, 0xC1},
0403     {0x0, 0x00, 0xC2},
0404     {0x0, 0x00, 0xC3},
0405     {0x0, 0x00, 0xC4},
0406     {0x0, 0x00, 0xC5},
0407     {0x0, 0x00, 0xC6},
0408     {0x0, 0x00, 0xC7},
0409     {0x0, 0x00, 0xC8},
0410     {0x0, 0x00, 0xC9},
0411     {0x0, 0x00, 0xCA},
0412     {0x0, 0x00, 0xCB},
0413     {0x0, 0x00, 0xCC},
0414     {0x1, 0xF4, 0x00},
0415     {0x1, 0x38, 0x01},
0416     {0x1, 0x40, 0x02},
0417     {0x1, 0x0A, 0x03},
0418     {0x1, 0x40, 0x04},
0419     {0x1, 0x40, 0x05},
0420     {0x1, 0x40, 0x06},
0421     {0x1, 0x67, 0x07},
0422     {0x1, 0x31, 0x08},
0423     {0x1, 0x00, 0x09},
0424     {0x1, 0x00, 0x0A},
0425     {0x1, 0x00, 0x0B},
0426     {0x1, 0x14, 0x0C},
0427     {0x1, 0x00, 0x0D},
0428     {0x1, 0x00, 0x0E},
0429     {0x1, 0x00, 0x0F},
0430     {0x1, 0x1E, 0x10},
0431     {0x1, 0x00, 0x11},
0432     {0x1, 0x00, 0x12},
0433     {0x1, 0x00, 0x13},
0434     {0x1, 0x00, 0x14},
0435     {0x1, 0xFF, 0x15},
0436     {0x1, 0x01, 0x16},
0437     {0x1, 0x32, 0x17},
0438     {0x1, 0x23, 0x18},
0439     {0x1, 0xCE, 0x19},
0440     {0x1, 0x23, 0x1A},
0441     {0x1, 0x32, 0x1B},
0442     {0x1, 0x8D, 0x1C},
0443     {0x1, 0xCE, 0x1D},
0444     {0x1, 0x8D, 0x1E},
0445     {0x1, 0x00, 0x1F},
0446     {0x1, 0x00, 0x20},
0447     {0x1, 0xFF, 0x3E},
0448     {0x1, 0x02, 0x3F},
0449     {0x1, 0x00, 0x40},
0450     {0x1, 0x00, 0x41},
0451     {0x1, 0x00, 0x42},
0452     {0x1, 0x00, 0x43},
0453     {0x1, 0x00, 0x44},
0454     {0x1, 0x00, 0x45},
0455     {0x1, 0x00, 0x46},
0456     {0x1, 0x00, 0x47},
0457     {0x1, 0x00, 0x48},
0458     {0x1, 0x00, 0x49},
0459     {0x1, 0x00, 0x4A},
0460     {0x1, 0x00, 0x4B},
0461     {0x1, 0x00, 0x4C},
0462     {0x1, 0x00, 0x4D},
0463     {0x1, 0x00, 0x4E},
0464     {0x1, 0x00, 0x4F},
0465     {0x1, 0x00, 0x50},
0466     {0x1, 0x00, 0x51},
0467     {0x1, 0x00, 0x52},
0468     {0x1, 0x00, 0x53},
0469     {0x1, 0x00, 0x54},
0470     {0x1, 0x00, 0x55},
0471     {0x1, 0x00, 0x56},
0472     {0x1, 0x00, 0x57},
0473     {0x1, 0x00, 0x58},
0474     {0x1, 0x00, 0x59},
0475     {0x1, 0x00, 0x5A},
0476     {0x2, 0x03, 0x00},
0477     {0x2, 0x00, 0x01},
0478     {0x2, 0x00, 0x05},
0479     {0x2, 0x00, 0x06},
0480     {0x2, 0x00, 0x07},
0481     {0x2, 0x00, 0x10},
0482     {0x2, 0x00, 0x11},
0483     /* Strange - looks like the 501 driver doesn't do anything
0484      * at insert time except read the EEPROM
0485      */
0486     {}
0487 };
0488 
0489 /* Data for video camera init before capture.
0490  * Capture and decoding by Colin Peart.
0491  * This is for the 3com HomeConnect Lite which is spca501a based.
0492  */
0493 static const __u16 spca501_3com_open_data[][3] = {
0494     /* bmRequest,value,index */
0495     {0x2, 0x0050, 0x0000},  /* C/S Enable TG soft reset, timing mode=010 */
0496     {0x2, 0x0043, 0x0000},  /* C/S Disable TG soft reset, timing mode=010 */
0497     {0x2, 0x0002, 0x0005},  /* C/S GPIO */
0498     {0x2, 0x0003, 0x0005},  /* C/S GPIO */
0499 
0500 #ifdef CCDSP_SET
0501     {0x1, 0x0020, 0x0001},  /* CCDSP Options */
0502 
0503     {0x1, 0x0020, 0x0002},  /* CCDSP Black Level */
0504     {0x1, 0x006e, 0x0007},  /* CCDSP Gamma options */
0505     {0x1, 0x0090, 0x0015},  /* CCDSP Luminance Low */
0506     {0x1, 0x00ff, 0x0016},  /* CCDSP Luminance High */
0507     {0x1, 0x0003, 0x003F},  /* CCDSP Gamma correction toggle */
0508 
0509 #ifdef ALTER_GAMMA
0510     {0x1, 0x0010, 0x0008},  /* CCDSP YUV A11 */
0511     {0x1, 0x0000, 0x0009},  /* CCDSP YUV A12 */
0512     {0x1, 0x0000, 0x000a},  /* CCDSP YUV A13 */
0513     {0x1, 0x0000, 0x000b},  /* CCDSP YUV A21 */
0514     {0x1, 0x0010, 0x000c},  /* CCDSP YUV A22 */
0515     {0x1, 0x0000, 0x000d},  /* CCDSP YUV A23 */
0516     {0x1, 0x0000, 0x000e},  /* CCDSP YUV A31 */
0517     {0x1, 0x0000, 0x000f},  /* CCDSP YUV A32 */
0518     {0x1, 0x0010, 0x0010},  /* CCDSP YUV A33 */
0519     {0x1, 0x0000, 0x0011},  /* CCDSP R Offset */
0520     {0x1, 0x0000, 0x0012},  /* CCDSP G Offset */
0521     {0x1, 0x0001, 0x0013},  /* CCDSP B Offset */
0522     {0x1, 0x0001, 0x0014},  /* CCDSP BG Offset */
0523     {0x1, 0x003f, 0x00C1},  /* CCDSP Gamma Correction Enable */
0524 #endif
0525 #endif
0526 
0527 #ifdef TG_SET
0528     {0x0, 0x00fc, 0x0000},  /* TG Shutter Speed High Bits */
0529     {0x0, 0x0000, 0x0001},  /* TG Shutter Speed Low Bits */
0530     {0x0, 0x00e4, 0x0004},  /* TG DCLK*2 Adjust */
0531     {0x0, 0x0008, 0x0005},  /* TG ADCK Adjust */
0532     {0x0, 0x0003, 0x0006},  /* TG FR Phase Adjust */
0533     {0x0, 0x0001, 0x0007},  /* TG FCDS Phase Adjust */
0534     {0x0, 0x0039, 0x0008},  /* TG FS Phase Adjust */
0535     {0x0, 0x0088, 0x000a},  /* TG MH1 */
0536     {0x0, 0x0003, 0x000f},  /* TG Pixel ID */
0537 
0538     /* Like below, unexplained toglleing */
0539     {0x0, 0x0080, 0x000c},
0540     {0x0, 0x0000, 0x000d},
0541     {0x0, 0x0080, 0x000c},
0542     {0x0, 0x0004, 0x000d},
0543     {0x0, 0x0000, 0x000c},
0544     {0x0, 0x0000, 0x000d},
0545     {0x0, 0x0040, 0x000c},
0546     {0x0, 0x0017, 0x000d},
0547     {0x0, 0x00c0, 0x000c},
0548     {0x0, 0x0000, 0x000d},
0549     {0x0, 0x0080, 0x000c},
0550     {0x0, 0x0006, 0x000d},
0551     {0x0, 0x0080, 0x000c},
0552     {0x0, 0x0004, 0x000d},
0553     {0x0, 0x0002, 0x0003},
0554 #endif
0555 
0556 #ifdef DSPWIN_SET
0557     {0x1, 0x001c, 0x0017},  /* CCDSP W1 Start X */
0558     {0x1, 0x00e2, 0x0019},  /* CCDSP W2 Start X */
0559     {0x1, 0x001c, 0x001b},  /* CCDSP W3 Start X */
0560     {0x1, 0x00e2, 0x001d},  /* CCDSP W4 Start X */
0561     {0x1, 0x00aa, 0x001f},  /* CCDSP W5 Start X */
0562     {0x1, 0x0070, 0x0020},  /* CCDSP W5 Start Y */
0563 #endif
0564     {0x0, 0x0001, 0x0010},  /* TG Start Clock */
0565 
0566 /*  {0x2, 0x006a, 0x0001},   * C/S Enable ISOSYNCH Packet Engine */
0567     {0x2, 0x0068, 0x0001},  /* C/S Disable ISOSYNCH Packet Engine */
0568     {0x2, 0x0000, 0x0005},
0569     {0x2, 0x0043, 0x0000},  /* C/S Set Timing Mode, Disable TG soft reset */
0570     {0x2, 0x0043, 0x0000},  /* C/S Set Timing Mode, Disable TG soft reset */
0571     {0x2, 0x0002, 0x0005},  /* C/S GPIO */
0572     {0x2, 0x0003, 0x0005},  /* C/S GPIO */
0573 
0574     {0x2, 0x006a, 0x0001},  /* C/S Enable ISOSYNCH Packet Engine */
0575     {}
0576 };
0577 
0578 /*
0579  * Data used to initialize a SPCA501C with HV7131B sensor.
0580  * From a capture file taken with USBSnoop v 1.5
0581  * I have a "SPCA501C pc camera chipset" manual by sunplus, but some
0582  * of the value meanings are obscure or simply "reserved".
0583  * to do list:
0584  * 1) Understand what every value means
0585  * 2) Understand why some values seem to appear more than once
0586  * 3) Write a small comment for each line of the following arrays.
0587  */
0588 static const __u16 spca501c_arowana_open_data[][3] = {
0589     /* bmRequest,value,index */
0590     {0x02, 0x0007, 0x0005},
0591     {0x02, 0xa048, 0x0000},
0592     {0x05, 0x0022, 0x0004},
0593     {0x01, 0x0006, 0x0011},
0594     {0x01, 0x00ff, 0x0012},
0595     {0x01, 0x0014, 0x0013},
0596     {0x01, 0x0000, 0x0014},
0597     {0x01, 0x0042, 0x0051},
0598     {0x01, 0x0040, 0x0052},
0599     {0x01, 0x0051, 0x0053},
0600     {0x01, 0x0040, 0x0054},
0601     {0x01, 0x0000, 0x0055},
0602     {0x00, 0x0025, 0x0000},
0603     {0x00, 0x0026, 0x0000},
0604     {0x00, 0x0001, 0x0000},
0605     {0x00, 0x0027, 0x0000},
0606     {0x00, 0x008a, 0x0000},
0607     {}
0608 };
0609 
0610 static const __u16 spca501c_arowana_init_data[][3] = {
0611     /* bmRequest,value,index */
0612     {0x02, 0x0007, 0x0005},
0613     {0x02, 0xa048, 0x0000},
0614     {0x05, 0x0022, 0x0004},
0615     {0x01, 0x0006, 0x0011},
0616     {0x01, 0x00ff, 0x0012},
0617     {0x01, 0x0014, 0x0013},
0618     {0x01, 0x0000, 0x0014},
0619     {0x01, 0x0042, 0x0051},
0620     {0x01, 0x0040, 0x0052},
0621     {0x01, 0x0051, 0x0053},
0622     {0x01, 0x0040, 0x0054},
0623     {0x01, 0x0000, 0x0055},
0624     {0x00, 0x0025, 0x0000},
0625     {0x00, 0x0026, 0x0000},
0626     {0x00, 0x0001, 0x0000},
0627     {0x00, 0x0027, 0x0000},
0628     {0x00, 0x008a, 0x0000},
0629     {0x02, 0x0000, 0x0005},
0630     {0x02, 0x0007, 0x0005},
0631     {0x02, 0x2000, 0x0000},
0632     {0x05, 0x0022, 0x0004},
0633     {0x05, 0x0015, 0x0001},
0634     {0x05, 0x00ea, 0x0000},
0635     {0x05, 0x0021, 0x0001},
0636     {0x05, 0x00d2, 0x0000},
0637     {0x05, 0x0023, 0x0001},
0638     {0x05, 0x0003, 0x0000},
0639     {0x05, 0x0030, 0x0001},
0640     {0x05, 0x002b, 0x0000},
0641     {0x05, 0x0031, 0x0001},
0642     {0x05, 0x0023, 0x0000},
0643     {0x05, 0x0032, 0x0001},
0644     {0x05, 0x0023, 0x0000},
0645     {0x05, 0x0033, 0x0001},
0646     {0x05, 0x0023, 0x0000},
0647     {0x05, 0x0034, 0x0001},
0648     {0x05, 0x0002, 0x0000},
0649     {0x05, 0x0050, 0x0001},
0650     {0x05, 0x0000, 0x0000},
0651     {0x05, 0x0051, 0x0001},
0652     {0x05, 0x0000, 0x0000},
0653     {0x05, 0x0052, 0x0001},
0654     {0x05, 0x0000, 0x0000},
0655     {0x05, 0x0054, 0x0001},
0656     {0x05, 0x0001, 0x0000},
0657     {0x00, 0x0000, 0x0001},
0658     {0x00, 0x0000, 0x0002},
0659     {0x00, 0x000c, 0x0003},
0660     {0x00, 0x0000, 0x0004},
0661     {0x00, 0x0090, 0x0005},
0662     {0x00, 0x0000, 0x0006},
0663     {0x00, 0x0040, 0x0007},
0664     {0x00, 0x00c0, 0x0008},
0665     {0x00, 0x004a, 0x0009},
0666     {0x00, 0x0000, 0x000a},
0667     {0x00, 0x0000, 0x000b},
0668     {0x00, 0x0001, 0x000c},
0669     {0x00, 0x0001, 0x000d},
0670     {0x00, 0x0000, 0x000e},
0671     {0x00, 0x0002, 0x000f},
0672     {0x00, 0x0001, 0x0010},
0673     {0x00, 0x0000, 0x0011},
0674     {0x00, 0x0000, 0x0012},
0675     {0x00, 0x0002, 0x0020},
0676     {0x00, 0x0080, 0x0021},
0677     {0x00, 0x0001, 0x0022},
0678     {0x00, 0x00e0, 0x0023},
0679     {0x00, 0x0000, 0x0024},
0680     {0x00, 0x00d5, 0x0025},
0681     {0x00, 0x0000, 0x0026},
0682     {0x00, 0x000b, 0x0027},
0683     {0x00, 0x0000, 0x0046},
0684     {0x00, 0x0000, 0x0047},
0685     {0x00, 0x0000, 0x0048},
0686     {0x00, 0x0000, 0x0049},
0687     {0x00, 0x0008, 0x004a},
0688     {0xff, 0x0000, 0x00d0},
0689     {0xff, 0x00d8, 0x00d1},
0690     {0xff, 0x0000, 0x00d4},
0691     {0xff, 0x0000, 0x00d5},
0692     {0x01, 0x00a6, 0x0000},
0693     {0x01, 0x0028, 0x0001},
0694     {0x01, 0x0000, 0x0002},
0695     {0x01, 0x000a, 0x0003},
0696     {0x01, 0x0040, 0x0004},
0697     {0x01, 0x0066, 0x0007},
0698     {0x01, 0x0011, 0x0008},
0699     {0x01, 0x0032, 0x0009},
0700     {0x01, 0x00fd, 0x000a},
0701     {0x01, 0x0038, 0x000b},
0702     {0x01, 0x00d1, 0x000c},
0703     {0x01, 0x00f7, 0x000d},
0704     {0x01, 0x00ed, 0x000e},
0705     {0x01, 0x00d8, 0x000f},
0706     {0x01, 0x0038, 0x0010},
0707     {0x01, 0x00ff, 0x0015},
0708     {0x01, 0x0001, 0x0016},
0709     {0x01, 0x0032, 0x0017},
0710     {0x01, 0x0023, 0x0018},
0711     {0x01, 0x00ce, 0x0019},
0712     {0x01, 0x0023, 0x001a},
0713     {0x01, 0x0032, 0x001b},
0714     {0x01, 0x008d, 0x001c},
0715     {0x01, 0x00ce, 0x001d},
0716     {0x01, 0x008d, 0x001e},
0717     {0x01, 0x0000, 0x001f},
0718     {0x01, 0x0000, 0x0020},
0719     {0x01, 0x00ff, 0x003e},
0720     {0x01, 0x0003, 0x003f},
0721     {0x01, 0x0000, 0x0040},
0722     {0x01, 0x0035, 0x0041},
0723     {0x01, 0x0053, 0x0042},
0724     {0x01, 0x0069, 0x0043},
0725     {0x01, 0x007c, 0x0044},
0726     {0x01, 0x008c, 0x0045},
0727     {0x01, 0x009a, 0x0046},
0728     {0x01, 0x00a8, 0x0047},
0729     {0x01, 0x00b4, 0x0048},
0730     {0x01, 0x00bf, 0x0049},
0731     {0x01, 0x00ca, 0x004a},
0732     {0x01, 0x00d4, 0x004b},
0733     {0x01, 0x00dd, 0x004c},
0734     {0x01, 0x00e7, 0x004d},
0735     {0x01, 0x00ef, 0x004e},
0736     {0x01, 0x00f8, 0x004f},
0737     {0x01, 0x00ff, 0x0050},
0738     {0x01, 0x0001, 0x0056},
0739     {0x01, 0x0060, 0x0057},
0740     {0x01, 0x0040, 0x0058},
0741     {0x01, 0x0011, 0x0059},
0742     {0x01, 0x0001, 0x005a},
0743     {0x02, 0x0007, 0x0005},
0744     {0x02, 0xa048, 0x0000},
0745     {0x02, 0x0007, 0x0005},
0746     {0x02, 0x0015, 0x0006},
0747     {0x02, 0x100a, 0x0007},
0748     {0x02, 0xa048, 0x0000},
0749     {0x02, 0xc002, 0x0001},
0750     {0x02, 0x000f, 0x0005},
0751     {0x02, 0xa048, 0x0000},
0752     {0x05, 0x0022, 0x0004},
0753     {0x05, 0x0025, 0x0001},
0754     {0x05, 0x0000, 0x0000},
0755     {0x05, 0x0026, 0x0001},
0756     {0x05, 0x0001, 0x0000},
0757     {0x05, 0x0027, 0x0001},
0758     {0x05, 0x0000, 0x0000},
0759     {0x05, 0x0001, 0x0001},
0760     {0x05, 0x0000, 0x0000},
0761     {0x05, 0x0021, 0x0001},
0762     {0x05, 0x00d2, 0x0000},
0763     {0x05, 0x0020, 0x0001},
0764     {0x05, 0x0000, 0x0000},
0765     {0x00, 0x0090, 0x0005},
0766     {0x01, 0x00a6, 0x0000},
0767     {0x02, 0x0007, 0x0005},
0768     {0x02, 0x2000, 0x0000},
0769     {0x05, 0x0022, 0x0004},
0770     {0x05, 0x0015, 0x0001},
0771     {0x05, 0x00ea, 0x0000},
0772     {0x05, 0x0021, 0x0001},
0773     {0x05, 0x00d2, 0x0000},
0774     {0x05, 0x0023, 0x0001},
0775     {0x05, 0x0003, 0x0000},
0776     {0x05, 0x0030, 0x0001},
0777     {0x05, 0x002b, 0x0000},
0778     {0x05, 0x0031, 0x0001},
0779     {0x05, 0x0023, 0x0000},
0780     {0x05, 0x0032, 0x0001},
0781     {0x05, 0x0023, 0x0000},
0782     {0x05, 0x0033, 0x0001},
0783     {0x05, 0x0023, 0x0000},
0784     {0x05, 0x0034, 0x0001},
0785     {0x05, 0x0002, 0x0000},
0786     {0x05, 0x0050, 0x0001},
0787     {0x05, 0x0000, 0x0000},
0788     {0x05, 0x0051, 0x0001},
0789     {0x05, 0x0000, 0x0000},
0790     {0x05, 0x0052, 0x0001},
0791     {0x05, 0x0000, 0x0000},
0792     {0x05, 0x0054, 0x0001},
0793     {0x05, 0x0001, 0x0000},
0794     {0x00, 0x0000, 0x0001},
0795     {0x00, 0x0000, 0x0002},
0796     {0x00, 0x000c, 0x0003},
0797     {0x00, 0x0000, 0x0004},
0798     {0x00, 0x0090, 0x0005},
0799     {0x00, 0x0000, 0x0006},
0800     {0x00, 0x0040, 0x0007},
0801     {0x00, 0x00c0, 0x0008},
0802     {0x00, 0x004a, 0x0009},
0803     {0x00, 0x0000, 0x000a},
0804     {0x00, 0x0000, 0x000b},
0805     {0x00, 0x0001, 0x000c},
0806     {0x00, 0x0001, 0x000d},
0807     {0x00, 0x0000, 0x000e},
0808     {0x00, 0x0002, 0x000f},
0809     {0x00, 0x0001, 0x0010},
0810     {0x00, 0x0000, 0x0011},
0811     {0x00, 0x0000, 0x0012},
0812     {0x00, 0x0002, 0x0020},
0813     {0x00, 0x0080, 0x0021},
0814     {0x00, 0x0001, 0x0022},
0815     {0x00, 0x00e0, 0x0023},
0816     {0x00, 0x0000, 0x0024},
0817     {0x00, 0x00d5, 0x0025},
0818     {0x00, 0x0000, 0x0026},
0819     {0x00, 0x000b, 0x0027},
0820     {0x00, 0x0000, 0x0046},
0821     {0x00, 0x0000, 0x0047},
0822     {0x00, 0x0000, 0x0048},
0823     {0x00, 0x0000, 0x0049},
0824     {0x00, 0x0008, 0x004a},
0825     {0xff, 0x0000, 0x00d0},
0826     {0xff, 0x00d8, 0x00d1},
0827     {0xff, 0x0000, 0x00d4},
0828     {0xff, 0x0000, 0x00d5},
0829     {0x01, 0x00a6, 0x0000},
0830     {0x01, 0x0028, 0x0001},
0831     {0x01, 0x0000, 0x0002},
0832     {0x01, 0x000a, 0x0003},
0833     {0x01, 0x0040, 0x0004},
0834     {0x01, 0x0066, 0x0007},
0835     {0x01, 0x0011, 0x0008},
0836     {0x01, 0x0032, 0x0009},
0837     {0x01, 0x00fd, 0x000a},
0838     {0x01, 0x0038, 0x000b},
0839     {0x01, 0x00d1, 0x000c},
0840     {0x01, 0x00f7, 0x000d},
0841     {0x01, 0x00ed, 0x000e},
0842     {0x01, 0x00d8, 0x000f},
0843     {0x01, 0x0038, 0x0010},
0844     {0x01, 0x00ff, 0x0015},
0845     {0x01, 0x0001, 0x0016},
0846     {0x01, 0x0032, 0x0017},
0847     {0x01, 0x0023, 0x0018},
0848     {0x01, 0x00ce, 0x0019},
0849     {0x01, 0x0023, 0x001a},
0850     {0x01, 0x0032, 0x001b},
0851     {0x01, 0x008d, 0x001c},
0852     {0x01, 0x00ce, 0x001d},
0853     {0x01, 0x008d, 0x001e},
0854     {0x01, 0x0000, 0x001f},
0855     {0x01, 0x0000, 0x0020},
0856     {0x01, 0x00ff, 0x003e},
0857     {0x01, 0x0003, 0x003f},
0858     {0x01, 0x0000, 0x0040},
0859     {0x01, 0x0035, 0x0041},
0860     {0x01, 0x0053, 0x0042},
0861     {0x01, 0x0069, 0x0043},
0862     {0x01, 0x007c, 0x0044},
0863     {0x01, 0x008c, 0x0045},
0864     {0x01, 0x009a, 0x0046},
0865     {0x01, 0x00a8, 0x0047},
0866     {0x01, 0x00b4, 0x0048},
0867     {0x01, 0x00bf, 0x0049},
0868     {0x01, 0x00ca, 0x004a},
0869     {0x01, 0x00d4, 0x004b},
0870     {0x01, 0x00dd, 0x004c},
0871     {0x01, 0x00e7, 0x004d},
0872     {0x01, 0x00ef, 0x004e},
0873     {0x01, 0x00f8, 0x004f},
0874     {0x01, 0x00ff, 0x0050},
0875     {0x01, 0x0001, 0x0056},
0876     {0x01, 0x0060, 0x0057},
0877     {0x01, 0x0040, 0x0058},
0878     {0x01, 0x0011, 0x0059},
0879     {0x01, 0x0001, 0x005a},
0880     {0x02, 0x0007, 0x0005},
0881     {0x02, 0xa048, 0x0000},
0882     {0x02, 0x0007, 0x0005},
0883     {0x02, 0x0015, 0x0006},
0884     {0x02, 0x100a, 0x0007},
0885     {0x02, 0xa048, 0x0000},
0886     {0x02, 0xc002, 0x0001},
0887     {0x02, 0x000f, 0x0005},
0888     {0x02, 0xa048, 0x0000},
0889     {0x05, 0x0022, 0x0004},
0890     {0x05, 0x0025, 0x0001},
0891     {0x05, 0x0000, 0x0000},
0892     {0x05, 0x0026, 0x0001},
0893     {0x05, 0x0001, 0x0000},
0894     {0x05, 0x0027, 0x0001},
0895     {0x05, 0x0000, 0x0000},
0896     {0x05, 0x0001, 0x0001},
0897     {0x05, 0x0000, 0x0000},
0898     {0x05, 0x0021, 0x0001},
0899     {0x05, 0x00d2, 0x0000},
0900     {0x05, 0x0020, 0x0001},
0901     {0x05, 0x0000, 0x0000},
0902     {0x00, 0x0090, 0x0005},
0903     {0x01, 0x00a6, 0x0000},
0904     {0x01, 0x0003, 0x003f},
0905     {0x01, 0x0001, 0x0056},
0906     {0x01, 0x0011, 0x0008},
0907     {0x01, 0x0032, 0x0009},
0908     {0x01, 0xfffd, 0x000a},
0909     {0x01, 0x0023, 0x000b},
0910     {0x01, 0xffea, 0x000c},
0911     {0x01, 0xfff4, 0x000d},
0912     {0x01, 0xfffc, 0x000e},
0913     {0x01, 0xffe3, 0x000f},
0914     {0x01, 0x001f, 0x0010},
0915     {0x01, 0x00a8, 0x0001},
0916     {0x01, 0x0067, 0x0007},
0917     {0x01, 0x0032, 0x0017},
0918     {0x01, 0x0023, 0x0018},
0919     {0x01, 0x00ce, 0x0019},
0920     {0x01, 0x0023, 0x001a},
0921     {0x01, 0x0032, 0x001b},
0922     {0x01, 0x008d, 0x001c},
0923     {0x01, 0x00ce, 0x001d},
0924     {0x01, 0x008d, 0x001e},
0925     {0x01, 0x00c8, 0x0015},
0926     {0x01, 0x0032, 0x0016},
0927     {0x01, 0x0000, 0x0011},
0928     {0x01, 0x0000, 0x0012},
0929     {0x01, 0x0000, 0x0013},
0930     {0x01, 0x000a, 0x0003},
0931     {0x02, 0xc002, 0x0001},
0932     {0x02, 0x0007, 0x0005},
0933     {0x02, 0xc000, 0x0001},
0934     {0x02, 0x0000, 0x0005},
0935     {0x02, 0x0007, 0x0005},
0936     {0x02, 0x2000, 0x0000},
0937     {0x05, 0x0022, 0x0004},
0938     {0x05, 0x0015, 0x0001},
0939     {0x05, 0x00ea, 0x0000},
0940     {0x05, 0x0021, 0x0001},
0941     {0x05, 0x00d2, 0x0000},
0942     {0x05, 0x0023, 0x0001},
0943     {0x05, 0x0003, 0x0000},
0944     {0x05, 0x0030, 0x0001},
0945     {0x05, 0x002b, 0x0000},
0946     {0x05, 0x0031, 0x0001},
0947     {0x05, 0x0023, 0x0000},
0948     {0x05, 0x0032, 0x0001},
0949     {0x05, 0x0023, 0x0000},
0950     {0x05, 0x0033, 0x0001},
0951     {0x05, 0x0023, 0x0000},
0952     {0x05, 0x0034, 0x0001},
0953     {0x05, 0x0002, 0x0000},
0954     {0x05, 0x0050, 0x0001},
0955     {0x05, 0x0000, 0x0000},
0956     {0x05, 0x0051, 0x0001},
0957     {0x05, 0x0000, 0x0000},
0958     {0x05, 0x0052, 0x0001},
0959     {0x05, 0x0000, 0x0000},
0960     {0x05, 0x0054, 0x0001},
0961     {0x05, 0x0001, 0x0000},
0962     {0x00, 0x0000, 0x0001},
0963     {0x00, 0x0000, 0x0002},
0964     {0x00, 0x000c, 0x0003},
0965     {0x00, 0x0000, 0x0004},
0966     {0x00, 0x0090, 0x0005},
0967     {0x00, 0x0000, 0x0006},
0968     {0x00, 0x0040, 0x0007},
0969     {0x00, 0x00c0, 0x0008},
0970     {0x00, 0x004a, 0x0009},
0971     {0x00, 0x0000, 0x000a},
0972     {0x00, 0x0000, 0x000b},
0973     {0x00, 0x0001, 0x000c},
0974     {0x00, 0x0001, 0x000d},
0975     {0x00, 0x0000, 0x000e},
0976     {0x00, 0x0002, 0x000f},
0977     {0x00, 0x0001, 0x0010},
0978     {0x00, 0x0000, 0x0011},
0979     {0x00, 0x0000, 0x0012},
0980     {0x00, 0x0002, 0x0020},
0981     {0x00, 0x0080, 0x0021},
0982     {0x00, 0x0001, 0x0022},
0983     {0x00, 0x00e0, 0x0023},
0984     {0x00, 0x0000, 0x0024},
0985     {0x00, 0x00d5, 0x0025},
0986     {0x00, 0x0000, 0x0026},
0987     {0x00, 0x000b, 0x0027},
0988     {0x00, 0x0000, 0x0046},
0989     {0x00, 0x0000, 0x0047},
0990     {0x00, 0x0000, 0x0048},
0991     {0x00, 0x0000, 0x0049},
0992     {0x00, 0x0008, 0x004a},
0993     {0xff, 0x0000, 0x00d0},
0994     {0xff, 0x00d8, 0x00d1},
0995     {0xff, 0x0000, 0x00d4},
0996     {0xff, 0x0000, 0x00d5},
0997     {0x01, 0x00a6, 0x0000},
0998     {0x01, 0x0028, 0x0001},
0999     {0x01, 0x0000, 0x0002},
1000     {0x01, 0x000a, 0x0003},
1001     {0x01, 0x0040, 0x0004},
1002     {0x01, 0x0066, 0x0007},
1003     {0x01, 0x0011, 0x0008},
1004     {0x01, 0x0032, 0x0009},
1005     {0x01, 0x00fd, 0x000a},
1006     {0x01, 0x0038, 0x000b},
1007     {0x01, 0x00d1, 0x000c},
1008     {0x01, 0x00f7, 0x000d},
1009     {0x01, 0x00ed, 0x000e},
1010     {0x01, 0x00d8, 0x000f},
1011     {0x01, 0x0038, 0x0010},
1012     {0x01, 0x00ff, 0x0015},
1013     {0x01, 0x0001, 0x0016},
1014     {0x01, 0x0032, 0x0017},
1015     {0x01, 0x0023, 0x0018},
1016     {0x01, 0x00ce, 0x0019},
1017     {0x01, 0x0023, 0x001a},
1018     {0x01, 0x0032, 0x001b},
1019     {0x01, 0x008d, 0x001c},
1020     {0x01, 0x00ce, 0x001d},
1021     {0x01, 0x008d, 0x001e},
1022     {0x01, 0x0000, 0x001f},
1023     {0x01, 0x0000, 0x0020},
1024     {0x01, 0x00ff, 0x003e},
1025     {0x01, 0x0003, 0x003f},
1026     {0x01, 0x0000, 0x0040},
1027     {0x01, 0x0035, 0x0041},
1028     {0x01, 0x0053, 0x0042},
1029     {0x01, 0x0069, 0x0043},
1030     {0x01, 0x007c, 0x0044},
1031     {0x01, 0x008c, 0x0045},
1032     {0x01, 0x009a, 0x0046},
1033     {0x01, 0x00a8, 0x0047},
1034     {0x01, 0x00b4, 0x0048},
1035     {0x01, 0x00bf, 0x0049},
1036     {0x01, 0x00ca, 0x004a},
1037     {0x01, 0x00d4, 0x004b},
1038     {0x01, 0x00dd, 0x004c},
1039     {0x01, 0x00e7, 0x004d},
1040     {0x01, 0x00ef, 0x004e},
1041     {0x01, 0x00f8, 0x004f},
1042     {0x01, 0x00ff, 0x0050},
1043     {0x01, 0x0001, 0x0056},
1044     {0x01, 0x0060, 0x0057},
1045     {0x01, 0x0040, 0x0058},
1046     {0x01, 0x0011, 0x0059},
1047     {0x01, 0x0001, 0x005a},
1048     {0x02, 0x0007, 0x0005},
1049     {0x02, 0xa048, 0x0000},
1050     {0x02, 0x0007, 0x0005},
1051     {0x02, 0x0015, 0x0006},
1052     {0x02, 0x100a, 0x0007},
1053     {0x02, 0xa048, 0x0000},
1054     {0x02, 0xc002, 0x0001},
1055     {0x02, 0x000f, 0x0005},
1056     {0x02, 0xa048, 0x0000},
1057     {0x05, 0x0022, 0x0004},
1058     {0x05, 0x0025, 0x0001},
1059     {0x05, 0x0000, 0x0000},
1060     {0x05, 0x0026, 0x0001},
1061     {0x05, 0x0001, 0x0000},
1062     {0x05, 0x0027, 0x0001},
1063     {0x05, 0x0000, 0x0000},
1064     {0x05, 0x0001, 0x0001},
1065     {0x05, 0x0000, 0x0000},
1066     {0x05, 0x0021, 0x0001},
1067     {0x05, 0x00d2, 0x0000},
1068     {0x05, 0x0020, 0x0001},
1069     {0x05, 0x0000, 0x0000},
1070     {0x00, 0x0090, 0x0005},
1071     {0x01, 0x00a6, 0x0000},
1072     {0x02, 0x0007, 0x0005},
1073     {0x02, 0x2000, 0x0000},
1074     {0x05, 0x0022, 0x0004},
1075     {0x05, 0x0015, 0x0001},
1076     {0x05, 0x00ea, 0x0000},
1077     {0x05, 0x0021, 0x0001},
1078     {0x05, 0x00d2, 0x0000},
1079     {0x05, 0x0023, 0x0001},
1080     {0x05, 0x0003, 0x0000},
1081     {0x05, 0x0030, 0x0001},
1082     {0x05, 0x002b, 0x0000},
1083     {0x05, 0x0031, 0x0001},
1084     {0x05, 0x0023, 0x0000},
1085     {0x05, 0x0032, 0x0001},
1086     {0x05, 0x0023, 0x0000},
1087     {0x05, 0x0033, 0x0001},
1088     {0x05, 0x0023, 0x0000},
1089     {0x05, 0x0034, 0x0001},
1090     {0x05, 0x0002, 0x0000},
1091     {0x05, 0x0050, 0x0001},
1092     {0x05, 0x0000, 0x0000},
1093     {0x05, 0x0051, 0x0001},
1094     {0x05, 0x0000, 0x0000},
1095     {0x05, 0x0052, 0x0001},
1096     {0x05, 0x0000, 0x0000},
1097     {0x05, 0x0054, 0x0001},
1098     {0x05, 0x0001, 0x0000},
1099     {0x00, 0x0000, 0x0001},
1100     {0x00, 0x0000, 0x0002},
1101     {0x00, 0x000c, 0x0003},
1102     {0x00, 0x0000, 0x0004},
1103     {0x00, 0x0090, 0x0005},
1104     {0x00, 0x0000, 0x0006},
1105     {0x00, 0x0040, 0x0007},
1106     {0x00, 0x00c0, 0x0008},
1107     {0x00, 0x004a, 0x0009},
1108     {0x00, 0x0000, 0x000a},
1109     {0x00, 0x0000, 0x000b},
1110     {0x00, 0x0001, 0x000c},
1111     {0x00, 0x0001, 0x000d},
1112     {0x00, 0x0000, 0x000e},
1113     {0x00, 0x0002, 0x000f},
1114     {0x00, 0x0001, 0x0010},
1115     {0x00, 0x0000, 0x0011},
1116     {0x00, 0x0000, 0x0012},
1117     {0x00, 0x0002, 0x0020},
1118     {0x00, 0x0080, 0x0021},
1119     {0x00, 0x0001, 0x0022},
1120     {0x00, 0x00e0, 0x0023},
1121     {0x00, 0x0000, 0x0024},
1122     {0x00, 0x00d5, 0x0025},
1123     {0x00, 0x0000, 0x0026},
1124     {0x00, 0x000b, 0x0027},
1125     {0x00, 0x0000, 0x0046},
1126     {0x00, 0x0000, 0x0047},
1127     {0x00, 0x0000, 0x0048},
1128     {0x00, 0x0000, 0x0049},
1129     {0x00, 0x0008, 0x004a},
1130     {0xff, 0x0000, 0x00d0},
1131     {0xff, 0x00d8, 0x00d1},
1132     {0xff, 0x0000, 0x00d4},
1133     {0xff, 0x0000, 0x00d5},
1134     {0x01, 0x00a6, 0x0000},
1135     {0x01, 0x0028, 0x0001},
1136     {0x01, 0x0000, 0x0002},
1137     {0x01, 0x000a, 0x0003},
1138     {0x01, 0x0040, 0x0004},
1139     {0x01, 0x0066, 0x0007},
1140     {0x01, 0x0011, 0x0008},
1141     {0x01, 0x0032, 0x0009},
1142     {0x01, 0x00fd, 0x000a},
1143     {0x01, 0x0038, 0x000b},
1144     {0x01, 0x00d1, 0x000c},
1145     {0x01, 0x00f7, 0x000d},
1146     {0x01, 0x00ed, 0x000e},
1147     {0x01, 0x00d8, 0x000f},
1148     {0x01, 0x0038, 0x0010},
1149     {0x01, 0x00ff, 0x0015},
1150     {0x01, 0x0001, 0x0016},
1151     {0x01, 0x0032, 0x0017},
1152     {0x01, 0x0023, 0x0018},
1153     {0x01, 0x00ce, 0x0019},
1154     {0x01, 0x0023, 0x001a},
1155     {0x01, 0x0032, 0x001b},
1156     {0x01, 0x008d, 0x001c},
1157     {0x01, 0x00ce, 0x001d},
1158     {0x01, 0x008d, 0x001e},
1159     {0x01, 0x0000, 0x001f},
1160     {0x01, 0x0000, 0x0020},
1161     {0x01, 0x00ff, 0x003e},
1162     {0x01, 0x0003, 0x003f},
1163     {0x01, 0x0000, 0x0040},
1164     {0x01, 0x0035, 0x0041},
1165     {0x01, 0x0053, 0x0042},
1166     {0x01, 0x0069, 0x0043},
1167     {0x01, 0x007c, 0x0044},
1168     {0x01, 0x008c, 0x0045},
1169     {0x01, 0x009a, 0x0046},
1170     {0x01, 0x00a8, 0x0047},
1171     {0x01, 0x00b4, 0x0048},
1172     {0x01, 0x00bf, 0x0049},
1173     {0x01, 0x00ca, 0x004a},
1174     {0x01, 0x00d4, 0x004b},
1175     {0x01, 0x00dd, 0x004c},
1176     {0x01, 0x00e7, 0x004d},
1177     {0x01, 0x00ef, 0x004e},
1178     {0x01, 0x00f8, 0x004f},
1179     {0x01, 0x00ff, 0x0050},
1180     {0x01, 0x0001, 0x0056},
1181     {0x01, 0x0060, 0x0057},
1182     {0x01, 0x0040, 0x0058},
1183     {0x01, 0x0011, 0x0059},
1184     {0x01, 0x0001, 0x005a},
1185     {0x02, 0x0007, 0x0005},
1186     {0x02, 0xa048, 0x0000},
1187     {0x02, 0x0007, 0x0005},
1188     {0x02, 0x0015, 0x0006},
1189     {0x02, 0x100a, 0x0007},
1190     {0x02, 0xa048, 0x0000},
1191     {0x02, 0xc002, 0x0001},
1192     {0x02, 0x000f, 0x0005},
1193     {0x02, 0xa048, 0x0000},
1194     {0x05, 0x0022, 0x0004},
1195     {0x05, 0x0025, 0x0001},
1196     {0x05, 0x0000, 0x0000},
1197     {0x05, 0x0026, 0x0001},
1198     {0x05, 0x0001, 0x0000},
1199     {0x05, 0x0027, 0x0001},
1200     {0x05, 0x0000, 0x0000},
1201     {0x05, 0x0001, 0x0001},
1202     {0x05, 0x0000, 0x0000},
1203     {0x05, 0x0021, 0x0001},
1204     {0x05, 0x00d2, 0x0000},
1205     {0x05, 0x0020, 0x0001},
1206     {0x05, 0x0000, 0x0000},
1207     {0x00, 0x0090, 0x0005},
1208     {0x01, 0x00a6, 0x0000},
1209     {0x05, 0x0026, 0x0001},
1210     {0x05, 0x0001, 0x0000},
1211     {0x05, 0x0027, 0x0001},
1212     {0x05, 0x000f, 0x0000},
1213     {0x01, 0x0003, 0x003f},
1214     {0x01, 0x0001, 0x0056},
1215     {0x01, 0x0011, 0x0008},
1216     {0x01, 0x0032, 0x0009},
1217     {0x01, 0xfffd, 0x000a},
1218     {0x01, 0x0023, 0x000b},
1219     {0x01, 0xffea, 0x000c},
1220     {0x01, 0xfff4, 0x000d},
1221     {0x01, 0xfffc, 0x000e},
1222     {0x01, 0xffe3, 0x000f},
1223     {0x01, 0x001f, 0x0010},
1224     {0x01, 0x00a8, 0x0001},
1225     {0x01, 0x0067, 0x0007},
1226     {0x01, 0x0042, 0x0051},
1227     {0x01, 0x0051, 0x0053},
1228     {0x01, 0x000a, 0x0003},
1229     {0x02, 0xc002, 0x0001},
1230     {0x02, 0x0007, 0x0005},
1231     {0x02, 0xc000, 0x0001},
1232     {0x02, 0x0000, 0x0005},
1233     {0x02, 0x0007, 0x0005},
1234     {0x02, 0x2000, 0x0000},
1235     {0x05, 0x0022, 0x0004},
1236     {0x05, 0x0015, 0x0001},
1237     {0x05, 0x00ea, 0x0000},
1238     {0x05, 0x0021, 0x0001},
1239     {0x05, 0x00d2, 0x0000},
1240     {0x05, 0x0023, 0x0001},
1241     {0x05, 0x0003, 0x0000},
1242     {0x05, 0x0030, 0x0001},
1243     {0x05, 0x002b, 0x0000},
1244     {0x05, 0x0031, 0x0001},
1245     {0x05, 0x0023, 0x0000},
1246     {0x05, 0x0032, 0x0001},
1247     {0x05, 0x0023, 0x0000},
1248     {0x05, 0x0033, 0x0001},
1249     {0x05, 0x0023, 0x0000},
1250     {0x05, 0x0034, 0x0001},
1251     {0x05, 0x0002, 0x0000},
1252     {0x05, 0x0050, 0x0001},
1253     {0x05, 0x0000, 0x0000},
1254     {0x05, 0x0051, 0x0001},
1255     {0x05, 0x0000, 0x0000},
1256     {0x05, 0x0052, 0x0001},
1257     {0x05, 0x0000, 0x0000},
1258     {0x05, 0x0054, 0x0001},
1259     {0x05, 0x0001, 0x0000},
1260     {0x00, 0x0000, 0x0001},
1261     {0x00, 0x0000, 0x0002},
1262     {0x00, 0x000c, 0x0003},
1263     {0x00, 0x0000, 0x0004},
1264     {0x00, 0x0090, 0x0005},
1265     {0x00, 0x0000, 0x0006},
1266     {0x00, 0x0040, 0x0007},
1267     {0x00, 0x00c0, 0x0008},
1268     {0x00, 0x004a, 0x0009},
1269     {0x00, 0x0000, 0x000a},
1270     {0x00, 0x0000, 0x000b},
1271     {0x00, 0x0001, 0x000c},
1272     {0x00, 0x0001, 0x000d},
1273     {0x00, 0x0000, 0x000e},
1274     {0x00, 0x0002, 0x000f},
1275     {0x00, 0x0001, 0x0010},
1276     {0x00, 0x0000, 0x0011},
1277     {0x00, 0x0000, 0x0012},
1278     {0x00, 0x0002, 0x0020},
1279     {0x00, 0x0080, 0x0021},
1280     {0x00, 0x0001, 0x0022},
1281     {0x00, 0x00e0, 0x0023},
1282     {0x00, 0x0000, 0x0024},
1283     {0x00, 0x00d5, 0x0025},
1284     {0x00, 0x0000, 0x0026},
1285     {0x00, 0x000b, 0x0027},
1286     {0x00, 0x0000, 0x0046},
1287     {0x00, 0x0000, 0x0047},
1288     {0x00, 0x0000, 0x0048},
1289     {0x00, 0x0000, 0x0049},
1290     {0x00, 0x0008, 0x004a},
1291     {0xff, 0x0000, 0x00d0},
1292     {0xff, 0x00d8, 0x00d1},
1293     {0xff, 0x0000, 0x00d4},
1294     {0xff, 0x0000, 0x00d5},
1295     {0x01, 0x00a6, 0x0000},
1296     {0x01, 0x0028, 0x0001},
1297     {0x01, 0x0000, 0x0002},
1298     {0x01, 0x000a, 0x0003},
1299     {0x01, 0x0040, 0x0004},
1300     {0x01, 0x0066, 0x0007},
1301     {0x01, 0x0011, 0x0008},
1302     {0x01, 0x0032, 0x0009},
1303     {0x01, 0x00fd, 0x000a},
1304     {0x01, 0x0038, 0x000b},
1305     {0x01, 0x00d1, 0x000c},
1306     {0x01, 0x00f7, 0x000d},
1307     {0x01, 0x00ed, 0x000e},
1308     {0x01, 0x00d8, 0x000f},
1309     {0x01, 0x0038, 0x0010},
1310     {0x01, 0x00ff, 0x0015},
1311     {0x01, 0x0001, 0x0016},
1312     {0x01, 0x0032, 0x0017},
1313     {0x01, 0x0023, 0x0018},
1314     {0x01, 0x00ce, 0x0019},
1315     {0x01, 0x0023, 0x001a},
1316     {0x01, 0x0032, 0x001b},
1317     {0x01, 0x008d, 0x001c},
1318     {0x01, 0x00ce, 0x001d},
1319     {0x01, 0x008d, 0x001e},
1320     {0x01, 0x0000, 0x001f},
1321     {0x01, 0x0000, 0x0020},
1322     {0x01, 0x00ff, 0x003e},
1323     {0x01, 0x0003, 0x003f},
1324     {0x01, 0x0000, 0x0040},
1325     {0x01, 0x0035, 0x0041},
1326     {0x01, 0x0053, 0x0042},
1327     {0x01, 0x0069, 0x0043},
1328     {0x01, 0x007c, 0x0044},
1329     {0x01, 0x008c, 0x0045},
1330     {0x01, 0x009a, 0x0046},
1331     {0x01, 0x00a8, 0x0047},
1332     {0x01, 0x00b4, 0x0048},
1333     {0x01, 0x00bf, 0x0049},
1334     {0x01, 0x00ca, 0x004a},
1335     {0x01, 0x00d4, 0x004b},
1336     {0x01, 0x00dd, 0x004c},
1337     {0x01, 0x00e7, 0x004d},
1338     {0x01, 0x00ef, 0x004e},
1339     {0x01, 0x00f8, 0x004f},
1340     {0x01, 0x00ff, 0x0050},
1341     {0x01, 0x0001, 0x0056},
1342     {0x01, 0x0060, 0x0057},
1343     {0x01, 0x0040, 0x0058},
1344     {0x01, 0x0011, 0x0059},
1345     {0x01, 0x0001, 0x005a},
1346     {0x02, 0x0007, 0x0005},
1347     {0x02, 0xa048, 0x0000},
1348     {0x02, 0x0007, 0x0005},
1349     {0x02, 0x0015, 0x0006},
1350     {0x02, 0x100a, 0x0007},
1351     {0x02, 0xa048, 0x0000},
1352     {0x02, 0xc002, 0x0001},
1353     {0x02, 0x000f, 0x0005},
1354     {0x02, 0xa048, 0x0000},
1355     {0x05, 0x0022, 0x0004},
1356     {0x05, 0x0025, 0x0001},
1357     {0x05, 0x0000, 0x0000},
1358     {0x05, 0x0026, 0x0001},
1359     {0x05, 0x0001, 0x0000},
1360     {0x05, 0x0027, 0x0001},
1361     {0x05, 0x0000, 0x0000},
1362     {0x05, 0x0001, 0x0001},
1363     {0x05, 0x0000, 0x0000},
1364     {0x05, 0x0021, 0x0001},
1365     {0x05, 0x00d2, 0x0000},
1366     {0x05, 0x0020, 0x0001},
1367     {0x05, 0x0000, 0x0000},
1368     {0x00, 0x0090, 0x0005},
1369     {0x01, 0x00a6, 0x0000},
1370     {0x02, 0x0007, 0x0005},
1371     {0x02, 0x2000, 0x0000},
1372     {0x05, 0x0022, 0x0004},
1373     {0x05, 0x0015, 0x0001},
1374     {0x05, 0x00ea, 0x0000},
1375     {0x05, 0x0021, 0x0001},
1376     {0x05, 0x00d2, 0x0000},
1377     {0x05, 0x0023, 0x0001},
1378     {0x05, 0x0003, 0x0000},
1379     {0x05, 0x0030, 0x0001},
1380     {0x05, 0x002b, 0x0000},
1381     {0x05, 0x0031, 0x0001},
1382     {0x05, 0x0023, 0x0000},
1383     {0x05, 0x0032, 0x0001},
1384     {0x05, 0x0023, 0x0000},
1385     {0x05, 0x0033, 0x0001},
1386     {0x05, 0x0023, 0x0000},
1387     {0x05, 0x0034, 0x0001},
1388     {0x05, 0x0002, 0x0000},
1389     {0x05, 0x0050, 0x0001},
1390     {0x05, 0x0000, 0x0000},
1391     {0x05, 0x0051, 0x0001},
1392     {0x05, 0x0000, 0x0000},
1393     {0x05, 0x0052, 0x0001},
1394     {0x05, 0x0000, 0x0000},
1395     {0x05, 0x0054, 0x0001},
1396     {0x05, 0x0001, 0x0000},
1397     {0x00, 0x0000, 0x0001},
1398     {0x00, 0x0000, 0x0002},
1399     {0x00, 0x000c, 0x0003},
1400     {0x00, 0x0000, 0x0004},
1401     {0x00, 0x0090, 0x0005},
1402     {0x00, 0x0000, 0x0006},
1403     {0x00, 0x0040, 0x0007},
1404     {0x00, 0x00c0, 0x0008},
1405     {0x00, 0x004a, 0x0009},
1406     {0x00, 0x0000, 0x000a},
1407     {0x00, 0x0000, 0x000b},
1408     {0x00, 0x0001, 0x000c},
1409     {0x00, 0x0001, 0x000d},
1410     {0x00, 0x0000, 0x000e},
1411     {0x00, 0x0002, 0x000f},
1412     {0x00, 0x0001, 0x0010},
1413     {0x00, 0x0000, 0x0011},
1414     {0x00, 0x0000, 0x0012},
1415     {0x00, 0x0002, 0x0020},
1416     {0x00, 0x0080, 0x0021},
1417     {0x00, 0x0001, 0x0022},
1418     {0x00, 0x00e0, 0x0023},
1419     {0x00, 0x0000, 0x0024},
1420     {0x00, 0x00d5, 0x0025},
1421     {0x00, 0x0000, 0x0026},
1422     {0x00, 0x000b, 0x0027},
1423     {0x00, 0x0000, 0x0046},
1424     {0x00, 0x0000, 0x0047},
1425     {0x00, 0x0000, 0x0048},
1426     {0x00, 0x0000, 0x0049},
1427     {0x00, 0x0008, 0x004a},
1428     {0xff, 0x0000, 0x00d0},
1429     {0xff, 0x00d8, 0x00d1},
1430     {0xff, 0x0000, 0x00d4},
1431     {0xff, 0x0000, 0x00d5},
1432     {0x01, 0x00a6, 0x0000},
1433     {0x01, 0x0028, 0x0001},
1434     {0x01, 0x0000, 0x0002},
1435     {0x01, 0x000a, 0x0003},
1436     {0x01, 0x0040, 0x0004},
1437     {0x01, 0x0066, 0x0007},
1438     {0x01, 0x0011, 0x0008},
1439     {0x01, 0x0032, 0x0009},
1440     {0x01, 0x00fd, 0x000a},
1441     {0x01, 0x0038, 0x000b},
1442     {0x01, 0x00d1, 0x000c},
1443     {0x01, 0x00f7, 0x000d},
1444     {0x01, 0x00ed, 0x000e},
1445     {0x01, 0x00d8, 0x000f},
1446     {0x01, 0x0038, 0x0010},
1447     {0x01, 0x00ff, 0x0015},
1448     {0x01, 0x0001, 0x0016},
1449     {0x01, 0x0032, 0x0017},
1450     {0x01, 0x0023, 0x0018},
1451     {0x01, 0x00ce, 0x0019},
1452     {0x01, 0x0023, 0x001a},
1453     {0x01, 0x0032, 0x001b},
1454     {0x01, 0x008d, 0x001c},
1455     {0x01, 0x00ce, 0x001d},
1456     {0x01, 0x008d, 0x001e},
1457     {0x01, 0x0000, 0x001f},
1458     {0x01, 0x0000, 0x0020},
1459     {0x01, 0x00ff, 0x003e},
1460     {0x01, 0x0003, 0x003f},
1461     {0x01, 0x0000, 0x0040},
1462     {0x01, 0x0035, 0x0041},
1463     {0x01, 0x0053, 0x0042},
1464     {0x01, 0x0069, 0x0043},
1465     {0x01, 0x007c, 0x0044},
1466     {0x01, 0x008c, 0x0045},
1467     {0x01, 0x009a, 0x0046},
1468     {0x01, 0x00a8, 0x0047},
1469     {0x01, 0x00b4, 0x0048},
1470     {0x01, 0x00bf, 0x0049},
1471     {0x01, 0x00ca, 0x004a},
1472     {0x01, 0x00d4, 0x004b},
1473     {0x01, 0x00dd, 0x004c},
1474     {0x01, 0x00e7, 0x004d},
1475     {0x01, 0x00ef, 0x004e},
1476     {0x01, 0x00f8, 0x004f},
1477     {0x01, 0x00ff, 0x0050},
1478     {0x01, 0x0001, 0x0056},
1479     {0x01, 0x0060, 0x0057},
1480     {0x01, 0x0040, 0x0058},
1481     {0x01, 0x0011, 0x0059},
1482     {0x01, 0x0001, 0x005a},
1483     {0x02, 0x0007, 0x0005},
1484     {0x02, 0xa048, 0x0000},
1485     {0x02, 0x0007, 0x0005},
1486     {0x02, 0x0015, 0x0006},
1487     {0x02, 0x100a, 0x0007},
1488     {0x02, 0xa048, 0x0000},
1489     {0x02, 0xc002, 0x0001},
1490     {0x02, 0x000f, 0x0005},
1491     {0x02, 0xa048, 0x0000},
1492     {0x05, 0x0022, 0x0004},
1493     {0x05, 0x0025, 0x0001},
1494     {0x05, 0x0000, 0x0000},
1495     {0x05, 0x0026, 0x0001},
1496     {0x05, 0x0001, 0x0000},
1497     {0x05, 0x0027, 0x0001},
1498     {0x05, 0x0000, 0x0000},
1499     {0x05, 0x0001, 0x0001},
1500     {0x05, 0x0000, 0x0000},
1501     {0x05, 0x0021, 0x0001},
1502     {0x05, 0x00d2, 0x0000},
1503     {0x05, 0x0020, 0x0001},
1504     {0x05, 0x0000, 0x0000},
1505     {0x00, 0x0090, 0x0005},
1506     {0x01, 0x00a6, 0x0000},
1507     {0x05, 0x0026, 0x0001},
1508     {0x05, 0x0001, 0x0000},
1509     {0x05, 0x0027, 0x0001},
1510     {0x05, 0x001e, 0x0000},
1511     {0x01, 0x0003, 0x003f},
1512     {0x01, 0x0001, 0x0056},
1513     {0x01, 0x0011, 0x0008},
1514     {0x01, 0x0032, 0x0009},
1515     {0x01, 0xfffd, 0x000a},
1516     {0x01, 0x0023, 0x000b},
1517     {0x01, 0xffea, 0x000c},
1518     {0x01, 0xfff4, 0x000d},
1519     {0x01, 0xfffc, 0x000e},
1520     {0x01, 0xffe3, 0x000f},
1521     {0x01, 0x001f, 0x0010},
1522     {0x01, 0x00a8, 0x0001},
1523     {0x01, 0x0067, 0x0007},
1524     {0x01, 0x0042, 0x0051},
1525     {0x01, 0x0051, 0x0053},
1526     {0x01, 0x000a, 0x0003},
1527     {0x02, 0xc002, 0x0001},
1528     {0x02, 0x0007, 0x0005},
1529     {0x01, 0x0042, 0x0051},
1530     {0x01, 0x0051, 0x0053},
1531     {0x05, 0x0026, 0x0001},
1532     {0x05, 0x0001, 0x0000},
1533     {0x05, 0x0027, 0x0001},
1534     {0x05, 0x002d, 0x0000},
1535     {0x01, 0x0003, 0x003f},
1536     {0x01, 0x0001, 0x0056},
1537     {0x02, 0xc000, 0x0001},
1538     {0x02, 0x0000, 0x0005},
1539     {}
1540 };
1541 
1542 /* Unknown camera from Ori Usbid 0x0000:0x0000 */
1543 /* Based on snoops from Ori Cohen */
1544 static const __u16 spca501c_mysterious_open_data[][3] = {
1545     {0x02, 0x000f, 0x0005},
1546     {0x02, 0xa048, 0x0000},
1547     {0x05, 0x0022, 0x0004},
1548 /* DSP Registers */
1549     {0x01, 0x0016, 0x0011}, /* RGB offset */
1550     {0x01, 0x0000, 0x0012},
1551     {0x01, 0x0006, 0x0013},
1552     {0x01, 0x0078, 0x0051},
1553     {0x01, 0x0040, 0x0052},
1554     {0x01, 0x0046, 0x0053},
1555     {0x01, 0x0040, 0x0054},
1556     {0x00, 0x0025, 0x0000},
1557 /*  {0x00, 0x0000, 0x0000 }, */
1558 /* Part 2 */
1559 /* TG Registers */
1560     {0x00, 0x0026, 0x0000},
1561     {0x00, 0x0001, 0x0000},
1562     {0x00, 0x0027, 0x0000},
1563     {0x00, 0x008a, 0x0000},
1564     {0x02, 0x0007, 0x0005},
1565     {0x02, 0x2000, 0x0000},
1566     {0x05, 0x0022, 0x0004},
1567     {0x05, 0x0015, 0x0001},
1568     {0x05, 0x00ea, 0x0000},
1569     {0x05, 0x0021, 0x0001},
1570     {0x05, 0x00d2, 0x0000},
1571     {0x05, 0x0023, 0x0001},
1572     {0x05, 0x0003, 0x0000},
1573     {0x05, 0x0030, 0x0001},
1574     {0x05, 0x002b, 0x0000},
1575     {0x05, 0x0031, 0x0001},
1576     {0x05, 0x0023, 0x0000},
1577     {0x05, 0x0032, 0x0001},
1578     {0x05, 0x0023, 0x0000},
1579     {0x05, 0x0033, 0x0001},
1580     {0x05, 0x0023, 0x0000},
1581     {0x05, 0x0034, 0x0001},
1582     {0x05, 0x0002, 0x0000},
1583     {0x05, 0x0050, 0x0001},
1584     {0x05, 0x0000, 0x0000},
1585     {0x05, 0x0051, 0x0001},
1586     {0x05, 0x0000, 0x0000},
1587     {0x05, 0x0052, 0x0001},
1588     {0x05, 0x0000, 0x0000},
1589     {0x05, 0x0054, 0x0001},
1590     {0x05, 0x0001, 0x0000},
1591     {}
1592 };
1593 
1594 /* Based on snoops from Ori Cohen */
1595 static const __u16 spca501c_mysterious_init_data[][3] = {
1596 /* Part 3 */
1597 /* TG registers */
1598 /*  {0x00, 0x0000, 0x0000}, */
1599     {0x00, 0x0000, 0x0001},
1600     {0x00, 0x0000, 0x0002},
1601     {0x00, 0x0006, 0x0003},
1602     {0x00, 0x0000, 0x0004},
1603     {0x00, 0x0090, 0x0005},
1604     {0x00, 0x0000, 0x0006},
1605     {0x00, 0x0040, 0x0007},
1606     {0x00, 0x00c0, 0x0008},
1607     {0x00, 0x004a, 0x0009},
1608     {0x00, 0x0000, 0x000a},
1609     {0x00, 0x0000, 0x000b},
1610     {0x00, 0x0001, 0x000c},
1611     {0x00, 0x0001, 0x000d},
1612     {0x00, 0x0000, 0x000e},
1613     {0x00, 0x0002, 0x000f},
1614     {0x00, 0x0001, 0x0010},
1615     {0x00, 0x0000, 0x0011},
1616     {0x00, 0x0001, 0x0012},
1617     {0x00, 0x0002, 0x0020},
1618     {0x00, 0x0080, 0x0021}, /* 640 */
1619     {0x00, 0x0001, 0x0022},
1620     {0x00, 0x00e0, 0x0023}, /* 480 */
1621     {0x00, 0x0000, 0x0024}, /* Offset H hight */
1622     {0x00, 0x00d3, 0x0025}, /* low */
1623     {0x00, 0x0000, 0x0026}, /* Offset V */
1624     {0x00, 0x000d, 0x0027}, /* low */
1625     {0x00, 0x0000, 0x0046},
1626     {0x00, 0x0000, 0x0047},
1627     {0x00, 0x0000, 0x0048},
1628     {0x00, 0x0000, 0x0049},
1629     {0x00, 0x0008, 0x004a},
1630 /* DSP Registers    */
1631     {0x01, 0x00a6, 0x0000},
1632     {0x01, 0x0028, 0x0001},
1633     {0x01, 0x0000, 0x0002},
1634     {0x01, 0x000a, 0x0003}, /* Level Calc bit7 ->1 Auto */
1635     {0x01, 0x0040, 0x0004},
1636     {0x01, 0x0066, 0x0007},
1637     {0x01, 0x000f, 0x0008}, /* A11 Color correction coeff */
1638     {0x01, 0x002d, 0x0009}, /* A12 */
1639     {0x01, 0x0005, 0x000a}, /* A13 */
1640     {0x01, 0x0023, 0x000b}, /* A21 */
1641     {0x01, 0x00e0, 0x000c}, /* A22 */
1642     {0x01, 0x00fd, 0x000d}, /* A23 */
1643     {0x01, 0x00f4, 0x000e}, /* A31 */
1644     {0x01, 0x00e4, 0x000f}, /* A32 */
1645     {0x01, 0x0028, 0x0010}, /* A33 */
1646     {0x01, 0x00ff, 0x0015}, /* Reserved */
1647     {0x01, 0x0001, 0x0016}, /* Reserved */
1648     {0x01, 0x0032, 0x0017}, /* Win1 Start begin */
1649     {0x01, 0x0023, 0x0018},
1650     {0x01, 0x00ce, 0x0019},
1651     {0x01, 0x0023, 0x001a},
1652     {0x01, 0x0032, 0x001b},
1653     {0x01, 0x008d, 0x001c},
1654     {0x01, 0x00ce, 0x001d},
1655     {0x01, 0x008d, 0x001e},
1656     {0x01, 0x0000, 0x001f},
1657     {0x01, 0x0000, 0x0020}, /* Win1 Start end */
1658     {0x01, 0x00ff, 0x003e}, /* Reserved begin */
1659     {0x01, 0x0002, 0x003f},
1660     {0x01, 0x0000, 0x0040},
1661     {0x01, 0x0035, 0x0041},
1662     {0x01, 0x0053, 0x0042},
1663     {0x01, 0x0069, 0x0043},
1664     {0x01, 0x007c, 0x0044},
1665     {0x01, 0x008c, 0x0045},
1666     {0x01, 0x009a, 0x0046},
1667     {0x01, 0x00a8, 0x0047},
1668     {0x01, 0x00b4, 0x0048},
1669     {0x01, 0x00bf, 0x0049},
1670     {0x01, 0x00ca, 0x004a},
1671     {0x01, 0x00d4, 0x004b},
1672     {0x01, 0x00dd, 0x004c},
1673     {0x01, 0x00e7, 0x004d},
1674     {0x01, 0x00ef, 0x004e},
1675     {0x01, 0x00f8, 0x004f},
1676     {0x01, 0x00ff, 0x0050},
1677     {0x01, 0x0003, 0x0056}, /* Reserved end */
1678     {0x01, 0x0060, 0x0057}, /* Edge Gain */
1679     {0x01, 0x0040, 0x0058},
1680     {0x01, 0x0011, 0x0059}, /* Edge Bandwidth */
1681     {0x01, 0x0001, 0x005a},
1682     {0x02, 0x0007, 0x0005},
1683     {0x02, 0xa048, 0x0000},
1684     {0x02, 0x0007, 0x0005},
1685     {0x02, 0x0015, 0x0006},
1686     {0x02, 0x200a, 0x0007},
1687     {0x02, 0xa048, 0x0000},
1688     {0x02, 0xc000, 0x0001},
1689     {0x02, 0x000f, 0x0005},
1690     {0x02, 0xa048, 0x0000},
1691     {0x05, 0x0022, 0x0004},
1692     {0x05, 0x0025, 0x0001},
1693     {0x05, 0x0000, 0x0000},
1694 /* Part 4 */
1695     {0x05, 0x0026, 0x0001},
1696     {0x05, 0x0001, 0x0000},
1697     {0x05, 0x0027, 0x0001},
1698     {0x05, 0x0000, 0x0000},
1699     {0x05, 0x0001, 0x0001},
1700     {0x05, 0x0000, 0x0000},
1701     {0x05, 0x0021, 0x0001},
1702     {0x05, 0x00d2, 0x0000},
1703     {0x05, 0x0020, 0x0001},
1704     {0x05, 0x0000, 0x0000},
1705     {0x00, 0x0090, 0x0005},
1706     {0x01, 0x00a6, 0x0000},
1707     {0x02, 0x0000, 0x0005},
1708     {0x05, 0x0026, 0x0001},
1709     {0x05, 0x0001, 0x0000},
1710     {0x05, 0x0027, 0x0001},
1711     {0x05, 0x004e, 0x0000},
1712 /* Part 5 */
1713     {0x01, 0x0003, 0x003f},
1714     {0x01, 0x0001, 0x0056},
1715     {0x01, 0x000f, 0x0008},
1716     {0x01, 0x002d, 0x0009},
1717     {0x01, 0x0005, 0x000a},
1718     {0x01, 0x0023, 0x000b},
1719     {0x01, 0xffe0, 0x000c},
1720     {0x01, 0xfffd, 0x000d},
1721     {0x01, 0xfff4, 0x000e},
1722     {0x01, 0xffe4, 0x000f},
1723     {0x01, 0x0028, 0x0010},
1724     {0x01, 0x00a8, 0x0001},
1725     {0x01, 0x0066, 0x0007},
1726     {0x01, 0x0032, 0x0017},
1727     {0x01, 0x0023, 0x0018},
1728     {0x01, 0x00ce, 0x0019},
1729     {0x01, 0x0023, 0x001a},
1730     {0x01, 0x0032, 0x001b},
1731     {0x01, 0x008d, 0x001c},
1732     {0x01, 0x00ce, 0x001d},
1733     {0x01, 0x008d, 0x001e},
1734     {0x01, 0x00c8, 0x0015}, /* c8 Poids fort Luma */
1735     {0x01, 0x0032, 0x0016}, /* 32 */
1736     {0x01, 0x0016, 0x0011}, /* R 00 */
1737     {0x01, 0x0016, 0x0012}, /* G 00 */
1738     {0x01, 0x0016, 0x0013}, /* B 00 */
1739     {0x01, 0x000a, 0x0003},
1740     {0x02, 0xc002, 0x0001},
1741     {0x02, 0x0007, 0x0005},
1742     {}
1743 };
1744 
1745 static int reg_write(struct gspca_dev *gspca_dev,
1746                     __u16 req, __u16 index, __u16 value)
1747 {
1748     int ret;
1749     struct usb_device *dev = gspca_dev->dev;
1750 
1751     ret = usb_control_msg(dev,
1752             usb_sndctrlpipe(dev, 0),
1753             req,
1754             USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1755             value, index, NULL, 0, 500);
1756     gspca_dbg(gspca_dev, D_USBO, "reg write: 0x%02x 0x%02x 0x%02x\n",
1757           req, index, value);
1758     if (ret < 0)
1759         pr_err("reg write: error %d\n", ret);
1760     return ret;
1761 }
1762 
1763 
1764 static int write_vector(struct gspca_dev *gspca_dev, const __u16 data[][3])
1765 {
1766     int ret, i = 0;
1767 
1768     while (data[i][0] != 0 || data[i][1] != 0 || data[i][2] != 0) {
1769         ret = reg_write(gspca_dev, data[i][0], data[i][2],
1770                                 data[i][1]);
1771         if (ret < 0) {
1772             gspca_err(gspca_dev, "Reg write failed for 0x%02x,0x%02x,0x%02x\n",
1773                   data[i][0], data[i][1], data[i][2]);
1774             return ret;
1775         }
1776         i++;
1777     }
1778     return 0;
1779 }
1780 
1781 static void setbrightness(struct gspca_dev *gspca_dev, s32 val)
1782 {
1783     reg_write(gspca_dev, SPCA501_REG_CCDSP, 0x12, val);
1784 }
1785 
1786 static void setcontrast(struct gspca_dev *gspca_dev, s32 val)
1787 {
1788     reg_write(gspca_dev, 0x00, 0x00, (val >> 8) & 0xff);
1789     reg_write(gspca_dev, 0x00, 0x01, val & 0xff);
1790 }
1791 
1792 static void setcolors(struct gspca_dev *gspca_dev, s32 val)
1793 {
1794     reg_write(gspca_dev, SPCA501_REG_CCDSP, 0x0c, val);
1795 }
1796 
1797 static void setblue_balance(struct gspca_dev *gspca_dev, s32 val)
1798 {
1799     reg_write(gspca_dev, SPCA501_REG_CCDSP, 0x11, val);
1800 }
1801 
1802 static void setred_balance(struct gspca_dev *gspca_dev, s32 val)
1803 {
1804     reg_write(gspca_dev, SPCA501_REG_CCDSP, 0x13, val);
1805 }
1806 
1807 /* this function is called at probe time */
1808 static int sd_config(struct gspca_dev *gspca_dev,
1809             const struct usb_device_id *id)
1810 {
1811     struct sd *sd = (struct sd *) gspca_dev;
1812     struct cam *cam;
1813 
1814     cam = &gspca_dev->cam;
1815     cam->cam_mode = vga_mode;
1816     cam->nmodes = ARRAY_SIZE(vga_mode);
1817     sd->subtype = id->driver_info;
1818 
1819     return 0;
1820 }
1821 
1822 /* this function is called at probe and resume time */
1823 static int sd_init(struct gspca_dev *gspca_dev)
1824 {
1825     struct sd *sd = (struct sd *) gspca_dev;
1826 
1827     switch (sd->subtype) {
1828     case Arowana300KCMOSCamera:
1829     case SmileIntlCamera:
1830         /* Arowana 300k CMOS Camera data */
1831         if (write_vector(gspca_dev, spca501c_arowana_init_data))
1832             goto error;
1833         break;
1834     case MystFromOriUnknownCamera:
1835         /* Unknown Ori CMOS Camera data */
1836         if (write_vector(gspca_dev, spca501c_mysterious_open_data))
1837             goto error;
1838         break;
1839     default:
1840         /* generic spca501 init data */
1841         if (write_vector(gspca_dev, spca501_init_data))
1842             goto error;
1843         break;
1844     }
1845     gspca_dbg(gspca_dev, D_STREAM, "Initializing SPCA501 finished\n");
1846     return 0;
1847 error:
1848     return -EINVAL;
1849 }
1850 
1851 static int sd_start(struct gspca_dev *gspca_dev)
1852 {
1853     struct sd *sd = (struct sd *) gspca_dev;
1854     int mode;
1855 
1856     switch (sd->subtype) {
1857     case ThreeComHomeConnectLite:
1858         /* Special handling for 3com data */
1859         write_vector(gspca_dev, spca501_3com_open_data);
1860         break;
1861     case Arowana300KCMOSCamera:
1862     case SmileIntlCamera:
1863         /* Arowana 300k CMOS Camera data */
1864         write_vector(gspca_dev, spca501c_arowana_open_data);
1865         break;
1866     case MystFromOriUnknownCamera:
1867         /* Unknown CMOS Camera data */
1868         write_vector(gspca_dev, spca501c_mysterious_init_data);
1869         break;
1870     default:
1871         /* Generic 501 open data */
1872         write_vector(gspca_dev, spca501_open_data);
1873     }
1874 
1875     /* memorize the wanted pixel format */
1876     mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
1877 
1878     /* Enable ISO packet machine CTRL reg=2,
1879      * index=1 bitmask=0x2 (bit ordinal 1) */
1880     reg_write(gspca_dev, SPCA50X_REG_USB, 0x6, 0x94);
1881     switch (mode) {
1882     case 0: /* 640x480 */
1883         reg_write(gspca_dev, SPCA50X_REG_USB, 0x07, 0x004a);
1884         break;
1885     case 1: /* 320x240 */
1886         reg_write(gspca_dev, SPCA50X_REG_USB, 0x07, 0x104a);
1887         break;
1888     default:
1889 /*  case 2:  * 160x120 */
1890         reg_write(gspca_dev, SPCA50X_REG_USB, 0x07, 0x204a);
1891         break;
1892     }
1893     reg_write(gspca_dev, SPCA501_REG_CTLRL, 0x01, 0x02);
1894 
1895     return 0;
1896 }
1897 
1898 static void sd_stopN(struct gspca_dev *gspca_dev)
1899 {
1900     /* Disable ISO packet
1901      * machine CTRL reg=2, index=1 bitmask=0x0 (bit ordinal 1) */
1902     reg_write(gspca_dev, SPCA501_REG_CTLRL, 0x01, 0x00);
1903 }
1904 
1905 /* called on streamoff with alt 0 and on disconnect */
1906 static void sd_stop0(struct gspca_dev *gspca_dev)
1907 {
1908     if (!gspca_dev->present)
1909         return;
1910     reg_write(gspca_dev, SPCA501_REG_CTLRL, 0x05, 0x00);
1911 }
1912 
1913 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
1914             u8 *data,           /* isoc packet */
1915             int len)            /* iso packet length */
1916 {
1917     switch (data[0]) {
1918     case 0:             /* start of frame */
1919         gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
1920         data += SPCA501_OFFSET_DATA;
1921         len -= SPCA501_OFFSET_DATA;
1922         gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
1923         return;
1924     case 0xff:          /* drop */
1925 /*      gspca_dev->last_packet_type = DISCARD_PACKET; */
1926         return;
1927     }
1928     data++;
1929     len--;
1930     gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
1931 }
1932 
1933 static int sd_s_ctrl(struct v4l2_ctrl *ctrl)
1934 {
1935     struct gspca_dev *gspca_dev =
1936         container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
1937 
1938     gspca_dev->usb_err = 0;
1939 
1940     if (!gspca_dev->streaming)
1941         return 0;
1942 
1943     switch (ctrl->id) {
1944     case V4L2_CID_BRIGHTNESS:
1945         setbrightness(gspca_dev, ctrl->val);
1946         break;
1947     case V4L2_CID_CONTRAST:
1948         setcontrast(gspca_dev, ctrl->val);
1949         break;
1950     case V4L2_CID_SATURATION:
1951         setcolors(gspca_dev, ctrl->val);
1952         break;
1953     case V4L2_CID_BLUE_BALANCE:
1954         setblue_balance(gspca_dev, ctrl->val);
1955         break;
1956     case V4L2_CID_RED_BALANCE:
1957         setred_balance(gspca_dev, ctrl->val);
1958         break;
1959     }
1960     return gspca_dev->usb_err;
1961 }
1962 
1963 static const struct v4l2_ctrl_ops sd_ctrl_ops = {
1964     .s_ctrl = sd_s_ctrl,
1965 };
1966 
1967 static int sd_init_controls(struct gspca_dev *gspca_dev)
1968 {
1969     struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
1970 
1971     gspca_dev->vdev.ctrl_handler = hdl;
1972     v4l2_ctrl_handler_init(hdl, 5);
1973     v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1974             V4L2_CID_BRIGHTNESS, 0, 127, 1, 0);
1975     v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1976             V4L2_CID_CONTRAST, 0, 64725, 1, 64725);
1977     v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1978             V4L2_CID_SATURATION, 0, 63, 1, 20);
1979     v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1980             V4L2_CID_BLUE_BALANCE, 0, 127, 1, 0);
1981     v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1982             V4L2_CID_RED_BALANCE, 0, 127, 1, 0);
1983 
1984     if (hdl->error) {
1985         pr_err("Could not initialize controls\n");
1986         return hdl->error;
1987     }
1988     return 0;
1989 }
1990 
1991 /* sub-driver description */
1992 static const struct sd_desc sd_desc = {
1993     .name = MODULE_NAME,
1994     .config = sd_config,
1995     .init = sd_init,
1996     .init_controls = sd_init_controls,
1997     .start = sd_start,
1998     .stopN = sd_stopN,
1999     .stop0 = sd_stop0,
2000     .pkt_scan = sd_pkt_scan,
2001 };
2002 
2003 /* -- module initialisation -- */
2004 static const struct usb_device_id device_table[] = {
2005     {USB_DEVICE(0x040a, 0x0002), .driver_info = KodakDVC325},
2006     {USB_DEVICE(0x0497, 0xc001), .driver_info = SmileIntlCamera},
2007     {USB_DEVICE(0x0506, 0x00df), .driver_info = ThreeComHomeConnectLite},
2008     {USB_DEVICE(0x0733, 0x0401), .driver_info = IntelCreateAndShare},
2009     {USB_DEVICE(0x0733, 0x0402), .driver_info = ViewQuestM318B},
2010     {USB_DEVICE(0x1776, 0x501c), .driver_info = Arowana300KCMOSCamera},
2011     {USB_DEVICE(0x0000, 0x0000), .driver_info = MystFromOriUnknownCamera},
2012     {}
2013 };
2014 MODULE_DEVICE_TABLE(usb, device_table);
2015 
2016 /* -- device connect -- */
2017 static int sd_probe(struct usb_interface *intf,
2018             const struct usb_device_id *id)
2019 {
2020     return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
2021                 THIS_MODULE);
2022 }
2023 
2024 static struct usb_driver sd_driver = {
2025     .name = MODULE_NAME,
2026     .id_table = device_table,
2027     .probe = sd_probe,
2028     .disconnect = gspca_disconnect,
2029 #ifdef CONFIG_PM
2030     .suspend = gspca_suspend,
2031     .resume = gspca_resume,
2032     .reset_resume = gspca_resume,
2033 #endif
2034 };
2035 
2036 module_usb_driver(sd_driver);