aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorsupriya karanth <supriya.karanth@stericsson.com>2012-12-06 00:42:48 -0500
committerFelipe Balbi <balbi@ti.com>2013-01-10 07:15:19 -0500
commitbb3a2ef2eb8cfaea335dcb3426350df7f3d48069 (patch)
treebf1388a03d7533cdabbed072cd6aaa9b09cc3734 /drivers/usb/musb
parent7e56e621ce9cf4604694c969087456aced338be6 (diff)
usb: musb: set TXMAXP and AUTOSET for full speed bulk in device mode
The TXMAXP register is not set correctly for full speed bulk case when the can_bulk_split() is used. Without this PIO transfers will not take place correctly The "mult" factor needs to be updated correctly for the can_bulk_split() case The AUTOSET bit in the TXCSR is not being set if the "mult" factor is greater than 0 for the High Bandwidth ISO case. But the "mult" factor is also greater than 0 in case of Full speed bulk transfers with the packet splitting in TXMAXP register Without the AUTOSET the DMA transfers will not progress in mode1 [ balbi@ti.com : add braces to both branches ] Signed-off-by: supriya karanth <supriya.karanth@stericsson.com> Signed-off-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_gadget.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 876787438c2f..be18537c5f14 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -408,7 +408,19 @@ static void txstate(struct musb *musb, struct musb_request *req)
408 csr |= (MUSB_TXCSR_DMAENAB 408 csr |= (MUSB_TXCSR_DMAENAB
409 | MUSB_TXCSR_DMAMODE 409 | MUSB_TXCSR_DMAMODE
410 | MUSB_TXCSR_MODE); 410 | MUSB_TXCSR_MODE);
411 if (!musb_ep->hb_mult) 411 /*
412 * Enable Autoset according to table
413 * below
414 * bulk_split hb_mult Autoset_Enable
415 * 0 0 Yes(Normal)
416 * 0 >0 No(High BW ISO)
417 * 1 0 Yes(HS bulk)
418 * 1 >0 Yes(FS bulk)
419 */
420 if (!musb_ep->hb_mult ||
421 (musb_ep->hb_mult &&
422 can_bulk_split(musb,
423 musb_ep->type)))
412 csr |= MUSB_TXCSR_AUTOSET; 424 csr |= MUSB_TXCSR_AUTOSET;
413 } 425 }
414 csr &= ~MUSB_TXCSR_P_UNDERRUN; 426 csr &= ~MUSB_TXCSR_P_UNDERRUN;
@@ -1110,11 +1122,15 @@ static int musb_gadget_enable(struct usb_ep *ep,
1110 /* Set TXMAXP with the FIFO size of the endpoint 1122 /* Set TXMAXP with the FIFO size of the endpoint
1111 * to disable double buffering mode. 1123 * to disable double buffering mode.
1112 */ 1124 */
1113 if (musb->double_buffer_not_ok) 1125 if (musb->double_buffer_not_ok) {
1114 musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx); 1126 musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx);
1115 else 1127 } else {
1128 if (can_bulk_split(musb, musb_ep->type))
1129 musb_ep->hb_mult = (hw_ep->max_packet_sz_tx /
1130 musb_ep->packet_sz) - 1;
1116 musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz 1131 musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz
1117 | (musb_ep->hb_mult << 11)); 1132 | (musb_ep->hb_mult << 11));
1133 }
1118 1134
1119 csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; 1135 csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG;
1120 if (musb_readw(regs, MUSB_TXCSR) 1136 if (musb_readw(regs, MUSB_TXCSR)