aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorsupriya karanth <supriya.karanth@stericsson.com>2012-12-06 00:46:23 -0500
committerFelipe Balbi <balbi@ti.com>2013-01-10 07:16:47 -0500
commitf27862819350d2c1a679b690b5b3559e632e81eb (patch)
treece6449f55b5238d486dc2b004df646cdfa13318e /drivers/usb/musb
parentbb3a2ef2eb8cfaea335dcb3426350df7f3d48069 (diff)
usb: musb: set AUTOSET for full speed bulk DMA transfer in host mode
The "mult" factor is not updated properly for the can_bulk_split() case. The AUTOSET bit in the TXCSR is not being set if the "mult" factor is greater than 1 for the High Bandwidth ISO case. But the "mult" factor is also greater than 1 in case of Full speed bulk transfers with the packet splitting in TXMAXP register enabled with can_bulk_split(). Without the AUTOSET the DMA transfers will not progress in mode1 [ balbi@ti.com : fix braces placement ] 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_host.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index e9f0fd9ddd2d..cf3705fd78c8 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -634,7 +634,17 @@ static bool musb_tx_dma_program(struct dma_controller *dma,
634 mode = 1; 634 mode = 1;
635 csr |= MUSB_TXCSR_DMAMODE | MUSB_TXCSR_DMAENAB; 635 csr |= MUSB_TXCSR_DMAMODE | MUSB_TXCSR_DMAENAB;
636 /* autoset shouldn't be set in high bandwidth */ 636 /* autoset shouldn't be set in high bandwidth */
637 if (qh->hb_mult == 1) 637 /*
638 * Enable Autoset according to table
639 * below
640 * bulk_split hb_mult Autoset_Enable
641 * 0 1 Yes(Normal)
642 * 0 >1 No(High BW ISO)
643 * 1 1 Yes(HS bulk)
644 * 1 >1 Yes(FS bulk)
645 */
646 if (qh->hb_mult == 1 || (qh->hb_mult > 1 &&
647 can_bulk_split(hw_ep->musb, qh->type)))
638 csr |= MUSB_TXCSR_AUTOSET; 648 csr |= MUSB_TXCSR_AUTOSET;
639 } else { 649 } else {
640 mode = 0; 650 mode = 0;
@@ -791,17 +801,19 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
791 /* protocol/endpoint/interval/NAKlimit */ 801 /* protocol/endpoint/interval/NAKlimit */
792 if (epnum) { 802 if (epnum) {
793 musb_writeb(epio, MUSB_TXTYPE, qh->type_reg); 803 musb_writeb(epio, MUSB_TXTYPE, qh->type_reg);
794 if (musb->double_buffer_not_ok) 804 if (musb->double_buffer_not_ok) {
795 musb_writew(epio, MUSB_TXMAXP, 805 musb_writew(epio, MUSB_TXMAXP,
796 hw_ep->max_packet_sz_tx); 806 hw_ep->max_packet_sz_tx);
797 else if (can_bulk_split(musb, qh->type)) 807 } else if (can_bulk_split(musb, qh->type)) {
808 qh->hb_mult = hw_ep->max_packet_sz_tx
809 / packet_sz;
798 musb_writew(epio, MUSB_TXMAXP, packet_sz 810 musb_writew(epio, MUSB_TXMAXP, packet_sz
799 | ((hw_ep->max_packet_sz_tx / 811 | ((qh->hb_mult) - 1) << 11);
800 packet_sz) - 1) << 11); 812 } else {
801 else
802 musb_writew(epio, MUSB_TXMAXP, 813 musb_writew(epio, MUSB_TXMAXP,
803 qh->maxpacket | 814 qh->maxpacket |
804 ((qh->hb_mult - 1) << 11)); 815 ((qh->hb_mult - 1) << 11));
816 }
805 musb_writeb(epio, MUSB_TXINTERVAL, qh->intv_reg); 817 musb_writeb(epio, MUSB_TXINTERVAL, qh->intv_reg);
806 } else { 818 } else {
807 musb_writeb(epio, MUSB_NAKLIMIT0, qh->intv_reg); 819 musb_writeb(epio, MUSB_NAKLIMIT0, qh->intv_reg);