Commit 67d019528e5c2693145217cf18a507689980d2a4
Exists in
master
and in
4 other branches
Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (21 commits) USB: cdc-acm: Adding second ACM channel support for Nokia N8 USB, Mass Storage, composite, gadget: Fix build failure and memset of a struct USB: Fix trout build failure with ci13xxx_msm gadget USB: EHCI: fix scheduling while atomic during suspend USB: usb-storage: unusual_devs entry for Coby MP3 player USB: ftdi_sio: Add VID=0x0647, PID=0x0100 for Acton Research spectrograph USB: fix race between root-hub resume and wakeup requests USB: prevent buggy hubs from crashing the USB stack usb: r8a66597-udc: Fixed bufnum of Bulk USB: ftdi_sio: add ST Micro Connect Lite uart support USB: Storage: Add unusual_devs entry for VTech Kidizoom USB SL811HS HCD: Fix memory leak in sl811h_urb_enqueue() USB: ti_usb: fix module removal USB: io_edgeport: fix the reported firmware major and minor usb: ehci-omap: Show fatal probing time errors to end user usb: musb: introduce api for dma code to check compatibility with usb request usb: musb: maintain three states for buffer mappings instead of two usb: musb: disable double buffering when it's broken usb: musb: hsdma: change back to use musb_read/writew usb: musb: core: fix IRQ check ...
Showing 27 changed files Side-by-side Diff
- drivers/usb/class/cdc-acm.c
- drivers/usb/core/hcd.c
- drivers/usb/core/hub.c
- drivers/usb/gadget/Kconfig
- drivers/usb/gadget/f_mass_storage.c
- drivers/usb/gadget/r8a66597-udc.c
- drivers/usb/host/Kconfig
- drivers/usb/host/ehci-au1xxx.c
- drivers/usb/host/ehci-hub.c
- drivers/usb/host/ehci-omap.c
- drivers/usb/host/ehci-pci.c
- drivers/usb/host/sl811-hcd.c
- drivers/usb/musb/blackfin.c
- drivers/usb/musb/musb_core.c
- drivers/usb/musb/musb_core.h
- drivers/usb/musb/musb_dma.h
- drivers/usb/musb/musb_gadget.c
- drivers/usb/musb/musb_gadget.h
- drivers/usb/musb/musb_host.c
- drivers/usb/musb/musbhsdma.h
- drivers/usb/otg/Kconfig
- drivers/usb/serial/ftdi_sio.c
- drivers/usb/serial/ftdi_sio_ids.h
- drivers/usb/serial/io_edgeport.c
- drivers/usb/serial/ti_usb_3410_5052.c
- drivers/usb/storage/unusual_devs.h
- include/linux/usb/msm_hsusb_hw.h
drivers/usb/class/cdc-acm.c
... | ... | @@ -1607,6 +1607,7 @@ |
1607 | 1607 | { NOKIA_PCSUITE_ACM_INFO(0x0154), }, /* Nokia 5800 XpressMusic */ |
1608 | 1608 | { NOKIA_PCSUITE_ACM_INFO(0x04ce), }, /* Nokia E90 */ |
1609 | 1609 | { NOKIA_PCSUITE_ACM_INFO(0x01d4), }, /* Nokia E55 */ |
1610 | + { NOKIA_PCSUITE_ACM_INFO(0x0302), }, /* Nokia N8 */ | |
1610 | 1611 | { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */ |
1611 | 1612 | |
1612 | 1613 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ |
drivers/usb/core/hcd.c
... | ... | @@ -1955,7 +1955,6 @@ |
1955 | 1955 | |
1956 | 1956 | dev_dbg(&rhdev->dev, "usb %s%s\n", |
1957 | 1957 | (msg.event & PM_EVENT_AUTO ? "auto-" : ""), "resume"); |
1958 | - clear_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags); | |
1959 | 1958 | if (!hcd->driver->bus_resume) |
1960 | 1959 | return -ENOENT; |
1961 | 1960 | if (hcd->state == HC_STATE_RUNNING) |
... | ... | @@ -1963,6 +1962,7 @@ |
1963 | 1962 | |
1964 | 1963 | hcd->state = HC_STATE_RESUMING; |
1965 | 1964 | status = hcd->driver->bus_resume(hcd); |
1965 | + clear_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags); | |
1966 | 1966 | if (status == 0) { |
1967 | 1967 | /* TRSMRCY = 10 msec */ |
1968 | 1968 | msleep(10); |
drivers/usb/core/hub.c
... | ... | @@ -2753,6 +2753,11 @@ |
2753 | 2753 | udev->ttport = hdev->ttport; |
2754 | 2754 | } else if (udev->speed != USB_SPEED_HIGH |
2755 | 2755 | && hdev->speed == USB_SPEED_HIGH) { |
2756 | + if (!hub->tt.hub) { | |
2757 | + dev_err(&udev->dev, "parent hub has no TT\n"); | |
2758 | + retval = -EINVAL; | |
2759 | + goto fail; | |
2760 | + } | |
2756 | 2761 | udev->tt = &hub->tt; |
2757 | 2762 | udev->ttport = port1; |
2758 | 2763 | } |
drivers/usb/gadget/Kconfig
... | ... | @@ -546,6 +546,8 @@ |
546 | 546 | ci13xxx_udc core. |
547 | 547 | This driver depends on OTG driver for PHY initialization, |
548 | 548 | clock management, powering up VBUS, and power management. |
549 | + This driver is not supported on boards like trout which | |
550 | + has an external PHY. | |
549 | 551 | |
550 | 552 | Say "y" to link the driver statically, or "m" to build a |
551 | 553 | dynamically linked module called "ci13xxx_msm" and force all |
drivers/usb/gadget/f_mass_storage.c
... | ... | @@ -293,6 +293,7 @@ |
293 | 293 | |
294 | 294 | #include <linux/usb/ch9.h> |
295 | 295 | #include <linux/usb/gadget.h> |
296 | +#include <linux/usb/composite.h> | |
296 | 297 | |
297 | 298 | #include "gadget_chips.h" |
298 | 299 | |
... | ... | @@ -2763,7 +2764,7 @@ |
2763 | 2764 | return ERR_PTR(-ENOMEM); |
2764 | 2765 | common->free_storage_on_release = 1; |
2765 | 2766 | } else { |
2766 | - memset(common, 0, sizeof common); | |
2767 | + memset(common, 0, sizeof *common); | |
2767 | 2768 | common->free_storage_on_release = 0; |
2768 | 2769 | } |
2769 | 2770 |
drivers/usb/gadget/r8a66597-udc.c
... | ... | @@ -258,7 +258,7 @@ |
258 | 258 | break; |
259 | 259 | case R8A66597_BULK: |
260 | 260 | /* isochronous pipes may be used as bulk pipes */ |
261 | - if (info->pipe > R8A66597_BASE_PIPENUM_BULK) | |
261 | + if (info->pipe >= R8A66597_BASE_PIPENUM_BULK) | |
262 | 262 | bufnum = info->pipe - R8A66597_BASE_PIPENUM_BULK; |
263 | 263 | else |
264 | 264 | bufnum = info->pipe - R8A66597_BASE_PIPENUM_ISOC; |
drivers/usb/host/Kconfig
... | ... | @@ -151,6 +151,8 @@ |
151 | 151 | Qualcomm chipsets. Root Hub has inbuilt TT. |
152 | 152 | This driver depends on OTG driver for PHY initialization, |
153 | 153 | clock management, powering up VBUS, and power management. |
154 | + This driver is not supported on boards like trout which | |
155 | + has an external PHY. | |
154 | 156 | |
155 | 157 | config USB_EHCI_HCD_PPC_OF |
156 | 158 | bool "EHCI support for PPC USB controller on OF platform bus" |
drivers/usb/host/ehci-au1xxx.c
... | ... | @@ -227,8 +227,8 @@ |
227 | 227 | * mark HW unaccessible. The PM and USB cores make sure that |
228 | 228 | * the root hub is either suspended or stopped. |
229 | 229 | */ |
230 | - spin_lock_irqsave(&ehci->lock, flags); | |
231 | 230 | ehci_prepare_ports_for_controller_suspend(ehci, device_may_wakeup(dev)); |
231 | + spin_lock_irqsave(&ehci->lock, flags); | |
232 | 232 | ehci_writel(ehci, 0, &ehci->regs->intr_enable); |
233 | 233 | (void)ehci_readl(ehci, &ehci->regs->intr_enable); |
234 | 234 |
drivers/usb/host/ehci-hub.c
... | ... | @@ -111,6 +111,7 @@ |
111 | 111 | { |
112 | 112 | int port; |
113 | 113 | u32 temp; |
114 | + unsigned long flags; | |
114 | 115 | |
115 | 116 | /* If remote wakeup is enabled for the root hub but disabled |
116 | 117 | * for the controller, we must adjust all the port wakeup flags |
... | ... | @@ -120,6 +121,8 @@ |
120 | 121 | if (!ehci_to_hcd(ehci)->self.root_hub->do_remote_wakeup || do_wakeup) |
121 | 122 | return; |
122 | 123 | |
124 | + spin_lock_irqsave(&ehci->lock, flags); | |
125 | + | |
123 | 126 | /* clear phy low-power mode before changing wakeup flags */ |
124 | 127 | if (ehci->has_hostpc) { |
125 | 128 | port = HCS_N_PORTS(ehci->hcs_params); |
126 | 129 | |
... | ... | @@ -131,7 +134,9 @@ |
131 | 134 | temp = ehci_readl(ehci, hostpc_reg); |
132 | 135 | ehci_writel(ehci, temp & ~HOSTPC_PHCD, hostpc_reg); |
133 | 136 | } |
137 | + spin_unlock_irqrestore(&ehci->lock, flags); | |
134 | 138 | msleep(5); |
139 | + spin_lock_irqsave(&ehci->lock, flags); | |
135 | 140 | } |
136 | 141 | |
137 | 142 | port = HCS_N_PORTS(ehci->hcs_params); |
... | ... | @@ -170,6 +175,8 @@ |
170 | 175 | /* Does the root hub have a port wakeup pending? */ |
171 | 176 | if (!suspending && (ehci_readl(ehci, &ehci->regs->status) & STS_PCD)) |
172 | 177 | usb_hcd_resume_root_hub(ehci_to_hcd(ehci)); |
178 | + | |
179 | + spin_unlock_irqrestore(&ehci->lock, flags); | |
173 | 180 | } |
174 | 181 | |
175 | 182 | static int ehci_bus_suspend (struct usb_hcd *hcd) |
drivers/usb/host/ehci-omap.c
... | ... | @@ -796,7 +796,7 @@ |
796 | 796 | hcd = usb_create_hcd(&ehci_omap_hc_driver, &pdev->dev, |
797 | 797 | dev_name(&pdev->dev)); |
798 | 798 | if (!hcd) { |
799 | - dev_dbg(&pdev->dev, "failed to create hcd with err %d\n", ret); | |
799 | + dev_err(&pdev->dev, "failed to create hcd with err %d\n", ret); | |
800 | 800 | ret = -ENOMEM; |
801 | 801 | goto err_create_hcd; |
802 | 802 | } |
... | ... | @@ -864,7 +864,7 @@ |
864 | 864 | |
865 | 865 | ret = omap_start_ehc(omap, hcd); |
866 | 866 | if (ret) { |
867 | - dev_dbg(&pdev->dev, "failed to start ehci\n"); | |
867 | + dev_err(&pdev->dev, "failed to start ehci with err %d\n", ret); | |
868 | 868 | goto err_start; |
869 | 869 | } |
870 | 870 | |
... | ... | @@ -879,7 +879,7 @@ |
879 | 879 | |
880 | 880 | ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED); |
881 | 881 | if (ret) { |
882 | - dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret); | |
882 | + dev_err(&pdev->dev, "failed to add hcd with err %d\n", ret); | |
883 | 883 | goto err_add_hcd; |
884 | 884 | } |
885 | 885 |
drivers/usb/host/ehci-pci.c
... | ... | @@ -367,8 +367,8 @@ |
367 | 367 | * mark HW unaccessible. The PM and USB cores make sure that |
368 | 368 | * the root hub is either suspended or stopped. |
369 | 369 | */ |
370 | - spin_lock_irqsave (&ehci->lock, flags); | |
371 | 370 | ehci_prepare_ports_for_controller_suspend(ehci, do_wakeup); |
371 | + spin_lock_irqsave (&ehci->lock, flags); | |
372 | 372 | ehci_writel(ehci, 0, &ehci->regs->intr_enable); |
373 | 373 | (void)ehci_readl(ehci, &ehci->regs->intr_enable); |
374 | 374 |
drivers/usb/host/sl811-hcd.c
drivers/usb/musb/blackfin.c
drivers/usb/musb/musb_core.c
... | ... | @@ -128,12 +128,7 @@ |
128 | 128 | |
129 | 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 | 131 | return dev_get_drvdata(dev); |
136 | -#endif | |
137 | 132 | } |
138 | 133 | |
139 | 134 | /*-------------------------------------------------------------------------*/ |
140 | 135 | |
... | ... | @@ -1876,10 +1871,9 @@ |
1876 | 1871 | musb = kzalloc(sizeof *musb, GFP_KERNEL); |
1877 | 1872 | if (!musb) |
1878 | 1873 | return NULL; |
1879 | - dev_set_drvdata(dev, musb); | |
1880 | 1874 | |
1881 | 1875 | #endif |
1882 | - | |
1876 | + dev_set_drvdata(dev, musb); | |
1883 | 1877 | musb->mregs = mbase; |
1884 | 1878 | musb->ctrl_base = mbase; |
1885 | 1879 | musb->nIrq = -ENODEV; |
... | ... | @@ -2191,7 +2185,7 @@ |
2191 | 2185 | void __iomem *base; |
2192 | 2186 | |
2193 | 2187 | iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2194 | - if (!iomem || irq == 0) | |
2188 | + if (!iomem || irq <= 0) | |
2195 | 2189 | return -ENODEV; |
2196 | 2190 | |
2197 | 2191 | base = ioremap(iomem->start, resource_size(iomem)); |
drivers/usb/musb/musb_core.h
... | ... | @@ -488,6 +488,18 @@ |
488 | 488 | unsigned set_address:1; |
489 | 489 | unsigned test_mode:1; |
490 | 490 | unsigned softconnect:1; |
491 | + /* | |
492 | + * FIXME: Remove this flag. | |
493 | + * | |
494 | + * This is only added to allow Blackfin to work | |
495 | + * with current driver. For some unknown reason | |
496 | + * Blackfin doesn't work with double buffering | |
497 | + * and that's enabled by default. | |
498 | + * | |
499 | + * We added this flag to forcefully disable double | |
500 | + * buffering until we get it working. | |
501 | + */ | |
502 | + unsigned double_buffer_not_ok:1 __deprecated; | |
491 | 503 | |
492 | 504 | u8 address; |
493 | 505 | u8 test_mode_nr; |
drivers/usb/musb/musb_dma.h
... | ... | @@ -169,6 +169,9 @@ |
169 | 169 | dma_addr_t dma_addr, |
170 | 170 | u32 length); |
171 | 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 | 177 | /* called after channel_program(), may indicate a fault */ |
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 | 98 | /* Maps the buffer to dma */ |
96 | 99 | |
97 | 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 | 122 | if (request->request.dma == DMA_ADDR_INVALID) { |
101 | 123 | request->request.dma = dma_map_single( |
102 | 124 | musb->controller, |
... | ... | @@ -105,7 +127,7 @@ |
105 | 127 | request->tx |
106 | 128 | ? DMA_TO_DEVICE |
107 | 129 | : DMA_FROM_DEVICE); |
108 | - request->mapped = 1; | |
130 | + request->map_state = MUSB_MAPPED; | |
109 | 131 | } else { |
110 | 132 | dma_sync_single_for_device(musb->controller, |
111 | 133 | request->request.dma, |
... | ... | @@ -113,7 +135,7 @@ |
113 | 135 | request->tx |
114 | 136 | ? DMA_TO_DEVICE |
115 | 137 | : DMA_FROM_DEVICE); |
116 | - request->mapped = 0; | |
138 | + request->map_state = PRE_MAPPED; | |
117 | 139 | } |
118 | 140 | } |
119 | 141 | |
120 | 142 | |
... | ... | @@ -121,11 +143,14 @@ |
121 | 143 | static inline void unmap_dma_buffer(struct musb_request *request, |
122 | 144 | struct musb *musb) |
123 | 145 | { |
146 | + if (!is_buffer_mapped(request)) | |
147 | + return; | |
148 | + | |
124 | 149 | if (request->request.dma == DMA_ADDR_INVALID) { |
125 | 150 | DBG(20, "not unmapping a never mapped buffer\n"); |
126 | 151 | return; |
127 | 152 | } |
128 | - if (request->mapped) { | |
153 | + if (request->map_state == MUSB_MAPPED) { | |
129 | 154 | dma_unmap_single(musb->controller, |
130 | 155 | request->request.dma, |
131 | 156 | request->request.length, |
132 | 157 | |
133 | 158 | |
... | ... | @@ -133,16 +158,15 @@ |
133 | 158 | ? DMA_TO_DEVICE |
134 | 159 | : DMA_FROM_DEVICE); |
135 | 160 | request->request.dma = DMA_ADDR_INVALID; |
136 | - request->mapped = 0; | |
137 | - } else { | |
161 | + } else { /* PRE_MAPPED */ | |
138 | 162 | dma_sync_single_for_cpu(musb->controller, |
139 | 163 | request->request.dma, |
140 | 164 | request->request.length, |
141 | 165 | request->tx |
142 | 166 | ? DMA_TO_DEVICE |
143 | 167 | : DMA_FROM_DEVICE); |
144 | - | |
145 | 168 | } |
169 | + request->map_state = UN_MAPPED; | |
146 | 170 | } |
147 | 171 | |
148 | 172 | /* |
... | ... | @@ -172,8 +196,7 @@ |
172 | 196 | |
173 | 197 | ep->busy = 1; |
174 | 198 | spin_unlock(&musb->lock); |
175 | - if (is_dma_capable() && ep->dma) | |
176 | - unmap_dma_buffer(req, musb); | |
199 | + unmap_dma_buffer(req, musb); | |
177 | 200 | if (request->status == 0) |
178 | 201 | DBG(5, "%s done request %p, %d/%d\n", |
179 | 202 | ep->end_point.name, request, |
... | ... | @@ -335,7 +358,7 @@ |
335 | 358 | csr); |
336 | 359 | |
337 | 360 | #ifndef CONFIG_MUSB_PIO_ONLY |
338 | - if (is_dma_capable() && musb_ep->dma) { | |
361 | + if (is_buffer_mapped(req)) { | |
339 | 362 | struct dma_controller *c = musb->dma_controller; |
340 | 363 | size_t request_size; |
341 | 364 | |
... | ... | @@ -436,8 +459,7 @@ |
436 | 459 | * Unmap the dma buffer back to cpu if dma channel |
437 | 460 | * programming fails |
438 | 461 | */ |
439 | - if (is_dma_capable() && musb_ep->dma) | |
440 | - unmap_dma_buffer(req, musb); | |
462 | + unmap_dma_buffer(req, musb); | |
441 | 463 | |
442 | 464 | musb_write_fifo(musb_ep->hw_ep, fifo_count, |
443 | 465 | (u8 *) (request->buf + request->actual)); |
... | ... | @@ -627,7 +649,7 @@ |
627 | 649 | return; |
628 | 650 | } |
629 | 651 | |
630 | - if (is_cppi_enabled() && musb_ep->dma) { | |
652 | + if (is_cppi_enabled() && is_buffer_mapped(req)) { | |
631 | 653 | struct dma_controller *c = musb->dma_controller; |
632 | 654 | struct dma_channel *channel = musb_ep->dma; |
633 | 655 | |
... | ... | @@ -658,7 +680,7 @@ |
658 | 680 | len = musb_readw(epio, MUSB_RXCOUNT); |
659 | 681 | if (request->actual < request->length) { |
660 | 682 | #ifdef CONFIG_USB_INVENTRA_DMA |
661 | - if (is_dma_capable() && musb_ep->dma) { | |
683 | + if (is_buffer_mapped(req)) { | |
662 | 684 | struct dma_controller *c; |
663 | 685 | struct dma_channel *channel; |
664 | 686 | int use_dma = 0; |
... | ... | @@ -742,7 +764,7 @@ |
742 | 764 | fifo_count = min_t(unsigned, len, fifo_count); |
743 | 765 | |
744 | 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 | 768 | struct dma_controller *c = musb->dma_controller; |
747 | 769 | struct dma_channel *channel = musb_ep->dma; |
748 | 770 | u32 dma_addr = request->dma + request->actual; |
... | ... | @@ -762,7 +784,7 @@ |
762 | 784 | * programming fails. This buffer is mapped if the |
763 | 785 | * channel allocation is successful |
764 | 786 | */ |
765 | - if (is_dma_capable() && musb_ep->dma) { | |
787 | + if (is_buffer_mapped(req)) { | |
766 | 788 | unmap_dma_buffer(req, musb); |
767 | 789 | |
768 | 790 | /* |
... | ... | @@ -989,7 +1011,11 @@ |
989 | 1011 | /* Set TXMAXP with the FIFO size of the endpoint |
990 | 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 | 1020 | csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; |
995 | 1021 | if (musb_readw(regs, MUSB_TXCSR) |
... | ... | @@ -1025,7 +1051,11 @@ |
1025 | 1051 | /* Set RXMAXP with the FIFO size of the endpoint |
1026 | 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 | 1060 | /* force shared fifo to OUT-only mode */ |
1031 | 1061 | if (hw_ep->is_shared_fifo) { |
... | ... | @@ -1214,10 +1244,7 @@ |
1214 | 1244 | request->epnum = musb_ep->current_epnum; |
1215 | 1245 | request->tx = musb_ep->is_in; |
1216 | 1246 | |
1217 | - if (is_dma_capable() && musb_ep->dma) | |
1218 | - map_dma_buffer(request, musb); | |
1219 | - else | |
1220 | - request->mapped = 0; | |
1247 | + map_dma_buffer(request, musb, musb_ep); | |
1221 | 1248 | |
1222 | 1249 | spin_lock_irqsave(&musb->lock, lockflags); |
1223 | 1250 |
drivers/usb/musb/musb_gadget.h
... | ... | @@ -35,13 +35,19 @@ |
35 | 35 | #ifndef __MUSB_GADGET_H |
36 | 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 | 44 | struct musb_request { |
39 | 45 | struct usb_request request; |
40 | 46 | struct musb_ep *ep; |
41 | 47 | struct musb *musb; |
42 | 48 | u8 tx; /* endpoint direction */ |
43 | 49 | u8 epnum; |
44 | - u8 mapped; | |
50 | + enum buffer_map_state map_state; | |
45 | 51 | }; |
46 | 52 | |
47 | 53 | static inline struct musb_request *to_musb_request(struct usb_request *req) |
drivers/usb/musb/musb_host.c
... | ... | @@ -609,7 +609,7 @@ |
609 | 609 | /* Set RXMAXP with the FIFO size of the endpoint |
610 | 610 | * to disable double buffer mode. |
611 | 611 | */ |
612 | - if (musb->hwvers < MUSB_HWVERS_2000) | |
612 | + if (musb->double_buffer_not_ok) | |
613 | 613 | musb_writew(ep->regs, MUSB_RXMAXP, ep->max_packet_sz_rx); |
614 | 614 | else |
615 | 615 | musb_writew(ep->regs, MUSB_RXMAXP, |
616 | 616 | |
617 | 617 | |
... | ... | @@ -784,14 +784,13 @@ |
784 | 784 | /* protocol/endpoint/interval/NAKlimit */ |
785 | 785 | if (epnum) { |
786 | 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 | 788 | musb_writew(epio, MUSB_TXMAXP, |
789 | - packet_sz | |
790 | - | ((hw_ep->max_packet_sz_tx / | |
791 | - packet_sz) - 1) << 11); | |
789 | + hw_ep->max_packet_sz_tx); | |
792 | 790 | else |
793 | 791 | musb_writew(epio, MUSB_TXMAXP, |
794 | - packet_sz); | |
792 | + qh->maxpacket | | |
793 | + ((qh->hb_mult - 1) << 11)); | |
795 | 794 | musb_writeb(epio, MUSB_TXINTERVAL, qh->intv_reg); |
796 | 795 | } else { |
797 | 796 | musb_writeb(epio, MUSB_NAKLIMIT0, qh->intv_reg); |
drivers/usb/musb/musbhsdma.h
... | ... | @@ -94,24 +94,33 @@ |
94 | 94 | { |
95 | 95 | musb_writew(mbase, |
96 | 96 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_LOW), |
97 | - ((u16)((u32) dma_addr & 0xFFFF))); | |
97 | + dma_addr); | |
98 | 98 | musb_writew(mbase, |
99 | 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 | 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 | 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 | 116 | static inline void musb_write_hsdma_count(void __iomem *mbase, |
110 | 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 | 122 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH), |
114 | - len); | |
123 | + (len >> 16)); | |
115 | 124 | } |
116 | 125 | |
117 | 126 | #endif /* CONFIG_BLACKFIN */ |
drivers/usb/otg/Kconfig
... | ... | @@ -103,6 +103,8 @@ |
103 | 103 | required after resetting the hardware and power management. |
104 | 104 | This driver is required even for peripheral only or host only |
105 | 105 | mode configurations. |
106 | + This driver is not supported on boards like trout which | |
107 | + has an external PHY. | |
106 | 108 | |
107 | 109 | config AB8500_USB |
108 | 110 | tristate "AB8500 USB Transceiver Driver" |
drivers/usb/serial/ftdi_sio.c
... | ... | @@ -100,6 +100,7 @@ |
100 | 100 | static int ftdi_jtag_probe(struct usb_serial *serial); |
101 | 101 | static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); |
102 | 102 | static int ftdi_NDI_device_setup(struct usb_serial *serial); |
103 | +static int ftdi_stmclite_probe(struct usb_serial *serial); | |
103 | 104 | static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); |
104 | 105 | static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); |
105 | 106 | |
... | ... | @@ -123,6 +124,10 @@ |
123 | 124 | .port_probe = ftdi_HE_TIRA1_setup, |
124 | 125 | }; |
125 | 126 | |
127 | +static struct ftdi_sio_quirk ftdi_stmclite_quirk = { | |
128 | + .probe = ftdi_stmclite_probe, | |
129 | +}; | |
130 | + | |
126 | 131 | /* |
127 | 132 | * The 8U232AM has the same API as the sio except for: |
128 | 133 | * - it can support MUCH higher baudrates; up to: |
... | ... | @@ -616,6 +621,7 @@ |
616 | 621 | { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, |
617 | 622 | { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, |
618 | 623 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, |
624 | + { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, | |
619 | 625 | { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, |
620 | 626 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, |
621 | 627 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, |
... | ... | @@ -810,6 +816,8 @@ |
810 | 816 | { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, |
811 | 817 | { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), |
812 | 818 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
819 | + { USB_DEVICE(ST_VID, ST_STMCLT1030_PID), | |
820 | + .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, | |
813 | 821 | { }, /* Optional parameter entry */ |
814 | 822 | { } /* Terminating entry */ |
815 | 823 | }; |
... | ... | @@ -1706,6 +1714,25 @@ |
1706 | 1714 | } |
1707 | 1715 | |
1708 | 1716 | return 0; |
1717 | +} | |
1718 | + | |
1719 | +/* | |
1720 | + * First and second port on STMCLiteadaptors is reserved for JTAG interface | |
1721 | + * and the forth port for pio | |
1722 | + */ | |
1723 | +static int ftdi_stmclite_probe(struct usb_serial *serial) | |
1724 | +{ | |
1725 | + struct usb_device *udev = serial->dev; | |
1726 | + struct usb_interface *interface = serial->interface; | |
1727 | + | |
1728 | + dbg("%s", __func__); | |
1729 | + | |
1730 | + if (interface == udev->actconfig->interface[2]) | |
1731 | + return 0; | |
1732 | + | |
1733 | + dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n"); | |
1734 | + | |
1735 | + return -ENODEV; | |
1709 | 1736 | } |
1710 | 1737 | |
1711 | 1738 | /* |
drivers/usb/serial/ftdi_sio_ids.h
... | ... | @@ -518,6 +518,12 @@ |
518 | 518 | #define RATOC_PRODUCT_ID_USB60F 0xb020 |
519 | 519 | |
520 | 520 | /* |
521 | + * Acton Research Corp. | |
522 | + */ | |
523 | +#define ACTON_VID 0x0647 /* Vendor ID */ | |
524 | +#define ACTON_SPECTRAPRO_PID 0x0100 | |
525 | + | |
526 | +/* | |
521 | 527 | * Contec products (http://www.contec.com) |
522 | 528 | * Submitted by Daniel Sangorrin |
523 | 529 | */ |
... | ... | @@ -1032,6 +1038,12 @@ |
1032 | 1038 | #define DE_VID 0x1cf1 /* Vendor ID */ |
1033 | 1039 | #define STB_PID 0x0001 /* Sensor Terminal Board */ |
1034 | 1040 | #define WHT_PID 0x0004 /* Wireless Handheld Terminal */ |
1041 | + | |
1042 | +/* | |
1043 | + * STMicroelectonics | |
1044 | + */ | |
1045 | +#define ST_VID 0x0483 | |
1046 | +#define ST_STMCLT1030_PID 0x3747 /* ST Micro Connect Lite STMCLT1030 */ | |
1035 | 1047 | |
1036 | 1048 | /* |
1037 | 1049 | * Papouch products (http://www.papouch.com/) |
drivers/usb/serial/io_edgeport.c
... | ... | @@ -2889,8 +2889,8 @@ |
2889 | 2889 | |
2890 | 2890 | dbg("%s %d.%d.%d", fw_info, rec->data[0], rec->data[1], build); |
2891 | 2891 | |
2892 | - edge_serial->product_info.FirmwareMajorVersion = fw->data[0]; | |
2893 | - edge_serial->product_info.FirmwareMinorVersion = fw->data[1]; | |
2892 | + edge_serial->product_info.FirmwareMajorVersion = rec->data[0]; | |
2893 | + edge_serial->product_info.FirmwareMinorVersion = rec->data[1]; | |
2894 | 2894 | edge_serial->product_info.FirmwareBuildNumber = cpu_to_le16(build); |
2895 | 2895 | |
2896 | 2896 | for (rec = ihex_next_binrec(rec); rec; |
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/storage/unusual_devs.h
... | ... | @@ -1397,6 +1397,13 @@ |
1397 | 1397 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
1398 | 1398 | US_FL_IGNORE_RESIDUE ), |
1399 | 1399 | |
1400 | +/* Submitted by Nick Holloway */ | |
1401 | +UNUSUAL_DEV( 0x0f88, 0x042e, 0x0100, 0x0100, | |
1402 | + "VTech", | |
1403 | + "Kidizoom", | |
1404 | + USB_SC_DEVICE, USB_PR_DEVICE, NULL, | |
1405 | + US_FL_FIX_CAPACITY ), | |
1406 | + | |
1400 | 1407 | /* Reported by Michael Stattmann <michael@stattmann.com> */ |
1401 | 1408 | UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, |
1402 | 1409 | "Sony Ericsson", |
... | ... | @@ -1889,6 +1896,13 @@ |
1889 | 1896 | "DataStation maxi g.u", |
1890 | 1897 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
1891 | 1898 | US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ), |
1899 | + | |
1900 | +/* Reported by Jasper Mackenzie <scarletpimpernal@hotmail.com> */ | |
1901 | +UNUSUAL_DEV( 0x1e74, 0x4621, 0x0000, 0x0000, | |
1902 | + "Coby Electronics", | |
1903 | + "MP3 Player", | |
1904 | + USB_SC_DEVICE, USB_PR_DEVICE, NULL, | |
1905 | + US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ), | |
1892 | 1906 | |
1893 | 1907 | UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, |
1894 | 1908 | "ST", |
include/linux/usb/msm_hsusb_hw.h
... | ... | @@ -16,12 +16,8 @@ |
16 | 16 | #ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__ |
17 | 17 | #define __LINUX_USB_GADGET_MSM72K_UDC_H__ |
18 | 18 | |
19 | -#ifdef CONFIG_ARCH_MSM7X00A | |
20 | -#define USB_SBUSCFG (MSM_USB_BASE + 0x0090) | |
21 | -#else | |
22 | 19 | #define USB_AHBBURST (MSM_USB_BASE + 0x0090) |
23 | 20 | #define USB_AHBMODE (MSM_USB_BASE + 0x0098) |
24 | -#endif | |
25 | 21 | #define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */ |
26 | 22 | |
27 | 23 | #define USB_USBCMD (MSM_USB_BASE + 0x0140) |