diff options
author | Felipe Balbi <balbi@ti.com> | 2011-01-21 00:39:20 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-02-01 03:41:30 -0500 |
commit | 0662481855c389b75a0a54c32870cc90563d80a9 (patch) | |
tree | dec1f1e397a2951fea686c6219bbeb81aa9d819b /drivers/usb/musb/musb_gadget.c | |
parent | 9c668079c864c3b49d8deb56dafedf916b2a72d0 (diff) |
usb: musb: disable double buffering when it's broken
We know that blackfin doesn't support double
buffering feature as of today. So we add a
flag set by musb_platform_init() to forcefully
disable that feature.
Such flag is created and marked as deprecated
to force us to find a solution for the missing
double buffering support on blackfin.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_gadget.c')
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index ed58c6c8f15c..23dad4c8785d 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -989,7 +989,11 @@ static int musb_gadget_enable(struct usb_ep *ep, | |||
989 | /* Set TXMAXP with the FIFO size of the endpoint | 989 | /* Set TXMAXP with the FIFO size of the endpoint |
990 | * to disable double buffering mode. | 990 | * to disable double buffering mode. |
991 | */ | 991 | */ |
992 | musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz | (musb_ep->hb_mult << 11)); | 992 | if (musb->double_buffer_not_ok) |
993 | musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx); | ||
994 | else | ||
995 | musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz | ||
996 | | (musb_ep->hb_mult << 11)); | ||
993 | 997 | ||
994 | csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; | 998 | csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; |
995 | if (musb_readw(regs, MUSB_TXCSR) | 999 | if (musb_readw(regs, MUSB_TXCSR) |
@@ -1025,7 +1029,11 @@ static int musb_gadget_enable(struct usb_ep *ep, | |||
1025 | /* Set RXMAXP with the FIFO size of the endpoint | 1029 | /* Set RXMAXP with the FIFO size of the endpoint |
1026 | * to disable double buffering mode. | 1030 | * to disable double buffering mode. |
1027 | */ | 1031 | */ |
1028 | musb_writew(regs, MUSB_RXMAXP, musb_ep->packet_sz | (musb_ep->hb_mult << 11)); | 1032 | if (musb->double_buffer_not_ok) |
1033 | musb_writew(regs, MUSB_RXMAXP, hw_ep->max_packet_sz_tx); | ||
1034 | else | ||
1035 | musb_writew(regs, MUSB_RXMAXP, musb_ep->packet_sz | ||
1036 | | (musb_ep->hb_mult << 11)); | ||
1029 | 1037 | ||
1030 | /* force shared fifo to OUT-only mode */ | 1038 | /* force shared fifo to OUT-only mode */ |
1031 | if (hw_ep->is_shared_fifo) { | 1039 | if (hw_ep->is_shared_fifo) { |