.. | .. |
---|
20 | 20 | #include <media/v4l2-common.h> |
---|
21 | 21 | |
---|
22 | 22 | #include "uvcvideo.h" |
---|
| 23 | +#include <soc/rockchip/rockchip-system-status.h> |
---|
23 | 24 | |
---|
24 | 25 | /* ------------------------------------------------------------------------ |
---|
25 | 26 | * UVC Controls |
---|
.. | .. |
---|
1308 | 1309 | if (has_scr) |
---|
1309 | 1310 | memcpy(stream->clock.last_scr, scr, 6); |
---|
1310 | 1311 | |
---|
1311 | | - memcpy(&meta->length, mem, length); |
---|
| 1312 | + meta->length = mem[0]; |
---|
| 1313 | + meta->flags = mem[1]; |
---|
| 1314 | + memcpy(meta->buf, &mem[2], length - 2); |
---|
1312 | 1315 | meta_buf->bytesused += length + sizeof(meta->ns) + sizeof(meta->sof); |
---|
1313 | 1316 | |
---|
1314 | 1317 | uvc_trace(UVC_TRACE_FRAME, |
---|
.. | .. |
---|
1903 | 1906 | uvc_trace(UVC_TRACE_VIDEO, "Selecting alternate setting %u " |
---|
1904 | 1907 | "(%u B/frame bandwidth).\n", altsetting, best_psize); |
---|
1905 | 1908 | |
---|
| 1909 | + /* |
---|
| 1910 | + * Some devices, namely the Logitech C910 and B910, are unable |
---|
| 1911 | + * to recover from a USB autosuspend, unless the alternate |
---|
| 1912 | + * setting of the streaming interface is toggled. |
---|
| 1913 | + */ |
---|
| 1914 | + if (stream->dev->quirks & UVC_QUIRK_WAKE_AUTOSUSPEND) { |
---|
| 1915 | + usb_set_interface(stream->dev->udev, intfnum, |
---|
| 1916 | + altsetting); |
---|
| 1917 | + usb_set_interface(stream->dev->udev, intfnum, 0); |
---|
| 1918 | + } |
---|
| 1919 | + |
---|
1906 | 1920 | ret = usb_set_interface(stream->dev->udev, intfnum, altsetting); |
---|
1907 | 1921 | if (ret < 0) |
---|
1908 | 1922 | return ret; |
---|
.. | .. |
---|
2126 | 2140 | if (ret < 0) |
---|
2127 | 2141 | goto error_commit; |
---|
2128 | 2142 | |
---|
| 2143 | + rockchip_set_system_status(SYS_STATUS_PERFORMANCE); |
---|
| 2144 | + |
---|
2129 | 2145 | ret = uvc_video_start_transfer(stream, GFP_KERNEL); |
---|
2130 | 2146 | if (ret < 0) |
---|
2131 | 2147 | goto error_video; |
---|
.. | .. |
---|
2133 | 2149 | return 0; |
---|
2134 | 2150 | |
---|
2135 | 2151 | error_video: |
---|
| 2152 | + rockchip_clear_system_status(SYS_STATUS_PERFORMANCE); |
---|
2136 | 2153 | usb_set_interface(stream->dev->udev, stream->intfnum, 0); |
---|
2137 | 2154 | error_commit: |
---|
2138 | 2155 | uvc_video_clock_cleanup(stream); |
---|
.. | .. |
---|
2163 | 2180 | } |
---|
2164 | 2181 | |
---|
2165 | 2182 | uvc_video_clock_cleanup(stream); |
---|
| 2183 | + rockchip_clear_system_status(SYS_STATUS_PERFORMANCE); |
---|
2166 | 2184 | } |
---|