diff options
Diffstat (limited to 'drivers/usb/musb/musb_gadget.c')
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index cbcf14a236e6..a9f288cd70ed 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -895,7 +895,14 @@ static int musb_gadget_enable(struct usb_ep *ep, | |||
895 | /* REVISIT if can_bulk_split(), use by updating "tmp"; | 895 | /* REVISIT if can_bulk_split(), use by updating "tmp"; |
896 | * likewise high bandwidth periodic tx | 896 | * likewise high bandwidth periodic tx |
897 | */ | 897 | */ |
898 | musb_writew(regs, MUSB_TXMAXP, tmp); | 898 | /* Set TXMAXP with the FIFO size of the endpoint |
899 | * to disable double buffering mode. Currently, It seems that double | ||
900 | * buffering has problem if musb RTL revision number < 2.0. | ||
901 | */ | ||
902 | if (musb->hwvers < MUSB_HWVERS_2000) | ||
903 | musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx); | ||
904 | else | ||
905 | musb_writew(regs, MUSB_TXMAXP, tmp); | ||
899 | 906 | ||
900 | csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; | 907 | csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; |
901 | if (musb_readw(regs, MUSB_TXCSR) | 908 | if (musb_readw(regs, MUSB_TXCSR) |
@@ -925,7 +932,13 @@ static int musb_gadget_enable(struct usb_ep *ep, | |||
925 | /* REVISIT if can_bulk_combine() use by updating "tmp" | 932 | /* REVISIT if can_bulk_combine() use by updating "tmp" |
926 | * likewise high bandwidth periodic rx | 933 | * likewise high bandwidth periodic rx |
927 | */ | 934 | */ |
928 | musb_writew(regs, MUSB_RXMAXP, tmp); | 935 | /* Set RXMAXP with the FIFO size of the endpoint |
936 | * to disable double buffering mode. | ||
937 | */ | ||
938 | if (musb->hwvers < MUSB_HWVERS_2000) | ||
939 | musb_writew(regs, MUSB_RXMAXP, hw_ep->max_packet_sz_rx); | ||
940 | else | ||
941 | musb_writew(regs, MUSB_RXMAXP, tmp); | ||
929 | 942 | ||
930 | /* force shared fifo to OUT-only mode */ | 943 | /* force shared fifo to OUT-only mode */ |
931 | if (hw_ep->is_shared_fifo) { | 944 | if (hw_ep->is_shared_fifo) { |
@@ -1697,8 +1710,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1697 | return -EINVAL; | 1710 | return -EINVAL; |
1698 | 1711 | ||
1699 | /* driver must be initialized to support peripheral mode */ | 1712 | /* driver must be initialized to support peripheral mode */ |
1700 | if (!musb || !(musb->board_mode == MUSB_OTG | 1713 | if (!musb) { |
1701 | || musb->board_mode != MUSB_OTG)) { | ||
1702 | DBG(1, "%s, no dev??\n", __func__); | 1714 | DBG(1, "%s, no dev??\n", __func__); |
1703 | return -ENODEV; | 1715 | return -ENODEV; |
1704 | } | 1716 | } |