diff options
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/blackfin.c | 1 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 11 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.h | 13 | ||||
-rw-r--r-- | drivers/usb/musb/musb_dma.h | 3 | ||||
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 71 | ||||
-rw-r--r-- | drivers/usb/musb/musb_gadget.h | 8 | ||||
-rw-r--r-- | drivers/usb/musb/musb_host.c | 11 | ||||
-rw-r--r-- | drivers/usb/musb/musbhsdma.h | 19 | ||||
-rw-r--r-- | drivers/usb/musb/omap2430.c | 1 |
9 files changed, 96 insertions, 42 deletions
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index eeba228eb2af..9d49d1cd7ce2 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -404,6 +404,7 @@ static int bfin_musb_init(struct musb *musb) | |||
404 | musb->xceiv->set_power = bfin_musb_set_power; | 404 | musb->xceiv->set_power = bfin_musb_set_power; |
405 | 405 | ||
406 | musb->isr = blackfin_interrupt; | 406 | musb->isr = blackfin_interrupt; |
407 | musb->double_buffer_not_ok = true; | ||
407 | 408 | ||
408 | return 0; | 409 | return 0; |
409 | } | 410 | } |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 07cf394e491b..c292d5c499e7 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -128,12 +128,7 @@ MODULE_ALIAS("platform:" MUSB_DRIVER_NAME); | |||
128 | 128 | ||
129 | static inline struct musb *dev_to_musb(struct device *dev) | 129 | static inline struct musb *dev_to_musb(struct device *dev) |
130 | { | 130 | { |
131 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
132 | /* usbcore insists dev->driver_data is a "struct hcd *" */ | ||
133 | return hcd_to_musb(dev_get_drvdata(dev)); | ||
134 | #else | ||
135 | return dev_get_drvdata(dev); | 131 | return dev_get_drvdata(dev); |
136 | #endif | ||
137 | } | 132 | } |
138 | 133 | ||
139 | /*-------------------------------------------------------------------------*/ | 134 | /*-------------------------------------------------------------------------*/ |
@@ -1869,6 +1864,7 @@ allocate_instance(struct device *dev, | |||
1869 | INIT_LIST_HEAD(&musb->out_bulk); | 1864 | INIT_LIST_HEAD(&musb->out_bulk); |
1870 | 1865 | ||
1871 | hcd->uses_new_polling = 1; | 1866 | hcd->uses_new_polling = 1; |
1867 | hcd->has_tt = 1; | ||
1872 | 1868 | ||
1873 | musb->vbuserr_retry = VBUSERR_RETRY_COUNT; | 1869 | musb->vbuserr_retry = VBUSERR_RETRY_COUNT; |
1874 | musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON; | 1870 | musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON; |
@@ -1876,10 +1872,9 @@ allocate_instance(struct device *dev, | |||
1876 | musb = kzalloc(sizeof *musb, GFP_KERNEL); | 1872 | musb = kzalloc(sizeof *musb, GFP_KERNEL); |
1877 | if (!musb) | 1873 | if (!musb) |
1878 | return NULL; | 1874 | return NULL; |
1879 | dev_set_drvdata(dev, musb); | ||
1880 | 1875 | ||
1881 | #endif | 1876 | #endif |
1882 | 1877 | dev_set_drvdata(dev, musb); | |
1883 | musb->mregs = mbase; | 1878 | musb->mregs = mbase; |
1884 | musb->ctrl_base = mbase; | 1879 | musb->ctrl_base = mbase; |
1885 | musb->nIrq = -ENODEV; | 1880 | musb->nIrq = -ENODEV; |
@@ -2191,7 +2186,7 @@ static int __init musb_probe(struct platform_device *pdev) | |||
2191 | void __iomem *base; | 2186 | void __iomem *base; |
2192 | 2187 | ||
2193 | iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2188 | iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2194 | if (!iomem || irq == 0) | 2189 | if (!iomem || irq <= 0) |
2195 | return -ENODEV; | 2190 | return -ENODEV; |
2196 | 2191 | ||
2197 | base = ioremap(iomem->start, resource_size(iomem)); | 2192 | base = ioremap(iomem->start, resource_size(iomem)); |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index d0c236f8e191..e6400be8a0f8 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -497,6 +497,19 @@ struct musb { | |||
497 | struct usb_gadget_driver *gadget_driver; /* its driver */ | 497 | struct usb_gadget_driver *gadget_driver; /* its driver */ |
498 | #endif | 498 | #endif |
499 | 499 | ||
500 | /* | ||
501 | * FIXME: Remove this flag. | ||
502 | * | ||
503 | * This is only added to allow Blackfin to work | ||
504 | * with current driver. For some unknown reason | ||
505 | * Blackfin doesn't work with double buffering | ||
506 | * and that's enabled by default. | ||
507 | * | ||
508 | * We added this flag to forcefully disable double | ||
509 | * buffering until we get it working. | ||
510 | */ | ||
511 | unsigned double_buffer_not_ok:1 __deprecated; | ||
512 | |||
500 | struct musb_hdrc_config *config; | 513 | struct musb_hdrc_config *config; |
501 | 514 | ||
502 | #ifdef MUSB_CONFIG_PROC_FS | 515 | #ifdef MUSB_CONFIG_PROC_FS |
diff --git a/drivers/usb/musb/musb_dma.h b/drivers/usb/musb/musb_dma.h index 916065ba9e70..3a97c4e2d4f5 100644 --- a/drivers/usb/musb/musb_dma.h +++ b/drivers/usb/musb/musb_dma.h | |||
@@ -169,6 +169,9 @@ struct dma_controller { | |||
169 | dma_addr_t dma_addr, | 169 | dma_addr_t dma_addr, |
170 | u32 length); | 170 | u32 length); |
171 | int (*channel_abort)(struct dma_channel *); | 171 | int (*channel_abort)(struct dma_channel *); |
172 | int (*is_compatible)(struct dma_channel *channel, | ||
173 | u16 maxpacket, | ||
174 | void *buf, u32 length); | ||
172 | }; | 175 | }; |
173 | 176 | ||
174 | /* called after channel_program(), may indicate a fault */ | 177 | /* called after channel_program(), may indicate a fault */ |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index ed58c6c8f15c..2fe304611dcf 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -92,11 +92,33 @@ | |||
92 | 92 | ||
93 | /* ----------------------------------------------------------------------- */ | 93 | /* ----------------------------------------------------------------------- */ |
94 | 94 | ||
95 | #define is_buffer_mapped(req) (is_dma_capable() && \ | ||
96 | (req->map_state != UN_MAPPED)) | ||
97 | |||
95 | /* Maps the buffer to dma */ | 98 | /* Maps the buffer to dma */ |
96 | 99 | ||
97 | static inline void map_dma_buffer(struct musb_request *request, | 100 | static inline void map_dma_buffer(struct musb_request *request, |
98 | struct musb *musb) | 101 | struct musb *musb, struct musb_ep *musb_ep) |
99 | { | 102 | { |
103 | int compatible = true; | ||
104 | struct dma_controller *dma = musb->dma_controller; | ||
105 | |||
106 | request->map_state = UN_MAPPED; | ||
107 | |||
108 | if (!is_dma_capable() || !musb_ep->dma) | ||
109 | return; | ||
110 | |||
111 | /* Check if DMA engine can handle this request. | ||
112 | * DMA code must reject the USB request explicitly. | ||
113 | * Default behaviour is to map the request. | ||
114 | */ | ||
115 | if (dma->is_compatible) | ||
116 | compatible = dma->is_compatible(musb_ep->dma, | ||
117 | musb_ep->packet_sz, request->request.buf, | ||
118 | request->request.length); | ||
119 | if (!compatible) | ||
120 | return; | ||
121 | |||
100 | if (request->request.dma == DMA_ADDR_INVALID) { | 122 | if (request->request.dma == DMA_ADDR_INVALID) { |
101 | request->request.dma = dma_map_single( | 123 | request->request.dma = dma_map_single( |
102 | musb->controller, | 124 | musb->controller, |
@@ -105,7 +127,7 @@ static inline void map_dma_buffer(struct musb_request *request, | |||
105 | request->tx | 127 | request->tx |
106 | ? DMA_TO_DEVICE | 128 | ? DMA_TO_DEVICE |
107 | : DMA_FROM_DEVICE); | 129 | : DMA_FROM_DEVICE); |
108 | request->mapped = 1; | 130 | request->map_state = MUSB_MAPPED; |
109 | } else { | 131 | } else { |
110 | dma_sync_single_for_device(musb->controller, | 132 | dma_sync_single_for_device(musb->controller, |
111 | request->request.dma, | 133 | request->request.dma, |
@@ -113,7 +135,7 @@ static inline void map_dma_buffer(struct musb_request *request, | |||
113 | request->tx | 135 | request->tx |
114 | ? DMA_TO_DEVICE | 136 | ? DMA_TO_DEVICE |
115 | : DMA_FROM_DEVICE); | 137 | : DMA_FROM_DEVICE); |
116 | request->mapped = 0; | 138 | request->map_state = PRE_MAPPED; |
117 | } | 139 | } |
118 | } | 140 | } |
119 | 141 | ||
@@ -121,11 +143,14 @@ static inline void map_dma_buffer(struct musb_request *request, | |||
121 | static inline void unmap_dma_buffer(struct musb_request *request, | 143 | static inline void unmap_dma_buffer(struct musb_request *request, |
122 | struct musb *musb) | 144 | struct musb *musb) |
123 | { | 145 | { |
146 | if (!is_buffer_mapped(request)) | ||
147 | return; | ||
148 | |||
124 | if (request->request.dma == DMA_ADDR_INVALID) { | 149 | if (request->request.dma == DMA_ADDR_INVALID) { |
125 | DBG(20, "not unmapping a never mapped buffer\n"); | 150 | DBG(20, "not unmapping a never mapped buffer\n"); |
126 | return; | 151 | return; |
127 | } | 152 | } |
128 | if (request->mapped) { | 153 | if (request->map_state == MUSB_MAPPED) { |
129 | dma_unmap_single(musb->controller, | 154 | dma_unmap_single(musb->controller, |
130 | request->request.dma, | 155 | request->request.dma, |
131 | request->request.length, | 156 | request->request.length, |
@@ -133,16 +158,15 @@ static inline void unmap_dma_buffer(struct musb_request *request, | |||
133 | ? DMA_TO_DEVICE | 158 | ? DMA_TO_DEVICE |
134 | : DMA_FROM_DEVICE); | 159 | : DMA_FROM_DEVICE); |
135 | request->request.dma = DMA_ADDR_INVALID; | 160 | request->request.dma = DMA_ADDR_INVALID; |
136 | request->mapped = 0; | 161 | } else { /* PRE_MAPPED */ |
137 | } else { | ||
138 | dma_sync_single_for_cpu(musb->controller, | 162 | dma_sync_single_for_cpu(musb->controller, |
139 | request->request.dma, | 163 | request->request.dma, |
140 | request->request.length, | 164 | request->request.length, |
141 | request->tx | 165 | request->tx |
142 | ? DMA_TO_DEVICE | 166 | ? DMA_TO_DEVICE |
143 | : DMA_FROM_DEVICE); | 167 | : DMA_FROM_DEVICE); |
144 | |||
145 | } | 168 | } |
169 | request->map_state = UN_MAPPED; | ||
146 | } | 170 | } |
147 | 171 | ||
148 | /* | 172 | /* |
@@ -172,8 +196,7 @@ __acquires(ep->musb->lock) | |||
172 | 196 | ||
173 | ep->busy = 1; | 197 | ep->busy = 1; |
174 | spin_unlock(&musb->lock); | 198 | spin_unlock(&musb->lock); |
175 | if (is_dma_capable() && ep->dma) | 199 | unmap_dma_buffer(req, musb); |
176 | unmap_dma_buffer(req, musb); | ||
177 | if (request->status == 0) | 200 | if (request->status == 0) |
178 | DBG(5, "%s done request %p, %d/%d\n", | 201 | DBG(5, "%s done request %p, %d/%d\n", |
179 | ep->end_point.name, request, | 202 | ep->end_point.name, request, |
@@ -335,7 +358,7 @@ static void txstate(struct musb *musb, struct musb_request *req) | |||
335 | csr); | 358 | csr); |
336 | 359 | ||
337 | #ifndef CONFIG_MUSB_PIO_ONLY | 360 | #ifndef CONFIG_MUSB_PIO_ONLY |
338 | if (is_dma_capable() && musb_ep->dma) { | 361 | if (is_buffer_mapped(req)) { |
339 | struct dma_controller *c = musb->dma_controller; | 362 | struct dma_controller *c = musb->dma_controller; |
340 | size_t request_size; | 363 | size_t request_size; |
341 | 364 | ||
@@ -436,8 +459,7 @@ static void txstate(struct musb *musb, struct musb_request *req) | |||
436 | * Unmap the dma buffer back to cpu if dma channel | 459 | * Unmap the dma buffer back to cpu if dma channel |
437 | * programming fails | 460 | * programming fails |
438 | */ | 461 | */ |
439 | if (is_dma_capable() && musb_ep->dma) | 462 | unmap_dma_buffer(req, musb); |
440 | unmap_dma_buffer(req, musb); | ||
441 | 463 | ||
442 | musb_write_fifo(musb_ep->hw_ep, fifo_count, | 464 | musb_write_fifo(musb_ep->hw_ep, fifo_count, |
443 | (u8 *) (request->buf + request->actual)); | 465 | (u8 *) (request->buf + request->actual)); |
@@ -627,7 +649,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
627 | return; | 649 | return; |
628 | } | 650 | } |
629 | 651 | ||
630 | if (is_cppi_enabled() && musb_ep->dma) { | 652 | if (is_cppi_enabled() && is_buffer_mapped(req)) { |
631 | struct dma_controller *c = musb->dma_controller; | 653 | struct dma_controller *c = musb->dma_controller; |
632 | struct dma_channel *channel = musb_ep->dma; | 654 | struct dma_channel *channel = musb_ep->dma; |
633 | 655 | ||
@@ -658,7 +680,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
658 | len = musb_readw(epio, MUSB_RXCOUNT); | 680 | len = musb_readw(epio, MUSB_RXCOUNT); |
659 | if (request->actual < request->length) { | 681 | if (request->actual < request->length) { |
660 | #ifdef CONFIG_USB_INVENTRA_DMA | 682 | #ifdef CONFIG_USB_INVENTRA_DMA |
661 | if (is_dma_capable() && musb_ep->dma) { | 683 | if (is_buffer_mapped(req)) { |
662 | struct dma_controller *c; | 684 | struct dma_controller *c; |
663 | struct dma_channel *channel; | 685 | struct dma_channel *channel; |
664 | int use_dma = 0; | 686 | int use_dma = 0; |
@@ -742,7 +764,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
742 | fifo_count = min_t(unsigned, len, fifo_count); | 764 | fifo_count = min_t(unsigned, len, fifo_count); |
743 | 765 | ||
744 | #ifdef CONFIG_USB_TUSB_OMAP_DMA | 766 | #ifdef CONFIG_USB_TUSB_OMAP_DMA |
745 | if (tusb_dma_omap() && musb_ep->dma) { | 767 | if (tusb_dma_omap() && is_buffer_mapped(req)) { |
746 | struct dma_controller *c = musb->dma_controller; | 768 | struct dma_controller *c = musb->dma_controller; |
747 | struct dma_channel *channel = musb_ep->dma; | 769 | struct dma_channel *channel = musb_ep->dma; |
748 | u32 dma_addr = request->dma + request->actual; | 770 | u32 dma_addr = request->dma + request->actual; |
@@ -762,7 +784,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
762 | * programming fails. This buffer is mapped if the | 784 | * programming fails. This buffer is mapped if the |
763 | * channel allocation is successful | 785 | * channel allocation is successful |
764 | */ | 786 | */ |
765 | if (is_dma_capable() && musb_ep->dma) { | 787 | if (is_buffer_mapped(req)) { |
766 | unmap_dma_buffer(req, musb); | 788 | unmap_dma_buffer(req, musb); |
767 | 789 | ||
768 | /* | 790 | /* |
@@ -989,7 +1011,11 @@ static int musb_gadget_enable(struct usb_ep *ep, | |||
989 | /* Set TXMAXP with the FIFO size of the endpoint | 1011 | /* Set TXMAXP with the FIFO size of the endpoint |
990 | * to disable double buffering mode. | 1012 | * to disable double buffering mode. |
991 | */ | 1013 | */ |
992 | musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz | (musb_ep->hb_mult << 11)); | 1014 | if (musb->double_buffer_not_ok) |
1015 | musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx); | ||
1016 | else | ||
1017 | musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz | ||
1018 | | (musb_ep->hb_mult << 11)); | ||
993 | 1019 | ||
994 | csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; | 1020 | csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; |
995 | if (musb_readw(regs, MUSB_TXCSR) | 1021 | if (musb_readw(regs, MUSB_TXCSR) |
@@ -1025,7 +1051,11 @@ static int musb_gadget_enable(struct usb_ep *ep, | |||
1025 | /* Set RXMAXP with the FIFO size of the endpoint | 1051 | /* Set RXMAXP with the FIFO size of the endpoint |
1026 | * to disable double buffering mode. | 1052 | * to disable double buffering mode. |
1027 | */ | 1053 | */ |
1028 | musb_writew(regs, MUSB_RXMAXP, musb_ep->packet_sz | (musb_ep->hb_mult << 11)); | 1054 | if (musb->double_buffer_not_ok) |
1055 | musb_writew(regs, MUSB_RXMAXP, hw_ep->max_packet_sz_tx); | ||
1056 | else | ||
1057 | musb_writew(regs, MUSB_RXMAXP, musb_ep->packet_sz | ||
1058 | | (musb_ep->hb_mult << 11)); | ||
1029 | 1059 | ||
1030 | /* force shared fifo to OUT-only mode */ | 1060 | /* force shared fifo to OUT-only mode */ |
1031 | if (hw_ep->is_shared_fifo) { | 1061 | if (hw_ep->is_shared_fifo) { |
@@ -1214,10 +1244,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, | |||
1214 | request->epnum = musb_ep->current_epnum; | 1244 | request->epnum = musb_ep->current_epnum; |
1215 | request->tx = musb_ep->is_in; | 1245 | request->tx = musb_ep->is_in; |
1216 | 1246 | ||
1217 | if (is_dma_capable() && musb_ep->dma) | 1247 | map_dma_buffer(request, musb, musb_ep); |
1218 | map_dma_buffer(request, musb); | ||
1219 | else | ||
1220 | request->mapped = 0; | ||
1221 | 1248 | ||
1222 | spin_lock_irqsave(&musb->lock, lockflags); | 1249 | spin_lock_irqsave(&musb->lock, lockflags); |
1223 | 1250 | ||
diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h index dec8dc008191..a55354fbccf5 100644 --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h | |||
@@ -35,13 +35,19 @@ | |||
35 | #ifndef __MUSB_GADGET_H | 35 | #ifndef __MUSB_GADGET_H |
36 | #define __MUSB_GADGET_H | 36 | #define __MUSB_GADGET_H |
37 | 37 | ||
38 | enum buffer_map_state { | ||
39 | UN_MAPPED = 0, | ||
40 | PRE_MAPPED, | ||
41 | MUSB_MAPPED | ||
42 | }; | ||
43 | |||
38 | struct musb_request { | 44 | struct musb_request { |
39 | struct usb_request request; | 45 | struct usb_request request; |
40 | struct musb_ep *ep; | 46 | struct musb_ep *ep; |
41 | struct musb *musb; | 47 | struct musb *musb; |
42 | u8 tx; /* endpoint direction */ | 48 | u8 tx; /* endpoint direction */ |
43 | u8 epnum; | 49 | u8 epnum; |
44 | u8 mapped; | 50 | enum buffer_map_state map_state; |
45 | }; | 51 | }; |
46 | 52 | ||
47 | static inline struct musb_request *to_musb_request(struct usb_request *req) | 53 | static inline struct musb_request *to_musb_request(struct usb_request *req) |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 4d5bcb4e14d2..0f523d7db57b 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -609,7 +609,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) | |||
609 | /* Set RXMAXP with the FIFO size of the endpoint | 609 | /* Set RXMAXP with the FIFO size of the endpoint |
610 | * to disable double buffer mode. | 610 | * to disable double buffer mode. |
611 | */ | 611 | */ |
612 | if (musb->hwvers < MUSB_HWVERS_2000) | 612 | if (musb->double_buffer_not_ok) |
613 | musb_writew(ep->regs, MUSB_RXMAXP, ep->max_packet_sz_rx); | 613 | musb_writew(ep->regs, MUSB_RXMAXP, ep->max_packet_sz_rx); |
614 | else | 614 | else |
615 | musb_writew(ep->regs, MUSB_RXMAXP, | 615 | musb_writew(ep->regs, MUSB_RXMAXP, |
@@ -784,14 +784,13 @@ static void musb_ep_program(struct musb *musb, u8 epnum, | |||
784 | /* protocol/endpoint/interval/NAKlimit */ | 784 | /* protocol/endpoint/interval/NAKlimit */ |
785 | if (epnum) { | 785 | if (epnum) { |
786 | musb_writeb(epio, MUSB_TXTYPE, qh->type_reg); | 786 | musb_writeb(epio, MUSB_TXTYPE, qh->type_reg); |
787 | if (can_bulk_split(musb, qh->type)) | 787 | if (musb->double_buffer_not_ok) |
788 | musb_writew(epio, MUSB_TXMAXP, | 788 | musb_writew(epio, MUSB_TXMAXP, |
789 | packet_sz | 789 | hw_ep->max_packet_sz_tx); |
790 | | ((hw_ep->max_packet_sz_tx / | ||
791 | packet_sz) - 1) << 11); | ||
792 | else | 790 | else |
793 | musb_writew(epio, MUSB_TXMAXP, | 791 | musb_writew(epio, MUSB_TXMAXP, |
794 | packet_sz); | 792 | qh->maxpacket | |
793 | ((qh->hb_mult - 1) << 11)); | ||
795 | musb_writeb(epio, MUSB_TXINTERVAL, qh->intv_reg); | 794 | musb_writeb(epio, MUSB_TXINTERVAL, qh->intv_reg); |
796 | } else { | 795 | } else { |
797 | musb_writeb(epio, MUSB_NAKLIMIT0, qh->intv_reg); | 796 | musb_writeb(epio, MUSB_NAKLIMIT0, qh->intv_reg); |
diff --git a/drivers/usb/musb/musbhsdma.h b/drivers/usb/musb/musbhsdma.h index f763d62f151c..21056c924c74 100644 --- a/drivers/usb/musb/musbhsdma.h +++ b/drivers/usb/musb/musbhsdma.h | |||
@@ -94,24 +94,33 @@ static inline void musb_write_hsdma_addr(void __iomem *mbase, | |||
94 | { | 94 | { |
95 | musb_writew(mbase, | 95 | musb_writew(mbase, |
96 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_LOW), | 96 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_LOW), |
97 | ((u16)((u32) dma_addr & 0xFFFF))); | 97 | dma_addr); |
98 | musb_writew(mbase, | 98 | musb_writew(mbase, |
99 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_HIGH), | 99 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_HIGH), |
100 | ((u16)(((u32) dma_addr >> 16) & 0xFFFF))); | 100 | (dma_addr >> 16)); |
101 | } | 101 | } |
102 | 102 | ||
103 | static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel) | 103 | static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel) |
104 | { | 104 | { |
105 | return musb_readl(mbase, | 105 | u32 count = musb_readw(mbase, |
106 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH)); | 106 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH)); |
107 | |||
108 | count = count << 16; | ||
109 | |||
110 | count |= musb_readw(mbase, | ||
111 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW)); | ||
112 | |||
113 | return count; | ||
107 | } | 114 | } |
108 | 115 | ||
109 | static inline void musb_write_hsdma_count(void __iomem *mbase, | 116 | static inline void musb_write_hsdma_count(void __iomem *mbase, |
110 | u8 bchannel, u32 len) | 117 | u8 bchannel, u32 len) |
111 | { | 118 | { |
112 | musb_writel(mbase, | 119 | musb_writew(mbase, |
120 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW),len); | ||
121 | musb_writew(mbase, | ||
113 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH), | 122 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH), |
114 | len); | 123 | (len >> 16)); |
115 | } | 124 | } |
116 | 125 | ||
117 | #endif /* CONFIG_BLACKFIN */ | 126 | #endif /* CONFIG_BLACKFIN */ |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index a3f12333fc41..bc8badd16897 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -362,6 +362,7 @@ static int omap2430_musb_init(struct musb *musb) | |||
362 | 362 | ||
363 | static int omap2430_musb_exit(struct musb *musb) | 363 | static int omap2430_musb_exit(struct musb *musb) |
364 | { | 364 | { |
365 | del_timer_sync(&musb_idle_timer); | ||
365 | 366 | ||
366 | omap2430_low_level_exit(musb); | 367 | omap2430_low_level_exit(musb); |
367 | otg_put_transceiver(musb->xceiv); | 368 | otg_put_transceiver(musb->xceiv); |