diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2013-12-13 12:23:38 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-12-17 13:17:41 -0600 |
commit | e117e742d310683b410951faeab4b13b6c3c609f (patch) | |
tree | a1f4eecfd74b5b80adb034acf11d102490d0e6d9 /drivers/usb/gadget/goku_udc.c | |
parent | f8800d47bcdf5ae0582ac674657fd939a9105be0 (diff) | |
download | linux-e117e742d310683b410951faeab4b13b6c3c609f.tar.gz linux-e117e742d310683b410951faeab4b13b6c3c609f.tar.bz2 linux-e117e742d310683b410951faeab4b13b6c3c609f.zip |
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/goku_udc.c')
-rw-r--r-- | drivers/usb/gadget/goku_udc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index 7eda9fd6528e..f66f3a7a35ef 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c @@ -231,7 +231,7 @@ static void ep_reset(struct goku_udc_regs __iomem *regs, struct goku_ep *ep) } } - ep->ep.maxpacket = MAX_FIFO_SIZE; + usb_ep_set_maxpacket_limit(&ep->ep, MAX_FIFO_SIZE); ep->ep.desc = NULL; ep->stopped = 1; ep->irqs = 0; @@ -1251,7 +1251,7 @@ static void udc_reinit (struct goku_udc *dev) } dev->ep[0].reg_mode = NULL; - dev->ep[0].ep.maxpacket = MAX_EP0_SIZE; + usb_ep_set_maxpacket_limit(&dev->ep[0].ep, MAX_EP0_SIZE); list_del_init (&dev->ep[0].ep.ep_list); } |