diff options
Diffstat (limited to 'drivers/media/video/zr364xx.c')
-rw-r--r-- | drivers/media/video/zr364xx.c | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c index 9aae011d92ab..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,8 @@ 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 }, |
119 | {USB_DEVICE(0x06d6, 0x003d), .driver_info = METHOD0 }, | ||
118 | {} /* Terminating entry */ | 120 | {} /* Terminating entry */ |
119 | }; | 121 | }; |
120 | 122 | ||
@@ -301,7 +303,7 @@ static message m2[] = { | |||
301 | }; | 303 | }; |
302 | 304 | ||
303 | /* init table */ | 305 | /* init table */ |
304 | static message *init[3] = { m0, m1, m2 }; | 306 | static message *init[4] = { m0, m1, m2, m2 }; |
305 | 307 | ||
306 | 308 | ||
307 | /* JPEG static data in header (Huffman table, etc) */ | 309 | /* JPEG static data in header (Huffman table, etc) */ |
@@ -966,6 +968,22 @@ static int zr364xx_vidioc_s_fmt_vid_cap(struct file *file, void *priv, | |||
966 | m0d1[0] = mode; | 968 | m0d1[0] = mode; |
967 | m1[2].value = 0xf000 + mode; | 969 | m1[2].value = 0xf000 + mode; |
968 | 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 | |||
969 | header2[437] = cam->height / 256; | 987 | header2[437] = cam->height / 256; |
970 | header2[438] = cam->height % 256; | 988 | header2[438] = cam->height % 256; |
971 | header2[439] = cam->width / 256; | 989 | header2[439] = cam->width / 256; |
@@ -1454,7 +1472,6 @@ static struct video_device zr364xx_template = { | |||
1454 | .fops = &zr364xx_fops, | 1472 | .fops = &zr364xx_fops, |
1455 | .ioctl_ops = &zr364xx_ioctl_ops, | 1473 | .ioctl_ops = &zr364xx_ioctl_ops, |
1456 | .release = video_device_release, | 1474 | .release = video_device_release, |
1457 | .minor = -1, | ||
1458 | }; | 1475 | }; |
1459 | 1476 | ||
1460 | 1477 | ||
@@ -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; |
@@ -1634,8 +1667,8 @@ static int zr364xx_probe(struct usb_interface *intf, | |||
1634 | 1667 | ||
1635 | spin_lock_init(&cam->slock); | 1668 | spin_lock_init(&cam->slock); |
1636 | 1669 | ||
1637 | dev_info(&udev->dev, DRIVER_DESC " controlling video device %d\n", | 1670 | dev_info(&udev->dev, DRIVER_DESC " controlling device %s\n", |
1638 | cam->vdev->num); | 1671 | video_device_node_name(cam->vdev)); |
1639 | return 0; | 1672 | return 0; |
1640 | } | 1673 | } |
1641 | 1674 | ||