diff options
author | Cristian Birsan <cristian.birsan@microchip.com> | 2017-01-23 16:45:59 +0200 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-01-24 11:04:24 +0200 |
commit | 741d2558bf0aa8da9c0834ad43e1b9a1b16aa515 (patch) | |
tree | ace7afcd11d93a35e7cfe50c30dbbc672446a910 /drivers/usb/gadget/udc/atmel_usba_udc.h | |
parent | 41dc9ac163e76718d445a8149f8ce635375c8c38 (diff) | |
download | linux-741d2558bf0aa8da9c0834ad43e1b9a1b16aa515.tar.bz2 |
usb: gadget: udc: atmel: Update endpoint allocation scheme
This patch updates the usb endpoint allocation scheme for atmel usba
driver to make sure all endpoints are allocated in order. This
requirement comes from the datasheet of the controller.
The allocation scheme is decided by fifo_mode parameter. For fifo_mode =
0 the driver tries to autoconfigure the endpoints fifo size. All other
modes contain fixed configurations optimized for different purposes. The
idea is somehow similar with the approach used on musb driver.
Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/udc/atmel_usba_udc.h')
-rw-r--r-- | drivers/usb/gadget/udc/atmel_usba_udc.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index 3e1c9d589dfa..a186cdde1f58 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -275,6 +275,12 @@ struct usba_dma_desc { u32 ctrl; }; +struct usba_fifo_cfg { + u8 hw_ep_num; + u16 fifo_size; + u8 nr_banks; +}; + struct usba_ep { int state; void __iomem *ep_regs; @@ -292,7 +298,7 @@ struct usba_ep { unsigned int can_isoc:1; unsigned int is_isoc:1; unsigned int is_in:1; - + unsigned long ept_cfg; #ifdef CONFIG_USB_GADGET_DEBUG_FS u32 last_dma_status; struct dentry *debugfs_dir; @@ -337,6 +343,8 @@ struct usba_udc { int vbus_pin; int vbus_pin_inverted; int num_ep; + int configured_ep; + struct usba_fifo_cfg *fifo_cfg; struct clk *pclk; struct clk *hclk; struct usba_ep *usba_ep; |