summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/Documentation/video4linux/gspca.txt4
-rw-r--r--linux/drivers/media/video/gspca/gspca.c39
-rw-r--r--linux/drivers/media/video/gspca/ov534.c477
-rw-r--r--linux/drivers/media/video/gspca/pac7311.c1
-rw-r--r--linux/drivers/media/video/gspca/sonixj.c209
-rw-r--r--linux/drivers/media/video/gspca/stk014.c6
-rw-r--r--linux/drivers/media/video/gspca/vc032x.c477
-rw-r--r--linux/drivers/media/video/gspca/zc3xx.c8
8 files changed, 685 insertions, 536 deletions
diff --git a/linux/Documentation/video4linux/gspca.txt b/linux/Documentation/video4linux/gspca.txt
index 4c96adc0b..a38c87246 100644
--- a/linux/Documentation/video4linux/gspca.txt
+++ b/linux/Documentation/video4linux/gspca.txt
@@ -171,6 +171,7 @@ sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom
spca506 06e1:a190 ADS Instant VCD
ov534 06f8:3002 Hercules Blog Webcam
ov534 06f8:3003 Hercules Dualpix HD Weblog
+sonixj 06f8:3004 Hercules Classic Silver
spca508 0733:0110 ViewQuest VQ110
spca508 0130:0130 Clone Digital Webcam 11043
spca501 0733:0401 Intel Create and Share
@@ -216,6 +217,7 @@ pac7311 093a:2608 Trust WB-3300p
pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
pac7311 093a:260f SnakeCam
pac7311 093a:2621 PAC731x
+pac7311 093a:2622 Genius Eye 312
pac7311 093a:2624 PAC7302
pac7311 093a:2626 Labtec 2200
pac7311 093a:262a Webcam 300k
@@ -251,11 +253,13 @@ sonixj 0c45:60c0 Sangha Sn535
sonixj 0c45:60ec SN9C105+MO4000
sonixj 0c45:60fb Surfer NoName
sonixj 0c45:60fc LG-LIC300
+sonixj 0c45:60fe Microdia Audio
sonixj 0c45:6128 Microdia/Sonix SNP325
sonixj 0c45:612a Avant Camera
sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix
sonixj 0c45:6130 Sonix Pccam
sonixj 0c45:6138 Sn9c120 Mo4000
+sonixj 0c45:613a Microdia Sonix PC Camera
sonixj 0c45:613b Surfer SN-206
sonixj 0c45:613c Sonix Pccam168
sonixj 0c45:6143 Sonix Pccam168
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c
index d725663fc..4fda0fca6 100644
--- a/linux/drivers/media/video/gspca/gspca.c
+++ b/linux/drivers/media/video/gspca/gspca.c
@@ -649,8 +649,11 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
"usb_submit_urb [%d] err %d", n, ret);
gspca_dev->streaming = 0;
destroy_urbs(gspca_dev);
- if (ret == -ENOSPC)
+ if (ret == -ENOSPC) {
+ msleep(20); /* wait for kill
+ * complete */
break; /* try the previous alt */
+ }
goto out;
}
}
@@ -668,7 +671,7 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev)
ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0);
if (ret < 0)
- PDEBUG(D_ERR|D_STREAM, "set interface 0 err %d", ret);
+ PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret);
return ret;
}
@@ -1078,6 +1081,35 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
return -EINVAL;
}
+/*fixme: have an audio flag in gspca_dev?*/
+static int vidioc_s_audio(struct file *file, void *priv,
+ struct v4l2_audio *audio)
+{
+ if (audio->index != 0)
+ return -EINVAL;
+ return 0;
+}
+
+static int vidioc_g_audio(struct file *file, void *priv,
+ struct v4l2_audio *audio)
+{
+ memset(audio, 0, sizeof *audio);
+ strcpy(audio->name, "Microphone");
+ return 0;
+}
+
+static int vidioc_enumaudio(struct file *file, void *priv,
+ struct v4l2_audio *audio)
+{
+ if (audio->index != 0)
+ return -EINVAL;
+
+ strcpy(audio->name, "Microphone");
+ audio->capability = 0;
+ audio->mode = 0;
+ return 0;
+}
+
static int vidioc_querymenu(struct file *file, void *priv,
struct v4l2_querymenu *qmenu)
{
@@ -1794,6 +1826,9 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {
.vidioc_queryctrl = vidioc_queryctrl,
.vidioc_g_ctrl = vidioc_g_ctrl,
.vidioc_s_ctrl = vidioc_s_ctrl,
+ .vidioc_g_audio = vidioc_g_audio,
+ .vidioc_s_audio = vidioc_s_audio,
+ .vidioc_enumaudio = vidioc_enumaudio,
.vidioc_querymenu = vidioc_querymenu,
.vidioc_enum_input = vidioc_enum_input,
.vidioc_g_input = vidioc_g_input,
diff --git a/linux/drivers/media/video/gspca/ov534.c b/linux/drivers/media/video/gspca/ov534.c
index a574be09b..28a798279 100644
--- a/linux/drivers/media/video/gspca/ov534.c
+++ b/linux/drivers/media/video/gspca/ov534.c
@@ -48,7 +48,8 @@ static int frame_rate;
/* specific webcam descriptor */
struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
- __u8 frame_rate;
+ __u32 last_fid;
+ __u32 last_pts;
};
/* V4L2 controls supported by the driver */
@@ -63,12 +64,12 @@ static struct v4l2_pix_format vga_mode[] = {
.priv = 0},
};
-static void ov534_reg_write(struct usb_device *udev, u16 reg, u16 val)
+static void ov534_reg_write(struct usb_device *udev, u16 reg, u8 val)
{
- u16 data = val;
+ u8 data = val;
int ret;
- PDEBUG(D_USBO, "reg=0x%04x, val=0%04x", reg, val);
+ PDEBUG(D_USBO, "reg=0x%04x, val=0%02x", reg, val);
ret = usb_control_msg(udev,
usb_sndctrlpipe(udev, 0),
0x1,
@@ -78,9 +79,9 @@ static void ov534_reg_write(struct usb_device *udev, u16 reg, u16 val)
PDEBUG(D_ERR, "write failed");
}
-static u16 ov534_reg_read(struct usb_device *udev, u16 reg)
+static u8 ov534_reg_read(struct usb_device *udev, u16 reg)
{
- u16 data;
+ u8 data;
int ret;
ret = usb_control_msg(udev,
@@ -88,30 +89,17 @@ static u16 ov534_reg_read(struct usb_device *udev, u16 reg)
0x1,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0x0, reg, &data, 1, CTRL_TIMEOUT);
- PDEBUG(D_USBI, "reg=0x%04x, data=0x%04x", reg, data);
+ PDEBUG(D_USBI, "reg=0x%04x, data=0x%02x", reg, data);
if (ret < 0)
PDEBUG(D_ERR, "read failed");
return data;
}
-static void ov534_reg_verify_write(struct usb_device *udev, u16 reg, u16 val)
-{
- u16 data;
-
- ov534_reg_write(udev, reg, val);
- data = ov534_reg_read(udev, reg);
- if (data != val) {
- PDEBUG(D_ERR | D_USBO,
- "unexpected result from read: 0x%04x != 0x%04x", val,
- data);
- }
-}
-
/* Two bits control LED: 0x21 bit 7 and 0x23 bit 7.
* (direction and output)? */
static void ov534_set_led(struct usb_device *udev, int status)
{
- u16 data;
+ u8 data;
PDEBUG(D_CONF, "led status: %d", status);
@@ -130,13 +118,13 @@ static void ov534_set_led(struct usb_device *udev, int status)
static int sccb_check_status(struct usb_device *udev)
{
- u16 data;
+ u8 data;
int i;
for (i = 0; i < 5; i++) {
data = ov534_reg_read(udev, OV534_REG_STATUS);
- switch (data & 0xFF) {
+ switch (data) {
case 0x00:
return 1;
case 0x04:
@@ -151,9 +139,9 @@ static int sccb_check_status(struct usb_device *udev)
return 0;
}
-static void sccb_reg_write(struct usb_device *udev, u16 reg, u16 val)
+static void sccb_reg_write(struct usb_device *udev, u16 reg, u8 val)
{
- PDEBUG(D_USBO, "reg: 0x%04x, val: 0x%04x", reg, val);
+ PDEBUG(D_USBO, "reg: 0x%04x, val: 0x%02x", reg, val);
ov534_reg_write(udev, OV534_REG_SUBADDR, reg);
ov534_reg_write(udev, OV534_REG_WRITE, val);
ov534_reg_write(udev, OV534_REG_OPERATION, OV534_OP_WRITE_3);
@@ -162,174 +150,164 @@ static void sccb_reg_write(struct usb_device *udev, u16 reg, u16 val)
PDEBUG(D_ERR, "sccb_reg_write failed");
}
-/* setup method */
-static void ov534_setup(struct usb_device *udev)
-{
- ov534_reg_verify_write(udev, 0xe7, 0x3a);
-
- ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
- ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
- ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
- ov534_reg_write(udev, OV534_REG_ADDRESS, 0x42);
-
- ov534_reg_verify_write(udev, 0xc2, 0x0c);
- ov534_reg_verify_write(udev, 0x88, 0xf8);
- ov534_reg_verify_write(udev, 0xc3, 0x69);
- ov534_reg_verify_write(udev, 0x89, 0xff);
- ov534_reg_verify_write(udev, 0x76, 0x03);
- ov534_reg_verify_write(udev, 0x92, 0x01);
- ov534_reg_verify_write(udev, 0x93, 0x18);
- ov534_reg_verify_write(udev, 0x94, 0x10);
- ov534_reg_verify_write(udev, 0x95, 0x10);
- ov534_reg_verify_write(udev, 0xe2, 0x00);
- ov534_reg_verify_write(udev, 0xe7, 0x3e);
-
- ov534_reg_write(udev, 0x1c, 0x0a);
- ov534_reg_write(udev, 0x1d, 0x22);
- ov534_reg_write(udev, 0x1d, 0x06);
-
- ov534_reg_verify_write(udev, 0x96, 0x00);
-
- ov534_reg_write(udev, 0x97, 0x20);
- ov534_reg_write(udev, 0x97, 0x20);
- ov534_reg_write(udev, 0x97, 0x20);
- ov534_reg_write(udev, 0x97, 0x0a);
- ov534_reg_write(udev, 0x97, 0x3f);
- ov534_reg_write(udev, 0x97, 0x4a);
- ov534_reg_write(udev, 0x97, 0x20);
- ov534_reg_write(udev, 0x97, 0x15);
- ov534_reg_write(udev, 0x97, 0x0b);
-
- ov534_reg_verify_write(udev, 0x8e, 0x40);
- ov534_reg_verify_write(udev, 0x1f, 0x81);
- ov534_reg_verify_write(udev, 0x34, 0x05);
- ov534_reg_verify_write(udev, 0xe3, 0x04);
- ov534_reg_verify_write(udev, 0x88, 0x00);
- ov534_reg_verify_write(udev, 0x89, 0x00);
- ov534_reg_verify_write(udev, 0x76, 0x00);
- ov534_reg_verify_write(udev, 0xe7, 0x2e);
- ov534_reg_verify_write(udev, 0x31, 0xf9);
- ov534_reg_verify_write(udev, 0x25, 0x42);
- ov534_reg_verify_write(udev, 0x21, 0xf0);
-
- ov534_reg_write(udev, 0x1c, 0x00);
- ov534_reg_write(udev, 0x1d, 0x40);
- ov534_reg_write(udev, 0x1d, 0x02);
- ov534_reg_write(udev, 0x1d, 0x00);
- ov534_reg_write(udev, 0x1d, 0x02);
- ov534_reg_write(udev, 0x1d, 0x57);
- ov534_reg_write(udev, 0x1d, 0xff);
-
- ov534_reg_verify_write(udev, 0x8d, 0x1c);
- ov534_reg_verify_write(udev, 0x8e, 0x80);
- ov534_reg_verify_write(udev, 0xe5, 0x04);
-
- ov534_set_led(udev, 1);
-
- sccb_reg_write(udev, 0x12, 0x80);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x11, 0x01);
-
- ov534_set_led(udev, 0);
-
- sccb_reg_write(udev, 0x3d, 0x03);
- sccb_reg_write(udev, 0x17, 0x26);
- sccb_reg_write(udev, 0x18, 0xa0);
- sccb_reg_write(udev, 0x19, 0x07);
- sccb_reg_write(udev, 0x1a, 0xf0);
- sccb_reg_write(udev, 0x32, 0x00);
- sccb_reg_write(udev, 0x29, 0xa0);
- sccb_reg_write(udev, 0x2c, 0xf0);
- sccb_reg_write(udev, 0x65, 0x20);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x42, 0x7f);
- sccb_reg_write(udev, 0x63, 0xe0);
- sccb_reg_write(udev, 0x64, 0xff);
- sccb_reg_write(udev, 0x66, 0x00);
- sccb_reg_write(udev, 0x13, 0xf0);
- sccb_reg_write(udev, 0x0d, 0x41);
- sccb_reg_write(udev, 0x0f, 0xc5);
- sccb_reg_write(udev, 0x14, 0x11);
-
- ov534_set_led(udev, 1);
-
- sccb_reg_write(udev, 0x22, 0x7f);
- sccb_reg_write(udev, 0x23, 0x03);
- sccb_reg_write(udev, 0x24, 0x40);
- sccb_reg_write(udev, 0x25, 0x30);
- sccb_reg_write(udev, 0x26, 0xa1);
- sccb_reg_write(udev, 0x2a, 0x00);
- sccb_reg_write(udev, 0x2b, 0x00);
- sccb_reg_write(udev, 0x6b, 0xaa);
- sccb_reg_write(udev, 0x13, 0xff);
+static const __u8 ov534_reg_initdata[][2] = {
+ { 0xe7, 0x3a },
+
+ { OV534_REG_ADDRESS, 0x42 }, /* select OV772x sensor */
+
+ { 0xc2, 0x0c },
+ { 0x88, 0xf8 },
+ { 0xc3, 0x69 },
+ { 0x89, 0xff },
+ { 0x76, 0x03 },
+ { 0x92, 0x01 },
+ { 0x93, 0x18 },
+ { 0x94, 0x10 },
+ { 0x95, 0x10 },
+ { 0xe2, 0x00 },
+ { 0xe7, 0x3e },
+
+ { 0x96, 0x00 },
+
+ { 0x97, 0x20 },
+ { 0x97, 0x20 },
+ { 0x97, 0x20 },
+ { 0x97, 0x0a },
+ { 0x97, 0x3f },
+ { 0x97, 0x4a },
+ { 0x97, 0x20 },
+ { 0x97, 0x15 },
+ { 0x97, 0x0b },
+
+ { 0x8e, 0x40 },
+ { 0x1f, 0x81 },
+ { 0x34, 0x05 },
+ { 0xe3, 0x04 },
+ { 0x88, 0x00 },
+ { 0x89, 0x00 },
+ { 0x76, 0x00 },
+ { 0xe7, 0x2e },
+ { 0x31, 0xf9 },
+ { 0x25, 0x42 },
+ { 0x21, 0xf0 },
+
+ { 0x1c, 0x00 },
+ { 0x1d, 0x40 },
+ { 0x1d, 0x02 },
+ { 0x1d, 0x00 },
+ { 0x1d, 0x02 }, /* frame size 0x025800 * 4 = 614400 */
+ { 0x1d, 0x58 }, /* frame size */
+ { 0x1d, 0x00 }, /* frame size */
+
+ { 0x8d, 0x1c },
+ { 0x8e, 0x80 },
+ { 0xe5, 0x04 },
+
+ { 0xc0, 0x50 },
+ { 0xc1, 0x3c },
+ { 0xc2, 0x0c },
+};
- ov534_set_led(udev, 0);
+static const __u8 ov772x_reg_initdata[][2] = {
+ { 0x12, 0x80 },
+ { 0x11, 0x01 },
+
+ { 0x3d, 0x03 },
+ { 0x17, 0x26 },
+ { 0x18, 0xa0 },
+ { 0x19, 0x07 },
+ { 0x1a, 0xf0 },
+ { 0x32, 0x00 },
+ { 0x29, 0xa0 },
+ { 0x2c, 0xf0 },
+ { 0x65, 0x20 },
+ { 0x11, 0x01 },
+ { 0x42, 0x7f },
+ { 0x63, 0xe0 },
+ { 0x64, 0xff },
+ { 0x66, 0x00 },
+ { 0x13, 0xf0 },
+ { 0x0d, 0x41 },
+ { 0x0f, 0xc5 },
+ { 0x14, 0x11 },
+
+ { 0x22, 0x7f },
+ { 0x23, 0x03 },
+ { 0x24, 0x40 },
+ { 0x25, 0x30 },
+ { 0x26, 0xa1 },
+ { 0x2a, 0x00 },
+ { 0x2b, 0x00 },
+ { 0x6b, 0xaa },
+ { 0x13, 0xff },
+
+ { 0x90, 0x05 },
+ { 0x91, 0x01 },
+ { 0x92, 0x03 },
+ { 0x93, 0x00 },
+ { 0x94, 0x60 },
+ { 0x95, 0x3c },
+ { 0x96, 0x24 },
+ { 0x97, 0x1e },
+ { 0x98, 0x62 },
+ { 0x99, 0x80 },
+ { 0x9a, 0x1e },
+ { 0x9b, 0x08 },
+ { 0x9c, 0x20 },
+ { 0x9e, 0x81 },
+
+ { 0xa6, 0x04 },
+ { 0x7e, 0x0c },
+ { 0x7f, 0x16 },
+ { 0x80, 0x2a },
+ { 0x81, 0x4e },
+ { 0x82, 0x61 },
+ { 0x83, 0x6f },
+ { 0x84, 0x7b },
+ { 0x85, 0x86 },
+ { 0x86, 0x8e },
+ { 0x87, 0x97 },
+ { 0x88, 0xa4 },
+ { 0x89, 0xaf },
+ { 0x8a, 0xc5 },
+ { 0x8b, 0xd7 },
+ { 0x8c, 0xe8 },
+ { 0x8d, 0x20 },
+
+ { 0x0c, 0x90 },
+
+ { 0x2b, 0x00 },
+ { 0x22, 0x7f },
+ { 0x23, 0x03 },
+ { 0x11, 0x01 },
+ { 0x0c, 0xd0 },
+ { 0x64, 0xff },
+ { 0x0d, 0x41 },
+
+ { 0x14, 0x41 },
+ { 0x0e, 0xcd },
+ { 0xac, 0xbf },
+ { 0x8e, 0x00 },
+ { 0x0c, 0xd0 }
+};
- sccb_reg_write(udev, 0x90, 0x05);
- sccb_reg_write(udev, 0x91, 0x01);
- sccb_reg_write(udev, 0x92, 0x03);
- sccb_reg_write(udev, 0x93, 0x00);
- sccb_reg_write(udev, 0x94, 0x60);
- sccb_reg_write(udev, 0x95, 0x3c);
- sccb_reg_write(udev, 0x96, 0x24);
- sccb_reg_write(udev, 0x97, 0x1e);
- sccb_reg_write(udev, 0x98, 0x62);
- sccb_reg_write(udev, 0x99, 0x80);
- sccb_reg_write(udev, 0x9a, 0x1e);
- sccb_reg_write(udev, 0x9b, 0x08);
- sccb_reg_write(udev, 0x9c, 0x20);
- sccb_reg_write(udev, 0x9e, 0x81);
- ov534_set_led(udev, 1);
+/* setup method */
+static void ov534_setup(struct usb_device *udev)
+{
+ int i;
- sccb_reg_write(udev, 0xa6, 0x04);
- sccb_reg_write(udev, 0x7e, 0x0c);
- sccb_reg_write(udev, 0x7f, 0x16);
- sccb_reg_write(udev, 0x80, 0x2a);
- sccb_reg_write(udev, 0x81, 0x4e);
- sccb_reg_write(udev, 0x82, 0x61);
- sccb_reg_write(udev, 0x83, 0x6f);
- sccb_reg_write(udev, 0x84, 0x7b);
- sccb_reg_write(udev, 0x85, 0x86);
- sccb_reg_write(udev, 0x86, 0x8e);
- sccb_reg_write(udev, 0x87, 0x97);
- sccb_reg_write(udev, 0x88, 0xa4);
- sccb_reg_write(udev, 0x89, 0xaf);
- sccb_reg_write(udev, 0x8a, 0xc5);
- sccb_reg_write(udev, 0x8b, 0xd7);
- sccb_reg_write(udev, 0x8c, 0xe8);
- sccb_reg_write(udev, 0x8d, 0x20);
-
- sccb_reg_write(udev, 0x0c, 0x90);
-
- ov534_reg_verify_write(udev, 0xc0, 0x50);
- ov534_reg_verify_write(udev, 0xc1, 0x3c);
- ov534_reg_verify_write(udev, 0xc2, 0x0c);
+ /* Initialize bridge chip */
+ for (i = 0; i < ARRAY_SIZE(ov534_reg_initdata); i++)
+ ov534_reg_write(udev, ov534_reg_initdata[i][0],
+ ov534_reg_initdata[i][1]);
ov534_set_led(udev, 1);
- sccb_reg_write(udev, 0x2b, 0x00);
- sccb_reg_write(udev, 0x22, 0x7f);
- sccb_reg_write(udev, 0x23, 0x03);
- sccb_reg_write(udev, 0x11, 0x01);
- sccb_reg_write(udev, 0x0c, 0xd0);
- sccb_reg_write(udev, 0x64, 0xff);
- sccb_reg_write(udev, 0x0d, 0x41);
-
- sccb_reg_write(udev, 0x14, 0x41);
- sccb_reg_write(udev, 0x0e, 0xcd);
- sccb_reg_write(udev, 0xac, 0xbf);
- sccb_reg_write(udev, 0x8e, 0x00);
- sccb_reg_write(udev, 0x0c, 0xd0);
+ /* Initialize sensor */
+ for (i = 0; i < ARRAY_SIZE(ov772x_reg_initdata); i++)
+ sccb_reg_write(udev, ov772x_reg_initdata[i][0],
+ ov772x_reg_initdata[i][1]);
ov534_reg_write(udev, 0xe0, 0x09);
ov534_set_led(udev, 0);
@@ -347,67 +325,53 @@ static int sd_config(struct gspca_dev *gspca_dev,
cam->cam_mode = vga_mode;
cam->nmodes = ARRAY_SIZE(vga_mode);
- cam->bulk_size = vga_mode[0].sizeimage;
+ cam->bulk_size = 2048;
cam->bulk_nurbs = 2;
- PDEBUG(D_PROBE, "bulk_size = %d", cam->bulk_size);
-
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;
- ov534_setup(gspca_dev->dev);
+ int fr;
- if (frame_rate > 0)
- sd->frame_rate = frame_rate;
+ ov534_setup(gspca_dev->dev);
- PDEBUG(D_PROBE, "frame_rate = %d", sd->frame_rate);
+ fr = frame_rate;
- switch (sd->frame_rate) {
+ switch (fr) {
case 50:
sccb_reg_write(gspca_dev->dev, 0x11, 0x01);
- sccb_check_status(gspca_dev->dev);
sccb_reg_write(gspca_dev->dev, 0x0d, 0x41);
- sccb_check_status(gspca_dev->dev);
- ov534_reg_verify_write(gspca_dev->dev, 0xe5, 0x02);
+ ov534_reg_write(gspca_dev->dev, 0xe5, 0x02);
break;
case 40:
sccb_reg_write(gspca_dev->dev, 0x11, 0x02);
- sccb_check_status(gspca_dev->dev);
sccb_reg_write(gspca_dev->dev, 0x0d, 0xc1);
- sccb_check_status(gspca_dev->dev);
- ov534_reg_verify_write(gspca_dev->dev, 0xe5, 0x04);
+ ov534_reg_write(gspca_dev->dev, 0xe5, 0x04);
break;
- case 30:
+/* case 30: */
default:
+ fr = 30;
sccb_reg_write(gspca_dev->dev, 0x11, 0x04);
- sccb_check_status(gspca_dev->dev);
sccb_reg_write(gspca_dev->dev, 0x0d, 0x81);
- sccb_check_status(gspca_dev->dev);
- ov534_reg_verify_write(gspca_dev->dev, 0xe5, 0x02);
+ ov534_reg_write(gspca_dev->dev, 0xe5, 0x02);
break;
case 15:
sccb_reg_write(gspca_dev->dev, 0x11, 0x03);
- sccb_check_status(gspca_dev->dev);
sccb_reg_write(gspca_dev->dev, 0x0d, 0x41);
- sccb_check_status(gspca_dev->dev);
- ov534_reg_verify_write(gspca_dev->dev, 0xe5, 0x04);
+ ov534_reg_write(gspca_dev->dev, 0xe5, 0x04);
break;
- };
+ }
+
+ PDEBUG(D_PROBE, "frame_rate: %d", fr);
return 0;
}
static int sd_start(struct gspca_dev *gspca_dev)
{
- PDEBUG(D_PROBE, "width = %d, height = %d",
- gspca_dev->width, gspca_dev->height);
-
- gspca_dev->cam.bulk_size = gspca_dev->width * gspca_dev->height * 2;
-
/* start streaming data */
ov534_set_led(gspca_dev->dev, 1);
ov534_reg_write(gspca_dev->dev, 0xe0, 0x00);
@@ -422,25 +386,78 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
ov534_set_led(gspca_dev->dev, 0);
}
+/* Values for bmHeaderInfo (Video and Still Image Payload Headers, 2.4.3.3) */
+#define UVC_STREAM_EOH (1 << 7)
+#define UVC_STREAM_ERR (1 << 6)
+#define UVC_STREAM_STI (1 << 5)
+#define UVC_STREAM_RES (1 << 4)
+#define UVC_STREAM_SCR (1 << 3)
+#define UVC_STREAM_PTS (1 << 2)
+#define UVC_STREAM_EOF (1 << 1)
+#define UVC_STREAM_FID (1 << 0)
+
static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame,
__u8 *data, int len)
{
- /*
- * The current camera setup doesn't stream the last pixel, so we set it
- * to a dummy value
- */
- __u8 last_pixel[4] = { 0, 0, 0, 0 };
- int framesize = gspca_dev->cam.bulk_size;
-
- if (len == framesize - 4) {
- frame =
- gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, len);
- frame =
- gspca_frame_add(gspca_dev, LAST_PACKET, frame, last_pixel,
- 4);
- } else
- PDEBUG(D_PACK, "packet len = %d, framesize = %d", len,
- framesize);
+ struct sd *sd = (struct sd *) gspca_dev;
+ __u32 this_pts;
+ int this_fid;
+
+ /* Payloads are prefixed with a the UVC-style header. We
+ consider a frame to start when the FID toggles, or the PTS
+ changes. A frame ends when EOF is set, and we've received
+ the correct number of bytes. */
+
+ /* Verify UVC header. Header length is always 12 */
+ if (data[0] != 12 || len < 12) {
+ PDEBUG(D_PACK, "bad header");
+ goto discard;
+ }
+
+ /* Check errors */
+ if (data[1] & UVC_STREAM_ERR) {
+ PDEBUG(D_PACK, "payload error");
+ goto discard;
+ }
+
+ /* Extract PTS and FID */
+ if (!(data[1] & UVC_STREAM_PTS)) {
+ PDEBUG(D_PACK, "PTS not present");
+ goto discard;
+ }
+ this_pts = (data[5] << 24) | (data[4] << 16) | (data[3] << 8) | data[2];
+ this_fid = (data[1] & UVC_STREAM_FID) ? 1 : 0;
+
+ /* If PTS or FID has changed, start a new frame. */
+ if (this_pts != sd->last_pts || this_fid != sd->last_fid) {
+ gspca_frame_add(gspca_dev, FIRST_PACKET, frame, NULL, 0);
+ sd->last_pts = this_pts;
+ sd->last_fid = this_fid;
+ }
+
+ /* Add the data from this payload */
+ gspca_frame_add(gspca_dev, INTER_PACKET, frame,
+ data + 12, len - 12);
+
+ /* If this packet is marked as EOF, end the frame */
+ if (data[1] & UVC_STREAM_EOF) {
+ sd->last_pts = 0;
+
+ if ((frame->data_end - frame->data) !=
+ (gspca_dev->width * gspca_dev->height * 2)) {
+ PDEBUG(D_PACK, "short frame");
+ goto discard;
+ }
+
+ gspca_frame_add(gspca_dev, LAST_PACKET, frame, NULL, 0);
+ }
+
+ /* Done */
+ return;
+
+discard:
+ /* Discard data until a new frame starts. */
+ gspca_frame_add(gspca_dev, DISCARD_PACKET, frame, NULL, 0);
}
/* sub-driver description */
diff --git a/linux/drivers/media/video/gspca/pac7311.c b/linux/drivers/media/video/gspca/pac7311.c
index f443df77e..b0a9d0687 100644
--- a/linux/drivers/media/video/gspca/pac7311.c
+++ b/linux/drivers/media/video/gspca/pac7311.c
@@ -1079,6 +1079,7 @@ static __devinitdata struct usb_device_id device_table[] = {
{USB_DEVICE(0x093a, 0x260e), .driver_info = SENSOR_PAC7311},
{USB_DEVICE(0x093a, 0x260f), .driver_info = SENSOR_PAC7311},
{USB_DEVICE(0x093a, 0x2621), .driver_info = SENSOR_PAC7302},
+ {USB_DEVICE(0x093a, 0x2622), .driver_info = SENSOR_PAC7302},
{USB_DEVICE(0x093a, 0x2624), .driver_info = SENSOR_PAC7302},
{USB_DEVICE(0x093a, 0x2626), .driver_info = SENSOR_PAC7302},
{USB_DEVICE(0x093a, 0x262a), .driver_info = SENSOR_PAC7302},
diff --git a/linux/drivers/media/video/gspca/sonixj.c b/linux/drivers/media/video/gspca/sonixj.c
index 182b84f1c..368382cf7 100644
--- a/linux/drivers/media/video/gspca/sonixj.c
+++ b/linux/drivers/media/video/gspca/sonixj.c
@@ -41,6 +41,8 @@ struct sd {
unsigned char contrast;
unsigned char colors;
unsigned char autogain;
+ __u8 blue;
+ __u8 red;
__u8 vflip; /* ov7630 only */
__u8 infrared; /* mi0360 only */
@@ -72,6 +74,10 @@ static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val);
+static int sd_setblue_balance(struct gspca_dev *gspca_dev, __s32 val);
+static int sd_getblue_balance(struct gspca_dev *gspca_dev, __s32 *val);
+static int sd_setred_balance(struct gspca_dev *gspca_dev, __s32 val);
+static int sd_getred_balance(struct gspca_dev *gspca_dev, __s32 *val);
static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val);
@@ -89,7 +95,7 @@ static struct ctrl sd_ctrls[] = {
#define BRIGHTNESS_MAX 0xffff
.maximum = BRIGHTNESS_MAX,
.step = 1,
-#define BRIGHTNESS_DEF 0x7fff
+#define BRIGHTNESS_DEF 0x8000
.default_value = BRIGHTNESS_DEF,
},
.set = sd_setbrightness,
@@ -116,7 +122,7 @@ static struct ctrl sd_ctrls[] = {
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "Color",
.minimum = 0,
- .maximum = 64,
+ .maximum = 40,
.step = 1,
#define COLOR_DEF 32
.default_value = COLOR_DEF,
@@ -124,7 +130,35 @@ static struct ctrl sd_ctrls[] = {
.set = sd_setcolors,
.get = sd_getcolors,
},
-#define AUTOGAIN_IDX 3
+ {
+ {
+ .id = V4L2_CID_BLUE_BALANCE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Blue Balance",
+ .minimum = 24,
+ .maximum = 40,
+ .step = 1,
+#define BLUE_BALANCE_DEF 32
+ .default_value = BLUE_BALANCE_DEF,
+ },
+ .set = sd_setblue_balance,
+ .get = sd_getblue_balance,
+ },
+ {
+ {
+ .id = V4L2_CID_RED_BALANCE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Red Balance",
+ .minimum = 24,
+ .maximum = 40,
+ .step = 1,
+#define RED_BALANCE_DEF 32
+ .default_value = RED_BALANCE_DEF,
+ },
+ .set = sd_setred_balance,
+ .get = sd_getred_balance,
+ },
+#define AUTOGAIN_IDX 5
{
{
.id = V4L2_CID_AUTOGAIN,
@@ -140,7 +174,7 @@ static struct ctrl sd_ctrls[] = {
.get = sd_getautogain,
},
/* ov7630 only */
-#define VFLIP_IDX 4
+#define VFLIP_IDX 6
{
{
.id = V4L2_CID_VFLIP,
@@ -156,7 +190,7 @@ static struct ctrl sd_ctrls[] = {
.get = sd_getvflip,
},
/* mi0360 only */
-#define INFRARED_IDX 5
+#define INFRARED_IDX 7
{
{
.id = V4L2_CID_INFRARED,
@@ -989,6 +1023,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
sd->brightness = BRIGHTNESS_DEF;
sd->contrast = CONTRAST_DEF;
sd->colors = COLOR_DEF;
+ sd->blue = BLUE_BALANCE_DEF;
+ sd->red = RED_BALANCE_DEF;
sd->autogain = AUTOGAIN_DEF;
sd->ag_cnt = -1;
sd->vflip = VFLIP_DEF;
@@ -1136,32 +1172,13 @@ static unsigned int setexposure(struct gspca_dev *gspca_dev,
return expo;
}
-/* this function is used for sensors o76xx only */
-static void setbrightcont(struct gspca_dev *gspca_dev)
-{
- struct sd *sd = (struct sd *) gspca_dev;
- int val;
- __u8 reg84_full[0x15];
-
- memcpy(reg84_full, reg84, sizeof reg84_full);
- val = sd->contrast * 0x30 / CONTRAST_MAX + 0x10; /* 10..40 */
- reg84_full[0] = (val + 1) / 2; /* red */
- reg84_full[2] = val; /* green */
- reg84_full[4] = (val + 1) / 5; /* blue */
- val = (sd->brightness - BRIGHTNESS_DEF) * 0x10
- / BRIGHTNESS_MAX;
- reg84_full[0x12] = val & 0x1f; /* 5:0 signed value */
- reg_w(gspca_dev, 0x84, reg84_full, sizeof reg84_full);
-}
-
-/* sensor != ov76xx */
static void setbrightness(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
unsigned int expo;
__u8 k2;
- k2 = sd->brightness >> 10;
+ k2 = ((int) sd->brightness - 0x8000) >> 10;
switch (sd->sensor) {
case SENSOR_HV7131R:
expo = sd->brightness << 4;
@@ -1183,38 +1200,46 @@ static void setbrightness(struct gspca_dev *gspca_dev)
break;
}
- reg_w1(gspca_dev, 0x96, k2);
+ reg_w1(gspca_dev, 0x96, k2); /* color matrix Y offset */
}
-/* sensor != ov76xx */
static void setcontrast(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
__u8 k2;
__u8 contrast[] = { 0x00, 0x00, 0x28, 0x00, 0x07, 0x00 };
- k2 = sd->contrast;
- contrast[2] = k2;
- contrast[0] = (k2 + 1) >> 1;
- contrast[4] = (k2 + 1) / 5;
+ k2 = sd->contrast * 0x30 / (CONTRAST_MAX + 1) + 0x10; /* 10..40 */
+ contrast[0] = (k2 + 1) / 2; /* red */
+ contrast[2] = k2; /* green */
+ contrast[4] = (k2 + 1) / 5; /* blue */
reg_w(gspca_dev, 0x84, contrast, 6);
}
static void setcolors(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
- __u8 blue, red;
-
- if (sd->colors >= 32) {
- red = 32 + (sd->colors - 32) / 2;
- blue = 64 - sd->colors;
- } else {
- red = sd->colors;
- blue = 32 + (32 - sd->colors) / 2;
+ int i, v;
+ __u8 reg8a[12]; /* U & V gains */
+ static __s16 uv[6] = { /* same as reg84 in signed decimal */
+ -24, -38, 64, /* UR UG UB */
+ 62, -51, -9 /* VR VG VB */
+ };
+ for (i = 0; i < 6; i++) {
+ v = uv[i] * sd->colors / COLOR_DEF;
+ reg8a[i * 2] = v;
+ reg8a[i * 2 + 1] = (v >> 8) & 0x0f;
}
- reg_w1(gspca_dev, 0x05, red);
+ reg_w(gspca_dev, 0x8a, reg8a, sizeof reg8a);
+}
+
+static void setredblue(struct gspca_dev *gspca_dev)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ reg_w1(gspca_dev, 0x05, sd->red);
/* reg_w1(gspca_dev, 0x07, 32); */
- reg_w1(gspca_dev, 0x06, blue);
+ reg_w1(gspca_dev, 0x06, sd->blue);
}
static void setautogain(struct gspca_dev *gspca_dev)
@@ -1300,9 +1325,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
}
reg_w1(gspca_dev, 0x17, reg17);
/* set reg1 was here */
- reg_w1(gspca_dev, 0x05, sn9c1xx[5]);
- reg_w1(gspca_dev, 0x07, sn9c1xx[7]);
- reg_w1(gspca_dev, 0x06, sn9c1xx[6]);
+ reg_w1(gspca_dev, 0x05, sn9c1xx[5]); /* red */
+ reg_w1(gspca_dev, 0x07, sn9c1xx[7]); /* green */
+ reg_w1(gspca_dev, 0x06, sn9c1xx[6]); /* blue */
reg_w1(gspca_dev, 0x14, sn9c1xx[0x14]);
reg_w(gspca_dev, 0x20, gamma_def, sizeof gamma_def);
for (i = 0; i < 8; i++)
@@ -1369,19 +1394,15 @@ static int sd_start(struct gspca_dev *gspca_dev)
default:
/* case SENSOR_OV7660: */
ov7660_InitSensor(gspca_dev);
- if (mode) {
-/* reg17 = 0x21; * 320 */
-/* reg1 = 0x44; */
-/* reg1 = 0x46; (done) */
- } else { /* 640 */
- if (sd->bridge == BRIDGE_SN9C120) {
+ if (sd->bridge == BRIDGE_SN9C120) {
+ if (mode) { /* 320x240 - 160x120 */
reg17 = 0xa2;
reg1 = 0x44; /* 48 Mhz, video trf eneble */
- } else {
- reg17 = 0x22;
- reg1 = 0x06; /* 24 Mhz, video trf eneble
- * inverse power down */
}
+ } else {
+ reg17 = 0x22;
+ reg1 = 0x06; /* 24 Mhz, video trf eneble
+ * inverse power down */
}
break;
}
@@ -1413,20 +1434,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
switch (sd->sensor) {
case SENSOR_MI0360:
setinfrared(sd);
- /* fall thru */
- case SENSOR_HV7131R:
- case SENSOR_MO4000:
- case SENSOR_OM6802:
- setbrightness(gspca_dev);
- setcontrast(gspca_dev);
break;
case SENSOR_OV7630:
setvflip(sd);
- /* fall thru */
- default: /* OV76xx */
- setbrightcont(gspca_dev);
break;
}
+ setbrightness(gspca_dev);
+ setcontrast(gspca_dev);
setautogain(gspca_dev);
return 0;
}
@@ -1510,7 +1524,7 @@ static void do_autogain(struct gspca_dev *gspca_dev)
expotimes = 0;
sd->exposure = setexposure(gspca_dev,
(unsigned int) expotimes);
- setcolors(gspca_dev);
+ setredblue(gspca_dev);
break;
}
}
@@ -1564,19 +1578,8 @@ static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
struct sd *sd = (struct sd *) gspca_dev;
sd->brightness = val;
- if (gspca_dev->streaming) {
- switch (sd->sensor) {
- case SENSOR_HV7131R:
- case SENSOR_MI0360:
- case SENSOR_MO4000:
- case SENSOR_OM6802:
- setbrightness(gspca_dev);
- break;
- default: /* OV76xx */
- setbrightcont(gspca_dev);
- break;
- }
- }
+ if (gspca_dev->streaming)
+ setbrightness(gspca_dev);
return 0;
}
@@ -1593,19 +1596,8 @@ static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
struct sd *sd = (struct sd *) gspca_dev;
sd->contrast = val;
- if (gspca_dev->streaming) {
- switch (sd->sensor) {
- case SENSOR_HV7131R:
- case SENSOR_MI0360:
- case SENSOR_MO4000:
- case SENSOR_OM6802:
- setcontrast(gspca_dev);
- break;
- default: /* OV76xx */
- setbrightcont(gspca_dev);
- break;
- }
- }
+ if (gspca_dev->streaming)
+ setcontrast(gspca_dev);
return 0;
}
@@ -1635,6 +1627,42 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val)
return 0;
}
+static int sd_setblue_balance(struct gspca_dev *gspca_dev, __s32 val)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ sd->blue = val;
+ if (gspca_dev->streaming)
+ setredblue(gspca_dev);
+ return 0;
+}
+
+static int sd_getblue_balance(struct gspca_dev *gspca_dev, __s32 *val)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ *val = sd->blue;
+ return 0;
+}
+
+static int sd_setred_balance(struct gspca_dev *gspca_dev, __s32 val)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ sd->red = val;
+ if (gspca_dev->streaming)
+ setredblue(gspca_dev);
+ return 0;
+}
+
+static int sd_getred_balance(struct gspca_dev *gspca_dev, __s32 *val)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ *val = sd->red;
+ return 0;
+}
+
static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
{
struct sd *sd = (struct sd *) gspca_dev;
@@ -1719,6 +1747,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
#endif
{USB_DEVICE(0x0471, 0x0328), BSI(SN9C105, MI0360, 0x5d)},
{USB_DEVICE(0x0471, 0x0330), BSI(SN9C105, MI0360, 0x5d)},
+ {USB_DEVICE(0x06f8, 0x3004), BSI(SN9C105, OV7660, 0x21)},
{USB_DEVICE(0x0c45, 0x6040), BSI(SN9C102P, HV7131R, 0x11)},
/* bw600.inf:
{USB_DEVICE(0x0c45, 0x6040), BSI(SN9C102P, MI0360, 0x5d)}, */
diff --git a/linux/drivers/media/video/gspca/stk014.c b/linux/drivers/media/video/gspca/stk014.c
index d9d64911f..74f57db53 100644
--- a/linux/drivers/media/video/gspca/stk014.c
+++ b/linux/drivers/media/video/gspca/stk014.c
@@ -424,10 +424,8 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
/* beginning of the frame */
#define STKHDRSZ 12
- gspca_frame_add(gspca_dev, INTER_PACKET, frame,
- data + STKHDRSZ, len - STKHDRSZ);
-#undef STKHDRSZ
- return;
+ data += STKHDRSZ;
+ len -= STKHDRSZ;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
}
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 */
diff --git a/linux/drivers/media/video/gspca/zc3xx.c b/linux/drivers/media/video/gspca/zc3xx.c
index adbca6a9d..ae4e30b52 100644
--- a/linux/drivers/media/video/gspca/zc3xx.c
+++ b/linux/drivers/media/video/gspca/zc3xx.c
@@ -5760,7 +5760,7 @@ static const struct usb_action tas5130cxx_Initial[] = {
{}
};
static const struct usb_action tas5130cxx_InitialScale[] = {
- {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
+/*?? {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, */
{0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
{0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
@@ -6084,7 +6084,7 @@ static const struct usb_action tas5130c_vf0250_InitialScale[] = {
{0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */
{0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */
{0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
- {0xaa, 0x01, 0x0000},
+/*?? {0xaa, 0x01, 0x0000}, */
{0xaa, 0x01, 0x0000},
{0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
{0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
@@ -6100,8 +6100,8 @@ static const struct usb_action tas5130c_vf0250_InitialScale[] = {
{0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */
{0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */
{0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */
- {0xa0, 0x00, 0x0039},
- {0xa1, 0x01, 0x0037},
+/*?? {0xa0, 0x00, 0x0039},
+ {0xa1, 0x01, 0x0037}, */
{0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
{0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa (e6 -> e8) */
{0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */