Skip to content

Commit

Permalink
V4L/DVB: uvc: Move constants and structures definitions to linux/usb/…
Browse files Browse the repository at this point in the history
…video.h

The UVC host and gadget drivers both define constants and structures in
private header files. Move all those definitions to linux/usb/video.h
where they can be shared by the two drivers (and be available for
userspace applications).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Aug 2, 2010
1 parent c89f66f commit bbafc0c
Show file tree
Hide file tree
Showing 6 changed files with 418 additions and 426 deletions.
19 changes: 0 additions & 19 deletions drivers/media/video/uvc/uvcvideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,25 +196,6 @@ struct uvc_device;
/* TODO: Put the most frequently accessed fields at the beginning of
* structures to maximize cache efficiency.
*/
struct uvc_streaming_control {
__u16 bmHint;
__u8 bFormatIndex;
__u8 bFrameIndex;
__u32 dwFrameInterval;
__u16 wKeyFrameRate;
__u16 wPFrameRate;
__u16 wCompQuality;
__u16 wCompWindowSize;
__u16 wDelay;
__u32 dwMaxVideoFrameSize;
__u32 dwMaxPayloadTransferSize;
__u32 dwClockFrequency;
__u8 bmFramingInfo;
__u8 bPreferedVersion;
__u8 bMinVersion;
__u8 bMaxVersion;
};

struct uvc_control_info {
struct list_head list;
struct list_head mappings;
Expand Down
16 changes: 8 additions & 8 deletions drivers/usb/gadget/f_uvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ static struct usb_gadget_strings *uvc_function_strings[] = {
#define UVC_INTF_VIDEO_STREAMING 1

static struct usb_interface_assoc_descriptor uvc_iad __initdata = {
.bLength = USB_DT_INTERFACE_ASSOCIATION_SIZE,
.bLength = sizeof(uvc_iad),
.bDescriptorType = USB_DT_INTERFACE_ASSOCIATION,
.bFirstInterface = 0,
.bInterfaceCount = 2,
.bFunctionClass = USB_CLASS_VIDEO,
.bFunctionSubClass = 0x03,
.bFunctionSubClass = UVC_SC_VIDEO_INTERFACE_COLLECTION,
.bFunctionProtocol = 0x00,
.iFunction = 0,
};
Expand All @@ -78,7 +78,7 @@ static struct usb_interface_descriptor uvc_control_intf __initdata = {
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_VIDEO,
.bInterfaceSubClass = 0x01,
.bInterfaceSubClass = UVC_SC_VIDEOCONTROL,
.bInterfaceProtocol = 0x00,
.iInterface = 0,
};
Expand Down Expand Up @@ -106,7 +106,7 @@ static struct usb_interface_descriptor uvc_streaming_intf_alt0 __initdata = {
.bAlternateSetting = 0,
.bNumEndpoints = 0,
.bInterfaceClass = USB_CLASS_VIDEO,
.bInterfaceSubClass = 0x02,
.bInterfaceSubClass = UVC_SC_VIDEOSTREAMING,
.bInterfaceProtocol = 0x00,
.iInterface = 0,
};
Expand All @@ -118,7 +118,7 @@ static struct usb_interface_descriptor uvc_streaming_intf_alt1 __initdata = {
.bAlternateSetting = 1,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_VIDEO,
.bInterfaceSubClass = 0x02,
.bInterfaceSubClass = UVC_SC_VIDEOSTREAMING,
.bInterfaceProtocol = 0x00,
.iInterface = 0,
};
Expand Down Expand Up @@ -603,15 +603,15 @@ uvc_bind_config(struct usb_configuration *c,

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

if (fs_streaming == NULL || fs_streaming[0] == NULL ||
fs_streaming[0]->bDescriptorSubType != UVC_DT_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_DT_INPUT_HEADER)
hs_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
goto error;

uvc->desc.control = control;
Expand Down
Loading

0 comments on commit bbafc0c

Please sign in to comment.