Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09bc7252 authored by Mayank Rana's avatar Mayank Rana
Browse files

USB: f_fs: Use config_ep_by_speed() for ADB endpoints



config_ep_by_speed() configures endpoint based on speed and
uses already available endpoint descriptors. Here it overrides
maxpacket field based on selected descriptor for endpoint. maxpacket
field is used by some of UDC driver to resize TXFIFO for IN endpoint.
Due to maxpacket is not being configured with selected endpoint
descriptor, UDC driver uses previously stale maxpacket value which
results into wrong TXFIFO calculated for used IN endpoint. Fix this
issue by calling config_ep_by_speed() for ADB endpoints to make sure
that proper value is updated with maxpacket field based on descriptor.

Change-Id: I9121f4df898de1455f9be4333ca8d0e744f4eb9e
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 0cbda97c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1854,6 +1854,14 @@ static int ffs_func_eps_enable(struct ffs_function *func)

		ep->ep->driver_data = ep;
		ep->ep->desc = ds;

		ret = config_ep_by_speed(func->gadget, &func->function, ep->ep);
		if (ret) {
			pr_err("%s(): config_ep_by_speed(%d) err for %s\n",
						__func__, ret, ep->ep->name);
			break;
		}

		ret = usb_ep_enable(ep->ep);
		if (likely(!ret)) {
			epfile->ep = ep;