aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_sourcesink.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/f_sourcesink.c')
-rw-r--r--drivers/usb/gadget/f_sourcesink.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c
index 5a92883f4c8c..e18b4f520951 100644
--- a/drivers/usb/gadget/f_sourcesink.c
+++ b/drivers/usb/gadget/f_sourcesink.c
@@ -131,6 +131,49 @@ static struct usb_descriptor_header *hs_source_sink_descs[] = {
131 NULL, 131 NULL,
132}; 132};
133 133
134/* super speed support: */
135
136static struct usb_endpoint_descriptor ss_source_desc = {
137 .bLength = USB_DT_ENDPOINT_SIZE,
138 .bDescriptorType = USB_DT_ENDPOINT,
139
140 .bmAttributes = USB_ENDPOINT_XFER_BULK,
141 .wMaxPacketSize = cpu_to_le16(1024),
142};
143
144struct usb_ss_ep_comp_descriptor ss_source_comp_desc = {
145 .bLength = USB_DT_SS_EP_COMP_SIZE,
146 .bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
147 .bMaxBurst = 0,
148 .bmAttributes = 0,
149 .wBytesPerInterval = 0,
150};
151
152static struct usb_endpoint_descriptor ss_sink_desc = {
153 .bLength = USB_DT_ENDPOINT_SIZE,
154 .bDescriptorType = USB_DT_ENDPOINT,
155
156 .bmAttributes = USB_ENDPOINT_XFER_BULK,
157 .wMaxPacketSize = cpu_to_le16(1024),
158};
159
160struct usb_ss_ep_comp_descriptor ss_sink_comp_desc = {
161 .bLength = USB_DT_SS_EP_COMP_SIZE,
162 .bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
163 .bMaxBurst = 0,
164 .bmAttributes = 0,
165 .wBytesPerInterval = 0,
166};
167
168static struct usb_descriptor_header *ss_source_sink_descs[] = {
169 (struct usb_descriptor_header *) &source_sink_intf,
170 (struct usb_descriptor_header *) &ss_source_desc,
171 (struct usb_descriptor_header *) &ss_source_comp_desc,
172 (struct usb_descriptor_header *) &ss_sink_desc,
173 (struct usb_descriptor_header *) &ss_sink_comp_desc,
174 NULL,
175};
176
134/* function-specific strings: */ 177/* function-specific strings: */
135 178
136static struct usb_string strings_sourcesink[] = { 179static struct usb_string strings_sourcesink[] = {
@@ -187,8 +230,18 @@ autoconf_fail:
187 f->hs_descriptors = hs_source_sink_descs; 230 f->hs_descriptors = hs_source_sink_descs;
188 } 231 }
189 232
233 /* support super speed hardware */
234 if (gadget_is_superspeed(c->cdev->gadget)) {
235 ss_source_desc.bEndpointAddress =
236 fs_source_desc.bEndpointAddress;
237 ss_sink_desc.bEndpointAddress =
238 fs_sink_desc.bEndpointAddress;
239 f->ss_descriptors = ss_source_sink_descs;
240 }
241
190 DBG(cdev, "%s speed %s: IN/%s, OUT/%s\n", 242 DBG(cdev, "%s speed %s: IN/%s, OUT/%s\n",
191 gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full", 243 (gadget_is_superspeed(c->cdev->gadget) ? "super" :
244 (gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full")),
192 f->name, ss->in_ep->name, ss->out_ep->name); 245 f->name, ss->in_ep->name, ss->out_ep->name);
193 return 0; 246 return 0;
194} 247}