1 From ba59a0812ba0e223bd0af8f4dea6c971b6289696 Mon Sep 17 00:00:00 2001
2 From: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
3 Date: Thu, 2 Apr 2009 12:07:08 -0700
4 Subject: [PATCH] musb: use dma mode 1 for TX if transfer size equals maxpacket (v2)
6 Currently, with Inventra DMA, we use Mode 0 if transfer size is less
7 than or equal to the endpoint's maxpacket size. This requires that
8 we explicitly set TXPKTRDY for that transfer.
10 However the musb_g_tx code will not set TXPKTRDY twice if the last
11 transfer is exactly equal to maxpacket, even if request->zero is set.
12 Using Mode 1 will solve this; a better fix might be in musb_g_tx().
14 Without this change, musb will not correctly send out a ZLP if the
15 last transfer is the maxpacket size and request->zero is set.
17 Signed-off-by: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
18 Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
20 drivers/usb/musb/musb_gadget.c | 2 +-
21 1 files changed, 1 insertions(+), 1 deletions(-)
23 diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
24 index bc197b2..e8f920c 100644
25 --- a/drivers/usb/musb/musb_gadget.c
26 +++ b/drivers/usb/musb/musb_gadget.c
27 @@ -310,7 +310,7 @@ static void txstate(struct musb *musb, struct musb_request *req)
28 /* setup DMA, then program endpoint CSR */
29 request_size = min(request->length,
30 musb_ep->dma->max_len);
31 - if (request_size <= musb_ep->packet_sz)
32 + if (request_size < musb_ep->packet_sz)
33 musb_ep->dma->desired_mode = 0;
35 musb_ep->dma->desired_mode = 1;