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>
This commit is contained in:
T. S., Anil Kumar 2010-09-24 13:44:09 +03:00 committed by Greg Kroah-Hartman
parent ae9b2ad2ee
commit f8afbf7f2b
1 changed files with 4 additions and 2 deletions

View File

@ -1120,6 +1120,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
u32 status = 0; u32 status = 0;
void __iomem *mbase = musb->mregs; void __iomem *mbase = musb->mregs;
struct dma_channel *dma; struct dma_channel *dma;
bool transfer_pending = false;
musb_ep_select(mbase, epnum); musb_ep_select(mbase, epnum);
tx_csr = musb_readw(epio, MUSB_TXCSR); tx_csr = musb_readw(epio, MUSB_TXCSR);
@ -1280,7 +1281,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
offset = d->offset; offset = d->offset;
length = d->length; length = d->length;
} }
} else if (dma) { } else if (dma && urb->transfer_buffer_length == qh->offset) {
done = true; done = true;
} else { } else {
/* see if we need to send more data, or ZLP */ /* see if we need to send more data, or ZLP */
@ -1293,6 +1294,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
if (!done) { if (!done) {
offset = qh->offset; offset = qh->offset;
length = urb->transfer_buffer_length - offset; length = urb->transfer_buffer_length - offset;
transfer_pending = true;
} }
} }
} }
@ -1312,7 +1314,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
urb->actual_length = qh->offset; urb->actual_length = qh->offset;
musb_advance_schedule(musb, urb, hw_ep, USB_DIR_OUT); musb_advance_schedule(musb, urb, hw_ep, USB_DIR_OUT);
return; return;
} else if (usb_pipeisoc(pipe) && dma) { } else if ((usb_pipeisoc(pipe) || transfer_pending) && dma) {
if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb, if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb,
offset, length)) { offset, length)) {
if (is_cppi_enabled() || tusb_dma_omap()) if (is_cppi_enabled() || tusb_dma_omap())