aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/atmel_usba_udc.c
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2013-12-13 06:23:38 -0500
committerFelipe Balbi <balbi@ti.com>2013-12-17 14:17:41 -0500
commite117e742d310683b410951faeab4b13b6c3c609f (patch)
treea1f4eecfd74b5b80adb034acf11d102490d0e6d9 /drivers/usb/gadget/atmel_usba_udc.c
parentf8800d47bcdf5ae0582ac674657fd939a9105be0 (diff)
usb: gadget: add "maxpacket_limit" field to struct usb_ep
This patch adds "maxpacket_limit" to struct usb_ep. This field contains maximum value of maxpacket supported by driver, and is set in driver probe. This value should be used by autoconfig() function, because value of field "maxpacket" is set to value from endpoint descriptor when endpoint becomes enabled. So when autoconfig() function will be called again for this endpoint, "maxpacket" value will contain wMaxPacketSize from descriptior instead of maximum packet size for this endpoint. For this reason this patch adds new field "maxpacket_limit" which contains value of maximum packet size (which defines maximum endpoint capabilities). This value is used in ep_matches() function used by autoconfig(). Value of "maxpacket_limit" should be set in UDC driver probe function, using usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function set choosen value to both "maxpacket_limit" and "maxpacket" fields. This patch modifies UDC drivers by adding support for maxpacket_limit. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/atmel_usba_udc.c')
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 2cb52e0438df..68cf3a40f98e 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1904,7 +1904,7 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
1904 ep->dma_regs = udc->regs + USBA_DMA_BASE(i); 1904 ep->dma_regs = udc->regs + USBA_DMA_BASE(i);
1905 ep->fifo = udc->fifo + USBA_FIFO_BASE(i); 1905 ep->fifo = udc->fifo + USBA_FIFO_BASE(i);
1906 ep->ep.ops = &usba_ep_ops; 1906 ep->ep.ops = &usba_ep_ops;
1907 ep->ep.maxpacket = ep->fifo_size; 1907 usb_ep_set_maxpacket_limit(&ep->ep, ep->fifo_size);
1908 ep->udc = udc; 1908 ep->udc = udc;
1909 INIT_LIST_HEAD(&ep->queue); 1909 INIT_LIST_HEAD(&ep->queue);
1910 1910
@@ -1957,7 +1957,8 @@ static struct usba_ep * usba_udc_pdata(struct platform_device *pdev,
1957 ep->fifo = udc->fifo + USBA_FIFO_BASE(i); 1957 ep->fifo = udc->fifo + USBA_FIFO_BASE(i);
1958 ep->ep.ops = &usba_ep_ops; 1958 ep->ep.ops = &usba_ep_ops;
1959 ep->ep.name = pdata->ep[i].name; 1959 ep->ep.name = pdata->ep[i].name;
1960 ep->fifo_size = ep->ep.maxpacket = pdata->ep[i].fifo_size; 1960 ep->fifo_size = pdata->ep[i].fifo_size;
1961 usb_ep_set_maxpacket_limit(&ep->ep, ep->fifo_size);
1961 ep->udc = udc; 1962 ep->udc = udc;
1962 INIT_LIST_HEAD(&ep->queue); 1963 INIT_LIST_HEAD(&ep->queue);
1963 ep->nr_banks = pdata->ep[i].nr_banks; 1964 ep->nr_banks = pdata->ep[i].nr_banks;