From f21eb9cd0af9b2a67309295986b9388e8659df17 Mon Sep 17 00:00:00 2001 From: Wu Liang feng Date: Tue, 24 Oct 2017 11:00:38 +0800 Subject: [PATCH] uvcvideo: add quirk for devices with broken auto suspend We found that some usb cameras(e.g. Manufacturer: HD Camera Manufacturer, idVendor=05a3, idProduct=9230) can't support auto-suspend well on rockchip platforms. With auto-suspend, these usb cameras MJPEG will display abnormally on all usb controllers(DWC2/DWC3/EHCI). So we need to disable auto suspend for these special usb cameras. Change-Id: Ibf50ed77edff0012a112dc42f09e022055908829 Signed-off-by: Wu Liang feng Signed-off-by: Frank Wang --- drivers/media/usb/uvc/uvc_driver.c | 6 +++++- drivers/usb/core/quirks.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 5ad528264135..b5ab43090e13 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -2309,7 +2310,10 @@ static int uvc_probe(struct usb_interface *intf, } uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n"); - usb_enable_autosuspend(udev); + if (udev->quirks & USB_QUIRK_AUTO_SUSPEND) + uvc_printk(KERN_INFO, "auto-suspend is blacklisted for this device\n"); + else + usb_enable_autosuspend(udev); return 0; error: diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 76ac5d6555ae..d799e93b9a0d 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -322,6 +322,9 @@ static const struct usb_device_id usb_quirk_list[] = { /* Alcor Micro Corp. Hub */ { USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME }, + /* HD Camera Manufacturer */ + { USB_DEVICE(0x05a3, 0x9230), .driver_info = USB_QUIRK_AUTO_SUSPEND }, + /* appletouch */ { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },