Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364722
b: refs/heads/master
c: ee6a4d8
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart authored and Felipe Balbi committed Mar 18, 2013
1 parent c17dbbb commit bfd18d2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 912ca429fc87ceb63ae9ae00eff08212aad890c5
refs/heads/master: ee6a4d870b722a57aa57abe7f12539bac9c01555
58 changes: 29 additions & 29 deletions trunk/drivers/usb/gadget/f_uvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,43 +164,43 @@ static struct usb_endpoint_descriptor uvc_hs_streaming_ep = {

/* super speed support */
static struct usb_endpoint_descriptor uvc_ss_control_ep __initdata = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(UVC_STATUS_MAX_PACKET_SIZE),
.bInterval = 8,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(UVC_STATUS_MAX_PACKET_SIZE),
.bInterval = 8,
};

static struct usb_ss_ep_comp_descriptor uvc_ss_control_comp __initdata = {
.bLength = sizeof uvc_ss_control_comp,
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
.bLength = sizeof(uvc_ss_control_comp),
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,

/* the following 3 values can be tweaked if necessary */
/* .bMaxBurst = 0, */
/* .bmAttributes = 0, */
.wBytesPerInterval = cpu_to_le16(UVC_STATUS_MAX_PACKET_SIZE),
.bMaxBurst = 0,
.bmAttributes = 0,
.wBytesPerInterval = cpu_to_le16(UVC_STATUS_MAX_PACKET_SIZE),
};

static struct usb_endpoint_descriptor uvc_ss_streaming_ep __initdata = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_ISOC,
.wMaxPacketSize = cpu_to_le16(1024),
.bInterval = 4,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_ISOC,
.wMaxPacketSize = cpu_to_le16(1024),
.bInterval = 4,
};

static struct usb_ss_ep_comp_descriptor uvc_ss_streaming_comp = {
.bLength = sizeof uvc_ss_streaming_comp,
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
.bLength = sizeof(uvc_ss_streaming_comp),
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,

/* the following 3 values can be tweaked if necessary */
.bMaxBurst = 0,
.bmAttributes = 0,
.wBytesPerInterval = cpu_to_le16(1024),
.bMaxBurst = 0,
.bmAttributes = 0,
.wBytesPerInterval = cpu_to_le16(1024),
};

static const struct usb_descriptor_header * const uvc_fs_streaming[] = {
Expand Down Expand Up @@ -514,13 +514,13 @@ uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed)
}

for (src = (const struct usb_descriptor_header **)uvc_control_desc;
*src; ++src) {
*src; ++src) {
control_size += (*src)->bLength;
bytes += (*src)->bLength;
n_desc++;
}
for (src = (const struct usb_descriptor_header **)uvc_streaming_cls;
*src; ++src) {
*src; ++src) {
streaming_size += (*src)->bLength;
bytes += (*src)->bLength;
n_desc++;
Expand Down Expand Up @@ -775,23 +775,23 @@ uvc_bind_config(struct usb_configuration *c,

/* Validate the descriptors. */
if (fs_control == NULL || fs_control[0] == NULL ||
fs_control[0]->bDescriptorSubType != UVC_VC_HEADER)
fs_control[0]->bDescriptorSubType != UVC_VC_HEADER)
goto error;

if (ss_control == NULL || ss_control[0] == NULL ||
ss_control[0]->bDescriptorSubType != UVC_VC_HEADER)
ss_control[0]->bDescriptorSubType != UVC_VC_HEADER)
goto error;

if (fs_streaming == NULL || fs_streaming[0] == NULL ||
fs_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
fs_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
goto error;

if (hs_streaming == NULL || hs_streaming[0] == NULL ||
hs_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
hs_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
goto error;

if (ss_streaming == NULL || ss_streaming[0] == NULL ||
ss_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
ss_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
goto error;

uvc->desc.fs_control = fs_control;
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/usb/gadget/f_uvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
#include <linux/usb/composite.h>
#include <linux/usb/video.h>

extern int uvc_bind_config(struct usb_configuration *c,
const struct uvc_descriptor_header * const *fs_control,
const struct uvc_descriptor_header * const *hs_control,
const struct uvc_descriptor_header * const *fs_streaming,
const struct uvc_descriptor_header * const *hs_streaming,
const struct uvc_descriptor_header * const *ss_streaming);
int uvc_bind_config(struct usb_configuration *c,
const struct uvc_descriptor_header * const *fs_control,
const struct uvc_descriptor_header * const *hs_control,
const struct uvc_descriptor_header * const *fs_streaming,
const struct uvc_descriptor_header * const *hs_streaming,
const struct uvc_descriptor_header * const *ss_streaming);

#endif /* _F_UVC_H_ */

0 comments on commit bfd18d2

Please sign in to comment.