aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_uvc.c
diff options
context:
space:
mode:
authorBhupesh Sharma <bhupesh.sharma@st.com>2012-06-01 05:38:55 -0400
committerFelipe Balbi <balbi@ti.com>2012-06-04 11:12:31 -0400
commit5797663674b0d802f275761e71593b32b0849242 (patch)
tree86f1ee4d35e18002d99d2f930424018bb8b79491 /drivers/usb/gadget/f_uvc.c
parent3de6e63f7845e99981e489ddccf70b3ec02fe00a (diff)
usb: gadget: uvc: Use macro for interrupt endpoint status size instead of using a MAGIC number
This patch adds a MACRO for the UVC video control status (interrupt) endpoint and removes the magic number which was being used earlier. Some UDCs have issues supporting an interrupt IN endpoint having a max packet size less than a particular value (say 32). It is easier in that case to simply change the MACRO value instead of changing the max packet size value at a number of locations. Signed-off-by: Bhupesh Sharma <bhupesh.sharma@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/f_uvc.c')
-rw-r--r--drivers/usb/gadget/f_uvc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
index 054c35a22fbf..dd7d7a98ed43 100644
--- a/drivers/usb/gadget/f_uvc.c
+++ b/drivers/usb/gadget/f_uvc.c
@@ -59,6 +59,8 @@ static struct usb_gadget_strings *uvc_function_strings[] = {
59#define UVC_INTF_VIDEO_CONTROL 0 59#define UVC_INTF_VIDEO_CONTROL 0
60#define UVC_INTF_VIDEO_STREAMING 1 60#define UVC_INTF_VIDEO_STREAMING 1
61 61
62#define STATUS_BYTECOUNT 16 /* 16 bytes status */
63
62static struct usb_interface_assoc_descriptor uvc_iad __initdata = { 64static struct usb_interface_assoc_descriptor uvc_iad __initdata = {
63 .bLength = sizeof(uvc_iad), 65 .bLength = sizeof(uvc_iad),
64 .bDescriptorType = USB_DT_INTERFACE_ASSOCIATION, 66 .bDescriptorType = USB_DT_INTERFACE_ASSOCIATION,
@@ -87,7 +89,7 @@ static struct usb_endpoint_descriptor uvc_control_ep __initdata = {
87 .bDescriptorType = USB_DT_ENDPOINT, 89 .bDescriptorType = USB_DT_ENDPOINT,
88 .bEndpointAddress = USB_DIR_IN, 90 .bEndpointAddress = USB_DIR_IN,
89 .bmAttributes = USB_ENDPOINT_XFER_INT, 91 .bmAttributes = USB_ENDPOINT_XFER_INT,
90 .wMaxPacketSize = cpu_to_le16(16), 92 .wMaxPacketSize = cpu_to_le16(STATUS_BYTECOUNT),
91 .bInterval = 8, 93 .bInterval = 8,
92}; 94};
93 95
@@ -95,7 +97,7 @@ static struct uvc_control_endpoint_descriptor uvc_control_cs_ep __initdata = {
95 .bLength = UVC_DT_CONTROL_ENDPOINT_SIZE, 97 .bLength = UVC_DT_CONTROL_ENDPOINT_SIZE,
96 .bDescriptorType = USB_DT_CS_ENDPOINT, 98 .bDescriptorType = USB_DT_CS_ENDPOINT,
97 .bDescriptorSubType = UVC_EP_INTERRUPT, 99 .bDescriptorSubType = UVC_EP_INTERRUPT,
98 .wMaxTransferSize = cpu_to_le16(16), 100 .wMaxTransferSize = cpu_to_le16(STATUS_BYTECOUNT),
99}; 101};
100 102
101static struct usb_interface_descriptor uvc_streaming_intf_alt0 __initdata = { 103static struct usb_interface_descriptor uvc_streaming_intf_alt0 __initdata = {