aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <yousaf.kaukab@intel.com>2015-05-16 16:33:37 -0400
committerFelipe Balbi <balbi@ti.com>2015-05-26 11:40:21 -0400
commite9ab4d0ab8f5b1159558b9ab236e408d50962a00 (patch)
tree5a0088879c6b449ed1230ece930126699cf4c33b
parentc65c4f052bc3b67989bf54914798513685c54988 (diff)
usb: gadget: autoconf: net2280: match hardware and usb ep address
USB3380 GPEP can be used in IN and OUT directions however, both directions should use same endpoint address. Fulfil this requirement by mapping usb endpoint to hardware endpoint with the same address. Tested-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/epautoconf.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 0567cca1465e..919cdfdda78b 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -258,15 +258,25 @@ struct usb_ep *usb_ep_autoconfig_ss(
258 /* First, apply chip-specific "best usage" knowledge. 258 /* First, apply chip-specific "best usage" knowledge.
259 * This might make a good usb_gadget_ops hook ... 259 * This might make a good usb_gadget_ops hook ...
260 */ 260 */
261 if (gadget_is_net2280 (gadget) && type == USB_ENDPOINT_XFER_INT) { 261 if (gadget_is_net2280(gadget)) {
262 /* ep-e, ep-f are PIO with only 64 byte fifos */ 262 char name[8];
263 ep = find_ep (gadget, "ep-e"); 263
264 if (ep && ep_matches(gadget, ep, desc, ep_comp)) 264 if (type == USB_ENDPOINT_XFER_INT) {
265 goto found_ep; 265 /* ep-e, ep-f are PIO with only 64 byte fifos */
266 ep = find_ep (gadget, "ep-f"); 266 ep = find_ep(gadget, "ep-e");
267 if (ep && ep_matches(gadget, ep, desc, ep_comp))
268 goto found_ep;
269 ep = find_ep(gadget, "ep-f");
270 if (ep && ep_matches(gadget, ep, desc, ep_comp))
271 goto found_ep;
272 }
273
274 /* USB3380: use same address for usb and hardware endpoints */
275 snprintf(name, sizeof(name), "ep%d%s", usb_endpoint_num(desc),
276 usb_endpoint_dir_in(desc) ? "in" : "out");
277 ep = find_ep(gadget, name);
267 if (ep && ep_matches(gadget, ep, desc, ep_comp)) 278 if (ep && ep_matches(gadget, ep, desc, ep_comp))
268 goto found_ep; 279 goto found_ep;
269
270 } else if (gadget_is_goku (gadget)) { 280 } else if (gadget_is_goku (gadget)) {
271 if (USB_ENDPOINT_XFER_INT == type) { 281 if (USB_ENDPOINT_XFER_INT == type) {
272 /* single buffering is enough */ 282 /* single buffering is enough */