aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorT. S., Anil Kumar <anil@ti.com>2010-09-24 06:44:09 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:21:54 -0400
commitf8afbf7f2bf3cee0f4fff7cb753ecc9f583972c3 (patch)
treeab438c81a15eda0f8b25191b766f644f3f2f81e3
parentae9b2ad2eea729b907ef5dd5e25d1ff8443d03fc (diff)
usb: musb: host: support DMA transfers greater than max channel length
Add support for MUSB Host DMA transfers greater than max channel length, so that such transfers won't be truncated. Signed-off-by: Anil Shetty <anil@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/musb/musb_host.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 62e39fc57211..4d5bcb4e14d2 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1120,6 +1120,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
1120 u32 status = 0; 1120 u32 status = 0;
1121 void __iomem *mbase = musb->mregs; 1121 void __iomem *mbase = musb->mregs;
1122 struct dma_channel *dma; 1122 struct dma_channel *dma;
1123 bool transfer_pending = false;
1123 1124
1124 musb_ep_select(mbase, epnum); 1125 musb_ep_select(mbase, epnum);
1125 tx_csr = musb_readw(epio, MUSB_TXCSR); 1126 tx_csr = musb_readw(epio, MUSB_TXCSR);
@@ -1280,7 +1281,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
1280 offset = d->offset; 1281 offset = d->offset;
1281 length = d->length; 1282 length = d->length;
1282 } 1283 }
1283 } else if (dma) { 1284 } else if (dma && urb->transfer_buffer_length == qh->offset) {
1284 done = true; 1285 done = true;
1285 } else { 1286 } else {
1286 /* see if we need to send more data, or ZLP */ 1287 /* see if we need to send more data, or ZLP */
@@ -1293,6 +1294,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
1293 if (!done) { 1294 if (!done) {
1294 offset = qh->offset; 1295 offset = qh->offset;
1295 length = urb->transfer_buffer_length - offset; 1296 length = urb->transfer_buffer_length - offset;
1297 transfer_pending = true;
1296 } 1298 }
1297 } 1299 }
1298 } 1300 }
@@ -1312,7 +1314,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
1312 urb->actual_length = qh->offset; 1314 urb->actual_length = qh->offset;
1313 musb_advance_schedule(musb, urb, hw_ep, USB_DIR_OUT); 1315 musb_advance_schedule(musb, urb, hw_ep, USB_DIR_OUT);
1314 return; 1316 return;
1315 } else if (usb_pipeisoc(pipe) && dma) { 1317 } else if ((usb_pipeisoc(pipe) || transfer_pending) && dma) {
1316 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb, 1318 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb,
1317 offset, length)) { 1319 offset, length)) {
1318 if (is_cppi_enabled() || tusb_dma_omap()) 1320 if (is_cppi_enabled() || tusb_dma_omap())