aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch')
-rw-r--r--target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch40
1 files changed, 20 insertions, 20 deletions
diff --git a/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch
index 7ed1a616f6..084b655483 100644
--- a/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch
+++ b/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch
@@ -13,10 +13,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
-@@ -2749,6 +2749,18 @@ static const struct usb_device_id uvc_id
+@@ -2908,6 +2908,18 @@ static const struct usb_device_id uvc_id
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 0,
- .driver_info = UVC_QUIRK_FORCE_Y8 },
+ .driver_info = UVC_INFO_META(V4L2_META_FMT_D4XX) },
+ /* iPassion iP2970 */
+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
+ | USB_DEVICE_ID_MATCH_INT_INFO,
@@ -34,15 +34,15 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15) },
--- a/drivers/media/usb/uvc/uvc_status.c
+++ b/drivers/media/usb/uvc/uvc_status.c
-@@ -139,6 +139,7 @@ static void uvc_status_complete(struct u
- switch (dev->status[0] & 0x0f) {
- case UVC_STATUS_TYPE_CONTROL:
- uvc_event_control(dev, dev->status, len);
+@@ -223,6 +223,7 @@ static void uvc_status_complete(struct u
+ if (uvc_event_control(urb, status, len))
+ /* The URB will be resubmitted in work context. */
+ return;
+ dev->motion = 1;
break;
+ }
- case UVC_STATUS_TYPE_STREAMING:
-@@ -182,6 +183,7 @@ int uvc_status_init(struct uvc_device *d
+@@ -271,6 +272,7 @@ int uvc_status_init(struct uvc_device *d
}
pipe = usb_rcvintpipe(dev->udev, ep->desc.bEndpointAddress);
@@ -52,7 +52,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
* an exponent of two. Some developers forgot about it.
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
-@@ -21,6 +21,11 @@
+@@ -16,6 +16,11 @@
#include <linux/wait.h>
#include <linux/atomic.h>
#include <asm/unaligned.h>
@@ -64,8 +64,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
#include <media/v4l2-common.h>
-@@ -1101,9 +1106,149 @@ static void uvc_video_decode_data(struct
- }
+@@ -1156,9 +1161,149 @@ static void uvc_video_decode_data(struct
+ uvc_urb->async_operations++;
}
+struct bh_priv {
@@ -196,7 +196,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+
+#define MOTION_FLAG_OFFSET 4
static void uvc_video_decode_end(struct uvc_streaming *stream,
- struct uvc_buffer *buf, const __u8 *data, int len)
+ struct uvc_buffer *buf, const u8 *data, int len)
{
+ if ((stream->dev->quirks & UVC_QUIRK_MOTION) &&
+ (data[len - 2] == 0xff) && (data[len - 1] == 0xd9)) {
@@ -214,7 +214,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/* Mark the buffer as done if the EOF marker is set. */
if (data[1] & UVC_STREAM_EOF && buf->bytesused != 0) {
uvc_trace(UVC_TRACE_FRAME, "Frame complete (EOF found).\n");
-@@ -1518,6 +1663,8 @@ static int uvc_init_video_isoc(struct uv
+@@ -1715,6 +1860,8 @@ static int uvc_init_video_isoc(struct uv
if (npackets == 0)
return -ENOMEM;
@@ -222,13 +222,13 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ npackets = 1;
size = npackets * psize;
- for (i = 0; i < UVC_URBS; ++i) {
+ for_each_uvc_urb(uvc_urb, stream) {
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
-@@ -186,7 +186,9 @@
- #define UVC_QUIRK_RESTRICT_FRAME_RATE 0x00000200
+@@ -199,7 +199,9 @@
#define UVC_QUIRK_RESTORE_CTRLS_ON_INIT 0x00000400
#define UVC_QUIRK_FORCE_Y8 0x00000800
+ #define UVC_QUIRK_FORCE_BPP 0x00001000
-
+#define UVC_QUIRK_MOTION 0x00001000
+#define UVC_QUIRK_SINGLE_ISO 0x00002000
@@ -236,11 +236,11 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/* Format flags */
#define UVC_FMT_FLAG_COMPRESSED 0x00000001
#define UVC_FMT_FLAG_STREAM 0x00000002
-@@ -584,6 +586,7 @@ struct uvc_device {
- __u8 *status;
+@@ -666,6 +668,7 @@ struct uvc_device {
+ u8 *status;
struct input_dev *input;
char input_phys[64];
+ int motion;
- };
- enum uvc_handle_state {
+ struct uvc_ctrl_work {
+ struct work_struct work;