diff options
| author | Felipe Balbi <balbi@ti.com> | 2015-03-11 11:00:05 -0400 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2015-03-11 11:00:05 -0400 |
| commit | 2c247804796bbcaa90087f2196f68fdc20a5fe04 (patch) | |
| tree | 614db37924b22f79b9ec24c65df2a49623a7ecf0 | |
| parent | d0f347d62814ec0f599a05c61c5619d5e999e4ae (diff) | |
Revert "usb: gadget: zero: Add support for interrupt EP"
This reverts commit ef11982dd7a657512c362242508bb4021e0d67b6.
That commit creates a problem for some UDCs (at least musb)
where it allocates an endpoints with a 64-byte FIFO, but later
tries to use that same FIFO for 1024-byte packets.
Before implementing this, composite framework needs to be
modified so we only allocate endpoints after we know negotiated
speed, however that needs quite a bit of extra work.
Cc: <stable@vger.kernel.org> # v3.18+
Signed-off-by: Felipe Balbi <balbi@ti.com>
| -rw-r--r-- | drivers/usb/gadget/function/f_loopback.c | 3 | ||||
| -rw-r--r-- | drivers/usb/gadget/function/f_sourcesink.c | 511 | ||||
| -rw-r--r-- | drivers/usb/gadget/function/g_zero.h | 13 | ||||
| -rw-r--r-- | drivers/usb/gadget/legacy/zero.c | 21 |
4 files changed, 22 insertions, 526 deletions
diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c index 298b46112b1a..39f49f1ad22f 100644 --- a/drivers/usb/gadget/function/f_loopback.c +++ b/drivers/usb/gadget/function/f_loopback.c | |||
| @@ -289,8 +289,7 @@ static void disable_loopback(struct f_loopback *loop) | |||
| 289 | struct usb_composite_dev *cdev; | 289 | struct usb_composite_dev *cdev; |
| 290 | 290 | ||
| 291 | cdev = loop->function.config->cdev; | 291 | cdev = loop->function.config->cdev; |
| 292 | disable_endpoints(cdev, loop->in_ep, loop->out_ep, NULL, NULL, NULL, | 292 | disable_endpoints(cdev, loop->in_ep, loop->out_ep, NULL, NULL); |
| 293 | NULL); | ||
| 294 | VDBG(cdev, "%s disabled\n", loop->function.name); | 293 | VDBG(cdev, "%s disabled\n", loop->function.name); |
| 295 | } | 294 | } |
| 296 | 295 | ||
diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c index e3dae47baef3..3a5ae9900b1e 100644 --- a/drivers/usb/gadget/function/f_sourcesink.c +++ b/drivers/usb/gadget/function/f_sourcesink.c | |||
| @@ -23,15 +23,6 @@ | |||
| 23 | #include "gadget_chips.h" | 23 | #include "gadget_chips.h" |
| 24 | #include "u_f.h" | 24 | #include "u_f.h" |
| 25 | 25 | ||
| 26 | #define USB_MS_TO_SS_INTERVAL(x) USB_MS_TO_HS_INTERVAL(x) | ||
| 27 | |||
| 28 | enum eptype { | ||
| 29 | EP_CONTROL = 0, | ||
| 30 | EP_BULK, | ||
| 31 | EP_ISOC, | ||
| 32 | EP_INTERRUPT, | ||
| 33 | }; | ||
| 34 | |||
| 35 | /* | 26 | /* |
| 36 | * SOURCE/SINK FUNCTION ... a primary testing vehicle for USB peripheral | 27 | * SOURCE/SINK FUNCTION ... a primary testing vehicle for USB peripheral |
| 37 | * controller drivers. | 28 | * controller drivers. |
| @@ -64,8 +55,6 @@ struct f_sourcesink { | |||
| 64 | struct usb_ep *out_ep; | 55 | struct usb_ep *out_ep; |
| 65 | struct usb_ep *iso_in_ep; | 56 | struct usb_ep *iso_in_ep; |
| 66 | struct usb_ep *iso_out_ep; | 57 | struct usb_ep *iso_out_ep; |
| 67 | struct usb_ep *int_in_ep; | ||
| 68 | struct usb_ep *int_out_ep; | ||
| 69 | int cur_alt; | 58 | int cur_alt; |
| 70 | }; | 59 | }; |
| 71 | 60 | ||
| @@ -79,10 +68,6 @@ static unsigned isoc_interval; | |||
| 79 | static unsigned isoc_maxpacket; | 68 | static unsigned isoc_maxpacket; |
| 80 | static unsigned isoc_mult; | 69 | static unsigned isoc_mult; |
| 81 | static unsigned isoc_maxburst; | 70 | static unsigned isoc_maxburst; |
| 82 | static unsigned int_interval; /* In ms */ | ||
| 83 | static unsigned int_maxpacket; | ||
| 84 | static unsigned int_mult; | ||
| 85 | static unsigned int_maxburst; | ||
| 86 | static unsigned buflen; | 71 | static unsigned buflen; |
| 87 | 72 | ||
| 88 | /*-------------------------------------------------------------------------*/ | 73 | /*-------------------------------------------------------------------------*/ |
| @@ -107,16 +92,6 @@ static struct usb_interface_descriptor source_sink_intf_alt1 = { | |||
| 107 | /* .iInterface = DYNAMIC */ | 92 | /* .iInterface = DYNAMIC */ |
| 108 | }; | 93 | }; |
| 109 | 94 | ||
| 110 | static struct usb_interface_descriptor source_sink_intf_alt2 = { | ||
| 111 | .bLength = USB_DT_INTERFACE_SIZE, | ||
| 112 | .bDescriptorType = USB_DT_INTERFACE, | ||
| 113 | |||
| 114 | .bAlternateSetting = 2, | ||
| 115 | .bNumEndpoints = 2, | ||
| 116 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | ||
| 117 | /* .iInterface = DYNAMIC */ | ||
| 118 | }; | ||
| 119 | |||
| 120 | /* full speed support: */ | 95 | /* full speed support: */ |
| 121 | 96 | ||
| 122 | static struct usb_endpoint_descriptor fs_source_desc = { | 97 | static struct usb_endpoint_descriptor fs_source_desc = { |
| @@ -155,26 +130,6 @@ static struct usb_endpoint_descriptor fs_iso_sink_desc = { | |||
| 155 | .bInterval = 4, | 130 | .bInterval = 4, |
| 156 | }; | 131 | }; |
| 157 | 132 | ||
| 158 | static struct usb_endpoint_descriptor fs_int_source_desc = { | ||
| 159 | .bLength = USB_DT_ENDPOINT_SIZE, | ||
| 160 | .bDescriptorType = USB_DT_ENDPOINT, | ||
| 161 | |||
| 162 | .bEndpointAddress = USB_DIR_IN, | ||
| 163 | .bmAttributes = USB_ENDPOINT_XFER_INT, | ||
| 164 | .wMaxPacketSize = cpu_to_le16(64), | ||
| 165 | .bInterval = GZERO_INT_INTERVAL, | ||
| 166 | }; | ||
| 167 | |||
| 168 | static struct usb_endpoint_descriptor fs_int_sink_desc = { | ||
| 169 | .bLength = USB_DT_ENDPOINT_SIZE, | ||
| 170 | .bDescriptorType = USB_DT_ENDPOINT, | ||
| 171 | |||
| 172 | .bEndpointAddress = USB_DIR_OUT, | ||
| 173 | .bmAttributes = USB_ENDPOINT_XFER_INT, | ||
| 174 | .wMaxPacketSize = cpu_to_le16(64), | ||
| 175 | .bInterval = GZERO_INT_INTERVAL, | ||
| 176 | }; | ||
| 177 | |||
| 178 | static struct usb_descriptor_header *fs_source_sink_descs[] = { | 133 | static struct usb_descriptor_header *fs_source_sink_descs[] = { |
| 179 | (struct usb_descriptor_header *) &source_sink_intf_alt0, | 134 | (struct usb_descriptor_header *) &source_sink_intf_alt0, |
| 180 | (struct usb_descriptor_header *) &fs_sink_desc, | 135 | (struct usb_descriptor_header *) &fs_sink_desc, |
| @@ -185,10 +140,6 @@ static struct usb_descriptor_header *fs_source_sink_descs[] = { | |||
| 185 | (struct usb_descriptor_header *) &fs_source_desc, | 140 | (struct usb_descriptor_header *) &fs_source_desc, |
| 186 | (struct usb_descriptor_header *) &fs_iso_sink_desc, | 141 | (struct usb_descriptor_header *) &fs_iso_sink_desc, |
| 187 | (struct usb_descriptor_header *) &fs_iso_source_desc, | 142 | (struct usb_descriptor_header *) &fs_iso_source_desc, |
| 188 | (struct usb_descriptor_header *) &source_sink_intf_alt2, | ||
| 189 | #define FS_ALT_IFC_2_OFFSET 8 | ||
| 190 | (struct usb_descriptor_header *) &fs_int_sink_desc, | ||
| 191 | (struct usb_descriptor_header *) &fs_int_source_desc, | ||
| 192 | NULL, | 143 | NULL, |
| 193 | }; | 144 | }; |
| 194 | 145 | ||
| @@ -228,24 +179,6 @@ static struct usb_endpoint_descriptor hs_iso_sink_desc = { | |||
| 228 | .bInterval = 4, | 179 | .bInterval = 4, |
| 229 | }; | 180 | }; |
| 230 | 181 | ||
| 231 | static struct usb_endpoint_descriptor hs_int_source_desc = { | ||
| 232 | .bLength = USB_DT_ENDPOINT_SIZE, | ||
| 233 | .bDescriptorType = USB_DT_ENDPOINT, | ||
| 234 | |||
| 235 | .bmAttributes = USB_ENDPOINT_XFER_INT, | ||
| 236 | .wMaxPacketSize = cpu_to_le16(1024), | ||
| 237 | .bInterval = USB_MS_TO_HS_INTERVAL(GZERO_INT_INTERVAL), | ||
| 238 | }; | ||
| 239 | |||
| 240 | static struct usb_endpoint_descriptor hs_int_sink_desc = { | ||
| 241 | .bLength = USB_DT_ENDPOINT_SIZE, | ||
| 242 | .bDescriptorType = USB_DT_ENDPOINT, | ||
| 243 | |||
| 244 | .bmAttributes = USB_ENDPOINT_XFER_INT, | ||
| 245 | .wMaxPacketSize = cpu_to_le16(1024), | ||
| 246 | .bInterval = USB_MS_TO_HS_INTERVAL(GZERO_INT_INTERVAL), | ||
| 247 | }; | ||
| 248 | |||
| 249 | static struct usb_descriptor_header *hs_source_sink_descs[] = { | 182 | static struct usb_descriptor_header *hs_source_sink_descs[] = { |
| 250 | (struct usb_descriptor_header *) &source_sink_intf_alt0, | 183 | (struct usb_descriptor_header *) &source_sink_intf_alt0, |
| 251 | (struct usb_descriptor_header *) &hs_source_desc, | 184 | (struct usb_descriptor_header *) &hs_source_desc, |
| @@ -256,10 +189,6 @@ static struct usb_descriptor_header *hs_source_sink_descs[] = { | |||
| 256 | (struct usb_descriptor_header *) &hs_sink_desc, | 189 | (struct usb_descriptor_header *) &hs_sink_desc, |
| 257 | (struct usb_descriptor_header *) &hs_iso_source_desc, | 190 | (struct usb_descriptor_header *) &hs_iso_source_desc, |
| 258 | (struct usb_descriptor_header *) &hs_iso_sink_desc, | 191 | (struct usb_descriptor_header *) &hs_iso_sink_desc, |
| 259 | (struct usb_descriptor_header *) &source_sink_intf_alt2, | ||
| 260 | #define HS_ALT_IFC_2_OFFSET 8 | ||
| 261 | (struct usb_descriptor_header *) &hs_int_source_desc, | ||
| 262 | (struct usb_descriptor_header *) &hs_int_sink_desc, | ||
| 263 | NULL, | 192 | NULL, |
| 264 | }; | 193 | }; |
| 265 | 194 | ||
| @@ -335,42 +264,6 @@ static struct usb_ss_ep_comp_descriptor ss_iso_sink_comp_desc = { | |||
| 335 | .wBytesPerInterval = cpu_to_le16(1024), | 264 | .wBytesPerInterval = cpu_to_le16(1024), |
| 336 | }; | 265 | }; |
| 337 | 266 | ||
| 338 | static struct usb_endpoint_descriptor ss_int_source_desc = { | ||
| 339 | .bLength = USB_DT_ENDPOINT_SIZE, | ||
| 340 | .bDescriptorType = USB_DT_ENDPOINT, | ||
| 341 | |||
| 342 | .bmAttributes = USB_ENDPOINT_XFER_INT, | ||
| 343 | .wMaxPacketSize = cpu_to_le16(1024), | ||
| 344 | .bInterval = USB_MS_TO_SS_INTERVAL(GZERO_INT_INTERVAL), | ||
| 345 | }; | ||
| 346 | |||
