diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-11-26 20:17:13 +0100 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2008-11-26 20:17:13 +0100 |
commit | 5e8806761e3146cdf8f1c400b2ff0090bfb6d2f0 (patch) | |
tree | 08b7da5720a2ccec38e024d4ded845c7a8d0801b /linux/drivers/media/video/gspca | |
parent | 891faaaa42567c3609045cff7972d61268b53b8e (diff) | |
download | mediapointer-dvb-s2-5e8806761e3146cdf8f1c400b2ff0090bfb6d2f0.tar.gz mediapointer-dvb-s2-5e8806761e3146cdf8f1c400b2ff0090bfb6d2f0.tar.bz2 |
gspca: Add sensor mi0360 in vc032x.
From: Jean-Francois Moine <moinejf@free.fr>
Priority: normal
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca')
-rw-r--r-- | linux/drivers/media/video/gspca/vc032x.c | 477 |
1 files changed, 271 insertions, 206 deletions
diff --git a/linux/drivers/media/video/gspca/vc032x.c b/linux/drivers/media/video/gspca/vc032x.c index f6fae60ae..db5deb957 100644 --- a/linux/drivers/media/video/gspca/vc032x.c +++ b/linux/drivers/media/video/gspca/vc032x.c @@ -41,11 +41,12 @@ struct sd { #define BRIDGE_VC0323 1 char sensor; #define SENSOR_HV7131R 0 -#define SENSOR_MI1320 1 -#define SENSOR_MI1310_SOC 2 -#define SENSOR_OV7660 3 -#define SENSOR_OV7670 4 -#define SENSOR_PO3130NC 5 +#define SENSOR_MI0360 1 +#define SENSOR_MI1320 2 +#define SENSOR_MI1310_SOC 3 +#define SENSOR_OV7660 4 +#define SENSOR_OV7670 5 +#define SENSOR_PO3130NC 6 }; /* V4L2 controls supported by the driver */ @@ -111,15 +112,239 @@ static struct v4l2_pix_format vc0323_mode[] = { .priv = 0}, }; -#if 0 -static const __u8 mi1310soc_gamma[17] = { - 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, - 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff +static const __u8 mi0360_matrix[9] = { + 0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50 }; -static const __u8 mi1310soc_matrix[9] = { - 0x56, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x58 + +static const __u8 mi0360_initVGA_JPG[][4] = { + {0xb0, 0x03, 0x19, 0xcc}, + {0xb0, 0x04, 0x02, 0xcc}, + {0xb3, 0x00, 0x24, 0xcc}, + {0xb3, 0x00, 0x25, 0xcc}, + {0xb3, 0x08, 0x01, 0xcc}, + {0xb3, 0x09, 0x0c, 0xcc}, + {0xb3, 0x05, 0x01, 0xcc}, + {0xb3, 0x06, 0x03, 0xcc}, + {0xb3, 0x03, 0x0a, 0xcc}, + {0xb3, 0x20, 0x00, 0xcc}, + {0xb3, 0x21, 0x00, 0xcc}, + {0xb3, 0x22, 0x01, 0xcc}, + {0xb3, 0x23, 0xe0, 0xcc}, + {0xb3, 0x04, 0x05, 0xcc}, + {0xb3, 0x14, 0x00, 0xcc}, + {0xb3, 0x15, 0x00, 0xcc}, + {0xb3, 0x16, 0x02, 0xcc}, + {0xb3, 0x17, 0x7f, 0xcc}, + {0xb3, 0x35, 0xdd, 0xcc}, + {0xb3, 0x34, 0x02, 0xcc}, + {0xb3, 0x00, 0x25, 0xcc}, + {0xbc, 0x00, 0x71, 0xcc}, + {0xb8, 0x00, 0x13, 0xcc}, + {0xb8, 0x27, 0x20, 0xcc}, + {0xb8, 0x2c, 0x50, 0xcc}, + {0xb8, 0x2d, 0xf8, 0xcc}, + {0xb8, 0x2e, 0xf8, 0xcc}, + {0xb8, 0x2f, 0xf8, 0xcc}, + {0xb8, 0x30, 0x50, 0xcc}, + {0xb8, 0x31, 0xf8, 0xcc}, + {0xb8, 0x32, 0xf8, 0xcc}, + {0xb8, 0x33, 0xf8, 0xcc}, + {0xb8, 0x34, 0x50, 0xcc}, + {0xb8, 0x35, 0x00, 0xcc}, + {0xb8, 0x36, 0x00, 0xcc}, + {0xb8, 0x37, 0x00, 0xcc}, + {0xb8, 0x01, 0x79, 0xcc}, + {0xb8, 0x08, 0xe0, 0xcc}, + {0xb3, 0x01, 0x41, 0xcc}, + {0xb8, 0x01, 0x79, 0xcc}, + {0xb8, 0x14, 0x18, 0xcc}, + {0xb8, 0xb2, 0x0a, 0xcc}, + {0xb8, 0xb4, 0x0a, 0xcc}, + {0xb8, 0xb5, 0x0a, 0xcc}, + {0xb8, 0xfe, 0x00, 0xcc}, + {0xb8, 0xff, 0x28, 0xcc}, + {0xb9, 0x00, 0x28, 0xcc}, + {0xb9, 0x01, 0x28, 0xcc}, + {0xb9, 0x02, 0x28, 0xcc}, + {0xb9, 0x03, 0x00, 0xcc}, + {0xb9, 0x04, 0x00, 0xcc}, + {0xb9, 0x05, 0x3c, 0xcc}, + {0xb9, 0x06, 0x3c, 0xcc}, + {0xb9, 0x07, 0x3c, 0xcc}, + {0xb9, 0x08, 0x3c, 0xcc}, + {0xb8, 0x8e, 0x00, 0xcc}, + {0xb8, 0x8f, 0xff, 0xcc}, + {0xb8, 0x81, 0x09, 0xcc}, + {0x31, 0x00, 0x00, 0xbb}, + {0x09, 0x01, 0xc7, 0xbb}, + {0x34, 0x01, 0x00, 0xbb}, + {0x2b, 0x00, 0x28, 0xbb}, + {0x2c, 0x00, 0x30, 0xbb}, + {0x2d, 0x00, 0x30, 0xbb}, + {0x2e, 0x00, 0x28, 0xbb}, + {0x62, 0x04, 0x11, 0xbb}, + {0x03, 0x01, 0xe0, 0xbb}, + {0x2c, 0x00, 0x2c, 0xbb}, + {0x20, 0xd0, 0x00, 0xbb}, + {0x01, 0x00, 0x08, 0xbb}, + {0x06, 0x00, 0x10, 0xbb}, + {0x05, 0x00, 0x20, 0xbb}, + {0x20, 0x00, 0x00, 0xbb}, + {0xb6, 0x00, 0x00, 0xcc}, + {0xb6, 0x03, 0x02, 0xcc}, + {0xb6, 0x02, 0x80, 0xcc}, + {0xb6, 0x05, 0x01, 0xcc}, + {0xb6, 0x04, 0xe0, 0xcc}, + {0xb6, 0x12, 0x78, 0xcc}, + {0xb6, 0x18, 0x02, 0xcc}, + {0xb6, 0x17, 0x58, 0xcc}, + {0xb6, 0x16, 0x00, 0xcc}, + {0xb6, 0x22, 0x12, 0xcc}, + {0xb6, 0x23, 0x0b, 0xcc}, + {0xb3, 0x02, 0x02, 0xcc}, + {0xbf, 0xc0, 0x39, 0xcc}, + {0xbf, 0xc1, 0x04, 0xcc}, + {0xbf, 0xcc, 0x10, 0xcc}, + {0xb9, 0x12, 0x00, 0xcc}, + {0xb9, 0x13, 0x0a, 0xcc}, + {0xb9, 0x14, 0x0a, 0xcc}, + {0xb9, 0x15, 0x0a, 0xcc}, + {0xb9, 0x16, 0x0a, 0xcc}, + {0xb9, 0x18, 0x00, 0xcc}, + {0xb9, 0x19, 0x0f, 0xcc}, + {0xb9, 0x1a, 0x0f, 0xcc}, + {0xb9, 0x1b, 0x0f, 0xcc}, + {0xb9, 0x1c, 0x0f, 0xcc}, + {0xb8, 0x8e, 0x00, 0xcc}, + {0xb8, 0x8f, 0xff, 0xcc}, + {0xb6, 0x12, 0xf8, 0xcc}, + {0xb8, 0x0c, 0x20, 0xcc}, + {0xb8, 0x0d, 0x70, 0xcc}, + {0xb6, 0x13, 0x13, 0xcc}, + {0x35, 0x00, 0x60, 0xbb}, + {0xb3, 0x5c, 0x01, 0xcc}, + {} }; -#endif +static const __u8 mi0360_initQVGA_JPG[][4] = { + {0xb0, 0x03, 0x19, 0xcc}, + {0xb0, 0x04, 0x02, 0xcc}, + {0xb3, 0x00, 0x24, 0xcc}, + {0xb3, 0x00, 0x25, 0xcc}, + {0xb3, 0x08, 0x01, 0xcc}, + {0xb3, 0x09, 0x0c, 0xcc}, + {0xb3, 0x05, 0x01, 0xcc}, + {0xb3, 0x06, 0x03, 0xcc}, + {0xb3, 0x03, 0x0a, 0xcc}, + {0xb3, 0x20, 0x00, 0xcc}, + {0xb3, 0x21, 0x00, 0xcc}, + {0xb3, 0x22, 0x01, 0xcc}, + {0xb3, 0x23, 0xe0, 0xcc}, + {0xb3, 0x04, 0x05, 0xcc}, + {0xb3, 0x14, 0x00, 0xcc}, + {0xb3, 0x15, 0x00, 0xcc}, + {0xb3, 0x16, 0x02, 0xcc}, + {0xb3, 0x17, 0x7f, 0xcc}, + {0xb3, 0x35, 0xdd, 0xcc}, + {0xb3, 0x34, 0x02, 0xcc}, + {0xb3, 0x00, 0x25, 0xcc}, + {0xbc, 0x00, 0xd1, 0xcc}, + {0xb8, 0x00, 0x13, 0xcc}, + {0xb8, 0x27, 0x20, 0xcc}, + {0xb8, 0x2c, 0x50, 0xcc}, + {0xb8, 0x2d, 0xf8, 0xcc}, + {0xb8, 0x2e, 0xf8, 0xcc}, + {0xb8, 0x2f, 0xf8, 0xcc}, + {0xb8, 0x30, 0x50, 0xcc}, + {0xb8, 0x31, 0xf8, 0xcc}, + {0xb8, 0x32, 0xf8, 0xcc}, + {0xb8, 0x33, 0xf8, 0xcc}, + {0xb8, 0x34, 0x50, 0xcc}, + {0xb8, 0x35, 0x00, 0xcc}, + {0xb8, 0x36, 0x00, 0xcc}, + {0xb8, 0x37, 0x00, 0xcc}, + {0xb8, 0x01, 0x79, 0xcc}, + {0xb8, 0x08, 0xe0, 0xcc}, + {0xb3, 0x01, 0x41, 0xcc}, + {0xb8, 0x01, 0x79, 0xcc}, + {0xb8, 0x14, 0x18, 0xcc}, + {0xb8, 0xb2, 0x0a, 0xcc}, + {0xb8, 0xb4, 0x0a, 0xcc}, + {0xb8, 0xb5, 0x0a, 0xcc}, + {0xb8, 0xfe, 0x00, 0xcc}, + {0xb8, 0xff, 0x28, 0xcc}, + {0xb9, 0x00, 0x28, 0xcc}, + {0xb9, 0x01, 0x28, 0xcc}, + {0xb9, 0x02, 0x28, 0xcc}, + {0xb9, 0x03, 0x00, 0xcc}, + {0xb9, 0x04, 0x00, 0xcc}, + {0xb9, 0x05, 0x3c, 0xcc}, + {0xb9, 0x06, 0x3c, 0xcc}, + {0xb9, 0x07, 0x3c, 0xcc}, + {0xb9, 0x08, 0x3c, 0xcc}, + {0xb8, 0x8e, 0x00, 0xcc}, + {0xb8, 0x8f, 0xff, 0xcc}, + {0xb8, 0x81, 0x09, 0xcc}, + {0x31, 0x00, 0x00, 0xbb}, + {0x09, 0x01, 0xc7, 0xbb}, + {0x34, 0x01, 0x00, 0xbb}, + {0x2b, 0x00, 0x28, 0xbb}, + {0x2c, 0x00, 0x30, 0xbb}, + {0x2d, 0x00, 0x30, 0xbb}, + {0x2e, 0x00, 0x28, 0xbb}, + {0x62, 0x04, 0x11, 0xbb}, + {0x03, 0x01, 0xe0, 0xbb}, + {0x2c, 0x00, 0x2c, 0xbb}, + {0x20, 0xd0, 0x00, 0xbb}, + {0x01, 0x00, 0x08, 0xbb}, + {0x06, 0x00, 0x10, 0xbb}, + {0x05, 0x00, 0x20, 0xbb}, + {0x20, 0x00, 0x00, 0xbb}, + {0xb6, 0x00, 0x00, 0xcc}, + {0xb6, 0x03, 0x01, 0xcc}, + {0xb6, 0x02, 0x40, 0xcc}, + {0xb6, 0x05, 0x00, 0xcc}, + {0xb6, 0x04, 0xf0, 0xcc}, + {0xb6, 0x12, 0x78, 0xcc}, + {0xb6, 0x18, 0x00, 0xcc}, + {0xb6, 0x17, 0x96, 0xcc}, + {0xb6, 0x16, 0x00, 0xcc}, + {0xb6, 0x22, 0x12, 0xcc}, + {0xb6, 0x23, 0x0b, 0xcc}, + {0xb3, 0x02, 0x02, 0xcc}, + {0xbf, 0xc0, 0x39, 0xcc}, + {0xbf, 0xc1, 0x04, 0xcc}, + {0xbf, 0xcc, 0x10, 0xcc}, + {0xb9, 0x12, 0x00, 0xcc}, + {0xb9, 0x13, 0x0a, 0xcc}, + {0xb9, 0x14, 0x0a, 0xcc}, + {0xb9, 0x15, 0x0a, 0xcc}, + {0xb9, 0x16, 0x0a, 0xcc}, + {0xb9, 0x18, 0x00, 0xcc}, + {0xb9, 0x19, 0x0f, 0xcc}, + {0xb9, 0x1a, 0x0f, 0xcc}, + {0xb9, 0x1b, 0x0f, 0xcc}, + {0xb9, 0x1c, 0x0f, 0xcc}, + {0xb8, 0x8e, 0x00, 0xcc}, + {0xb8, 0x8f, 0xff, 0xcc}, + {0xb6, 0x12, 0xf8, 0xcc}, + {0xb6, 0x13, 0x13, 0xcc}, + {0xbc, 0x02, 0x18, 0xcc}, + {0xbc, 0x03, 0x50, 0xcc}, + {0xbc, 0x04, 0x18, 0xcc}, + {0xbc, 0x05, 0x00, 0xcc}, + {0xbc, 0x06, 0x00, 0xcc}, + {0xbc, 0x08, 0x30, 0xcc}, + {0xbc, 0x09, 0x40, 0xcc}, + {0xbc, 0x0a, 0x10, 0xcc}, + {0xb8, 0x0c, 0x20, 0xcc}, + {0xb8, 0x0d, 0x70, 0xcc}, + {0xbc, 0x0b, 0x00, 0xcc}, + {0xbc, 0x0c, 0x00, 0xcc}, + {0x35, 0x00, 0xef, 0xbb}, + {0xb3, 0x5c, 0x01, 0xcc}, + {} +}; + static const __u8 mi1310_socinitVGA_JPG[][4] = { {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc}, @@ -1212,178 +1437,6 @@ static const __u8 ov7670_initQVGA_JPG[][4] = { {0x00, 0x77, 0x05, 0xaa }, {}, }; -#if 0 -static const __u8 ov7670_initQVGA_JPG[][4] = { - {0xb3, 0x00, 0x00, 0xcc}, - {0xb0, 0x16, 0x0d, 0xcc}, - {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x16, 0x00, 0xcc}, - {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x19, 0xcc}, - {0x00, 0x00, 0x50, 0xdd}, {0xb3, 0x49, 0x11, 0xcc}, - {0xb3, 0x49, 0x00, 0xcc}, {0xb0, 0x16, 0x00, 0xcc}, - - {0xb3, 0x01, 0x05, 0xcc}, {0x00, 0x00, 0x50, 0xdd}, - {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc}, - {0x00, 0x00, 0x50, 0xdd}, {0xb3, 0x00, 0x66, 0xcc}, - {0xb3, 0x00, 0x67, 0xcc}, {0xb3, 0x35, 0xa1, 0xcc}, - {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x05, 0x01, 0xcc}, - {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x08, 0x01, 0xcc}, - {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x02, 0x02, 0xcc}, - {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x14, 0x00, 0xcc}, - {0xb3, 0x15, 0x00, 0xcc}, {0xb3, 0x16, 0x02, 0xcc}, - {0xb3, 0x17, 0x7f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc}, - {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc}, - {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc}, - {0xbc, 0x00, 0xd1, 0xcc}, /* set QVGA */ - {0xbc, 0x01, 0x01, 0xcc},/* */ - {0x00, 0x12, 0x80, 0xaa},/* OV sensor reset */ - {0x00, 0x00, 0x50, 0xdd},/* wait sometimes */ - {0, 0x12, 0x00, 0xaa}, - {0, 0x11, 0x40, 0xaa}, {0, 0x6b, 0x0a, 0xaa}, - {0, 0x3a, 0x04, 0xaa}, {0, 0x40, 0xc0, 0xaa}, - {0, 0x8c, 0x00, 0xaa}, {0, 0x7a, 0x29, 0xaa}, - {0, 0x7b, 0x0e, 0xaa}, {0, 0x7c, 0x1a, 0xaa}, - {0, 0x7d, 0x31, 0xaa}, {0, 0x7e, 0x53, 0xaa}, - {0, 0x7f, 0x60, 0xaa}, {0, 0x80, 0x6b, 0xaa}, - {0, 0x81, 0x73, 0xaa}, {0, 0x82, 0x7b, 0xaa}, - {0, 0x83, 0x82, 0xaa}, {0, 0x84, 0x89, 0xaa}, - {0, 0x85, 0x96, 0xaa}, {0, 0x86, 0xa1, 0xaa}, - {0, 0x87, 0xb7, 0xaa}, {0, 0x88, 0xcc, 0xaa}, - {0, 0x89, 0xe1, 0xaa}, {0, 0x13, 0xe0, 0xaa}, - {0, 0x00, 0x00, 0xaa}, {0, 0x10, 0x00, 0xaa}, - {0, 0x0d, 0x40, 0xaa}, {0, 0x14, 0x28, 0xaa}, - {0, 0xa5, 0x05, 0xaa}, {0, 0xab, 0x07, 0xaa}, - {0, 0x24, 0x95, 0xaa}, {0, 0x25, 0x33, 0xaa}, - {0, 0x26, 0xe3, 0xaa}, {0, 0x9f, 0x88, 0xaa}, - {0, 0xa0, 0x78, 0xaa}, {0, 0x55, 0x90, 0xaa}, - {0, 0xa1, 0x03, 0xaa}, {0, 0xa6, 0xe0, 0xaa}, - {0, 0xa7, 0xd8, 0xaa}, {0, 0xa8, 0xf0, 0xaa}, - {0, 0xa9, 0x90, 0xaa}, {0, 0xaa, 0x14, 0xaa}, - {0, 0x13, 0xe5, 0xaa}, {0, 0x0e, 0x61, 0xaa}, - {0, 0x0f, 0x4b, 0xaa}, {0, 0x16, 0x02, 0xaa}, - {0, 0x1e, 0x07, 0xaa}, {0, 0x21, 0x02, 0xaa}, - {0, 0x22, 0x91, 0xaa}, {0, 0x29, 0x07, 0xaa}, - {0, 0x33, 0x0b, 0xaa}, {0, 0x35, 0x0b, 0xaa}, - {0, 0x37, 0x1d, 0xaa}, {0, 0x38, 0x71, 0xaa}, - {0, 0x39, 0x2a, 0xaa}, {0, 0x3c, 0x78, 0xaa}, - {0, 0x4d, 0x40, 0xaa}, {0, 0x4e, 0x20, 0xaa}, - {0, 0x74, 0x19, 0xaa}, {0, 0x8d, 0x4f, 0xaa}, - {0, 0x8e, 0x00, 0xaa}, {0, 0x8f, 0x00, 0xaa}, - {0, 0x90, 0x00, 0xaa}, {0, 0x91, 0x00, 0xaa}, - {0, 0x96, 0x00, 0xaa}, {0, 0x9a, 0x80, 0xaa}, - {0, 0xb0, 0x84, 0xaa}, {0, 0xb1, 0x0c, 0xaa}, - {0, 0xb2, 0x0e, 0xaa}, {0, 0xb3, 0x82, 0xaa}, - {0, 0xb8, 0x0a, 0xaa}, {0, 0x43, 0x14, 0xaa}, - {0, 0x44, 0xf0, 0xaa}, {0, 0x45, 0x45, 0xaa}, - {0, 0x46, 0x63, 0xaa}, {0, 0x47, 0x2d, 0xaa}, - {0, 0x48, 0x46, 0xaa}, {0, 0x59, 0x88, 0xaa}, - {0, 0x5a, 0xa0, 0xaa}, {0, 0x5b, 0xc6, 0xaa}, - {0, 0x5c, 0x7d, 0xaa}, {0, 0x5d, 0x5f, 0xaa}, - {0, 0x5e, 0x19, 0xaa}, {0, 0x6c, 0x0a, 0xaa}, - {0, 0x6d, 0x55, 0xaa}, {0, 0x6e, 0x11, 0xaa}, - {0, 0x6f, 0x9e, 0xaa}, {0, 0x69, 0x00, 0xaa}, - {0, 0x6a, 0x40, 0xaa}, {0, 0x01, 0x40, 0xaa}, - {0, 0x02, 0x40, 0xaa}, {0, 0x13, 0xe7, 0xaa}, - {0, 0x5f, 0xf0, 0xaa}, {0, 0x60, 0xf0, 0xaa}, - {0, 0x61, 0xf0, 0xaa}, {0, 0x27, 0xa0, 0xaa}, - {0, 0x28, 0x80, 0xaa}, {0, 0x2c, 0x90, 0xaa}, - {0, 0x4f, 0x66, 0xaa}, {0, 0x50, 0x66, 0xaa}, - {0, 0x51, 0x00, 0xaa}, {0, 0x52, 0x22, 0xaa}, - {0, 0x53, 0x5e, 0xaa}, {0, 0x54, 0x80, 0xaa}, - {0, 0x58, 0x9e, 0xaa}, {0, 0x41, 0x08, 0xaa}, - {0, 0x3f, 0x00, 0xaa}, {0, 0x75, 0x85, 0xaa}, - {0, 0x76, 0xe1, 0xaa}, {0, 0x4c, 0x00, 0xaa}, - {0, 0x77, 0x0a, 0xaa}, {0, 0x3d, 0x88, 0xaa}, - {0, 0x4b, 0x09, 0xaa}, {0, 0xc9, 0x60, 0xaa}, - {0, 0x41, 0x38, 0xaa}, {0, 0x62, 0x30, 0xaa}, - {0, 0x63, 0x30, 0xaa}, {0, 0x64, 0x08, 0xaa}, - {0, 0x94, 0x07, 0xaa}, {0, 0x95, 0x0b, 0xaa}, - {0, 0x65, 0x00, 0xaa}, {0, 0x66, 0x05, 0xaa}, - {0, 0x56, 0x50, 0xaa}, {0, 0x34, 0x11, 0xaa}, - {0, 0xa4, 0x88, 0xaa}, {0, 0x96, 0x00, 0xaa}, - {0, 0x97, 0x30, 0xaa}, {0, 0x98, 0x20, 0xaa}, - {0, 0x99, 0x30, 0xaa}, {0, 0x9a, 0x84, 0xaa}, - {0, 0x9b, 0x29, 0xaa}, {0, 0x9c, 0x03, 0xaa}, - {0, 0x78, 0x04, 0xaa}, {0, 0x79, 0x01, 0xaa}, - {0, 0xc8, 0xf0, 0xaa}, {0, 0x79, 0x0f, 0xaa}, - {0, 0xc8, 0x00, 0xaa}, {0, 0x79, 0x10, 0xaa}, - {0, 0xc8, 0x7e, 0xaa}, {0, 0x79, 0x0a, 0xaa}, - {0, 0xc8, 0x80, 0xaa}, {0, 0x79, 0x0b, 0xaa}, - {0, 0xc8, 0x01, 0xaa}, {0, 0x79, 0x0c, 0xaa}, - {0, 0xc8, 0x0f, 0xaa}, {0, 0x79, 0x0d, 0xaa}, - {0, 0xc8, 0x20, 0xaa}, {0, 0x79, 0x09, 0xaa}, - {0, 0xc8, 0x80, 0xaa}, {0, 0x79, 0x02, 0xaa}, - {0, 0xc8, 0xc0, 0xaa}, {0, 0x79, 0x03, 0xaa}, - {0, 0xc8, 0x40, 0xaa}, {0, 0x79, 0x05, 0xaa}, - {0, 0xc8, 0x30, 0xaa}, {0, 0x79, 0x26, 0xaa}, - {0, 0x11, 0x40, 0xaa}, {0, 0x3a, 0x04, 0xaa}, - {0, 0x12, 0x00, 0xaa}, {0, 0x40, 0xc0, 0xaa}, - {0, 0x8c, 0x00, 0xaa}, {0, 0x17, 0x14, 0xaa}, - {0, 0x18, 0x02, 0xaa}, {0, 0x32, 0x92, 0xaa}, - {0, 0x19, 0x02, 0xaa}, {0, 0x1a, 0x7a, 0xaa}, - {0, 0x03, 0x0a, 0xaa}, {0, 0x0c, 0x00, 0xaa}, - {0, 0x3e, 0x00, 0xaa}, {0, 0x70, 0x3a, 0xaa}, - {0, 0x71, 0x35, 0xaa}, {0, 0x72, 0x11, 0xaa}, - {0, 0x73, 0xf0, 0xaa}, {0, 0xa2, 0x02, 0xaa}, - {0, 0xb1, 0x00, 0xaa}, {0, 0xb1, 0x0c, 0xaa}, - {0, 0x1e, 0x37, 0xaa}, {0, 0xaa, 0x14, 0xaa}, - {0, 0x24, 0x80, 0xaa}, {0, 0x25, 0x74, 0xaa}, - {0, 0x26, 0xd3, 0xaa}, {0, 0x0d, 0x00, 0xaa}, - {0, 0x14, 0x18, 0xaa}, {0, 0x9d, 0x99, 0xaa}, - {0, 0x9e, 0x7f, 0xaa}, {0, 0x64, 0x08, 0xaa}, - {0, 0x94, 0x07, 0xaa}, {0, 0x95, 0x06, 0xaa}, - {0, 0x66, 0x05, 0xaa}, {0, 0x41, 0x08, 0xaa}, - {0, 0x3f, 0x00, 0xaa}, {0, 0x75, 0x07, 0xaa}, - {0, 0x76, 0xe1, 0xaa}, {0, 0x4c, 0x00, 0xaa}, - {0, 0x77, 0x00, 0xaa}, {0, 0x3d, 0xc2, 0xaa}, - {0, 0x4b, 0x09, 0xaa}, {0, 0xc9, 0x60, 0xaa}, - {0, 0x41, 0x38, 0xaa}, - {0xb6, 0x00, 0x00, 0xcc}, {0xb6, 0x03, 0x01, 0xcc}, - {0xb6, 0x02, 0x40, 0xcc}, - {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc}, - {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x21, 0xcc}, - {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc}, - {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc}, - {0xb6, 0x23, 0x0b, 0xcc}, - {0xbf, 0xc0, 0x39, 0xcc},/* set jpeg */ - {0xbf, 0xc1, 0x04, 0xcc},/* */ - {0xbf, 0xcc, 0x00, 0xcc},/* */ - {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc}, - {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc}, - {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc}, - {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc}, - {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc}, - {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc}, - {0, 0x77, 0x05, 0xaa}, {0xb6, 0x12, 0xf8, 0xcc}, - {0xb6, 0x13, 0x20, 0xcc}, - {0, 0x24, 0x6c, 0xaa}, - {0, 0x25, 0x5c, 0xaa}, {0, 0x56, 0x50, 0xaa}, - {0, 0x4f, 0xa8, 0xaa}, {0, 0x50, 0xa5, 0xaa}, - {0, 0x51, 0x02, 0xaa}, {0, 0x52, 0x22, 0xaa}, - {0, 0x53, 0x86, 0xaa}, {0, 0x54, 0xaa, 0xaa}, - {0, 0x7a, 0x19, 0xaa}, {0, 0x7b, 0x0c, 0xaa}, - {0, 0x7c, 0x18, 0xaa}, {0, 0x7d, 0x2f, 0xaa}, - {0, 0x7e, 0x54, 0xaa}, {0, 0x7f, 0x64, 0xaa}, - {0, 0x80, 0x71, 0xaa}, {0, 0x81, 0x7d, 0xaa}, - {0, 0x82, 0x88, 0xaa}, {0, 0x83, 0x91, 0xaa}, - {0, 0x84, 0x98, 0xaa}, {0, 0x85, 0xa7, 0xaa}, - {0, 0x86, 0xb4, 0xaa}, {0, 0x87, 0xcb, 0xaa}, - {0, 0x88, 0xde, 0xaa}, {0, 0x89, 0xed, 0xaa}, - {0, 0x75, 0x86, 0xaa}, {0, 0x92, 0x00, 0xaa}, - {0, 0x3b, 0, 0xbb}, - {0, 0x3b, 0x00, 0xaa}, - {0, 0x13, 0, 0xbb}, {0, 0x13, 0xe7, 0xaa}, - {0, 0x2d, 0x00, 0xaa}, {0, 0x2e, 0x00, 0xaa}, - {0, 0x04, 0x00, 0xaa}, {0, 0x10, 0x00, 0xaa}, - {0, 0x3b, 0, 0xbb}, {0, 0x3b, 0x80, 0xaa}, - {0, 0x13, 0, 0xbb}, - {0, 0x13, 0xe7, 0xaa}, - {0, 0x1e, 0x27, 0xaa}, - {0, 0x1e, 0x27, 0xaa}, - {0, 0x3b, 0xc8, 0xaa}, - {} -}; -#endif - struct sensor_info { int sensorId; __u8 I2cAdd; @@ -1402,6 +1455,8 @@ static const struct sensor_info sensor_info_data[] = { {SENSOR_MI1320, 0x80 | 0xc8, 0x00, 0x148c, 0x64, 0x65, 0x01}, {SENSOR_OV7670, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05}, {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01}, +/* (tested in vc032x_probe_sensor) */ +/* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x4382, 0x24, 0x25, 0x01}, */ }; /* read 'len' bytes in gspca_dev->usb_buf */ @@ -1463,7 +1518,7 @@ static void read_sensor_register(struct gspca_dev *gspca_dev, mdata = gspca_dev->usb_buf[0]; reg_r(gspca_dev, 0xa1, 0xb33c, 1); ldata = gspca_dev->usb_buf[0]; - PDEBUG(D_PROBE, "Read Sensor h (0x%02X) m (0x%02X) l (0x%02X)", + PDEBUG(D_PROBE, "Read Sensor %02x %02x%02x", hdata, mdata, ldata); reg_r(gspca_dev, 0xa1, 0xb334, 1); if (gspca_dev->usb_buf[0] == 0x02) @@ -1480,7 +1535,7 @@ static int vc032x_probe_sensor(struct gspca_dev *gspca_dev) const struct sensor_info *ptsensor_info; reg_r(gspca_dev, 0xa1, 0xbfcf, 1); - PDEBUG(D_PROBE, "check sensor header %d", gspca_dev->usb_buf[0]); + PDEBUG(D_PROBE, "check sensor header %02x", gspca_dev->usb_buf[0]); for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) { ptsensor_info = &sensor_info_data[i]; reg_w(dev, 0xa0, 0x02, 0xb334); @@ -1489,16 +1544,15 @@ static int vc032x_probe_sensor(struct gspca_dev *gspca_dev) reg_w(dev, 0xa0, 0x01, 0xb308); reg_w(dev, 0xa0, 0x0c, 0xb309); reg_w(dev, 0xa0, ptsensor_info->I2cAdd, 0xb335); -/* PDEBUG(D_PROBE, - "check sensor VC032X -> %d Add -> ox%02X!", - i, ptsensor_info->I2cAdd); */ reg_w(dev, 0xa0, ptsensor_info->op, 0xb301); read_sensor_register(gspca_dev, ptsensor_info->IdAdd, &value); - if (value == ptsensor_info->VpId) { -/* PDEBUG(D_PROBE, "find sensor VC032X -> ox%04X!", - ptsensor_info->VpId); */ + if (value == ptsensor_info->VpId) + return ptsensor_info->sensorId; + + /* special case for MI0360 */ + if (ptsensor_info->sensorId == SENSOR_MI1310_SOC + && value == 0x4382) return ptsensor_info->sensorId; - } } return -1; } @@ -1600,13 +1654,6 @@ static int sd_config(struct gspca_dev *gspca_dev, cam = &gspca_dev->cam; cam->epaddr = 0x02; sd->bridge = id->driver_info; - if (sd->bridge == BRIDGE_VC0321) { - cam->cam_mode = vc0321_mode; - cam->nmodes = ARRAY_SIZE(vc0321_mode); - } else { - cam->cam_mode = vc0323_mode; - cam->nmodes = ARRAY_SIZE(vc0323_mode); - } vc0321_reset(gspca_dev); sensor = vc032x_probe_sensor(gspca_dev); @@ -1616,29 +1663,36 @@ static int sd_config(struct gspca_dev *gspca_dev, return -EINVAL; case SENSOR_HV7131R: PDEBUG(D_PROBE, "Find Sensor HV7131R"); - sd->sensor = SENSOR_HV7131R; + break; + case SENSOR_MI0360: + PDEBUG(D_PROBE, "Find Sensor MI0360"); + sd->bridge = BRIDGE_VC0323; break; case SENSOR_MI1310_SOC: PDEBUG(D_PROBE, "Find Sensor MI1310_SOC"); - sd->sensor = SENSOR_MI1310_SOC; break; case SENSOR_MI1320: PDEBUG(D_PROBE, "Find Sensor MI1320"); - sd->sensor = SENSOR_MI1320; break; case SENSOR_OV7660: PDEBUG(D_PROBE, "Find Sensor OV7660"); - sd->sensor = SENSOR_OV7660; break; case SENSOR_OV7670: PDEBUG(D_PROBE, "Find Sensor OV7670"); - sd->sensor = SENSOR_OV7670; break; case SENSOR_PO3130NC: PDEBUG(D_PROBE, "Find Sensor PO3130NC"); - sd->sensor = SENSOR_PO3130NC; break; } + sd->sensor = sensor; + + if (sd->bridge == BRIDGE_VC0321) { + cam->cam_mode = vc0321_mode; + cam->nmodes = ARRAY_SIZE(vc0321_mode); + } else { + cam->cam_mode = vc0323_mode; + cam->nmodes = ARRAY_SIZE(vc0323_mode); + } sd->qindex = 7; sd->autogain = AUTOGAIN_DEF; @@ -1748,6 +1802,17 @@ static int sd_start(struct gspca_dev *gspca_dev) usb_exchange(gspca_dev, ov7670_initVGA_JPG); } break; + case SENSOR_MI0360: + GammaT = mi1320_gamma; + MatrixT = mi0360_matrix; + if (mode) { + /* 320x240 */ + usb_exchange(gspca_dev, mi0360_initQVGA_JPG); + } else { + /* 640x480 */ + usb_exchange(gspca_dev, mi0360_initVGA_JPG); + } + break; case SENSOR_MI1310_SOC: if (mode) { /* 320x240 */ |