[U-Boot,2/9] gadget: f_thor: properly enable 3rd endpoint defined by the protocol

Message ID 20181107150105.23165-3-m.szyprowski@samsung.com
State Changes Requested
Delegated to: Minkyu Kang
Headers show
Series
  • ARM: Exynos: Add TM2 board support
Related show

Commit Message

Marek Szyprowski Nov. 7, 2018, 3 p.m.
This is needed to make Windows THOR flash tool happy, because it
starts sending data only when interrupt packet is received on the 3rd
endpoint.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/usb/gadget/f_thor.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Lukasz Majewski Nov. 21, 2018, 12:49 a.m. | #1
On Wed, 07 Nov 2018 16:00:58 +0100
Marek Szyprowski <m.szyprowski@samsung.com> wrote:

> This is needed to make Windows THOR flash tool happy, because it
> starts sending data only when interrupt packet is received on the 3rd
> endpoint.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/usb/gadget/f_thor.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
> index 8b3b19feaf..920fa5279c 100644
> --- a/drivers/usb/gadget/f_thor.c
> +++ b/drivers/usb/gadget/f_thor.c
> @@ -941,6 +941,13 @@ static int thor_eps_setup(struct usb_function *f)
>  	dev->out_req = req;
>  	/* ACM control EP */
>  	ep = dev->int_ep;
> +	d = ep_desc(gadget, &hs_int_desc, &fs_int_desc);
> +	debug("(d)bEndpointAddress: 0x%x\n", d->bEndpointAddress);
> +
> +	result = usb_ep_enable(ep, d);
> +	if (result)
> +		goto err;
> +
>  	ep->driver_data = cdev;	/* claim */
>  
>  	return 0;

Acked-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

Patch

diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index 8b3b19feaf..920fa5279c 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -941,6 +941,13 @@  static int thor_eps_setup(struct usb_function *f)
 	dev->out_req = req;
 	/* ACM control EP */
 	ep = dev->int_ep;
+	d = ep_desc(gadget, &hs_int_desc, &fs_int_desc);
+	debug("(d)bEndpointAddress: 0x%x\n", d->bEndpointAddress);
+
+	result = usb_ep_enable(ep, d);
+	if (result)
+		goto err;
+
 	ep->driver_data = cdev;	/* claim */
 
 	return 0;