]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc2/gadget: assign TX FIFO dynamically
authorRobert Baldyga <r.baldyga@samsung.com>
Tue, 9 Sep 2014 08:44:56 +0000 (10:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2014 23:16:39 +0000 (16:16 -0700)
commit30a5e61d5209d1fa588426ace08fd41b49f3f461
tree3ad3cf19201105da8bb0bb13dbaaddcaca8fcc08
parentd883eeab128adad2d5f0f634e7ecceef924b5bd2
usb: dwc2/gadget: assign TX FIFO dynamically

Because we have not enough memory to have each TX FIFO of size at least
3072 bytes (the maximum single packet size with 3 transactions per
microframe), we create four FIFOs of lenght 1024, and four of length
3072 bytes, and assing them to endpoints dynamically according to
maxpacket size value of given endpoint.

Up to now there were initialized 16 TX FIFOs, but we use only 8 IN
endpoints, so we can split available memory for 8 FIFOs to have more
memory for each one.

It needed to do some small modifications in few places in code, because
there was assumption that TX FIFO numbers assigned to endpoints are the
same as the endpoint numbers, which is not true since we have dynamic
FIFO assigning.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/core.h
drivers/usb/dwc2/gadget.c