aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
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/renesas_usbhs
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/renesas_usbhs')
-rw-r--r--drivers/usb/renesas_usbhs/mod_gadget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 3385aeb5a364..458f3766bef1 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -987,11 +987,11 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
987 /* init DCP */ 987 /* init DCP */
988 if (usbhsg_is_dcp(uep)) { 988 if (usbhsg_is_dcp(uep)) {
989 gpriv->gadget.ep0 = &uep->ep; 989 gpriv->gadget.ep0 = &uep->ep;
990 uep->ep.maxpacket = 64; 990 usb_ep_set_maxpacket_limit(&uep->ep, 64);
991 } 991 }
992 /* init normal pipe */ 992 /* init normal pipe */
993 else { 993 else {
994 uep->ep.maxpacket = 512; 994 usb_ep_set_maxpacket_limit(&uep->ep, 512);
995 list_add_tail(&uep->ep.ep_list, &gpriv->gadget.ep_list); 995 list_add_tail(&uep->ep.ep_list, &gpriv->gadget.ep_list);
996 } 996 }
997 } 997 }