diff options
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/omap_udc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index b7885dc0f42f..de8a89ae4bc3 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -691,7 +691,7 @@ static void next_out_dma(struct omap_ep *ep, struct omap_req *req) | |||
691 | } | 691 | } |
692 | 692 | ||
693 | static void | 693 | static void |
694 | finish_out_dma(struct omap_ep *ep, struct omap_req *req, int status) | 694 | finish_out_dma(struct omap_ep *ep, struct omap_req *req, int status, int one) |
695 | { | 695 | { |
696 | u16 count; | 696 | u16 count; |
697 | 697 | ||
@@ -699,6 +699,8 @@ finish_out_dma(struct omap_ep *ep, struct omap_req *req, int status) | |||
699 | ep->dma_counter = (u16) (req->req.dma + req->req.actual); | 699 | ep->dma_counter = (u16) (req->req.dma + req->req.actual); |
700 | count = dma_dest_len(ep, req->req.dma + req->req.actual); | 700 | count = dma_dest_len(ep, req->req.dma + req->req.actual); |
701 | count += req->req.actual; | 701 | count += req->req.actual; |
702 | if (one) | ||
703 | count--; | ||
702 | if (count <= req->req.length) | 704 | if (count <= req->req.length) |
703 | req->req.actual = count; | 705 | req->req.actual = count; |
704 | 706 | ||
@@ -747,7 +749,7 @@ static void dma_irq(struct omap_udc *udc, u16 irq_src) | |||
747 | if (!list_empty(&ep->queue)) { | 749 | if (!list_empty(&ep->queue)) { |
748 | req = container_of(ep->queue.next, | 750 | req = container_of(ep->queue.next, |
749 | struct omap_req, queue); | 751 | struct omap_req, queue); |
750 | finish_out_dma(ep, req, 0); | 752 | finish_out_dma(ep, req, 0, dman_stat & UDC_DMA_RX_SB); |
751 | } | 753 | } |
752 | UDC_IRQ_SRC_REG = UDC_RXN_EOT; | 754 | UDC_IRQ_SRC_REG = UDC_RXN_EOT; |
753 | 755 | ||
@@ -925,7 +927,7 @@ static void dma_channel_release(struct omap_ep *ep) | |||
925 | while (UDC_RXDMA_CFG_REG & mask) | 927 | while (UDC_RXDMA_CFG_REG & mask) |
926 | udelay(10); | 928 | udelay(10); |
927 | if (req) | 929 | if (req) |
928 | finish_out_dma(ep, req, -ECONNRESET); | 930 | finish_out_dma(ep, req, -ECONNRESET, 0); |
929 | } | 931 | } |
930 | omap_free_dma(ep->lch); | 932 | omap_free_dma(ep->lch); |
931 | ep->dma_channel = 0; | 933 | ep->dma_channel = 0; |