aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zr364xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/zr364xx.c')
-rw-r--r--drivers/media/video/zr364xx.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index f0eae83e3d89..3d4bac252902 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -78,6 +78,7 @@
78#define METHOD0 0 78#define METHOD0 0
79#define METHOD1 1 79#define METHOD1 1
80#define METHOD2 2 80#define METHOD2 2
81#define METHOD3 3
81 82
82 83
83/* Module parameters */ 84/* Module parameters */
@@ -114,7 +115,7 @@ static struct usb_device_id device_table[] = {
114 {USB_DEVICE(0x06d6, 0x003b), .driver_info = METHOD0 }, 115 {USB_DEVICE(0x06d6, 0x003b), .driver_info = METHOD0 },
115 {USB_DEVICE(0x0a17, 0x004e), .driver_info = METHOD2 }, 116 {USB_DEVICE(0x0a17, 0x004e), .driver_info = METHOD2 },
116 {USB_DEVICE(0x041e, 0x405d), .driver_info = METHOD2 }, 117 {USB_DEVICE(0x041e, 0x405d), .driver_info = METHOD2 },
117 {USB_DEVICE(0x08ca, 0x2102), .driver_info = METHOD2 }, 118 {USB_DEVICE(0x08ca, 0x2102), .driver_info = METHOD3 },
118 {USB_DEVICE(0x06d6, 0x003d), .driver_info = METHOD0 }, 119 {USB_DEVICE(0x06d6, 0x003d), .driver_info = METHOD0 },
119 {} /* Terminating entry */ 120 {} /* Terminating entry */
120}; 121};
@@ -302,7 +303,7 @@ static message m2[] = {
302}; 303};
303 304
304/* init table */ 305/* init table */
305static message *init[3] = { m0, m1, m2 }; 306static message *init[4] = { m0, m1, m2, m2 };
306 307
307 308
308/* JPEG static data in header (Huffman table, etc) */ 309/* JPEG static data in header (Huffman table, etc) */
@@ -967,6 +968,22 @@ static int zr364xx_vidioc_s_fmt_vid_cap(struct file *file, void *priv,
967 m0d1[0] = mode; 968 m0d1[0] = mode;
968 m1[2].value = 0xf000 + mode; 969 m1[2].value = 0xf000 + mode;
969 m2[1].value = 0xf000 + mode; 970 m2[1].value = 0xf000 + mode;
971
972 /* special case for METHOD3, the modes are different */
973 if (cam->method == METHOD3) {
974 switch (mode) {
975 case 1:
976 m2[1].value = 0xf000 + 4;
977 break;
978 case 2:
979 m2[1].value = 0xf000 + 0;
980 break;
981 default:
982 m2[1].value = 0xf000 + 1;
983 break;
984 }
985 }
986
970 header2[437] = cam->height / 256; 987 header2[437] = cam->height / 256;
971 header2[438] = cam->height % 256; 988 header2[438] = cam->height % 256;
972 header2[439] = cam->width / 256; 989 header2[439] = cam->width / 256;
@@ -1582,6 +1599,22 @@ static int zr364xx_probe(struct usb_interface *intf,
1582 m0d1[0] = mode; 1599 m0d1[0] = mode;
1583 m1[2].value = 0xf000 + mode; 1600 m1[2].value = 0xf000 + mode;
1584 m2[1].value = 0xf000 + mode; 1601 m2[1].value = 0xf000 + mode;
1602
1603 /* special case for METHOD3, the modes are different */
1604 if (cam->method == METHOD3) {
1605 switch (mode) {
1606 case 1:
1607 m2[1].value = 0xf000 + 4;
1608 break;
1609 case 2:
1610 m2[1].value = 0xf000 + 0;
1611 break;
1612 default:
1613 m2[1].value = 0xf000 + 1;
1614 break;
1615 }
1616 }
1617
1585 header2[437] = cam->height / 256; 1618 header2[437] = cam->height / 256;
1586 header2[438] = cam->height % 256; 1619 header2[438] = cam->height % 256;
1587 header2[439] = cam->width / 256; 1620 header2[439] = cam->width / 256;