aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/ep0.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-01-18 11:04:09 -0500
committerFelipe Balbi <balbi@ti.com>2012-02-06 04:48:34 -0500
commit457e84b6624b4d97e6ffae437887ea51a22d54a0 (patch)
treee1ca1503cdda97570fa692589e44a1ca43e72d8b /drivers/usb/dwc3/ep0.c
parentbb5cfd6811c63c47403e98028bde7e98bd7a1751 (diff)
usb: dwc3: gadget: dynamically re-size TxFifos
We need to dynamically re-size TxFifos for the cases where default values will not do. While at that, we create a simple function which, for now, will just allocate one full packet fifo space for each of the enabled endpoints. This can be improved later in order to allow for better throughput by allocating more space for endpoints which could make good use of that like isochronous and bulk. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/ep0.c')
-rw-r--r--drivers/usb/dwc3/ep0.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index e90ebb9dd3e8..5104dbf46680 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -457,8 +457,11 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
457 case DWC3_ADDRESS_STATE: 457 case DWC3_ADDRESS_STATE:
458 ret = dwc3_ep0_delegate_req(dwc, ctrl); 458 ret = dwc3_ep0_delegate_req(dwc, ctrl);
459 /* if the cfg matches and the cfg is non zero */ 459 /* if the cfg matches and the cfg is non zero */
460 if (cfg && (!ret || (ret == USB_GADGET_DELAYED_STATUS))) 460 if (cfg && (!ret || (ret == USB_GADGET_DELAYED_STATUS))) {
461 dwc->dev_state = DWC3_CONFIGURED_STATE; 461 dwc->dev_state = DWC3_CONFIGURED_STATE;
462 dwc->resize_fifos = true;
463 dev_dbg(dwc->dev, "resize fifos flag SET\n");
464 }
462 break; 465 break;
463 466
464 case DWC3_CONFIGURED_STATE: 467 case DWC3_CONFIGURED_STATE:
@@ -707,6 +710,12 @@ static void dwc3_ep0_do_control_status(struct dwc3 *dwc, u32 epnum)
707{ 710{
708 struct dwc3_ep *dep = dwc->eps[epnum]; 711 struct dwc3_ep *dep = dwc->eps[epnum];
709 712
713 if (dwc->resize_fifos) {
714 dev_dbg(dwc->dev, "starting to resize fifos\n");
715 dwc3_gadget_resize_tx_fifos(dwc);
716 dwc->resize_fifos = 0;
717 }
718
710 WARN_ON(dwc3_ep0_start_control_status(dep)); 719 WARN_ON(dwc3_ep0_start_control_status(dep));
711} 720}
712 721