mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
Revert "usb: gadget: uvc: add a new attribute uvc_num_request"
This reverts commit fbb23b9e8c.
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I62ef3bc763ab6d318d80ccef64fdb17d8c67998b
This commit is contained in:
@@ -1170,7 +1170,6 @@ static struct usb_function_instance *uvc_alloc_inst(void)
|
||||
|
||||
opts->streaming_interval = 1;
|
||||
opts->streaming_maxpacket = 1024;
|
||||
opts->uvc_num_request = UVC_NUM_REQUESTS;
|
||||
opts->pm_qos_latency = 0;
|
||||
|
||||
ret = uvcg_attach_configfs(opts);
|
||||
|
||||
@@ -33,7 +33,6 @@ struct f_uvc_opts {
|
||||
|
||||
unsigned int control_interface;
|
||||
unsigned int streaming_interface;
|
||||
unsigned int uvc_num_request;
|
||||
|
||||
/*
|
||||
* Control descriptors array pointers for full-/high-speed and
|
||||
|
||||
@@ -69,7 +69,6 @@ extern unsigned int uvc_gadget_trace_param;
|
||||
#define UVC_NUM_REQUESTS 4
|
||||
#define UVC_MAX_REQUEST_SIZE 64
|
||||
#define UVC_MAX_EVENTS 4
|
||||
#define UVC_MAX_NUM_REQUESTS 8
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
* Structures
|
||||
@@ -91,8 +90,8 @@ struct uvc_video {
|
||||
|
||||
/* Requests */
|
||||
unsigned int req_size;
|
||||
struct usb_request *req[UVC_MAX_NUM_REQUESTS];
|
||||
__u8 *req_buffer[UVC_MAX_NUM_REQUESTS];
|
||||
struct usb_request *req[UVC_NUM_REQUESTS];
|
||||
__u8 *req_buffer[UVC_NUM_REQUESTS];
|
||||
struct list_head req_free;
|
||||
spinlock_t req_lock;
|
||||
|
||||
|
||||
@@ -2766,7 +2766,6 @@ UVCG_OPTS_ATTR(streaming_bulk, streaming_bulk, 1);
|
||||
UVCG_OPTS_ATTR(streaming_interval, streaming_interval, 16);
|
||||
UVCG_OPTS_ATTR(streaming_maxpacket, streaming_maxpacket, 3072);
|
||||
UVCG_OPTS_ATTR(streaming_maxburst, streaming_maxburst, 15);
|
||||
UVCG_OPTS_ATTR(uvc_num_request, uvc_num_request, UVC_MAX_NUM_REQUESTS);
|
||||
UVCG_OPTS_ATTR(pm_qos_latency, pm_qos_latency, PM_QOS_LATENCY_ANY);
|
||||
|
||||
#undef UVCG_OPTS_ATTR
|
||||
@@ -2832,7 +2831,6 @@ static struct configfs_attribute *uvc_attrs[] = {
|
||||
&f_uvc_opts_attr_streaming_interval,
|
||||
&f_uvc_opts_attr_streaming_maxpacket,
|
||||
&f_uvc_opts_attr_streaming_maxburst,
|
||||
&f_uvc_opts_attr_uvc_num_request,
|
||||
&f_uvc_opts_attr_pm_qos_latency,
|
||||
#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
|
||||
&f_uvc_opts_attr_device_name,
|
||||
|
||||
@@ -179,13 +179,8 @@ static int
|
||||
uvc_video_free_requests(struct uvc_video *video)
|
||||
{
|
||||
unsigned int i;
|
||||
struct uvc_device *uvc;
|
||||
struct f_uvc_opts *opts;
|
||||
|
||||
uvc = container_of(video, struct uvc_device, video);
|
||||
opts = fi_to_f_uvc_opts(uvc->func.fi);
|
||||
|
||||
for (i = 0; i < opts->uvc_num_request; ++i) {
|
||||
for (i = 0; i < UVC_NUM_REQUESTS; ++i) {
|
||||
if (video->req[i]) {
|
||||
usb_ep_free_request(video->ep, video->req[i]);
|
||||
video->req[i] = NULL;
|
||||
@@ -208,11 +203,6 @@ uvc_video_alloc_requests(struct uvc_video *video)
|
||||
unsigned int req_size;
|
||||
unsigned int i;
|
||||
int ret = -ENOMEM;
|
||||
struct uvc_device *uvc;
|
||||
struct f_uvc_opts *opts;
|
||||
|
||||
uvc = container_of(video, struct uvc_device, video);
|
||||
opts = fi_to_f_uvc_opts(uvc->func.fi);
|
||||
|
||||
BUG_ON(video->req_size);
|
||||
|
||||
@@ -225,7 +215,7 @@ uvc_video_alloc_requests(struct uvc_video *video)
|
||||
* max_t(unsigned int, video->ep->maxburst, 1);
|
||||
}
|
||||
|
||||
for (i = 0; i < opts->uvc_num_request; ++i) {
|
||||
for (i = 0; i < UVC_NUM_REQUESTS; ++i) {
|
||||
video->req_buffer[i] = kmalloc(req_size, GFP_KERNEL);
|
||||
if (video->req_buffer[i] == NULL)
|
||||
goto error;
|
||||
@@ -335,7 +325,7 @@ int uvcg_video_enable(struct uvc_video *video, int enable)
|
||||
cancel_work_sync(&video->pump);
|
||||
uvcg_queue_cancel(&video->queue, 0);
|
||||
|
||||
for (i = 0; i < opts->uvc_num_request; ++i)
|
||||
for (i = 0; i < UVC_NUM_REQUESTS; ++i)
|
||||
if (video->req[i])
|
||||
usb_ep_dequeue(video->ep, video->req[i]);
|
||||
|
||||
|
||||
@@ -383,7 +383,6 @@ webcam_bind(struct usb_composite_dev *cdev)
|
||||
uvc_opts->fs_streaming = uvc_fs_streaming_cls;
|
||||
uvc_opts->hs_streaming = uvc_hs_streaming_cls;
|
||||
uvc_opts->ss_streaming = uvc_ss_streaming_cls;
|
||||
uvc_opts->uvc_num_request = UVC_NUM_REQUESTS;
|
||||
uvc_opts->pm_qos_latency = 0;
|
||||
|
||||
/* Allocate string descriptor numbers ... note that string contents
|
||||
|
||||
Reference in New Issue
Block a user