// SPDX-License-Identifier: GPL-2.0-or-later
/*
* SPCA501 chip based cameras initialization data
*
* V4L2 by Jean - Francois Moine < http : //moinejf.free.fr>
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define MODULE_NAME "spca501"
#include "gspca.h"
MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>" );
MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver" );
MODULE_LICENSE("GPL" );
/* specific webcam descriptor */
struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
unsigned short contrast;
__u8 brightness;
__u8 colors;
__u8 blue_balance;
__u8 red_balance;
char subtype;
#define Arowana300KCMOSCamera 0
#define IntelCreateAndShare 1
#define KodakDVC325 2
#define MystFromOriUnknownCamera 3
#define SmileIntlCamera 4
#define ThreeComHomeConnectLite 5
#define ViewQuestM318B 6
};
static const struct v4l2_pix_format vga_mode[] = {
{160 , 120 , V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
.bytesperline = 160 ,
.sizeimage = 160 * 120 * 3 / 2 ,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 2 },
{320 , 240 , V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
.bytesperline = 320 ,
.sizeimage = 320 * 240 * 3 / 2 ,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 1 },
{640 , 480 , V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
.bytesperline = 640 ,
.sizeimage = 640 * 480 * 3 / 2 ,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 0 },
};
#define SPCA50X_REG_USB 0 x2 /* spca505 501 */
/*
* Data to initialize a SPCA501 . From a capture file provided by Bill Roehl
* With SPCA501 chip description
*/
#define CCDSP_SET /* set CCDSP parameters */
#define TG_SET /* set time generator set */
#undef DSPWIN_SET /* set DSP windows parameters */
#undef ALTER_GAMA /* Set alternate set to YUV transform coeffs. */
#define SPCA501_SNAPBIT 0 x80
#define SPCA501_SNAPCTRL 0 x10
/* Frame packet header offsets for the spca501 */
#define SPCA501_OFFSET_GPIO 1
#define SPCA501_OFFSET_TYPE 2
#define SPCA501_OFFSET_TURN3A 3
#define SPCA501_OFFSET_FRAMSEQ 4
#define SPCA501_OFFSET_COMPRESS 5
#define SPCA501_OFFSET_QUANT 6
#define SPCA501_OFFSET_QUANT2 7
#define SPCA501_OFFSET_DATA 8
#define SPCA501_PROP_COMP_ENABLE(d) ((d) & 1 )
#define SPCA501_PROP_SNAP(d) ((d) & 0 x40)
#define SPCA501_PROP_SNAP_CTRL(d) ((d) & 0 x10)
#define SPCA501_PROP_COMP_THRESH(d) (((d) & 0 x0e) >> 1 )
#define SPCA501_PROP_COMP_QUANT(d) (((d) & 0 x70) >> 4 )
/* SPCA501 CCDSP control */
#define SPCA501_REG_CCDSP 0 x01
/* SPCA501 control/status registers */
#define SPCA501_REG_CTLRL 0 x02
/* registers for color correction and YUV transformation */
#define SPCA501_A11 0 x08
#define SPCA501_A12 0 x09
#define SPCA501_A13 0 x0A
#define SPCA501_A21 0 x0B
#define SPCA501_A22 0 x0C
#define SPCA501_A23 0 x0D
#define SPCA501_A31 0 x0E
#define SPCA501_A32 0 x0F
#define SPCA501_A33 0 x10
/* Data for video camera initialization before capturing */
static const __u16 spca501_open_data[][3 ] = {
/* bmRequest,value,index */
{0 x2, 0 x50, 0 x00}, /* C/S enable soft reset */
{0 x2, 0 x40, 0 x00}, /* C/S disable soft reset */
{0 x2, 0 x02, 0 x05}, /* C/S general purpose I/O data */
{0 x2, 0 x03, 0 x05}, /* C/S general purpose I/O data */
#ifdef CCDSP_SET
{0 x1, 0 x38, 0 x01}, /* CCDSP options */
{0 x1, 0 x05, 0 x02}, /* CCDSP Optical black level for user settings */
{0 x1, 0 xC0, 0 x03}, /* CCDSP Optical black settings */
{0 x1, 0 x67, 0 x07},
{0 x1, 0 x63, 0 x3f}, /* CCDSP CCD gamma enable */
{0 x1, 0 x03, 0 x56}, /* Add gamma correction */
{0 x1, 0 xFF, 0 x15}, /* CCDSP High luminance for white balance */
{0 x1, 0 x01, 0 x16}, /* CCDSP Low luminance for white balance */
/* Color correction and RGB-to-YUV transformation coefficients changing */
#ifdef ALTER_GAMA
{0 x0, 0 x00, 0 x08}, /* A11 */
{0 x0, 0 x00, 0 x09}, /* A12 */
{0 x0, 0 x90, 0 x0A}, /* A13 */
{0 x0, 0 x12, 0 x0B}, /* A21 */
{0 x0, 0 x00, 0 x0C}, /* A22 */
{0 x0, 0 x00, 0 x0D}, /* A23 */
{0 x0, 0 x00, 0 x0E}, /* A31 */
{0 x0, 0 x02, 0 x0F}, /* A32 */
{0 x0, 0 x00, 0 x10}, /* A33 */
#else
{0 x1, 0 x2a, 0 x08}, /* A11 0x31 */
{0 x1, 0 xf8, 0 x09}, /* A12 f8 */
{0 x1, 0 xf8, 0 x0A}, /* A13 f8 */
{0 x1, 0 xf8, 0 x0B}, /* A21 f8 */
{0 x1, 0 x14, 0 x0C}, /* A22 0x14 */
{0 x1, 0 xf8, 0 x0D}, /* A23 f8 */
{0 x1, 0 xf8, 0 x0E}, /* A31 f8 */
{0 x1, 0 xf8, 0 x0F}, /* A32 f8 */
{0 x1, 0 x20, 0 x10}, /* A33 0x20 */
#endif
{0 x1, 0 x00, 0 x11}, /* R offset */
{0 x1, 0 x00, 0 x12}, /* G offset */
{0 x1, 0 x00, 0 x13}, /* B offset */
{0 x1, 0 x00, 0 x14}, /* GB offset */
#endif
#ifdef TG_SET
/* Time generator manipulations */
{0 x0, 0 xfc, 0 x0}, /* Set up high bits of shutter speed */
{0 x0, 0 x01, 0 x1}, /* Set up low bits of shutter speed */
{0 x0, 0 xe4, 0 x04}, /* DCLK*2 clock phase adjustment */
{0 x0, 0 x08, 0 x05}, /* ADCK phase adjustment, inv. ext. VB */
{0 x0, 0 x03, 0 x06}, /* FR phase adjustment */
{0 x0, 0 x01, 0 x07}, /* FCDS phase adjustment */
{0 x0, 0 x39, 0 x08}, /* FS phase adjustment */
{0 x0, 0 x88, 0 x0a}, /* FH1 phase and delay adjustment */
{0 x0, 0 x03, 0 x0f}, /* pixel identification */
{0 x0, 0 x00, 0 x11}, /* clock source selection (default) */
/*VERY strange manipulations with
* select DMCLP or OBPX to be ADCLP output ( 0 x0C )
* OPB always toggle or not ( 0 x0D ) but they allow
* us to set up brightness
*/
{0 x0, 0 x01, 0 x0c},
{0 x0, 0 xe0, 0 x0d},
/* Done */
#endif
#ifdef DSPWIN_SET
{0 x1, 0 xa0, 0 x01}, /* Setting image processing parameters */
{0 x1, 0 x1c, 0 x17}, /* Changing Windows positions X1 */
{0 x1, 0 xe2, 0 x19}, /* X2 */
{0 x1, 0 x1c, 0 x1b}, /* X3 */
{0 x1, 0 xe2, 0 x1d}, /* X4 */
{0 x1, 0 x5f, 0 x1f}, /* X5 */
{0 x1, 0 x32, 0 x20}, /* Y5 */
{0 x1, 0 x01, 0 x10}, /* Changing A33 */
#endif
{0 x2, 0 x204a, 0 x07},/* Setting video compression & resolution 160x120 */
{0 x2, 0 x94, 0 x06}, /* Setting video no compression */
{}
};
/*
The SPCAxxx docs from Sunplus document these values
in tables , one table per register number . In the data
below , dmRequest is the register number , index is the Addr ,
and value is a combination of Bit values .
Bit Value ( hex )
0 01
1 02
2 04
3 08
4 10
5 20
6 40
7 80
*/
/* Data for chip initialization (set default values) */
static const __u16 spca501_init_data[][3 ] = {
/* Set all the values to powerup defaults */
/* bmRequest,value,index */
{0 x0, 0 xAA, 0 x00},
{0 x0, 0 x02, 0 x01},
{0 x0, 0 x01, 0 x02},
{0 x0, 0 x02, 0 x03},
{0 x0, 0 xCE, 0 x04},
{0 x0, 0 x00, 0 x05},
{0 x0, 0 x00, 0 x06},
{0 x0, 0 x00, 0 x07},
{0 x0, 0 x00, 0 x08},
{0 x0, 0 x00, 0 x09},
{0 x0, 0 x90, 0 x0A},
{0 x0, 0 x12, 0 x0B},
{0 x0, 0 x00, 0 x0C},
{0 x0, 0 x00, 0 x0D},
{0 x0, 0 x00, 0 x0E},
{0 x0, 0 x02, 0 x0F},
{0 x0, 0 x00, 0 x10},
{0 x0, 0 x00, 0 x11},
{0 x0, 0 x00, 0 x12},
{0 x0, 0 x00, 0 x13},
{0 x0, 0 x00, 0 x14},
{0 x0, 0 x00, 0 x15},
{0 x0, 0 x00, 0 x16},
{0 x0, 0 x00, 0 x17},
{0 x0, 0 x00, 0 x18},
{0 x0, 0 x00, 0 x19},
{0 x0, 0 x00, 0 x1A},
{0 x0, 0 x00, 0 x1B},
{0 x0, 0 x00, 0 x1C},
{0 x0, 0 x00, 0 x1D},
{0 x0, 0 x00, 0 x1E},
{0 x0, 0 x00, 0 x1F},
{0 x0, 0 x00, 0 x20},
{0 x0, 0 x00, 0 x21},
{0 x0, 0 x00, 0 x22},
{0 x0, 0 x00, 0 x23},
{0 x0, 0 x00, 0 x24},
{0 x0, 0 x00, 0 x25},
{0 x0, 0 x00, 0 x26},
{0 x0, 0 x00, 0 x27},
{0 x0, 0 x00, 0 x28},
{0 x0, 0 x00, 0 x29},
{0 x0, 0 x00, 0 x2A},
{0 x0, 0 x00, 0 x2B},
{0 x0, 0 x00, 0 x2C},
{0 x0, 0 x00, 0 x2D},
{0 x0, 0 x00, 0 x2E},
{0 x0, 0 x00, 0 x2F},
{0 x0, 0 x00, 0 x30},
{0 x0, 0 x00, 0 x31},
{0 x0, 0 x00, 0 x32},
{0 x0, 0 x00, 0 x33},
{0 x0, 0 x00, 0 x34},
{0 x0, 0 x00, 0 x35},
{0 x0, 0 x00, 0 x36},
{0 x0, 0 x00, 0 x37},
{0 x0, 0 x00, 0 x38},
{0 x0, 0 x00, 0 x39},
{0 x0, 0 x00, 0 x3A},
{0 x0, 0 x00, 0 x3B},
{0 x0, 0 x00, 0 x3C},
{0 x0, 0 x00, 0 x3D},
{0 x0, 0 x00, 0 x3E},
{0 x0, 0 x00, 0 x3F},
{0 x0, 0 x00, 0 x40},
{0 x0, 0 x00, 0 x41},
{0 x0, 0 x00, 0 x42},
{0 x0, 0 x00, 0 x43},
{0 x0, 0 x00, 0 x44},
{0 x0, 0 x00, 0 x45},
{0 x0, 0 x00, 0 x46},
{0 x0, 0 x00, 0 x47},
{0 x0, 0 x00, 0 x48},
{0 x0, 0 x00, 0 x49},
{0 x0, 0 x00, 0 x4A},
{0 x0, 0 x00, 0 x4B},
{0 x0, 0 x00, 0 x4C},
{0 x0, 0 x00, 0 x4D},
{0 x0, 0 x00, 0 x4E},
{0 x0, 0 x00, 0 x4F},
{0 x0, 0 x00, 0 x50},
{0 x0, 0 x00, 0 x51},
{0 x0, 0 x00, 0 x52},
{0 x0, 0 x00, 0 x53},
{0 x0, 0 x00, 0 x54},
{0 x0, 0 x00, 0 x55},
{0 x0, 0 x00, 0 x56},
{0 x0, 0 x00, 0 x57},
{0 x0, 0 x00, 0 x58},
{0 x0, 0 x00, 0 x59},
{0 x0, 0 x00, 0 x5A},
{0 x0, 0 x00, 0 x5B},
{0 x0, 0 x00, 0 x5C},
{0 x0, 0 x00, 0 x5D},
{0 x0, 0 x00, 0 x5E},
{0 x0, 0 x00, 0 x5F},
{0 x0, 0 x00, 0 x60},
{0 x0, 0 x00, 0 x61},
{0 x0, 0 x00, 0 x62},
{0 x0, 0 x00, 0 x63},
{0 x0, 0 x00, 0 x64},
{0 x0, 0 x00, 0 x65},
{0 x0, 0 x00, 0 x66},
{0 x0, 0 x00, 0 x67},
{0 x0, 0 x00, 0 x68},
{0 x0, 0 x00, 0 x69},
{0 x0, 0 x00, 0 x6A},
{0 x0, 0 x00, 0 x6B},
{0 x0, 0 x00, 0 x6C},
{0 x0, 0 x00, 0 x6D},
{0 x0, 0 x00, 0 x6E},
{0 x0, 0 x00, 0 x6F},
{0 x0, 0 x00, 0 x70},
{0 x0, 0 x00, 0 x71},
{0 x0, 0 x00, 0 x72},
{0 x0, 0 x00, 0 x73},
{0 x0, 0 x00, 0 x74},
{0 x0, 0 x00, 0 x75},
{0 x0, 0 x00, 0 x76},
{0 x0, 0 x00, 0 x77},
{0 x0, 0 x00, 0 x78},
{0 x0, 0 x00, 0 x79},
{0 x0, 0 x00, 0 x7A},
{0 x0, 0 x00, 0 x7B},
{0 x0, 0 x00, 0 x7C},
{0 x0, 0 x00, 0 x7D},
{0 x0, 0 x00, 0 x7E},
{0 x0, 0 x00, 0 x7F},
{0 x0, 0 x00, 0 x80},
{0 x0, 0 x00, 0 x81},
{0 x0, 0 x00, 0 x82},
{0 x0, 0 x00, 0 x83},
{0 x0, 0 x00, 0 x84},
{0 x0, 0 x00, 0 x85},
{0 x0, 0 x00, 0 x86},
{0 x0, 0 x00, 0 x87},
{0 x0, 0 x00, 0 x88},
{0 x0, 0 x00, 0 x89},
{0 x0, 0 x00, 0 x8A},
{0 x0, 0 x00, 0 x8B},
{0 x0, 0 x00, 0 x8C},
{0 x0, 0 x00, 0 x8D},
{0 x0, 0 x00, 0 x8E},
{0 x0, 0 x00, 0 x8F},
{0 x0, 0 x00, 0 x90},
{0 x0, 0 x00, 0 x91},
{0 x0, 0 x00, 0 x92},
{0 x0, 0 x00, 0 x93},
{0 x0, 0 x00, 0 x94},
{0 x0, 0 x00, 0 x95},
{0 x0, 0 x00, 0 x96},
{0 x0, 0 x00, 0 x97},
{0 x0, 0 x00, 0 x98},
{0 x0, 0 x00, 0 x99},
{0 x0, 0 x00, 0 x9A},
{0 x0, 0 x00, 0 x9B},
{0 x0, 0 x00, 0 x9C},
{0 x0, 0 x00, 0 x9D},
{0 x0, 0 x00, 0 x9E},
{0 x0, 0 x00, 0 x9F},
{0 x0, 0 x00, 0 xA0},
{0 x0, 0 x00, 0 xA1},
{0 x0, 0 x00, 0 xA2},
{0 x0, 0 x00, 0 xA3},
{0 x0, 0 x00, 0 xA4},
{0 x0, 0 x00, 0 xA5},
{0 x0, 0 x00, 0 xA6},
{0 x0, 0 x00, 0 xA7},
{0 x0, 0 x00, 0 xA8},
{0 x0, 0 x00, 0 xA9},
{0 x0, 0 x00, 0 xAA},
{0 x0, 0 x00, 0 xAB},
{0 x0, 0 x00, 0 xAC},
{0 x0, 0 x00, 0 xAD},
{0 x0, 0 x00, 0 xAE},
{0 x0, 0 x00, 0 xAF},
{0 x0, 0 x00, 0 xB0},
{0 x0, 0 x00, 0 xB1},
{0 x0, 0 x00, 0 xB2},
{0 x0, 0 x00, 0 xB3},
{0 x0, 0 x00, 0 xB4},
{0 x0, 0 x00, 0 xB5},
{0 x0, 0 x00, 0 xB6},
{0 x0, 0 x00, 0 xB7},
{0 x0, 0 x00, 0 xB8},
{0 x0, 0 x00, 0 xB9},
{0 x0, 0 x00, 0 xBA},
{0 x0, 0 x00, 0 xBB},
{0 x0, 0 x00, 0 xBC},
{0 x0, 0 x00, 0 xBD},
{0 x0, 0 x00, 0 xBE},
{0 x0, 0 x00, 0 xBF},
{0 x0, 0 x00, 0 xC0},
{0 x0, 0 x00, 0 xC1},
{0 x0, 0 x00, 0 xC2},
{0 x0, 0 x00, 0 xC3},
{0 x0, 0 x00, 0 xC4},
{0 x0, 0 x00, 0 xC5},
{0 x0, 0 x00, 0 xC6},
{0 x0, 0 x00, 0 xC7},
{0 x0, 0 x00, 0 xC8},
{0 x0, 0 x00, 0 xC9},
{0 x0, 0 x00, 0 xCA},
{0 x0, 0 x00, 0 xCB},
{0 x0, 0 x00, 0 xCC},
{0 x1, 0 xF4, 0 x00},
{0 x1, 0 x38, 0 x01},
{0 x1, 0 x40, 0 x02},
{0 x1, 0 x0A, 0 x03},
{0 x1, 0 x40, 0 x04},
{0 x1, 0 x40, 0 x05},
{0 x1, 0 x40, 0 x06},
{0 x1, 0 x67, 0 x07},
{0 x1, 0 x31, 0 x08},
{0 x1, 0 x00, 0 x09},
{0 x1, 0 x00, 0 x0A},
{0 x1, 0 x00, 0 x0B},
{0 x1, 0 x14, 0 x0C},
{0 x1, 0 x00, 0 x0D},
{0 x1, 0 x00, 0 x0E},
{0 x1, 0 x00, 0 x0F},
{0 x1, 0 x1E, 0 x10},
{0 x1, 0 x00, 0 x11},
{0 x1, 0 x00, 0 x12},
{0 x1, 0 x00, 0 x13},
{0 x1, 0 x00, 0 x14},
{0 x1, 0 xFF, 0 x15},
{0 x1, 0 x01, 0 x16},
{0 x1, 0 x32, 0 x17},
{0 x1, 0 x23, 0 x18},
{0 x1, 0 xCE, 0 x19},
{0 x1, 0 x23, 0 x1A},
{0 x1, 0 x32, 0 x1B},
{0 x1, 0 x8D, 0 x1C},
{0 x1, 0 xCE, 0 x1D},
{0 x1, 0 x8D, 0 x1E},
{0 x1, 0 x00, 0 x1F},
{0 x1, 0 x00, 0 x20},
{0 x1, 0 xFF, 0 x3E},
{0 x1, 0 x02, 0 x3F},
{0 x1, 0 x00, 0 x40},
{0 x1, 0 x00, 0 x41},
{0 x1, 0 x00, 0 x42},
{0 x1, 0 x00, 0 x43},
{0 x1, 0 x00, 0 x44},
{0 x1, 0 x00, 0 x45},
{0 x1, 0 x00, 0 x46},
{0 x1, 0 x00, 0 x47},
{0 x1, 0 x00, 0 x48},
{0 x1, 0 x00, 0 x49},
{0 x1, 0 x00, 0 x4A},
{0 x1, 0 x00, 0 x4B},
{0 x1, 0 x00, 0 x4C},
{0 x1, 0 x00, 0 x4D},
{0 x1, 0 x00, 0 x4E},
{0 x1, 0 x00, 0 x4F},
{0 x1, 0 x00, 0 x50},
{0 x1, 0 x00, 0 x51},
{0 x1, 0 x00, 0 x52},
{0 x1, 0 x00, 0 x53},
{0 x1, 0 x00, 0 x54},
{0 x1, 0 x00, 0 x55},
{0 x1, 0 x00, 0 x56},
{0 x1, 0 x00, 0 x57},
{0 x1, 0 x00, 0 x58},
{0 x1, 0 x00, 0 x59},
{0 x1, 0 x00, 0 x5A},
{0 x2, 0 x03, 0 x00},
{0 x2, 0 x00, 0 x01},
{0 x2, 0 x00, 0 x05},
{0 x2, 0 x00, 0 x06},
{0 x2, 0 x00, 0 x07},
{0 x2, 0 x00, 0 x10},
{0 x2, 0 x00, 0 x11},
/* Strange - looks like the 501 driver doesn't do anything
* at insert time except read the EEPROM
*/
{}
};
/* Data for video camera init before capture.
* Capture and decoding by Colin Peart .
* This is for the 3 com HomeConnect Lite which is spca501a based .
*/
static const __u16 spca501_3com_open_data[][3 ] = {
/* bmRequest,value,index */
{0 x2, 0 x0050, 0 x0000}, /* C/S Enable TG soft reset, timing mode=010 */
{0 x2, 0 x0043, 0 x0000}, /* C/S Disable TG soft reset, timing mode=010 */
{0 x2, 0 x0002, 0 x0005}, /* C/S GPIO */
{0 x2, 0 x0003, 0 x0005}, /* C/S GPIO */
#ifdef CCDSP_SET
{0 x1, 0 x0020, 0 x0001}, /* CCDSP Options */
{0 x1, 0 x0020, 0 x0002}, /* CCDSP Black Level */
{0 x1, 0 x006e, 0 x0007}, /* CCDSP Gamma options */
{0 x1, 0 x0090, 0 x0015}, /* CCDSP Luminance Low */
{0 x1, 0 x00ff, 0 x0016}, /* CCDSP Luminance High */
{0 x1, 0 x0003, 0 x003F}, /* CCDSP Gamma correction toggle */
#ifdef ALTER_GAMMA
{0 x1, 0 x0010, 0 x0008}, /* CCDSP YUV A11 */
{0 x1, 0 x0000, 0 x0009}, /* CCDSP YUV A12 */
{0 x1, 0 x0000, 0 x000a}, /* CCDSP YUV A13 */
{0 x1, 0 x0000, 0 x000b}, /* CCDSP YUV A21 */
{0 x1, 0 x0010, 0 x000c}, /* CCDSP YUV A22 */
{0 x1, 0 x0000, 0 x000d}, /* CCDSP YUV A23 */
{0 x1, 0 x0000, 0 x000e}, /* CCDSP YUV A31 */
{0 x1, 0 x0000, 0 x000f}, /* CCDSP YUV A32 */
{0 x1, 0 x0010, 0 x0010}, /* CCDSP YUV A33 */
{0 x1, 0 x0000, 0 x0011}, /* CCDSP R Offset */
{0 x1, 0 x0000, 0 x0012}, /* CCDSP G Offset */
{0 x1, 0 x0001, 0 x0013}, /* CCDSP B Offset */
{0 x1, 0 x0001, 0 x0014}, /* CCDSP BG Offset */
{0 x1, 0 x003f, 0 x00C1}, /* CCDSP Gamma Correction Enable */
#endif
#endif
#ifdef TG_SET
{0 x0, 0 x00fc, 0 x0000}, /* TG Shutter Speed High Bits */
{0 x0, 0 x0000, 0 x0001}, /* TG Shutter Speed Low Bits */
{0 x0, 0 x00e4, 0 x0004}, /* TG DCLK*2 Adjust */
{0 x0, 0 x0008, 0 x0005}, /* TG ADCK Adjust */
{0 x0, 0 x0003, 0 x0006}, /* TG FR Phase Adjust */
{0 x0, 0 x0001, 0 x0007}, /* TG FCDS Phase Adjust */
{0 x0, 0 x0039, 0 x0008}, /* TG FS Phase Adjust */
{0 x0, 0 x0088, 0 x000a}, /* TG MH1 */
{0 x0, 0 x0003, 0 x000f}, /* TG Pixel ID */
/* Like below, unexplained toglleing */
{0 x0, 0 x0080, 0 x000c},
{0 x0, 0 x0000, 0 x000d},
{0 x0, 0 x0080, 0 x000c},
{0 x0, 0 x0004, 0 x000d},
{0 x0, 0 x0000, 0 x000c},
{0 x0, 0 x0000, 0 x000d},
{0 x0, 0 x0040, 0 x000c},
{0 x0, 0 x0017, 0 x000d},
{0 x0, 0 x00c0, 0 x000c},
{0 x0, 0 x0000, 0 x000d},
{0 x0, 0 x0080, 0 x000c},
{0 x0, 0 x0006, 0 x000d},
{0 x0, 0 x0080, 0 x000c},
{0 x0, 0 x0004, 0 x000d},
{0 x0, 0 x0002, 0 x0003},
#endif
#ifdef DSPWIN_SET
{0 x1, 0 x001c, 0 x0017}, /* CCDSP W1 Start X */
{0 x1, 0 x00e2, 0 x0019}, /* CCDSP W2 Start X */
{0 x1, 0 x001c, 0 x001b}, /* CCDSP W3 Start X */
{0 x1, 0 x00e2, 0 x001d}, /* CCDSP W4 Start X */
{0 x1, 0 x00aa, 0 x001f}, /* CCDSP W5 Start X */
{0 x1, 0 x0070, 0 x0020}, /* CCDSP W5 Start Y */
#endif
{0 x0, 0 x0001, 0 x0010}, /* TG Start Clock */
/* {0x2, 0x006a, 0x0001}, * C/S Enable ISOSYNCH Packet Engine */
{0 x2, 0 x0068, 0 x0001}, /* C/S Disable ISOSYNCH Packet Engine */
{0 x2, 0 x0000, 0 x0005},
{0 x2, 0 x0043, 0 x0000}, /* C/S Set Timing Mode, Disable TG soft reset */
{0 x2, 0 x0043, 0 x0000}, /* C/S Set Timing Mode, Disable TG soft reset */
{0 x2, 0 x0002, 0 x0005}, /* C/S GPIO */
{0 x2, 0 x0003, 0 x0005}, /* C/S GPIO */
{0 x2, 0 x006a, 0 x0001}, /* C/S Enable ISOSYNCH Packet Engine */
{}
};
/*
* Data used to initialize a SPCA501C with HV7131B sensor .
* From a capture file taken with USBSnoop v 1 . 5
* I have a " SPCA501C pc camera chipset " manual by sunplus , but some
* of the value meanings are obscure or simply " reserved " .
* to do list :
* 1 ) Understand what every value means
* 2 ) Understand why some values seem to appear more than once
* 3 ) Write a small comment for each line of the following arrays .
*/
static const __u16 spca501c_arowana_open_data[][3 ] = {
/* bmRequest,value,index */
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x01, 0 x0006, 0 x0011},
{0 x01, 0 x00ff, 0 x0012},
{0 x01, 0 x0014, 0 x0013},
{0 x01, 0 x0000, 0 x0014},
{0 x01, 0 x0042, 0 x0051},
{0 x01, 0 x0040, 0 x0052},
{0 x01, 0 x0051, 0 x0053},
{0 x01, 0 x0040, 0 x0054},
{0 x01, 0 x0000, 0 x0055},
{0 x00, 0 x0025, 0 x0000},
{0 x00, 0 x0026, 0 x0000},
{0 x00, 0 x0001, 0 x0000},
{0 x00, 0 x0027, 0 x0000},
{0 x00, 0 x008a, 0 x0000},
{}
};
static const __u16 spca501c_arowana_init_data[][3 ] = {
/* bmRequest,value,index */
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x01, 0 x0006, 0 x0011},
{0 x01, 0 x00ff, 0 x0012},
{0 x01, 0 x0014, 0 x0013},
{0 x01, 0 x0000, 0 x0014},
{0 x01, 0 x0042, 0 x0051},
{0 x01, 0 x0040, 0 x0052},
{0 x01, 0 x0051, 0 x0053},
{0 x01, 0 x0040, 0 x0054},
{0 x01, 0 x0000, 0 x0055},
{0 x00, 0 x0025, 0 x0000},
{0 x00, 0 x0026, 0 x0000},
{0 x00, 0 x0001, 0 x0000},
{0 x00, 0 x0027, 0 x0000},
{0 x00, 0 x008a, 0 x0000},
{0 x02, 0 x0000, 0 x0005},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x2000, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0015, 0 x0001},
{0 x05, 0 x00ea, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0023, 0 x0001},
{0 x05, 0 x0003, 0 x0000},
{0 x05, 0 x0030, 0 x0001},
{0 x05, 0 x002b, 0 x0000},
{0 x05, 0 x0031, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0032, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0033, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0034, 0 x0001},
{0 x05, 0 x0002, 0 x0000},
{0 x05, 0 x0050, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0051, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0052, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0054, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x00, 0 x0000, 0 x0001},
{0 x00, 0 x0000, 0 x0002},
{0 x00, 0 x000c, 0 x0003},
{0 x00, 0 x0000, 0 x0004},
{0 x00, 0 x0090, 0 x0005},
{0 x00, 0 x0000, 0 x0006},
{0 x00, 0 x0040, 0 x0007},
{0 x00, 0 x00c0, 0 x0008},
{0 x00, 0 x004a, 0 x0009},
{0 x00, 0 x0000, 0 x000a},
{0 x00, 0 x0000, 0 x000b},
{0 x00, 0 x0001, 0 x000c},
{0 x00, 0 x0001, 0 x000d},
{0 x00, 0 x0000, 0 x000e},
{0 x00, 0 x0002, 0 x000f},
{0 x00, 0 x0001, 0 x0010},
{0 x00, 0 x0000, 0 x0011},
{0 x00, 0 x0000, 0 x0012},
{0 x00, 0 x0002, 0 x0020},
{0 x00, 0 x0080, 0 x0021},
{0 x00, 0 x0001, 0 x0022},
{0 x00, 0 x00e0, 0 x0023},
{0 x00, 0 x0000, 0 x0024},
{0 x00, 0 x00d5, 0 x0025},
{0 x00, 0 x0000, 0 x0026},
{0 x00, 0 x000b, 0 x0027},
{0 x00, 0 x0000, 0 x0046},
{0 x00, 0 x0000, 0 x0047},
{0 x00, 0 x0000, 0 x0048},
{0 x00, 0 x0000, 0 x0049},
{0 x00, 0 x0008, 0 x004a},
{0 xff, 0 x0000, 0 x00d0},
{0 xff, 0 x00d8, 0 x00d1},
{0 xff, 0 x0000, 0 x00d4},
{0 xff, 0 x0000, 0 x00d5},
{0 x01, 0 x00a6, 0 x0000},
{0 x01, 0 x0028, 0 x0001},
{0 x01, 0 x0000, 0 x0002},
{0 x01, 0 x000a, 0 x0003},
{0 x01, 0 x0040, 0 x0004},
{0 x01, 0 x0066, 0 x0007},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 x00fd, 0 x000a},
{0 x01, 0 x0038, 0 x000b},
{0 x01, 0 x00d1, 0 x000c},
{0 x01, 0 x00f7, 0 x000d},
{0 x01, 0 x00ed, 0 x000e},
{0 x01, 0 x00d8, 0 x000f},
{0 x01, 0 x0038, 0 x0010},
{0 x01, 0 x00ff, 0 x0015},
{0 x01, 0 x0001, 0 x0016},
{0 x01, 0 x0032, 0 x0017},
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x0000, 0 x001f},
{0 x01, 0 x0000, 0 x0020},
{0 x01, 0 x00ff, 0 x003e},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0000, 0 x0040},
{0 x01, 0 x0035, 0 x0041},
{0 x01, 0 x0053, 0 x0042},
{0 x01, 0 x0069, 0 x0043},
{0 x01, 0 x007c, 0 x0044},
{0 x01, 0 x008c, 0 x0045},
{0 x01, 0 x009a, 0 x0046},
{0 x01, 0 x00a8, 0 x0047},
{0 x01, 0 x00b4, 0 x0048},
{0 x01, 0 x00bf, 0 x0049},
{0 x01, 0 x00ca, 0 x004a},
{0 x01, 0 x00d4, 0 x004b},
{0 x01, 0 x00dd, 0 x004c},
{0 x01, 0 x00e7, 0 x004d},
{0 x01, 0 x00ef, 0 x004e},
{0 x01, 0 x00f8, 0 x004f},
{0 x01, 0 x00ff, 0 x0050},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0060, 0 x0057},
{0 x01, 0 x0040, 0 x0058},
{0 x01, 0 x0011, 0 x0059},
{0 x01, 0 x0001, 0 x005a},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x0015, 0 x0006},
{0 x02, 0 x100a, 0 x0007},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x000f, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0025, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0001, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0020, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x00, 0 x0090, 0 x0005},
{0 x01, 0 x00a6, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x2000, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0015, 0 x0001},
{0 x05, 0 x00ea, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0023, 0 x0001},
{0 x05, 0 x0003, 0 x0000},
{0 x05, 0 x0030, 0 x0001},
{0 x05, 0 x002b, 0 x0000},
{0 x05, 0 x0031, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0032, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0033, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0034, 0 x0001},
{0 x05, 0 x0002, 0 x0000},
{0 x05, 0 x0050, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0051, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0052, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0054, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x00, 0 x0000, 0 x0001},
{0 x00, 0 x0000, 0 x0002},
{0 x00, 0 x000c, 0 x0003},
{0 x00, 0 x0000, 0 x0004},
{0 x00, 0 x0090, 0 x0005},
{0 x00, 0 x0000, 0 x0006},
{0 x00, 0 x0040, 0 x0007},
{0 x00, 0 x00c0, 0 x0008},
{0 x00, 0 x004a, 0 x0009},
{0 x00, 0 x0000, 0 x000a},
{0 x00, 0 x0000, 0 x000b},
{0 x00, 0 x0001, 0 x000c},
{0 x00, 0 x0001, 0 x000d},
{0 x00, 0 x0000, 0 x000e},
{0 x00, 0 x0002, 0 x000f},
{0 x00, 0 x0001, 0 x0010},
{0 x00, 0 x0000, 0 x0011},
{0 x00, 0 x0000, 0 x0012},
{0 x00, 0 x0002, 0 x0020},
{0 x00, 0 x0080, 0 x0021},
{0 x00, 0 x0001, 0 x0022},
{0 x00, 0 x00e0, 0 x0023},
{0 x00, 0 x0000, 0 x0024},
{0 x00, 0 x00d5, 0 x0025},
{0 x00, 0 x0000, 0 x0026},
{0 x00, 0 x000b, 0 x0027},
{0 x00, 0 x0000, 0 x0046},
{0 x00, 0 x0000, 0 x0047},
{0 x00, 0 x0000, 0 x0048},
{0 x00, 0 x0000, 0 x0049},
{0 x00, 0 x0008, 0 x004a},
{0 xff, 0 x0000, 0 x00d0},
{0 xff, 0 x00d8, 0 x00d1},
{0 xff, 0 x0000, 0 x00d4},
{0 xff, 0 x0000, 0 x00d5},
{0 x01, 0 x00a6, 0 x0000},
{0 x01, 0 x0028, 0 x0001},
{0 x01, 0 x0000, 0 x0002},
{0 x01, 0 x000a, 0 x0003},
{0 x01, 0 x0040, 0 x0004},
{0 x01, 0 x0066, 0 x0007},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 x00fd, 0 x000a},
{0 x01, 0 x0038, 0 x000b},
{0 x01, 0 x00d1, 0 x000c},
{0 x01, 0 x00f7, 0 x000d},
{0 x01, 0 x00ed, 0 x000e},
{0 x01, 0 x00d8, 0 x000f},
{0 x01, 0 x0038, 0 x0010},
{0 x01, 0 x00ff, 0 x0015},
{0 x01, 0 x0001, 0 x0016},
{0 x01, 0 x0032, 0 x0017},
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x0000, 0 x001f},
{0 x01, 0 x0000, 0 x0020},
{0 x01, 0 x00ff, 0 x003e},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0000, 0 x0040},
{0 x01, 0 x0035, 0 x0041},
{0 x01, 0 x0053, 0 x0042},
{0 x01, 0 x0069, 0 x0043},
{0 x01, 0 x007c, 0 x0044},
{0 x01, 0 x008c, 0 x0045},
{0 x01, 0 x009a, 0 x0046},
{0 x01, 0 x00a8, 0 x0047},
{0 x01, 0 x00b4, 0 x0048},
{0 x01, 0 x00bf, 0 x0049},
{0 x01, 0 x00ca, 0 x004a},
{0 x01, 0 x00d4, 0 x004b},
{0 x01, 0 x00dd, 0 x004c},
{0 x01, 0 x00e7, 0 x004d},
{0 x01, 0 x00ef, 0 x004e},
{0 x01, 0 x00f8, 0 x004f},
{0 x01, 0 x00ff, 0 x0050},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0060, 0 x0057},
{0 x01, 0 x0040, 0 x0058},
{0 x01, 0 x0011, 0 x0059},
{0 x01, 0 x0001, 0 x005a},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x0015, 0 x0006},
{0 x02, 0 x100a, 0 x0007},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x000f, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0025, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0001, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0020, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x00, 0 x0090, 0 x0005},
{0 x01, 0 x00a6, 0 x0000},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 xfffd, 0 x000a},
{0 x01, 0 x0023, 0 x000b},
{0 x01, 0 xffea, 0 x000c},
{0 x01, 0 xfff4, 0 x000d},
{0 x01, 0 xfffc, 0 x000e},
{0 x01, 0 xffe3, 0 x000f},
{0 x01, 0 x001f, 0 x0010},
{0 x01, 0 x00a8, 0 x0001},
{0 x01, 0 x0067, 0 x0007},
{0 x01, 0 x0032, 0 x0017},
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x00c8, 0 x0015},
{0 x01, 0 x0032, 0 x0016},
{0 x01, 0 x0000, 0 x0011},
{0 x01, 0 x0000, 0 x0012},
{0 x01, 0 x0000, 0 x0013},
{0 x01, 0 x000a, 0 x0003},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xc000, 0 x0001},
{0 x02, 0 x0000, 0 x0005},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x2000, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0015, 0 x0001},
{0 x05, 0 x00ea, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0023, 0 x0001},
{0 x05, 0 x0003, 0 x0000},
{0 x05, 0 x0030, 0 x0001},
{0 x05, 0 x002b, 0 x0000},
{0 x05, 0 x0031, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0032, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0033, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0034, 0 x0001},
{0 x05, 0 x0002, 0 x0000},
{0 x05, 0 x0050, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0051, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0052, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0054, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x00, 0 x0000, 0 x0001},
{0 x00, 0 x0000, 0 x0002},
{0 x00, 0 x000c, 0 x0003},
{0 x00, 0 x0000, 0 x0004},
{0 x00, 0 x0090, 0 x0005},
{0 x00, 0 x0000, 0 x0006},
{0 x00, 0 x0040, 0 x0007},
{0 x00, 0 x00c0, 0 x0008},
{0 x00, 0 x004a, 0 x0009},
{0 x00, 0 x0000, 0 x000a},
{0 x00, 0 x0000, 0 x000b},
{0 x00, 0 x0001, 0 x000c},
{0 x00, 0 x0001, 0 x000d},
{0 x00, 0 x0000, 0 x000e},
{0 x00, 0 x0002, 0 x000f},
{0 x00, 0 x0001, 0 x0010},
{0 x00, 0 x0000, 0 x0011},
{0 x00, 0 x0000, 0 x0012},
{0 x00, 0 x0002, 0 x0020},
{0 x00, 0 x0080, 0 x0021},
{0 x00, 0 x0001, 0 x0022},
{0 x00, 0 x00e0, 0 x0023},
{0 x00, 0 x0000, 0 x0024},
{0 x00, 0 x00d5, 0 x0025},
{0 x00, 0 x0000, 0 x0026},
{0 x00, 0 x000b, 0 x0027},
{0 x00, 0 x0000, 0 x0046},
{0 x00, 0 x0000, 0 x0047},
{0 x00, 0 x0000, 0 x0048},
{0 x00, 0 x0000, 0 x0049},
{0 x00, 0 x0008, 0 x004a},
{0 xff, 0 x0000, 0 x00d0},
{0 xff, 0 x00d8, 0 x00d1},
{0 xff, 0 x0000, 0 x00d4},
{0 xff, 0 x0000, 0 x00d5},
{0 x01, 0 x00a6, 0 x0000},
{0 x01, 0 x0028, 0 x0001},
{0 x01, 0 x0000, 0 x0002},
{0 x01, 0 x000a, 0 x0003},
{0 x01, 0 x0040, 0 x0004},
{0 x01, 0 x0066, 0 x0007},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 x00fd, 0 x000a},
{0 x01, 0 x0038, 0 x000b},
{0 x01, 0 x00d1, 0 x000c},
{0 x01, 0 x00f7, 0 x000d},
{0 x01, 0 x00ed, 0 x000e},
{0 x01, 0 x00d8, 0 x000f},
{0 x01, 0 x0038, 0 x0010},
{0 x01, 0 x00ff, 0 x0015},
{0 x01, 0 x0001, 0 x0016},
{0 x01, 0 x0032, 0 x0017},
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x0000, 0 x001f},
{0 x01, 0 x0000, 0 x0020},
{0 x01, 0 x00ff, 0 x003e},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0000, 0 x0040},
{0 x01, 0 x0035, 0 x0041},
{0 x01, 0 x0053, 0 x0042},
{0 x01, 0 x0069, 0 x0043},
{0 x01, 0 x007c, 0 x0044},
{0 x01, 0 x008c, 0 x0045},
{0 x01, 0 x009a, 0 x0046},
{0 x01, 0 x00a8, 0 x0047},
{0 x01, 0 x00b4, 0 x0048},
{0 x01, 0 x00bf, 0 x0049},
{0 x01, 0 x00ca, 0 x004a},
{0 x01, 0 x00d4, 0 x004b},
{0 x01, 0 x00dd, 0 x004c},
{0 x01, 0 x00e7, 0 x004d},
{0 x01, 0 x00ef, 0 x004e},
{0 x01, 0 x00f8, 0 x004f},
{0 x01, 0 x00ff, 0 x0050},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0060, 0 x0057},
{0 x01, 0 x0040, 0 x0058},
{0 x01, 0 x0011, 0 x0059},
{0 x01, 0 x0001, 0 x005a},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x0015, 0 x0006},
{0 x02, 0 x100a, 0 x0007},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x000f, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0025, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0001, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0020, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x00, 0 x0090, 0 x0005},
{0 x01, 0 x00a6, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x2000, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0015, 0 x0001},
{0 x05, 0 x00ea, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0023, 0 x0001},
{0 x05, 0 x0003, 0 x0000},
{0 x05, 0 x0030, 0 x0001},
{0 x05, 0 x002b, 0 x0000},
{0 x05, 0 x0031, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0032, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0033, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0034, 0 x0001},
{0 x05, 0 x0002, 0 x0000},
{0 x05, 0 x0050, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0051, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0052, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0054, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x00, 0 x0000, 0 x0001},
{0 x00, 0 x0000, 0 x0002},
{0 x00, 0 x000c, 0 x0003},
{0 x00, 0 x0000, 0 x0004},
{0 x00, 0 x0090, 0 x0005},
{0 x00, 0 x0000, 0 x0006},
{0 x00, 0 x0040, 0 x0007},
{0 x00, 0 x00c0, 0 x0008},
{0 x00, 0 x004a, 0 x0009},
{0 x00, 0 x0000, 0 x000a},
{0 x00, 0 x0000, 0 x000b},
{0 x00, 0 x0001, 0 x000c},
{0 x00, 0 x0001, 0 x000d},
{0 x00, 0 x0000, 0 x000e},
{0 x00, 0 x0002, 0 x000f},
{0 x00, 0 x0001, 0 x0010},
{0 x00, 0 x0000, 0 x0011},
{0 x00, 0 x0000, 0 x0012},
{0 x00, 0 x0002, 0 x0020},
{0 x00, 0 x0080, 0 x0021},
{0 x00, 0 x0001, 0 x0022},
{0 x00, 0 x00e0, 0 x0023},
{0 x00, 0 x0000, 0 x0024},
{0 x00, 0 x00d5, 0 x0025},
{0 x00, 0 x0000, 0 x0026},
{0 x00, 0 x000b, 0 x0027},
{0 x00, 0 x0000, 0 x0046},
{0 x00, 0 x0000, 0 x0047},
{0 x00, 0 x0000, 0 x0048},
{0 x00, 0 x0000, 0 x0049},
{0 x00, 0 x0008, 0 x004a},
{0 xff, 0 x0000, 0 x00d0},
{0 xff, 0 x00d8, 0 x00d1},
{0 xff, 0 x0000, 0 x00d4},
{0 xff, 0 x0000, 0 x00d5},
{0 x01, 0 x00a6, 0 x0000},
{0 x01, 0 x0028, 0 x0001},
{0 x01, 0 x0000, 0 x0002},
{0 x01, 0 x000a, 0 x0003},
{0 x01, 0 x0040, 0 x0004},
{0 x01, 0 x0066, 0 x0007},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 x00fd, 0 x000a},
{0 x01, 0 x0038, 0 x000b},
{0 x01, 0 x00d1, 0 x000c},
{0 x01, 0 x00f7, 0 x000d},
{0 x01, 0 x00ed, 0 x000e},
{0 x01, 0 x00d8, 0 x000f},
{0 x01, 0 x0038, 0 x0010},
{0 x01, 0 x00ff, 0 x0015},
{0 x01, 0 x0001, 0 x0016},
{0 x01, 0 x0032, 0 x0017},
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x0000, 0 x001f},
{0 x01, 0 x0000, 0 x0020},
{0 x01, 0 x00ff, 0 x003e},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0000, 0 x0040},
{0 x01, 0 x0035, 0 x0041},
{0 x01, 0 x0053, 0 x0042},
{0 x01, 0 x0069, 0 x0043},
{0 x01, 0 x007c, 0 x0044},
{0 x01, 0 x008c, 0 x0045},
{0 x01, 0 x009a, 0 x0046},
{0 x01, 0 x00a8, 0 x0047},
{0 x01, 0 x00b4, 0 x0048},
{0 x01, 0 x00bf, 0 x0049},
{0 x01, 0 x00ca, 0 x004a},
{0 x01, 0 x00d4, 0 x004b},
{0 x01, 0 x00dd, 0 x004c},
{0 x01, 0 x00e7, 0 x004d},
{0 x01, 0 x00ef, 0 x004e},
{0 x01, 0 x00f8, 0 x004f},
{0 x01, 0 x00ff, 0 x0050},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0060, 0 x0057},
{0 x01, 0 x0040, 0 x0058},
{0 x01, 0 x0011, 0 x0059},
{0 x01, 0 x0001, 0 x005a},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x0015, 0 x0006},
{0 x02, 0 x100a, 0 x0007},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x000f, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0025, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0001, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0020, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x00, 0 x0090, 0 x0005},
{0 x01, 0 x00a6, 0 x0000},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x000f, 0 x0000},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 xfffd, 0 x000a},
{0 x01, 0 x0023, 0 x000b},
{0 x01, 0 xffea, 0 x000c},
{0 x01, 0 xfff4, 0 x000d},
{0 x01, 0 xfffc, 0 x000e},
{0 x01, 0 xffe3, 0 x000f},
{0 x01, 0 x001f, 0 x0010},
{0 x01, 0 x00a8, 0 x0001},
{0 x01, 0 x0067, 0 x0007},
{0 x01, 0 x0042, 0 x0051},
{0 x01, 0 x0051, 0 x0053},
{0 x01, 0 x000a, 0 x0003},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xc000, 0 x0001},
{0 x02, 0 x0000, 0 x0005},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x2000, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0015, 0 x0001},
{0 x05, 0 x00ea, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0023, 0 x0001},
{0 x05, 0 x0003, 0 x0000},
{0 x05, 0 x0030, 0 x0001},
{0 x05, 0 x002b, 0 x0000},
{0 x05, 0 x0031, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0032, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0033, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0034, 0 x0001},
{0 x05, 0 x0002, 0 x0000},
{0 x05, 0 x0050, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0051, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0052, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0054, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x00, 0 x0000, 0 x0001},
{0 x00, 0 x0000, 0 x0002},
{0 x00, 0 x000c, 0 x0003},
{0 x00, 0 x0000, 0 x0004},
{0 x00, 0 x0090, 0 x0005},
{0 x00, 0 x0000, 0 x0006},
{0 x00, 0 x0040, 0 x0007},
{0 x00, 0 x00c0, 0 x0008},
{0 x00, 0 x004a, 0 x0009},
{0 x00, 0 x0000, 0 x000a},
{0 x00, 0 x0000, 0 x000b},
{0 x00, 0 x0001, 0 x000c},
{0 x00, 0 x0001, 0 x000d},
{0 x00, 0 x0000, 0 x000e},
{0 x00, 0 x0002, 0 x000f},
{0 x00, 0 x0001, 0 x0010},
{0 x00, 0 x0000, 0 x0011},
{0 x00, 0 x0000, 0 x0012},
{0 x00, 0 x0002, 0 x0020},
{0 x00, 0 x0080, 0 x0021},
{0 x00, 0 x0001, 0 x0022},
{0 x00, 0 x00e0, 0 x0023},
{0 x00, 0 x0000, 0 x0024},
{0 x00, 0 x00d5, 0 x0025},
{0 x00, 0 x0000, 0 x0026},
{0 x00, 0 x000b, 0 x0027},
{0 x00, 0 x0000, 0 x0046},
{0 x00, 0 x0000, 0 x0047},
{0 x00, 0 x0000, 0 x0048},
{0 x00, 0 x0000, 0 x0049},
{0 x00, 0 x0008, 0 x004a},
{0 xff, 0 x0000, 0 x00d0},
{0 xff, 0 x00d8, 0 x00d1},
{0 xff, 0 x0000, 0 x00d4},
{0 xff, 0 x0000, 0 x00d5},
{0 x01, 0 x00a6, 0 x0000},
{0 x01, 0 x0028, 0 x0001},
{0 x01, 0 x0000, 0 x0002},
{0 x01, 0 x000a, 0 x0003},
{0 x01, 0 x0040, 0 x0004},
{0 x01, 0 x0066, 0 x0007},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 x00fd, 0 x000a},
{0 x01, 0 x0038, 0 x000b},
{0 x01, 0 x00d1, 0 x000c},
{0 x01, 0 x00f7, 0 x000d},
{0 x01, 0 x00ed, 0 x000e},
{0 x01, 0 x00d8, 0 x000f},
{0 x01, 0 x0038, 0 x0010},
{0 x01, 0 x00ff, 0 x0015},
{0 x01, 0 x0001, 0 x0016},
{0 x01, 0 x0032, 0 x0017},
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x0000, 0 x001f},
{0 x01, 0 x0000, 0 x0020},
{0 x01, 0 x00ff, 0 x003e},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0000, 0 x0040},
{0 x01, 0 x0035, 0 x0041},
{0 x01, 0 x0053, 0 x0042},
{0 x01, 0 x0069, 0 x0043},
{0 x01, 0 x007c, 0 x0044},
{0 x01, 0 x008c, 0 x0045},
{0 x01, 0 x009a, 0 x0046},
{0 x01, 0 x00a8, 0 x0047},
{0 x01, 0 x00b4, 0 x0048},
{0 x01, 0 x00bf, 0 x0049},
{0 x01, 0 x00ca, 0 x004a},
{0 x01, 0 x00d4, 0 x004b},
{0 x01, 0 x00dd, 0 x004c},
{0 x01, 0 x00e7, 0 x004d},
{0 x01, 0 x00ef, 0 x004e},
{0 x01, 0 x00f8, 0 x004f},
{0 x01, 0 x00ff, 0 x0050},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0060, 0 x0057},
{0 x01, 0 x0040, 0 x0058},
{0 x01, 0 x0011, 0 x0059},
{0 x01, 0 x0001, 0 x005a},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x0015, 0 x0006},
{0 x02, 0 x100a, 0 x0007},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x000f, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0025, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0001, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0020, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x00, 0 x0090, 0 x0005},
{0 x01, 0 x00a6, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x2000, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0015, 0 x0001},
{0 x05, 0 x00ea, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0023, 0 x0001},
{0 x05, 0 x0003, 0 x0000},
{0 x05, 0 x0030, 0 x0001},
{0 x05, 0 x002b, 0 x0000},
{0 x05, 0 x0031, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0032, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0033, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0034, 0 x0001},
{0 x05, 0 x0002, 0 x0000},
{0 x05, 0 x0050, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0051, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0052, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0054, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x00, 0 x0000, 0 x0001},
{0 x00, 0 x0000, 0 x0002},
{0 x00, 0 x000c, 0 x0003},
{0 x00, 0 x0000, 0 x0004},
{0 x00, 0 x0090, 0 x0005},
{0 x00, 0 x0000, 0 x0006},
{0 x00, 0 x0040, 0 x0007},
{0 x00, 0 x00c0, 0 x0008},
{0 x00, 0 x004a, 0 x0009},
{0 x00, 0 x0000, 0 x000a},
{0 x00, 0 x0000, 0 x000b},
{0 x00, 0 x0001, 0 x000c},
{0 x00, 0 x0001, 0 x000d},
{0 x00, 0 x0000, 0 x000e},
{0 x00, 0 x0002, 0 x000f},
{0 x00, 0 x0001, 0 x0010},
{0 x00, 0 x0000, 0 x0011},
{0 x00, 0 x0000, 0 x0012},
{0 x00, 0 x0002, 0 x0020},
{0 x00, 0 x0080, 0 x0021},
{0 x00, 0 x0001, 0 x0022},
{0 x00, 0 x00e0, 0 x0023},
{0 x00, 0 x0000, 0 x0024},
{0 x00, 0 x00d5, 0 x0025},
{0 x00, 0 x0000, 0 x0026},
{0 x00, 0 x000b, 0 x0027},
{0 x00, 0 x0000, 0 x0046},
{0 x00, 0 x0000, 0 x0047},
{0 x00, 0 x0000, 0 x0048},
{0 x00, 0 x0000, 0 x0049},
{0 x00, 0 x0008, 0 x004a},
{0 xff, 0 x0000, 0 x00d0},
{0 xff, 0 x00d8, 0 x00d1},
{0 xff, 0 x0000, 0 x00d4},
{0 xff, 0 x0000, 0 x00d5},
{0 x01, 0 x00a6, 0 x0000},
{0 x01, 0 x0028, 0 x0001},
{0 x01, 0 x0000, 0 x0002},
{0 x01, 0 x000a, 0 x0003},
{0 x01, 0 x0040, 0 x0004},
{0 x01, 0 x0066, 0 x0007},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 x00fd, 0 x000a},
{0 x01, 0 x0038, 0 x000b},
{0 x01, 0 x00d1, 0 x000c},
{0 x01, 0 x00f7, 0 x000d},
{0 x01, 0 x00ed, 0 x000e},
{0 x01, 0 x00d8, 0 x000f},
{0 x01, 0 x0038, 0 x0010},
{0 x01, 0 x00ff, 0 x0015},
{0 x01, 0 x0001, 0 x0016},
{0 x01, 0 x0032, 0 x0017},
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x0000, 0 x001f},
{0 x01, 0 x0000, 0 x0020},
{0 x01, 0 x00ff, 0 x003e},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0000, 0 x0040},
{0 x01, 0 x0035, 0 x0041},
{0 x01, 0 x0053, 0 x0042},
{0 x01, 0 x0069, 0 x0043},
{0 x01, 0 x007c, 0 x0044},
{0 x01, 0 x008c, 0 x0045},
{0 x01, 0 x009a, 0 x0046},
{0 x01, 0 x00a8, 0 x0047},
{0 x01, 0 x00b4, 0 x0048},
{0 x01, 0 x00bf, 0 x0049},
{0 x01, 0 x00ca, 0 x004a},
{0 x01, 0 x00d4, 0 x004b},
{0 x01, 0 x00dd, 0 x004c},
{0 x01, 0 x00e7, 0 x004d},
{0 x01, 0 x00ef, 0 x004e},
{0 x01, 0 x00f8, 0 x004f},
{0 x01, 0 x00ff, 0 x0050},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0060, 0 x0057},
{0 x01, 0 x0040, 0 x0058},
{0 x01, 0 x0011, 0 x0059},
{0 x01, 0 x0001, 0 x005a},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x0015, 0 x0006},
{0 x02, 0 x100a, 0 x0007},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x000f, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0025, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0001, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0020, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x00, 0 x0090, 0 x0005},
{0 x01, 0 x00a6, 0 x0000},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x001e, 0 x0000},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x0011, 0 x0008},
{0 x01, 0 x0032, 0 x0009},
{0 x01, 0 xfffd, 0 x000a},
{0 x01, 0 x0023, 0 x000b},
{0 x01, 0 xffea, 0 x000c},
{0 x01, 0 xfff4, 0 x000d},
{0 x01, 0 xfffc, 0 x000e},
{0 x01, 0 xffe3, 0 x000f},
{0 x01, 0 x001f, 0 x0010},
{0 x01, 0 x00a8, 0 x0001},
{0 x01, 0 x0067, 0 x0007},
{0 x01, 0 x0042, 0 x0051},
{0 x01, 0 x0051, 0 x0053},
{0 x01, 0 x000a, 0 x0003},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x0007, 0 x0005},
{0 x01, 0 x0042, 0 x0051},
{0 x01, 0 x0051, 0 x0053},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x002d, 0 x0000},
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0001, 0 x0056},
{0 x02, 0 xc000, 0 x0001},
{0 x02, 0 x0000, 0 x0005},
{}
};
/* Unknown camera from Ori Usbid 0x0000:0x0000 */
/* Based on snoops from Ori Cohen */
static const __u16 spca501c_mysterious_open_data[][3 ] = {
{0 x02, 0 x000f, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
/* DSP Registers */
{0 x01, 0 x0016, 0 x0011}, /* RGB offset */
{0 x01, 0 x0000, 0 x0012},
{0 x01, 0 x0006, 0 x0013},
{0 x01, 0 x0078, 0 x0051},
{0 x01, 0 x0040, 0 x0052},
{0 x01, 0 x0046, 0 x0053},
{0 x01, 0 x0040, 0 x0054},
{0 x00, 0 x0025, 0 x0000},
/* {0x00, 0x0000, 0x0000 }, */
/* Part 2 */
/* TG Registers */
{0 x00, 0 x0026, 0 x0000},
{0 x00, 0 x0001, 0 x0000},
{0 x00, 0 x0027, 0 x0000},
{0 x00, 0 x008a, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x2000, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0015, 0 x0001},
{0 x05, 0 x00ea, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0023, 0 x0001},
{0 x05, 0 x0003, 0 x0000},
{0 x05, 0 x0030, 0 x0001},
{0 x05, 0 x002b, 0 x0000},
{0 x05, 0 x0031, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0032, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0033, 0 x0001},
{0 x05, 0 x0023, 0 x0000},
{0 x05, 0 x0034, 0 x0001},
{0 x05, 0 x0002, 0 x0000},
{0 x05, 0 x0050, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0051, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0052, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0054, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{}
};
/* Based on snoops from Ori Cohen */
static const __u16 spca501c_mysterious_init_data[][3 ] = {
/* Part 3 */
/* TG registers */
/* {0x00, 0x0000, 0x0000}, */
{0 x00, 0 x0000, 0 x0001},
{0 x00, 0 x0000, 0 x0002},
{0 x00, 0 x0006, 0 x0003},
{0 x00, 0 x0000, 0 x0004},
{0 x00, 0 x0090, 0 x0005},
{0 x00, 0 x0000, 0 x0006},
{0 x00, 0 x0040, 0 x0007},
{0 x00, 0 x00c0, 0 x0008},
{0 x00, 0 x004a, 0 x0009},
{0 x00, 0 x0000, 0 x000a},
{0 x00, 0 x0000, 0 x000b},
{0 x00, 0 x0001, 0 x000c},
{0 x00, 0 x0001, 0 x000d},
{0 x00, 0 x0000, 0 x000e},
{0 x00, 0 x0002, 0 x000f},
{0 x00, 0 x0001, 0 x0010},
{0 x00, 0 x0000, 0 x0011},
{0 x00, 0 x0001, 0 x0012},
{0 x00, 0 x0002, 0 x0020},
{0 x00, 0 x0080, 0 x0021}, /* 640 */
{0 x00, 0 x0001, 0 x0022},
{0 x00, 0 x00e0, 0 x0023}, /* 480 */
{0 x00, 0 x0000, 0 x0024}, /* Offset H hight */
{0 x00, 0 x00d3, 0 x0025}, /* low */
{0 x00, 0 x0000, 0 x0026}, /* Offset V */
{0 x00, 0 x000d, 0 x0027}, /* low */
{0 x00, 0 x0000, 0 x0046},
{0 x00, 0 x0000, 0 x0047},
{0 x00, 0 x0000, 0 x0048},
{0 x00, 0 x0000, 0 x0049},
{0 x00, 0 x0008, 0 x004a},
/* DSP Registers */
{0 x01, 0 x00a6, 0 x0000},
{0 x01, 0 x0028, 0 x0001},
{0 x01, 0 x0000, 0 x0002},
{0 x01, 0 x000a, 0 x0003}, /* Level Calc bit7 ->1 Auto */
{0 x01, 0 x0040, 0 x0004},
{0 x01, 0 x0066, 0 x0007},
{0 x01, 0 x000f, 0 x0008}, /* A11 Color correction coeff */
{0 x01, 0 x002d, 0 x0009}, /* A12 */
{0 x01, 0 x0005, 0 x000a}, /* A13 */
{0 x01, 0 x0023, 0 x000b}, /* A21 */
{0 x01, 0 x00e0, 0 x000c}, /* A22 */
{0 x01, 0 x00fd, 0 x000d}, /* A23 */
{0 x01, 0 x00f4, 0 x000e}, /* A31 */
{0 x01, 0 x00e4, 0 x000f}, /* A32 */
{0 x01, 0 x0028, 0 x0010}, /* A33 */
{0 x01, 0 x00ff, 0 x0015}, /* Reserved */
{0 x01, 0 x0001, 0 x0016}, /* Reserved */
{0 x01, 0 x0032, 0 x0017}, /* Win1 Start begin */
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x0000, 0 x001f},
{0 x01, 0 x0000, 0 x0020}, /* Win1 Start end */
{0 x01, 0 x00ff, 0 x003e}, /* Reserved begin */
{0 x01, 0 x0002, 0 x003f},
{0 x01, 0 x0000, 0 x0040},
{0 x01, 0 x0035, 0 x0041},
{0 x01, 0 x0053, 0 x0042},
{0 x01, 0 x0069, 0 x0043},
{0 x01, 0 x007c, 0 x0044},
{0 x01, 0 x008c, 0 x0045},
{0 x01, 0 x009a, 0 x0046},
{0 x01, 0 x00a8, 0 x0047},
{0 x01, 0 x00b4, 0 x0048},
{0 x01, 0 x00bf, 0 x0049},
{0 x01, 0 x00ca, 0 x004a},
{0 x01, 0 x00d4, 0 x004b},
{0 x01, 0 x00dd, 0 x004c},
{0 x01, 0 x00e7, 0 x004d},
{0 x01, 0 x00ef, 0 x004e},
{0 x01, 0 x00f8, 0 x004f},
{0 x01, 0 x00ff, 0 x0050},
{0 x01, 0 x0003, 0 x0056}, /* Reserved end */
{0 x01, 0 x0060, 0 x0057}, /* Edge Gain */
{0 x01, 0 x0040, 0 x0058},
{0 x01, 0 x0011, 0 x0059}, /* Edge Bandwidth */
{0 x01, 0 x0001, 0 x005a},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 x0007, 0 x0005},
{0 x02, 0 x0015, 0 x0006},
{0 x02, 0 x200a, 0 x0007},
{0 x02, 0 xa048, 0 x0000},
{0 x02, 0 xc000, 0 x0001},
{0 x02, 0 x000f, 0 x0005},
{0 x02, 0 xa048, 0 x0000},
{0 x05, 0 x0022, 0 x0004},
{0 x05, 0 x0025, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
/* Part 4 */
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0001, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x05, 0 x0021, 0 x0001},
{0 x05, 0 x00d2, 0 x0000},
{0 x05, 0 x0020, 0 x0001},
{0 x05, 0 x0000, 0 x0000},
{0 x00, 0 x0090, 0 x0005},
{0 x01, 0 x00a6, 0 x0000},
{0 x02, 0 x0000, 0 x0005},
{0 x05, 0 x0026, 0 x0001},
{0 x05, 0 x0001, 0 x0000},
{0 x05, 0 x0027, 0 x0001},
{0 x05, 0 x004e, 0 x0000},
/* Part 5 */
{0 x01, 0 x0003, 0 x003f},
{0 x01, 0 x0001, 0 x0056},
{0 x01, 0 x000f, 0 x0008},
{0 x01, 0 x002d, 0 x0009},
{0 x01, 0 x0005, 0 x000a},
{0 x01, 0 x0023, 0 x000b},
{0 x01, 0 xffe0, 0 x000c},
{0 x01, 0 xfffd, 0 x000d},
{0 x01, 0 xfff4, 0 x000e},
{0 x01, 0 xffe4, 0 x000f},
{0 x01, 0 x0028, 0 x0010},
{0 x01, 0 x00a8, 0 x0001},
{0 x01, 0 x0066, 0 x0007},
{0 x01, 0 x0032, 0 x0017},
{0 x01, 0 x0023, 0 x0018},
{0 x01, 0 x00ce, 0 x0019},
{0 x01, 0 x0023, 0 x001a},
{0 x01, 0 x0032, 0 x001b},
{0 x01, 0 x008d, 0 x001c},
{0 x01, 0 x00ce, 0 x001d},
{0 x01, 0 x008d, 0 x001e},
{0 x01, 0 x00c8, 0 x0015}, /* c8 Poids fort Luma */
{0 x01, 0 x0032, 0 x0016}, /* 32 */
{0 x01, 0 x0016, 0 x0011}, /* R 00 */
{0 x01, 0 x0016, 0 x0012}, /* G 00 */
{0 x01, 0 x0016, 0 x0013}, /* B 00 */
{0 x01, 0 x000a, 0 x0003},
{0 x02, 0 xc002, 0 x0001},
{0 x02, 0 x0007, 0 x0005},
{}
};
static int reg_write(struct gspca_dev *gspca_dev,
__u16 req, __u16 index, __u16 value)
{
int ret;
struct usb_device *dev = gspca_dev->dev;
ret = usb_control_msg(dev,
usb_sndctrlpipe(dev, 0 ),
req,
USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value, index, NULL, 0 , 500 );
gspca_dbg(gspca_dev, D_USBO, "reg write: 0x%02x 0x%02x 0x%02x\n" ,
req, index, value);
if (ret < 0 )
pr_err("reg write: error %d\n" , ret);
return ret;
}
static int write_vector(struct gspca_dev *gspca_dev, const __u16 data[][3 ])
{
int ret, i = 0 ;
while (data[i][0 ] != 0 || data[i][1 ] != 0 || data[i][2 ] != 0 ) {
ret = reg_write(gspca_dev, data[i][0 ], data[i][2 ],
data[i][1 ]);
if (ret < 0 ) {
gspca_err(gspca_dev, "Reg write failed for 0x%02x,0x%02x,0x%02x\n" ,
data[i][0 ], data[i][1 ], data[i][2 ]);
return ret;
}
i++;
}
return 0 ;
}
static void setbrightness(struct gspca_dev *gspca_dev, s32 val)
{
reg_write(gspca_dev, SPCA501_REG_CCDSP, 0 x12, val);
}
static void setcontrast(struct gspca_dev *gspca_dev, s32 val)
{
reg_write(gspca_dev, 0 x00, 0 x00, (val >> 8 ) & 0 xff);
reg_write(gspca_dev, 0 x00, 0 x01, val & 0 xff);
}
static void setcolors(struct gspca_dev *gspca_dev, s32 val)
{
reg_write(gspca_dev, SPCA501_REG_CCDSP, 0 x0c, val);
}
static void setblue_balance(struct gspca_dev *gspca_dev, s32 val)
{
reg_write(gspca_dev, SPCA501_REG_CCDSP, 0 x11, val);
}
static void setred_balance(struct gspca_dev *gspca_dev, s32 val)
{
reg_write(gspca_dev, SPCA501_REG_CCDSP, 0 x13, val);
}
/* this function is called at probe time */
static int sd_config(struct gspca_dev *gspca_dev,
const struct usb_device_id *id)
{
struct sd *sd = (struct sd *) gspca_dev;
struct cam *cam;
cam = &gspca_dev->cam;
cam->cam_mode = vga_mode;
cam->nmodes = ARRAY_SIZE(vga_mode);
sd->subtype = id->driver_info;
return 0 ;
}
/* this function is called at probe and resume time */
static int sd_init(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
switch (sd->subtype) {
case Arowana300KCMOSCamera:
case SmileIntlCamera:
/* Arowana 300k CMOS Camera data */
if (write_vector(gspca_dev, spca501c_arowana_init_data))
goto error;
break ;
case MystFromOriUnknownCamera:
/* Unknown Ori CMOS Camera data */
if (write_vector(gspca_dev, spca501c_mysterious_open_data))
goto error;
break ;
default :
/* generic spca501 init data */
if (write_vector(gspca_dev, spca501_init_data))
goto error;
break ;
}
gspca_dbg(gspca_dev, D_STREAM, "Initializing SPCA501 finished\n" );
return 0 ;
error:
return -EINVAL;
}
static int sd_start(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
int mode;
switch (sd->subtype) {
case ThreeComHomeConnectLite:
/* Special handling for 3com data */
write_vector(gspca_dev, spca501_3com_open_data);
break ;
case Arowana300KCMOSCamera:
case SmileIntlCamera:
/* Arowana 300k CMOS Camera data */
write_vector(gspca_dev, spca501c_arowana_open_data);
break ;
case MystFromOriUnknownCamera:
/* Unknown CMOS Camera data */
write_vector(gspca_dev, spca501c_mysterious_init_data);
break ;
default :
/* Generic 501 open data */
write_vector(gspca_dev, spca501_open_data);
}
/* memorize the wanted pixel format */
mode = gspca_dev->cam.cam_mode[(int ) gspca_dev->curr_mode].priv;
/* Enable ISO packet machine CTRL reg=2,
* index=1 bitmask=0x2 (bit ordinal 1) */
reg_write(gspca_dev, SPCA50X_REG_USB, 0 x6, 0 x94);
switch (mode) {
case 0 : /* 640x480 */
reg_write(gspca_dev, SPCA50X_REG_USB, 0 x07, 0 x004a);
break ;
case 1 : /* 320x240 */
reg_write(gspca_dev, SPCA50X_REG_USB, 0 x07, 0 x104a);
break ;
default :
/* case 2: * 160x120 */
reg_write(gspca_dev, SPCA50X_REG_USB, 0 x07, 0 x204a);
break ;
}
reg_write(gspca_dev, SPCA501_REG_CTLRL, 0 x01, 0 x02);
return 0 ;
}
static void sd_stopN(struct gspca_dev *gspca_dev)
{
/* Disable ISO packet
* machine CTRL reg=2, index=1 bitmask=0x0 (bit ordinal 1) */
reg_write(gspca_dev, SPCA501_REG_CTLRL, 0 x01, 0 x00);
}
/* called on streamoff with alt 0 and on disconnect */
static void sd_stop0(struct gspca_dev *gspca_dev)
{
if (!gspca_dev->present)
return ;
reg_write(gspca_dev, SPCA501_REG_CTLRL, 0 x05, 0 x00);
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
switch (data[0 ]) {
case 0 : /* start of frame */
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0 );
data += SPCA501_OFFSET_DATA;
len -= SPCA501_OFFSET_DATA;
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
return ;
case 0 xff: /* drop */
/* gspca_dev->last_packet_type = DISCARD_PACKET; */
return ;
}
data++;
len--;
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct gspca_dev *gspca_dev =
container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
gspca_dev->usb_err = 0 ;
if (!gspca_dev->streaming)
return 0 ;
switch (ctrl->id) {
case V4L2_CID_BRIGHTNESS:
setbrightness(gspca_dev, ctrl->val);
break ;
case V4L2_CID_CONTRAST:
setcontrast(gspca_dev, ctrl->val);
break ;
case V4L2_CID_SATURATION:
setcolors(gspca_dev, ctrl->val);
break ;
case V4L2_CID_BLUE_BALANCE:
setblue_balance(gspca_dev, ctrl->val);
break ;
case V4L2_CID_RED_BALANCE:
setred_balance(gspca_dev, ctrl->val);
break ;
}
return gspca_dev->usb_err;
}
static const struct v4l2_ctrl_ops sd_ctrl_ops = {
.s_ctrl = sd_s_ctrl,
};
static int sd_init_controls(struct gspca_dev *gspca_dev)
{
struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
gspca_dev->vdev.ctrl_handler = hdl;
v4l2_ctrl_handler_init(hdl, 5 );
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
V4L2_CID_BRIGHTNESS, 0 , 127 , 1 , 0 );
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
V4L2_CID_CONTRAST, 0 , 64725 , 1 , 64725 );
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
V4L2_CID_SATURATION, 0 , 63 , 1 , 20 );
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
V4L2_CID_BLUE_BALANCE, 0 , 127 , 1 , 0 );
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
V4L2_CID_RED_BALANCE, 0 , 127 , 1 , 0 );
if (hdl->error) {
pr_err("Could not initialize controls\n" );
return hdl->error;
}
return 0 ;
}
/* sub-driver description */
static const struct sd_desc sd_desc = {
.name = MODULE_NAME,
.config = sd_config,
.init = sd_init,
.init_controls = sd_init_controls,
.start = sd_start,
.stopN = sd_stopN,
.stop0 = sd_stop0,
.pkt_scan = sd_pkt_scan,
};
/* -- module initialisation -- */
static const struct usb_device_id device_table[] = {
{USB_DEVICE(0 x040a, 0 x0002), .driver_info = KodakDVC325},
{USB_DEVICE(0 x0497, 0 xc001), .driver_info = SmileIntlCamera},
{USB_DEVICE(0 x0506, 0 x00df), .driver_info = ThreeComHomeConnectLite},
{USB_DEVICE(0 x0733, 0 x0401), .driver_info = IntelCreateAndShare},
{USB_DEVICE(0 x0733, 0 x0402), .driver_info = ViewQuestM318B},
{USB_DEVICE(0 x1776, 0 x501c), .driver_info = Arowana300KCMOSCamera},
{USB_DEVICE(0 x0000, 0 x0000), .driver_info = MystFromOriUnknownCamera},
{}
};
MODULE_DEVICE_TABLE(usb, device_table);
/* -- device connect -- */
static int sd_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
return gspca_dev_probe(intf, id, &sd_desc, sizeof (struct sd),
THIS_MODULE);
}
static struct usb_driver sd_driver = {
.name = MODULE_NAME,
.id_table = device_table,
.probe = sd_probe,
.disconnect = gspca_disconnect,
#ifdef CONFIG_PM
.suspend = gspca_suspend,
.resume = gspca_resume,
.reset_resume = gspca_resume,
#endif
};
module_usb_driver(sd_driver);
Messung V0.5 in Prozent C=91 H=96 G=93