usb: gadget: uvc: Fix comment blocks style
The UVC gadget driver historically uses the /* Comment * style */ for multi-line block comments, which is frowned upon. Patches for the driver are required to use the more standard /* * Comment * style */ style. This result in inconsistencies. Fix it by converting all remaining instances of the old style. Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20220608174918.14656-1-laurent.pinchart@ideasonboard.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f2906aa863
commit
c5d337a358
|
@ -141,7 +141,8 @@ static struct usb_endpoint_descriptor uvc_fs_streaming_ep = {
|
||||||
.bEndpointAddress = USB_DIR_IN,
|
.bEndpointAddress = USB_DIR_IN,
|
||||||
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
|
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
|
||||||
| USB_ENDPOINT_XFER_ISOC,
|
| USB_ENDPOINT_XFER_ISOC,
|
||||||
/* The wMaxPacketSize and bInterval values will be initialized from
|
/*
|
||||||
|
* The wMaxPacketSize and bInterval values will be initialized from
|
||||||
* module parameters.
|
* module parameters.
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
@ -152,7 +153,8 @@ static struct usb_endpoint_descriptor uvc_hs_streaming_ep = {
|
||||||
.bEndpointAddress = USB_DIR_IN,
|
.bEndpointAddress = USB_DIR_IN,
|
||||||
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
|
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
|
||||||
| USB_ENDPOINT_XFER_ISOC,
|
| USB_ENDPOINT_XFER_ISOC,
|
||||||
/* The wMaxPacketSize and bInterval values will be initialized from
|
/*
|
||||||
|
* The wMaxPacketSize and bInterval values will be initialized from
|
||||||
* module parameters.
|
* module parameters.
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
@ -164,7 +166,8 @@ static struct usb_endpoint_descriptor uvc_ss_streaming_ep = {
|
||||||
.bEndpointAddress = USB_DIR_IN,
|
.bEndpointAddress = USB_DIR_IN,
|
||||||
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
|
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
|
||||||
| USB_ENDPOINT_XFER_ISOC,
|
| USB_ENDPOINT_XFER_ISOC,
|
||||||
/* The wMaxPacketSize and bInterval values will be initialized from
|
/*
|
||||||
|
* The wMaxPacketSize and bInterval values will be initialized from
|
||||||
* module parameters.
|
* module parameters.
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
@ -172,7 +175,8 @@ static struct usb_endpoint_descriptor uvc_ss_streaming_ep = {
|
||||||
static struct usb_ss_ep_comp_descriptor uvc_ss_streaming_comp = {
|
static struct usb_ss_ep_comp_descriptor uvc_ss_streaming_comp = {
|
||||||
.bLength = sizeof(uvc_ss_streaming_comp),
|
.bLength = sizeof(uvc_ss_streaming_comp),
|
||||||
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
|
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
|
||||||
/* The bMaxBurst, bmAttributes and wBytesPerInterval values will be
|
/*
|
||||||
|
* The bMaxBurst, bmAttributes and wBytesPerInterval values will be
|
||||||
* initialized from module parameters.
|
* initialized from module parameters.
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
@ -234,7 +238,8 @@ uvc_function_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
|
||||||
if (le16_to_cpu(ctrl->wLength) > UVC_MAX_REQUEST_SIZE)
|
if (le16_to_cpu(ctrl->wLength) > UVC_MAX_REQUEST_SIZE)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Tell the complete callback to generate an event for the next request
|
/*
|
||||||
|
* Tell the complete callback to generate an event for the next request
|
||||||
* that will be enqueued by UVCIOC_SEND_RESPONSE.
|
* that will be enqueued by UVCIOC_SEND_RESPONSE.
|
||||||
*/
|
*/
|
||||||
uvc->event_setup_out = !(ctrl->bRequestType & USB_DIR_IN);
|
uvc->event_setup_out = !(ctrl->bRequestType & USB_DIR_IN);
|
||||||
|
@ -500,7 +505,8 @@ uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed)
|
||||||
if (!uvc_control_desc || !uvc_streaming_cls)
|
if (!uvc_control_desc || !uvc_streaming_cls)
|
||||||
return ERR_PTR(-ENODEV);
|
return ERR_PTR(-ENODEV);
|
||||||
|
|
||||||
/* Descriptors layout
|
/*
|
||||||
|
* Descriptors layout
|
||||||
*
|
*
|
||||||
* uvc_iad
|
* uvc_iad
|
||||||
* uvc_control_intf
|
* uvc_control_intf
|
||||||
|
@ -597,8 +603,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
|
||||||
uvcg_info(f, "%s()\n", __func__);
|
uvcg_info(f, "%s()\n", __func__);
|
||||||
|
|
||||||
opts = fi_to_f_uvc_opts(f->fi);
|
opts = fi_to_f_uvc_opts(f->fi);
|
||||||
/* Sanity check the streaming endpoint module parameters.
|
/* Sanity check the streaming endpoint module parameters. */
|
||||||
*/
|
|
||||||
opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U);
|
opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U);
|
||||||
opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U);
|
opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U);
|
||||||
opts->streaming_maxburst = min(opts->streaming_maxburst, 15U);
|
opts->streaming_maxburst = min(opts->streaming_maxburst, 15U);
|
||||||
|
@ -611,7 +616,8 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
|
||||||
opts->streaming_maxpacket);
|
opts->streaming_maxpacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill in the FS/HS/SS Video Streaming specific descriptors from the
|
/*
|
||||||
|
* Fill in the FS/HS/SS Video Streaming specific descriptors from the
|
||||||
* module parameters.
|
* module parameters.
|
||||||
*
|
*
|
||||||
* NOTE: We assume that the user knows what they are doing and won't
|
* NOTE: We assume that the user knows what they are doing and won't
|
||||||
|
@ -895,7 +901,8 @@ static void uvc_function_unbind(struct usb_configuration *c,
|
||||||
|
|
||||||
uvcg_info(f, "%s()\n", __func__);
|
uvcg_info(f, "%s()\n", __func__);
|
||||||
|
|
||||||
/* If we know we're connected via v4l2, then there should be a cleanup
|
/*
|
||||||
|
* If we know we're connected via v4l2, then there should be a cleanup
|
||||||
* of the device from userspace either via UVC_EVENT_DISCONNECT or
|
* of the device from userspace either via UVC_EVENT_DISCONNECT or
|
||||||
* though the video device removal uevent. Allow some time for the
|
* though the video device removal uevent. Allow some time for the
|
||||||
* application to close out before things get deleted.
|
* application to close out before things get deleted.
|
||||||
|
@ -912,7 +919,8 @@ static void uvc_function_unbind(struct usb_configuration *c,
|
||||||
v4l2_device_unregister(&uvc->v4l2_dev);
|
v4l2_device_unregister(&uvc->v4l2_dev);
|
||||||
|
|
||||||
if (uvc->func_connected) {
|
if (uvc->func_connected) {
|
||||||
/* Wait for the release to occur to ensure there are no longer any
|
/*
|
||||||
|
* Wait for the release to occur to ensure there are no longer any
|
||||||
* pending operations that may cause panics when resources are cleaned
|
* pending operations that may cause panics when resources are cleaned
|
||||||
* up.
|
* up.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -104,7 +104,8 @@ static void uvc_buffer_queue(struct vb2_buffer *vb)
|
||||||
if (likely(!(queue->flags & UVC_QUEUE_DISCONNECTED))) {
|
if (likely(!(queue->flags & UVC_QUEUE_DISCONNECTED))) {
|
||||||
list_add_tail(&buf->queue, &queue->irqqueue);
|
list_add_tail(&buf->queue, &queue->irqqueue);
|
||||||
} else {
|
} else {
|
||||||
/* If the device is disconnected return the buffer to userspace
|
/*
|
||||||
|
* If the device is disconnected return the buffer to userspace
|
||||||
* directly. The next QBUF call will fail with -ENODEV.
|
* directly. The next QBUF call will fail with -ENODEV.
|
||||||
*/
|
*/
|
||||||
buf->state = UVC_BUF_STATE_ERROR;
|
buf->state = UVC_BUF_STATE_ERROR;
|
||||||
|
@ -255,7 +256,8 @@ void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect)
|
||||||
}
|
}
|
||||||
queue->buf_used = 0;
|
queue->buf_used = 0;
|
||||||
|
|
||||||
/* This must be protected by the irqlock spinlock to avoid race
|
/*
|
||||||
|
* This must be protected by the irqlock spinlock to avoid race
|
||||||
* conditions between uvc_queue_buffer and the disconnection event that
|
* conditions between uvc_queue_buffer and the disconnection event that
|
||||||
* could result in an interruptible wait in uvc_dequeue_buffer. Do not
|
* could result in an interruptible wait in uvc_dequeue_buffer. Do not
|
||||||
* blindly replace this logic by checking for the UVC_DEV_DISCONNECTED
|
* blindly replace this logic by checking for the UVC_DEV_DISCONNECTED
|
||||||
|
|
|
@ -378,7 +378,8 @@ static void uvcg_video_pump(struct work_struct *work)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
while (video->ep->enabled) {
|
while (video->ep->enabled) {
|
||||||
/* Retrieve the first available USB request, protected by the
|
/*
|
||||||
|
* Retrieve the first available USB request, protected by the
|
||||||
* request lock.
|
* request lock.
|
||||||
*/
|
*/
|
||||||
spin_lock_irqsave(&video->req_lock, flags);
|
spin_lock_irqsave(&video->req_lock, flags);
|
||||||
|
@ -391,7 +392,8 @@ static void uvcg_video_pump(struct work_struct *work)
|
||||||
list_del(&req->list);
|
list_del(&req->list);
|
||||||
spin_unlock_irqrestore(&video->req_lock, flags);
|
spin_unlock_irqrestore(&video->req_lock, flags);
|
||||||
|
|
||||||
/* Retrieve the first available video buffer and fill the
|
/*
|
||||||
|
* Retrieve the first available video buffer and fill the
|
||||||
* request, protected by the video queue irqlock.
|
* request, protected by the video queue irqlock.
|
||||||
*/
|
*/
|
||||||
spin_lock_irqsave(&queue->irqlock, flags);
|
spin_lock_irqsave(&queue->irqlock, flags);
|
||||||
|
@ -403,9 +405,11 @@ static void uvcg_video_pump(struct work_struct *work)
|
||||||
|
|
||||||
video->encode(req, video, buf);
|
video->encode(req, video, buf);
|
||||||
|
|
||||||
/* With usb3 we have more requests. This will decrease the
|
/*
|
||||||
|
* With usb3 we have more requests. This will decrease the
|
||||||
* interrupt load to a quarter but also catches the corner
|
* interrupt load to a quarter but also catches the corner
|
||||||
* cases, which needs to be handled */
|
* cases, which needs to be handled.
|
||||||
|
*/
|
||||||
if (list_empty(&video->req_free) ||
|
if (list_empty(&video->req_free) ||
|
||||||
buf->state == UVC_BUF_STATE_DONE ||
|
buf->state == UVC_BUF_STATE_DONE ||
|
||||||
!(video->req_int_count %
|
!(video->req_int_count %
|
||||||
|
|
Loading…
Reference in New Issue