Commit c3ee142b authored by Jean-François Moine's avatar Jean-François Moine Committed by Mauro Carvalho Chehab

[media] gspca - nw80x: Cleanup source

Signed-off-by: default avatarJean-François Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b1a873a3
......@@ -53,7 +53,7 @@ struct sd {
};
enum bridges {
BRIDGE_NW800, /* et31x110 */
BRIDGE_NW800, /* and et31x110 */
BRIDGE_NW801,
BRIDGE_NW802,
};
......@@ -145,7 +145,7 @@ enum webcams {
nw801/nw802 320x240 - 640x480
*/
static const struct v4l2_pix_format sif_mode[] = {
static const struct v4l2_pix_format cif_mode[] = {
{352, 288, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
.bytesperline = 352,
.sizeimage = 352 * 288 * 4 / 8,
......@@ -171,6 +171,7 @@ static const struct v4l2_pix_format vga_mode[] = {
* - n bytes: data
*/
#define I2C0 0xff
static const u8 nw800_init[] = {
0x05, 0x00, 0x01, 0x55,
0x10, 0x9b, 0x01, 0xaa,
......@@ -333,8 +334,9 @@ static const u8 nw800_init[] = {
0, 0, 0
};
/* 06a5:d001 - nw801 - p35u */
static const u8 nw801_init_1[] = {
/* 06a5:d001 - nw801 - Panasonic
* P35u */
static const u8 nw801_start_1[] = {
0x05, 0x06, 0x01, 0x04,
0x00, 0x00, 0x40, 0x0e, 0x00, 0x00, 0xf9, 0x02, 0x11, 0x00, 0x0e,
0x01, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
......@@ -389,7 +391,7 @@ static const u8 nw801_init_1[] = {
0xf0, 0x00,
0, 0, 0,
};
static const u8 nw801_init_qvga[] = {
static const u8 nw801_start_qvga[] = {
0x02, 0x00, 0x10, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
0x00, 0x78, 0x18, 0x0b, 0x06, 0xa2, 0x86, 0x78,
0x02, 0x0f, 0x01, 0x6b,
......@@ -401,7 +403,7 @@ static const u8 nw801_init_qvga[] = {
/* AE window */
0, 0, 0,
};
static const u8 nw801_init_vga[] = {
static const u8 nw801_start_vga[] = {
0x02, 0x00, 0x10, 0x78, 0xa0, 0x97, 0x78, 0xa0, 0x00, 0x00, 0x00,
0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xf0,
0x02, 0x0f, 0x01, 0xd5,
......@@ -412,7 +414,7 @@ static const u8 nw801_init_vga[] = {
0x10, 0x11, 0x08, 0x51, 0x00, 0x30, 0x02, 0x3d, 0x00, 0xa4, 0x01,
0, 0, 0,
};
static const u8 nw801_init_2[] = {
static const u8 nw801_start_2[] = {
0x10, 0x04, 0x01, 0x1a,
0x10, 0x19, 0x01, 0x09, /* clock */
0x10, 0x24, 0x06, 0xc0, 0x00, 0x3f, 0x02, 0x00, 0x01,
......@@ -441,7 +443,7 @@ static const u8 nw801_init_2[] = {
};
/* nw802 (sharp IR3Y38M?) */
static const u8 nw802_init[] = {
static const u8 nw802_start[] = {
0x04, 0x06, 0x01, 0x04,
0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0xf9, 0x02, 0x10, 0x00, 0x4d,
0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
......@@ -524,7 +526,6 @@ static const u8 nw802_init[] = {
};
/* et31x110 - Trust 120 SpaceCam */
static const u8 spacecam_init[] = {
/*fixme: at connection time*/
0x04, 0x05, 0x01, 0x01,
0x04, 0x04, 0x01, 0x01,
0x04, 0x06, 0x01, 0x04,
......@@ -617,13 +618,8 @@ static const u8 spacecam_init[] = {
0x04, 0x04, 0x01, 0x40,
0, 0, 0
};
/* et31x110 - other Trust SpaceCam120 */
static const u8 spacecam2_init[] = {
0x04, 0x05, 0x01, 0x61,
0x04, 0x04, 0x01, 0x01,
0x04, 0x06, 0x01, 0x04,
0x04, 0x04, 0x03, 0x00, 0x00, 0x00,
0x05, 0x05, 0x01, 0x00,
/* et31x110 - pas106 - other Trust SpaceCam120 */
static const u8 spacecam2_start[] = {
0x04, 0x06, 0x01, 0x44,
0x04, 0x06, 0x01, 0x00,
0x00, 0x00, 0x40, 0x14, 0x83, 0x00, 0xba, 0x01, 0x10, 0x00, 0x4f,
......@@ -682,79 +678,25 @@ static const u8 spacecam2_init[] = {
0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
0x04, 0x04, 0x01, 0x40,
0x04, 0x04, 0x01, 0x00,
#if 1
I2C0, 0x40, 0x0c, 0x02, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x05,
0x00, 0x00, 0x05, 0x05,
I2C0, 0x40, 0x02, 0x11, 0x06,
I2C0, 0x40, 0x02, 0x14, 0x00,
I2C0, 0x40, 0x02, 0x13, 0x01,
#else
0x06, 0x00, 0x0b, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00,
0x00, 0x05, 0x05,
0x06, 0x00, 0x0c, 0x02, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x05,
0x00, 0x00, 0x05, 0x05,
0x05, 0x02, 0x02, 0x0c, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x06,
0x06, 0x00, 0x02, 0x11, 0x06,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x00,
0x06, 0x00, 0x02, 0x14, 0x00,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x01,
0x06, 0x00, 0x02, 0x13, 0x01,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
#endif
I2C0, 0x40, 0x02, 0x13, 0x01, /* i2c end */
0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
0x40,
#if 1
I2C0, 0x40, 0x02, 0x02, 0x0c,
I2C0, 0x40, 0x02, 0x02, 0x0c, /* pixel clock */
I2C0, 0x40, 0x02, 0x0f, 0x00,
I2C0, 0x40, 0x02, 0x13, 0x01,
#else
0x06, 0x00, 0x01, 0x0c,
0x06, 0x00, 0x02, 0x02, 0x0c,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x00,
0x06, 0x00, 0x02, 0x0f, 0x00,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x01,
0x06, 0x00, 0x02, 0x13, 0x01,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
#endif
I2C0, 0x40, 0x02, 0x13, 0x01, /* i2c end */
0x10, 0x00, 0x01, 0x01,
0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
0x20, 0x01, 0x60, 0x01,
#if 1
I2C0, 0x40, 0x02, 0x05, 0x0f,
I2C0, 0x40, 0x02, 0x13, 0x01,
I2C0, 0x40, 0x02, 0x05, 0x0f, /* exposure */
I2C0, 0x40, 0x02, 0x13, 0x01, /* i2c end */
I2C0, 0x40, 0x07, 0x09, 0x0b, 0x0f, 0x05, 0x05, 0x0f, 0x00,
/* gains */
I2C0, 0x40, 0x03, 0x12, 0x04, 0x01,
#else
0x06, 0x00, 0x01, 0x0f,
0x06, 0x00, 0x02, 0x05, 0x0f,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x01,
0x06, 0x00, 0x02, 0x13, 0x01,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x06, 0x0b, 0x0f, 0x05, 0x05, 0x0f, 0x00,
0x06, 0x00, 0x07, 0x09, 0x0b, 0x0f, 0x05, 0x05, 0x0f, 0x00,
0x05, 0x02, 0x02, 0x07, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x02, 0x04, 0x01,
0x06, 0x00, 0x03, 0x12, 0x04, 0x01,
0x05, 0x02, 0x02, 0x03, 0x40,
0x05, 0x05, 0x01, 0x01,
#endif
0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
0x10, 0x0e, 0x01, 0x08,
0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
......@@ -776,7 +718,7 @@ static const u8 spacecam2_init[] = {
};
/* nw802 - Conceptronic Video Pro */
static const u8 cvideopro_init[] = {
static const u8 cvideopro_start[] = {
0x04, 0x06, 0x01, 0x04,
0x00, 0x00, 0x40, 0x54, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x4c,
0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
......@@ -856,10 +798,9 @@ static const u8 cvideopro_init[] = {
};
/* nw802 - D-link dru-350c cam */
static const u8 dlink_init[] = {
static const u8 dlink_start[] = {
0x04, 0x06, 0x01, 0x04,
0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x92, 0x03, 0x10, 0x00, 0x4d,
/* 0xf9, 0x02, = nb pixels per line */
0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
......@@ -878,7 +819,6 @@ static const u8 dlink_init[] = {
0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x68, 0x00,
0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
0x00, 0x0c, 0x02, 0x01, 0x00, 0x16, 0x00, 0x94,
/* 0x19, v index of clamping pulse */
0x00, 0x10, 0x06, 0x10, 0x00, 0x36, 0x00,
0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
......@@ -909,7 +849,6 @@ static const u8 dlink_init[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x82,
0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
0x01, 0xf0, 0x00,
/* 0x00, 0x03, 0x02, 0x92, 0x03, = nb of pixels per line */
0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
0x40,
......@@ -938,8 +877,10 @@ static const u8 dlink_init[] = {
0, 0, 0
};
/* nw801 - Plustek Opticam 500U or ProLink DS3303u (Hitachi HD49322BF) */
static const u8 ds330_init[] = {
/* 06a5:d001 - nw801 - Sony
* Plustek Opticam 500U or ProLink DS3303u (Hitachi HD49322BF) */
/*fixme: 320x240 only*/
static const u8 ds3303_start[] = {
0x05, 0x06, 0x01, 0x04,
0x00, 0x00, 0x40, 0x16, 0x00, 0x00, 0xf9, 0x02, 0x11, 0x00, 0x0e,
0x01, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
......@@ -1021,8 +962,9 @@ static const u8 ds330_init[] = {
0, 0, 0
};
/* 06a5:d001 - nw802 - Panasonic GP-KR651US (Philips TDA8786) */
static const u8 kr651_init_1[] = {
/* 06a5:d001 - nw802 - Panasonic
* GP-KR651US (Philips TDA8786) */
static const u8 kr651_start_1[] = {
0x04, 0x06, 0x01, 0x04,
0x00, 0x00, 0x40, 0x44, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x48,
0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
......@@ -1075,7 +1017,7 @@ static const u8 kr651_init_1[] = {
0x01, 0xf0, 0x00,
0, 0, 0
};
static const u8 kr651_init_qvga[] = {
static const u8 kr651_start_qvga[] = {
0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
0x40,
......@@ -1088,21 +1030,19 @@ static const u8 kr651_init_qvga[] = {
0x10, 0x1d, 0x02, 0x28, 0x01,
0, 0, 0
};
static const u8 kr651_init_vga[] = {
static const u8 kr651_start_vga[] = {
0x02, 0x00, 0x11, 0x78, 0xa0, 0x8c, 0x78, 0xa0, 0x00, 0x00, 0x00,
0x00, 0xf0, 0x30, 0x03, 0x01, 0x82, 0x82, 0x98,
0x80,
0x10, 0x1a, 0x01, 0x03,
0x10, 0x00, 0x01, 0xa0,
0x10, 0x85, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
0x10, 0x1b, 0x02, 0x00, 0x00,
0x10, 0x11, 0x08, 0x51, 0x00, 0x30, 0x02, 0x3d, 0x00, 0xa4, 0x01,
0x10, 0x1d, 0x06, 0xe0, 0x00, 0x0c, 0x00, 0x52, 0x00,
0x10, 0x1d, 0x02, 0x68, 0x00,
};
static const u8 kr651_init_2[] = {
static const u8 kr651_start_2[] = {
0x10, 0x0e, 0x01, 0x08,
0x10, 0x41, 0x11, 0x00, 0x11, 0x3c, 0x5c, 0x74, 0x88, 0x99, 0xa8,
0xb7, 0xc4, 0xd0, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
......@@ -1122,7 +1062,7 @@ static const u8 kr651_init_2[] = {
};
/* nw802 - iRez Kritter cam */
static const u8 kritter_init[] = {
static const u8 kritter_start[] = {
0x04, 0x06, 0x01, 0x06,
0x00, 0x00, 0x40, 0x44, 0x96, 0x98, 0x94, 0x03, 0x18, 0x00, 0x48,
0x0f, 0x1e, 0x00, 0x0c, 0x02, 0x01, 0x00, 0x19,
......@@ -1202,7 +1142,7 @@ static const u8 kritter_init[] = {
};
/* nw802 - Mustek Wcam 300 mini */
static const u8 mustek_init[] = {
static const u8 mustek_start[] = {
0x04, 0x06, 0x01, 0x04,
0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x92, 0x03, 0x10, 0x00, 0x4d,
0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
......@@ -1337,7 +1277,7 @@ static const u8 proscope_init_1[] = {
0x01, 0xf0, 0x00,
0, 0, 0
};
static const u8 proscope_init_qvga[] = {
static const u8 proscope_start_qvga[] = {
0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
0x40,
......@@ -1350,7 +1290,7 @@ static const u8 proscope_init_qvga[] = {
0x10, 0x0e, 0x01, 0x10,
0, 0, 0
};
static const u8 proscope_init_vga[] = {
static const u8 proscope_start_vga[] = {
0x00, 0x03, 0x02, 0xf9, 0x02,
0x10, 0x85, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
0x02, 0x00, 0x11, 0x78, 0xa0, 0x8c, 0x78, 0xa0, 0x00, 0x00, 0x00,
......@@ -1368,7 +1308,7 @@ static const u8 proscope_init_vga[] = {
0x10, 0x03, 0x01, 0x00,
0, 0, 0
};
static const u8 proscope_init_2[] = {
static const u8 proscope_start_2[] = {
0x10, 0x0f, 0x02, 0x0c, 0x0c,
0x10, 0x03, 0x01, 0x0c,
0x10, 0x41, 0x11, 0x00, 0x10, 0x51, 0x6e, 0x83, 0x93, 0xa1, 0xae,
......@@ -1383,14 +1323,8 @@ static const u8 proscope_init_2[] = {
0, 0, 0
};
/* nw800 - Divio Chicony TwinkleCam */
static const u8 twinkle_init[] = {
0x04, 0x05, 0x01, 0x61,
0x04, 0x04, 0x01, 0x01,
0x04, 0x06, 0x01, 0x04,
0x04, 0x04, 0x03, 0x00, 0x00, 0x00,
0x05, 0x05, 0x01, 0x00,
/* nw800 - hv7121b? (seems pas106) - Divio Chicony TwinkleCam */
static const u8 twinkle_start[] = {
0x04, 0x06, 0x01, 0x44,
0x04, 0x06, 0x01, 0x00,
0x00, 0x00, 0x40, 0x14, 0x83, 0x00, 0xba, 0x01, 0x10, 0x00, 0x4f,
......@@ -1448,107 +1382,32 @@ static const u8 twinkle_init[] = {
0x01, 0x60, 0x01, 0x00, 0x00,
0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
/*320 3f ef, 0x00 */
0x04, 0x04, 0x01, 0x10,
0x04, 0x04, 0x01, 0x00,
0x04, 0x05, 0x01, 0x61,
0x04, 0x04, 0x01, 0x01,
#if 1
I2C0, 0x40, 0x0c, 0x02, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0a,
I2C0, 0x40, 0x02, 0x11, 0x06,
I2C0, 0x40, 0x02, 0x14, 0x00,
I2C0, 0x40, 0x02, 0x13, 0x01,
I2C0, 0x40, 0x02, 0x13, 0x01, /* i2c end */
I2C0, 0x40, 0x02, 0x07, 0x01,
#else
0x06, 0x00, 0x0b, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0a,
0x06, 0x00, 0x0c, 0x02, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0a,
0x05, 0x02, 0x02, 0x0c, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x06,
0x06, 0x00, 0x02, 0x11, 0x06,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x00,
0x06, 0x00, 0x02, 0x14, 0x00,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x01,
0x06, 0x00, 0x02, 0x13, 0x01,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x01,
0x06, 0x00, 0x02, 0x07, 0x01,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
#endif
0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
/* 320 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00, */
0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
/* 320 0x00, 0x78, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x5c, */
0x40,
#if 1
I2C0, 0x40, 0x02, 0x02, 0x0c,
I2C0, 0x40, 0x02, 0x13, 0x01,
#else
0x06, 0x00, 0x01, 0x0c,
0x06, 0x00, 0x02, 0x02, 0x0c,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x01,
0x06, 0x00, 0x02, 0x13, 0x01,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
#endif
0x10, 0x00, 0x01, 0x01,
0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
0x20, 0x01, 0x60, 0x01,
/* 320 0xf0, 0x00, 0x40, 0x01, */
#if 1
I2C0, 0x40, 0x02, 0x05, 0x0f,
I2C0, 0x40, 0x02, 0x13, 0x01,
I2C0, 0x40, 0x08, 0x08, 0x04, 0x0b, 0x01, 0x01, 0x02, 0x00, 0x17,
I2C0, 0x40, 0x03, 0x12, 0x00, 0x01,
#else
0x06, 0x00, 0x01, 0x0f,
0x06, 0x00, 0x02, 0x05, 0x0f,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x01,
0x06, 0x00, 0x02, 0x13, 0x01,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x07, 0x04, 0x0b, 0x01, 0x01, 0x02, 0x00, 0x17,
0x06, 0x00, 0x08, 0x08, 0x04, 0x0b, 0x01, 0x01, 0x02, 0x00, 0x17,
0x05, 0x02, 0x02, 0x08, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x02, 0x00, 0x01,
0x06, 0x00, 0x03, 0x12, 0x00, 0x01,
0x05, 0x02, 0x02, 0x03, 0x40,
0x05, 0x05, 0x01, 0x01,
#endif
0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
/* 320 3f ef */
#if 1
I2C0, 0x40, 0x02, 0x12, 0x00,
I2C0, 0x40, 0x02, 0x0e, 0x00,
I2C0, 0x40, 0x02, 0x11, 0x06,
#else
0x06, 0x00, 0x01, 0x00,
0x06, 0x00, 0x02, 0x12, 0x00,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x00,
0x06, 0x00, 0x02, 0x0e, 0x00,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
0x06, 0x00, 0x01, 0x06,
0x06, 0x00, 0x02, 0x11, 0x06,
0x05, 0x02, 0x02, 0x02, 0x40,
0x05, 0x05, 0x01, 0x01,
#endif
0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
0xf9,
......@@ -1745,7 +1604,7 @@ static const u8 dsbc110_init[] = {
};
/* nw802 dvc-v6 */
static const u8 dvcv6_init[] = {
static const u8 dvcv6_start[] = {
0x04, 0x06, 0x01, 0x06,
0x00, 0x00, 0x40, 0x54, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x4c,
0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
......@@ -1830,22 +1689,22 @@ static const u8 dvcv6_init[] = {
0x04, 0x04, 0x01, 0x00,
};
static const u8 *webcam_init[] = {
static const u8 *webcam_start[] = {
[Generic800] = nw800_init,
[SpaceCam] = spacecam_init,
[SpaceCam2] = spacecam2_init,
[Cvideopro] = cvideopro_init,
[Dlink350c] = dlink_init,
[DS3303u] = ds330_init,
[Kr651us] = kr651_init_1,
[Kritter] = kritter_init,
[Mustek300] = mustek_init,
[SpaceCam2] = spacecam2_start,
[Cvideopro] = cvideopro_start,
[Dlink350c] = dlink_start,
[DS3303u] = ds3303_start,
[Kr651us] = kr651_start_1,
[Kritter] = kritter_start,
[Mustek300] = mustek_start,
[Proscope] = proscope_init_1,
[Twinkle] = twinkle_init,
[Twinkle] = twinkle_start,
[DsbC110] = dsbc110_init,
[DvcV6] = dvcv6_init,
[P35u] = nw801_init_1,
[Generic802] = nw802_init,
[DvcV6] = dvcv6_start,
[P35u] = nw801_start_1,
[Generic802] = nw802_start,
};
/* -- write a register -- */
......@@ -1949,7 +1808,7 @@ static void reg_w_buf(struct gspca_dev *gspca_dev,
if (cmd[-3] != I2C0)
reg_w(gspca_dev, reg, cmd, len);
else
i2c_w(gspca_dev, reg & 0xff, cmd, len);
i2c_w(gspca_dev, reg, cmd, len);
cmd += len;
}
}
......@@ -2092,8 +1951,8 @@ static int sd_init(struct gspca_dev *gspca_dev)
PDEBUG(D_PROBE, "Bridge nw80%d", sd->bridge);
if (sd->bridge == BRIDGE_NW800) {
gspca_dev->cam.cam_mode = sif_mode;
gspca_dev->cam.nmodes = ARRAY_SIZE(sif_mode);
gspca_dev->cam.cam_mode = cif_mode;
gspca_dev->cam.nmodes = ARRAY_SIZE(cif_mode);
} else {
gspca_dev->cam.cam_mode = vga_mode;
switch (sd->webcam) {
......@@ -2110,12 +1969,10 @@ static int sd_init(struct gspca_dev *gspca_dev)
}
switch (sd->webcam) {
case P35u:
/* sd->ctrls[EXPOSURE].min = 0;
* sd->ctrls[EXPOSURE].max = 9;
/* sd->ctrls[EXPOSURE].max = 9;
* sd->ctrls[EXPOSURE].def = 1; */
break;
case Kr651us:
/* sd->ctrls[EXPOSURE].min = 0; */
sd->ctrls[EXPOSURE].max = 315;
sd->ctrls[EXPOSURE].def = 150;
break;
......@@ -2133,29 +1990,29 @@ static int sd_start(struct gspca_dev *gspca_dev)
struct sd *sd = (struct sd *) gspca_dev;
const u8 *cmd;
cmd = webcam_init[sd->webcam];
cmd = webcam_start[sd->webcam];
reg_w_buf(gspca_dev, cmd);
switch (sd->webcam) {
case P35u:
if (gspca_dev->width == 320)
reg_w_buf(gspca_dev, nw801_init_qvga);
reg_w_buf(gspca_dev, nw801_start_qvga);
else
reg_w_buf(gspca_dev, nw801_init_vga);
reg_w_buf(gspca_dev, nw801_init_2);
reg_w_buf(gspca_dev, nw801_start_vga);
reg_w_buf(gspca_dev, nw801_start_2);
break;
case Kr651us:
if (gspca_dev->width == 320)
reg_w_buf(gspca_dev, kr651_init_qvga);
reg_w_buf(gspca_dev, kr651_start_qvga);
else
reg_w_buf(gspca_dev, kr651_init_vga);
reg_w_buf(gspca_dev, kr651_init_2);
reg_w_buf(gspca_dev, kr651_start_vga);
reg_w_buf(gspca_dev, kr651_start_2);
break;
case Proscope:
if (gspca_dev->width == 320)
reg_w_buf(gspca_dev, proscope_init_qvga);
reg_w_buf(gspca_dev, proscope_start_qvga);
else
reg_w_buf(gspca_dev, proscope_init_vga);
reg_w_buf(gspca_dev, proscope_init_2);
reg_w_buf(gspca_dev, proscope_start_vga);
reg_w_buf(gspca_dev, proscope_start_2);
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment