Re: [PATCH v3 26/46] usb: gadget: pch_ud: add ep capabilities support

2015-07-20 Thread Krzysztof Opasiak



On 07/15/2015 08:32 AM, Robert Baldyga wrote:

Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga 
---
  drivers/usb/gadget/udc/pch_udc.c | 14 --
  1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index 613547f..cc8fb3c 100644
--- a/drivers/usb/gadget/udc/pch_udc.c
+++ b/drivers/usb/gadget/udc/pch_udc.c
@@ -2895,11 +2895,21 @@ static void pch_udc_pcd_reinit(struct pch_udc_dev *dev)
ep->in = ~i & 1;
ep->ep.name = ep_string[i];
ep->ep.ops = &pch_udc_ep_ops;
-   if (ep->in)
+   if (ep->in) {
ep->offset_addr = ep->num * UDC_EP_REG_SHIFT;
-   else
+   ep->ep.caps.dir_in = true;
+   } else {
ep->offset_addr = (UDC_EPINT_OUT_SHIFT + ep->num) *
  UDC_EP_REG_SHIFT;
+   ep->ep.caps.dir_out = true;
+   }
+   if (i == UDC_EP0IN_IDX || i == UDC_EP0OUT_IDX) {
+   ep->ep.caps.type_control = true;


In all previous patches you set both dir_in and dir_out to true for ep0 
but in this patch you don't do this. Is there some reason for this or 
it's just a mistake?



+   } else {
+   ep->ep.caps.type_iso = true;
+   ep->ep.caps.type_bulk = true;
+   ep->ep.caps.type_int = true;
+   }
/* need to set ep->ep.maxpacket and set Default Configuration?*/
usb_ep_set_maxpacket_limit(&ep->ep, UDC_BULK_MAX_PKT_SIZE);
list_add_tail(&ep->ep.ep_list, &dev->gadget.ep_list);



Best Regards,

--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 01/46] usb: gadget: encapsulate endpoint claiming mechanism

2015-07-20 Thread Krzysztof Opasiak



On 07/15/2015 08:31 AM, Robert Baldyga wrote:

So far it was necessary for usb functions to set ep->driver_data in
endpoint obtained from autoconfig to non-null value, to indicate that
endpoint is claimed by function (in autoconfig it was checked if endpoint
has set this field to non-null value, and if it has, it was assumed that
it is claimed). It could cause bugs becouse if some function doesn't


s/becouse/because

Best regards,
--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html