aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/epautoconf.c
diff options
context:
space:
mode:
authorBryan Wu <cooloney@kernel.org>2009-12-21 10:43:06 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:53:28 -0500
commit3a8a3b1cee6c525661732b8bcf29ac63d42945ed (patch)
tree0d35ecc39dbd9b879b61d6b49bc5f2085b55c564 /drivers/usb/gadget/epautoconf.c
parentca0e9485afb8db3abf58235abf6afded2df0db17 (diff)
USB: gadget: use ep5 for bulk-in and ep6 for bulk-out for Blackfin MUSB
Normally, the musb uses ep1 as the bidirectional bulk endpoint. This won't work on the Blackfin musb as all endpoints (except ep0) are unidirectional. Further, ep1-ep4 have a small 128 byte FIFO which makes them undesirable for bulk endpoints (which need more like a 512 byte FIFO). This leaves us with ep5-ep7 which have 1024 byte FIFOs and can be configured as either in/out and bulk/interrupt/iso on the fly. Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/epautoconf.c')
-rw-r--r--drivers/usb/gadget/epautoconf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index cd0914ec898e..4671d5d7973d 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -275,6 +275,20 @@ struct usb_ep * __init usb_ep_autoconfig (
275 ep = find_ep (gadget, "ep1-bulk"); 275 ep = find_ep (gadget, "ep1-bulk");
276 if (ep && ep_matches (gadget, ep, desc)) 276 if (ep && ep_matches (gadget, ep, desc))
277 return ep; 277 return ep;
278
279#ifdef CONFIG_BLACKFIN
280 } else if (gadget_is_musbhsfc(gadget) || gadget_is_musbhdrc(gadget)) {
281 if ((USB_ENDPOINT_XFER_BULK == type) ||
282 (USB_ENDPOINT_XFER_ISOC == type)) {
283 if (USB_DIR_IN & desc->bEndpointAddress)
284 ep = find_ep (gadget, "ep5in");
285 else
286 ep = find_ep (gadget, "ep6out");
287 } else
288 ep = NULL;
289 if (ep && ep_matches (gadget, ep, desc))
290 return ep;
291#endif
278 } 292 }
279 293
280 /* Second, look at endpoints until an unclaimed one looks usable */ 294 /* Second, look at endpoints until an unclaimed one looks usable */