diff mbox

[linux-next] usb: gadget: atmel_usba_udc: add ep capabilities support on device tree binding

Message ID 1441657171-15362-1-git-send-email-sylvain.rochet@finsecur.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sylvain Rochet Sept. 7, 2015, 8:19 p.m. UTC
The recently added endpoint capabilities flags verification breaks Atmel
USBA because the endpoint configuration was only added when the driver
is bound using the legacy pdata interface.

Convert endpoint configuration to new capabilities model when driver is
bound to a device tree as well.

Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Nicolas Ferre Sept. 18, 2015, 2:22 p.m. UTC | #1
Le 07/09/2015 22:19, Sylvain Rochet a écrit :
> The recently added endpoint capabilities flags verification breaks Atmel
> USBA because the endpoint configuration was only added when the driver
> is bound using the legacy pdata interface.
> 
> Convert endpoint configuration to new capabilities model when driver is
> bound to a device tree as well.
> 
> Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

With this additional tag:
Fixes: 47bef3865115 ("usb: gadget: atmel_usba_udc: add ep capabilities support")

Felipe, Greg,

It is considered as a fix for 4.3. Can you please queue it for the "4.3-rc" phase?

Thanks, bye.

> ---
>  drivers/usb/gadget/udc/atmel_usba_udc.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index 2cbbb46..c2ea5e1 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -2002,6 +2002,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
>  		ep->udc = udc;
>  		INIT_LIST_HEAD(&ep->queue);
>  
> +		if (ep->index == 0) {
> +			ep->ep.caps.type_control = true;
> +		} else {
> +			ep->ep.caps.type_iso = ep->can_isoc;
> +			ep->ep.caps.type_bulk = true;
> +			ep->ep.caps.type_int = true;
> +		}
> +
> +		ep->ep.caps.dir_in = true;
> +		ep->ep.caps.dir_out = true;
> +
>  		if (i)
>  			list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
>  
>
Felipe Balbi Sept. 18, 2015, 2:27 p.m. UTC | #2
On Fri, Sep 18, 2015 at 04:22:07PM +0200, Nicolas Ferre wrote:
> Le 07/09/2015 22:19, Sylvain Rochet a écrit :
> > The recently added endpoint capabilities flags verification breaks Atmel
> > USBA because the endpoint configuration was only added when the driver
> > is bound using the legacy pdata interface.
> > 
> > Convert endpoint configuration to new capabilities model when driver is
> > bound to a device tree as well.
> > 
> > Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> With this additional tag:
> Fixes: 47bef3865115 ("usb: gadget: atmel_usba_udc: add ep capabilities support")
> 
> Felipe, Greg,
> 
> It is considered as a fix for 4.3. Can you please queue it for the "4.3-rc" phase?

sure thing, just, please, resend with linux-usb in Cc :-)
diff mbox

Patch

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 2cbbb46..c2ea5e1 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -2002,6 +2002,17 @@  static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
 		ep->udc = udc;
 		INIT_LIST_HEAD(&ep->queue);
 
+		if (ep->index == 0) {
+			ep->ep.caps.type_control = true;
+		} else {
+			ep->ep.caps.type_iso = ep->can_isoc;
+			ep->ep.caps.type_bulk = true;
+			ep->ep.caps.type_int = true;
+		}
+
+		ep->ep.caps.dir_in = true;
+		ep->ep.caps.dir_out = true;
+
 		if (i)
 			list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);