diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2013-12-13 06:23:38 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-12-17 14:17:41 -0500 |
commit | e117e742d310683b410951faeab4b13b6c3c609f (patch) | |
tree | a1f4eecfd74b5b80adb034acf11d102490d0e6d9 /drivers/usb/musb/musb_gadget.c | |
parent | f8800d47bcdf5ae0582ac674657fd939a9105be0 (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/musb/musb_gadget.c')
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index d2d3a173b315..76f007654821 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1727,14 +1727,14 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) | |||
1727 | ep->end_point.name = ep->name; | 1727 | ep->end_point.name = ep->name; |
1728 | INIT_LIST_HEAD(&ep->end_point.ep_list); | 1728 | INIT_LIST_HEAD(&ep->end_point.ep_list); |
1729 | if (!epnum) { | 1729 | if (!epnum) { |
1730 | ep->end_point.maxpacket = 64; | 1730 | usb_ep_set_maxpacket_limit(&ep->end_point, 64); |
1731 | ep->end_point.ops = &musb_g_ep0_ops; | 1731 | ep->end_point.ops = &musb_g_ep0_ops; |
1732 | musb->g.ep0 = &ep->end_point; | 1732 | musb->g.ep0 = &ep->end_point; |
1733 | } else { | 1733 | } else { |
1734 | if (is_in) | 1734 | if (is_in) |
1735 | ep->end_point.maxpacket = hw_ep->max_packet_sz_tx; | 1735 | usb_ep_set_maxpacket_limit(&ep->end_point, hw_ep->max_packet_sz_tx); |
1736 | else | 1736 | else |
1737 | ep->end_point.maxpacket = hw_ep->max_packet_sz_rx; | 1737 | usb_ep_set_maxpacket_limit(&ep->end_point, hw_ep->max_packet_sz_rx); |
1738 | ep->end_point.ops = &musb_ep_ops; | 1738 | ep->end_point.ops = &musb_ep_ops; |
1739 | list_add_tail(&ep->end_point.ep_list, &musb->g.ep_list); | 1739 | list_add_tail(&ep->end_point.ep_list, &musb->g.ep_list); |
1740 | } | 1740 | } |