]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
UBUNTU: SAUCE: media: uvcvideo: Support realtek's UVC 1.5 device
authorming_qian <ming_qian@realsil.com.cn>
Mon, 14 May 2018 05:37:00 +0000 (07:37 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 May 2018 07:08:34 +0000 (09:08 +0200)
BugLink: https://bugs.launchpad.net/bugs/1763748
The length of UVC 1.5 video control is 48, and it id 34 for UVC 1.1.
Change it to 48 for UVC 1.5 device,
and the UVC 1.5 device can be recognized.

More changes to the driver are needed for full UVC 1.5 compatibility.
However, at least the UVC 1.5 Realtek RTS5847/RTS5852 cameras have
been reported to work well.

Signed-off-by: ming_qian <ming_qian@realsil.com.cn>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: AceLan Kao <acelan.kao@canonical.com>
Acked-by: Andy Whitcroft <andy.whitcroft@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/media/usb/uvc/uvc_video.c

index fb86d6af398d305a123be15e1b4c574888d1354c..4114915f1171c76c52aa5864d7fa5fc304ad2a0c 100644 (file)
@@ -171,6 +171,8 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
        int ret;
 
        size = stream->dev->uvc_version >= 0x0110 ? 34 : 26;
+       if (stream->dev->uvc_version >= 0x0150)
+               size = 48;
        if ((stream->dev->quirks & UVC_QUIRK_PROBE_DEF) &&
                        query == UVC_GET_DEF)
                return -EIO;
@@ -259,6 +261,8 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,
        int ret;
 
        size = stream->dev->uvc_version >= 0x0110 ? 34 : 26;
+       if (stream->dev->uvc_version >= 0x0150)
+               size = 48;
        data = kzalloc(size, GFP_KERNEL);
        if (data == NULL)
                return -ENOMEM;