| From ee68e5d79e6aa0caa499b216c2352b47d1fc4e3e Mon Sep 17 00:00:00 2001 |
| From: Ricardo Ribalda <ribalda@chromium.org> |
| Date: Tue, 1 Nov 2022 09:34:35 +0100 |
| Subject: [PATCH] BACKPORT: FROMLIST: media: uvcvideo: Disable autosuspend for |
| Insta360 Link |
| |
| When the device suspends, it keeps power-cycling. |
| |
| The user notices it because the LED constanct oscillate between |
| blue (ready) and no LED (off). |
| |
| <6>[95202.128542] usb 3-3-port4: attempt power cycle |
| <6>[95206.070120] usb 3-3.4: new high-speed USB device number 49 using xhci_hcd |
| <6>[95206.212027] usb 3-3.4: New USB device found, idVendor=2e1a, idProduct=4c01, bcdDevice= 2.00 |
| <6>[95206.212044] usb 3-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=<Serial: 1> |
| <6>[95206.212050] usb 3-3.4: Product: Insta360 Link |
| <6>[95206.212075] usb 3-3.4: Manufacturer: Amba |
| <7>[95206.214862] usb 3-3.4: GPIO lookup for consumer privacy |
| <7>[95206.214866] usb 3-3.4: using lookup tables for GPIO lookup |
| <7>[95206.214869] usb 3-3.4: No GPIO consumer privacy found |
| <6>[95206.214871] usb 3-3.4: Found UVC 1.10 device Insta360 Link (2e1a:4c01) |
| <3>[95206.217113] usb 3-3.4: Failed to query (GET_INFO) UVC control 14 on unit 1: -32 (exp. 1). |
| <3>[95206.217733] usb 3-3.4: Failed to query (GET_INFO) UVC control 16 on unit 1: -32 (exp. 1). |
| <4>[95206.223544] usb 3-3.4: Warning! Unlikely big volume range (=32767), cval->res is probably wrong. |
| <4>[95206.223554] usb 3-3.4: [9] FU [Mic Capture Volume] ch = 1, val = -32768/-1/1 |
| <6>[95210.698990] usb 3-3.4: USB disconnect, device number 49 |
| <6>[95211.963090] usb 3-3.4: new high-speed USB device number 50 using xhci_hcd |
| <6>[95212.657061] usb 3-3.4: new full-speed USB device number 51 using xhci_hcd |
| <3>[95212.783119] usb 3-3.4: device descriptor read/64, error -32 |
| <3>[95213.015076] usb 3-3.4: device descriptor read/64, error -32 |
| <6>[95213.120358] usb 3-3-port4: attempt power cycle |
| |
| Bus 001 Device 009: ID 2e1a:4c01 Amba Insta360 Link |
| Device Descriptor: |
| bLength 18 |
| bDescriptorType 1 |
| bcdUSB 2.00 |
| bDeviceClass 239 Miscellaneous Device |
| bDeviceSubClass 2 |
| bDeviceProtocol 1 Interface Association |
| bMaxPacketSize0 64 |
| idVendor 0x2e1a |
| idProduct 0x4c01 |
| bcdDevice 2.00 |
| iManufacturer 1 Amba |
| iProduct 2 Insta360 Link |
| iSerial 0 |
| bNumConfigurations 1 |
| |
| Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> |
| (am from https://patchwork.kernel.org/patch/13026731/) |
| (also found at https://lore.kernel.org/r/20221101-instal-v1-1-321f3d96ad92@chromium.org) |
| |
| Conflicts: |
| drivers/media/usb/uvc/uvcvideo.h |
| |
| UPSTREAM-TASK=b:255969015 |
| BUG=b:256241147 |
| TEST=manual test on hatch |
| |
| Change-Id: I626fc0735d42ae77f5d979dfbab8a7d393d56749 |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3995269 |
| Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> |
| Reviewed-by: Shik Chen <shik@chromium.org> |
| Tested-by: Shik Chen <shik@chromium.org> |
| Tested-by: Ricardo Ribalda <ribalda@chromium.org> |
| Commit-Queue: Ricardo Ribalda <ribalda@chromium.org> |
| --- |
| drivers/media/usb/uvc/uvc_driver.c | 13 ++++++++++++- |
| drivers/media/usb/uvc/uvcvideo.h | 3 ++- |
| 2 files changed, 14 insertions(+), 2 deletions(-) |
| |
| diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c |
| index f6c4b5bedb4f4b352276c55310832169943191e7..f02db82bf3791af81e04e6b66f8ae393139ce841 100644 |
| --- a/drivers/media/usb/uvc/uvc_driver.c |
| +++ b/drivers/media/usb/uvc/uvc_driver.c |
| @@ -2265,7 +2265,9 @@ static int uvc_probe(struct usb_interface *intf, |
| } |
| |
| uvc_dbg(dev, PROBE, "UVC device initialized\n"); |
| - usb_enable_autosuspend(udev); |
| + if (!(dev->quirks & UVC_QUIRK_DISABLE_AUTOSUSPEND)) |
| + usb_enable_autosuspend(udev); |
| + |
| return 0; |
| |
| error: |
| @@ -3017,6 +3019,15 @@ static const struct usb_device_id uvc_ids[] = { |
| .bInterfaceSubClass = 1, |
| .bInterfaceProtocol = 0, |
| .driver_info = (kernel_ulong_t)&uvc_quirk_force_y8 }, |
| + /* Insta360 Link */ |
| + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
| + | USB_DEVICE_ID_MATCH_INT_INFO, |
| + .idVendor = 0x2e1a, |
| + .idProduct = 0x4c01, |
| + .bInterfaceClass = USB_CLASS_VIDEO, |
| + .bInterfaceSubClass = 1, |
| + .bInterfaceProtocol = 0, |
| + .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_DISABLE_AUTOSUSPEND) }, |
| /* GEO Semiconductor GC6500 */ |
| { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
| | USB_DEVICE_ID_MATCH_INT_INFO, |
| diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h |
| index db7ac236564cd28a6178ab96e88b8dc765062af6..5ea630f4d32b13b2207785ef642c93a85cd188e1 100644 |
| --- a/drivers/media/usb/uvc/uvcvideo.h |
| +++ b/drivers/media/usb/uvc/uvcvideo.h |
| @@ -73,7 +73,8 @@ |
| #define UVC_QUIRK_FORCE_Y8 0x00000800 |
| #define UVC_QUIRK_FORCE_BPP 0x00001000 |
| #define UVC_QUIRK_WAKE_AUTOSUSPEND 0x00002000 |
| -#define UVC_QUIRK_PRIVACY_DURING_STREAM 0x00004000 |
| +#define UVC_QUIRK_DISABLE_AUTOSUSPEND 0x00004000 |
| +#define UVC_QUIRK_PRIVACY_DURING_STREAM 0x80000000 |
| |
| /* Format flags */ |
| #define UVC_FMT_FLAG_COMPRESSED 0x00000001 |
| -- |
| 2.34.1 |
| |