Commit e9ab4d0a authored by Mian Yousaf Kaukab's avatar Mian Yousaf Kaukab Committed by Felipe Balbi

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: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: default avatarMian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent c65c4f05
...@@ -258,15 +258,25 @@ struct usb_ep *usb_ep_autoconfig_ss( ...@@ -258,15 +258,25 @@ struct usb_ep *usb_ep_autoconfig_ss(
/* First, apply chip-specific "best usage" knowledge. /* First, apply chip-specific "best usage" knowledge.
* This might make a good usb_gadget_ops hook ... * This might make a good usb_gadget_ops hook ...
*/ */
if (gadget_is_net2280 (gadget) && type == USB_ENDPOINT_XFER_INT) { if (gadget_is_net2280(gadget)) {
char name[8];
if (type == USB_ENDPOINT_XFER_INT) {
/* ep-e, ep-f are PIO with only 64 byte fifos */ /* ep-e, ep-f are PIO with only 64 byte fifos */
ep = find_ep (gadget, "ep-e"); ep = find_ep(gadget, "ep-e");
if (ep && ep_matches(gadget, ep, desc, ep_comp)) if (ep && ep_matches(gadget, ep, desc, ep_comp))
goto found_ep; goto found_ep;
ep = find_ep (gadget, "ep-f"); ep = find_ep(gadget, "ep-f");
if (ep && ep_matches(gadget, ep, desc, ep_comp)) if (ep && ep_matches(gadget, ep, desc, ep_comp))
goto found_ep; goto found_ep;
}
/* USB3380: use same address for usb and hardware endpoints */
snprintf(name, sizeof(name), "ep%d%s", usb_endpoint_num(desc),
usb_endpoint_dir_in(desc) ? "in" : "out");
ep = find_ep(gadget, name);
if (ep && ep_matches(gadget, ep, desc, ep_comp))
goto found_ep;
} else if (gadget_is_goku (gadget)) { } else if (gadget_is_goku (gadget)) {
if (USB_ENDPOINT_XFER_INT == type) { if (USB_ENDPOINT_XFER_INT == type) {
/* single buffering is enough */ /* single buffering is enough */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment