diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-05-19 22:57:38 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-19 22:57:38 -0400 |
commit | ffee72d4681c8777918268a96aef42bdeb6c367b (patch) | |
tree | 4baf91483886d561c198ed0524ab54b783273e86 /drivers/usb | |
parent | fb54d268329846aa13b2bc44a64d90e9b7131192 (diff) | |
parent | f72caf7e496465182eeda842ac66a5e75404ddf1 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/usb')
40 files changed, 336 insertions, 108 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index be6331e2c276..5e1a253b08a0 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1542,6 +1542,9 @@ static const struct usb_device_id acm_ids[] = { | |||
1542 | { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ | 1542 | { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ |
1543 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ | 1543 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ |
1544 | }, | 1544 | }, |
1545 | { USB_DEVICE(0x1576, 0x03b1), /* Maretron USB100 */ | ||
1546 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ | ||
1547 | }, | ||
1545 | 1548 | ||
1546 | /* Nokia S60 phones expose two ACM channels. The first is | 1549 | /* Nokia S60 phones expose two ACM channels. The first is |
1547 | * a modem and is picked up by the standard AT-command | 1550 | * a modem and is picked up by the standard AT-command |
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index 97a819c23ef3..7e594449600e 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
@@ -109,7 +109,7 @@ config USB_SUSPEND | |||
109 | config USB_OTG | 109 | config USB_OTG |
110 | bool | 110 | bool |
111 | depends on USB && EXPERIMENTAL | 111 | depends on USB && EXPERIMENTAL |
112 | select USB_SUSPEND | 112 | depends on USB_SUSPEND |
113 | default n | 113 | default n |
114 | 114 | ||
115 | 115 | ||
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 6a3b5cae3a6e..2f3dc4cdf79b 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -301,7 +301,7 @@ static int usb_probe_interface(struct device *dev) | |||
301 | 301 | ||
302 | intf->condition = USB_INTERFACE_BINDING; | 302 | intf->condition = USB_INTERFACE_BINDING; |
303 | 303 | ||
304 | /* Bound interfaces are initially active. They are | 304 | /* Probed interfaces are initially active. They are |
305 | * runtime-PM-enabled only if the driver has autosuspend support. | 305 | * runtime-PM-enabled only if the driver has autosuspend support. |
306 | * They are sensitive to their children's power states. | 306 | * They are sensitive to their children's power states. |
307 | */ | 307 | */ |
@@ -437,11 +437,11 @@ int usb_driver_claim_interface(struct usb_driver *driver, | |||
437 | 437 | ||
438 | iface->condition = USB_INTERFACE_BOUND; | 438 | iface->condition = USB_INTERFACE_BOUND; |
439 | 439 | ||
440 | /* Bound interfaces are initially active. They are | 440 | /* Claimed interfaces are initially inactive (suspended). They are |
441 | * runtime-PM-enabled only if the driver has autosuspend support. | 441 | * runtime-PM-enabled only if the driver has autosuspend support. |
442 | * They are sensitive to their children's power states. | 442 | * They are sensitive to their children's power states. |
443 | */ | 443 | */ |
444 | pm_runtime_set_active(dev); | 444 | pm_runtime_set_suspended(dev); |
445 | pm_suspend_ignore_children(dev, false); | 445 | pm_suspend_ignore_children(dev, false); |
446 | if (driver->supports_autosuspend) | 446 | if (driver->supports_autosuspend) |
447 | pm_runtime_enable(dev); | 447 | pm_runtime_enable(dev); |
@@ -1170,7 +1170,7 @@ done: | |||
1170 | static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | 1170 | static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) |
1171 | { | 1171 | { |
1172 | int status = 0; | 1172 | int status = 0; |
1173 | int i = 0; | 1173 | int i = 0, n = 0; |
1174 | struct usb_interface *intf; | 1174 | struct usb_interface *intf; |
1175 | 1175 | ||
1176 | if (udev->state == USB_STATE_NOTATTACHED || | 1176 | if (udev->state == USB_STATE_NOTATTACHED || |
@@ -1179,7 +1179,8 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1179 | 1179 | ||
1180 | /* Suspend all the interfaces and then udev itself */ | 1180 | /* Suspend all the interfaces and then udev itself */ |
1181 | if (udev->actconfig) { | 1181 | if (udev->actconfig) { |
1182 | for (; i < udev->actconfig->desc.bNumInterfaces; i++) { | 1182 | n = udev->actconfig->desc.bNumInterfaces; |
1183 | for (i = n - 1; i >= 0; --i) { | ||
1183 | intf = udev->actconfig->interface[i]; | 1184 | intf = udev->actconfig->interface[i]; |
1184 | status = usb_suspend_interface(udev, intf, msg); | 1185 | status = usb_suspend_interface(udev, intf, msg); |
1185 | if (status != 0) | 1186 | if (status != 0) |
@@ -1192,7 +1193,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1192 | /* If the suspend failed, resume interfaces that did get suspended */ | 1193 | /* If the suspend failed, resume interfaces that did get suspended */ |
1193 | if (status != 0) { | 1194 | if (status != 0) { |
1194 | msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME); | 1195 | msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME); |
1195 | while (--i >= 0) { | 1196 | while (++i < n) { |
1196 | intf = udev->actconfig->interface[i]; | 1197 | intf = udev->actconfig->interface[i]; |
1197 | usb_resume_interface(udev, intf, msg, 0); | 1198 | usb_resume_interface(udev, intf, msg, 0); |
1198 | } | 1199 | } |
@@ -1263,13 +1264,47 @@ static int usb_resume_both(struct usb_device *udev, pm_message_t msg) | |||
1263 | return status; | 1264 | return status; |
1264 | } | 1265 | } |
1265 | 1266 | ||
1267 | static void choose_wakeup(struct usb_device *udev, pm_message_t msg) | ||
1268 | { | ||
1269 | int w, i; | ||
1270 | struct usb_interface *intf; | ||
1271 | |||
1272 | /* Remote wakeup is needed only when we actually go to sleep. | ||
1273 | * For things like FREEZE and QUIESCE, if the device is already | ||
1274 | * autosuspended then its current wakeup setting is okay. | ||
1275 | */ | ||
1276 | if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_QUIESCE) { | ||
1277 | if (udev->state != USB_STATE_SUSPENDED) | ||
1278 | udev->do_remote_wakeup = 0; | ||
1279 | return; | ||
1280 | } | ||
1281 | |||
1282 | /* If remote wakeup is permitted, see whether any interface drivers | ||
1283 | * actually want it. | ||
1284 | */ | ||
1285 | w = 0; | ||
1286 | if (device_may_wakeup(&udev->dev) && udev->actconfig) { | ||
1287 | for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { | ||
1288 | intf = udev->actconfig->interface[i]; | ||
1289 | w |= intf->needs_remote_wakeup; | ||
1290 | } | ||
1291 | } | ||
1292 | |||
1293 | /* If the device is autosuspended with the wrong wakeup setting, | ||
1294 | * autoresume now so the setting can be changed. | ||
1295 | */ | ||
1296 | if (udev->state == USB_STATE_SUSPENDED && w != udev->do_remote_wakeup) | ||
1297 | pm_runtime_resume(&udev->dev); | ||
1298 | udev->do_remote_wakeup = w; | ||
1299 | } | ||
1300 | |||
1266 | /* The device lock is held by the PM core */ | 1301 | /* The device lock is held by the PM core */ |
1267 | int usb_suspend(struct device *dev, pm_message_t msg) | 1302 | int usb_suspend(struct device *dev, pm_message_t msg) |
1268 | { | 1303 | { |
1269 | struct usb_device *udev = to_usb_device(dev); | 1304 | struct usb_device *udev = to_usb_device(dev); |
1270 | 1305 | ||
1271 | do_unbind_rebind(udev, DO_UNBIND); | 1306 | do_unbind_rebind(udev, DO_UNBIND); |
1272 | udev->do_remote_wakeup = device_may_wakeup(&udev->dev); | 1307 | choose_wakeup(udev, msg); |
1273 | return usb_suspend_both(udev, msg); | 1308 | return usb_suspend_both(udev, msg); |
1274 | } | 1309 | } |
1275 | 1310 | ||
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index bdf87a8414a1..2c95153c0f24 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c | |||
@@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_device *udev) | |||
120 | * than a vendor-specific driver. */ | 120 | * than a vendor-specific driver. */ |
121 | else if (udev->descriptor.bDeviceClass != | 121 | else if (udev->descriptor.bDeviceClass != |
122 | USB_CLASS_VENDOR_SPEC && | 122 | USB_CLASS_VENDOR_SPEC && |
123 | (!desc || desc->bInterfaceClass != | 123 | (desc && desc->bInterfaceClass != |
124 | USB_CLASS_VENDOR_SPEC)) { | 124 | USB_CLASS_VENDOR_SPEC)) { |
125 | best = c; | 125 | best = c; |
126 | break; | 126 | break; |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 97b40ce133f0..111a01a747fc 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -380,6 +380,7 @@ static int usbfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
380 | mutex_lock(&inode->i_mutex); | 380 | mutex_lock(&inode->i_mutex); |
381 | dentry_unhash(dentry); | 381 | dentry_unhash(dentry); |
382 | if (usbfs_empty(dentry)) { | 382 | if (usbfs_empty(dentry)) { |
383 | dont_mount(dentry); | ||
383 | drop_nlink(dentry->d_inode); | 384 | drop_nlink(dentry->d_inode); |
384 | drop_nlink(dentry->d_inode); | 385 | drop_nlink(dentry->d_inode); |
385 | dput(dentry); | 386 | dput(dentry); |
@@ -515,13 +516,13 @@ static int fs_create_by_name (const char *name, mode_t mode, | |||
515 | *dentry = NULL; | 516 | *dentry = NULL; |
516 | mutex_lock(&parent->d_inode->i_mutex); | 517 | mutex_lock(&parent->d_inode->i_mutex); |
517 | *dentry = lookup_one_len(name, parent, strlen(name)); | 518 | *dentry = lookup_one_len(name, parent, strlen(name)); |
518 | if (!IS_ERR(dentry)) { | 519 | if (!IS_ERR(*dentry)) { |
519 | if ((mode & S_IFMT) == S_IFDIR) | 520 | if ((mode & S_IFMT) == S_IFDIR) |
520 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); | 521 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); |
521 | else | 522 | else |
522 | error = usbfs_create (parent->d_inode, *dentry, mode); | 523 | error = usbfs_create (parent->d_inode, *dentry, mode); |
523 | } else | 524 | } else |
524 | error = PTR_ERR(dentry); | 525 | error = PTR_ERR(*dentry); |
525 | mutex_unlock(&parent->d_inode->i_mutex); | 526 | mutex_unlock(&parent->d_inode->i_mutex); |
526 | 527 | ||
527 | return error; | 528 | return error; |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 1297e9b16a51..0561430f2ede 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -718,7 +718,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
718 | EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); | 718 | EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); |
719 | 719 | ||
720 | /** | 720 | /** |
721 | * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP | 721 | * usb_alloc_coherent - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP |
722 | * @dev: device the buffer will be used with | 722 | * @dev: device the buffer will be used with |
723 | * @size: requested buffer size | 723 | * @size: requested buffer size |
724 | * @mem_flags: affect whether allocation may block | 724 | * @mem_flags: affect whether allocation may block |
@@ -737,30 +737,30 @@ EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); | |||
737 | * architectures where CPU caches are not DMA-coherent. On systems without | 737 | * architectures where CPU caches are not DMA-coherent. On systems without |
738 | * bus-snooping caches, these buffers are uncached. | 738 | * bus-snooping caches, these buffers are uncached. |
739 | * | 739 | * |
740 | * When the buffer is no longer used, free it with usb_buffer_free(). | 740 | * When the buffer is no longer used, free it with usb_free_coherent(). |
741 | */ | 741 | */ |
742 | void *usb_buffer_alloc(struct usb_device *dev, size_t size, gfp_t mem_flags, | 742 | void *usb_alloc_coherent(struct usb_device *dev, size_t size, gfp_t mem_flags, |
743 | dma_addr_t *dma) | 743 | dma_addr_t *dma) |
744 | { | 744 | { |
745 | if (!dev || !dev->bus) | 745 | if (!dev || !dev->bus) |
746 | return NULL; | 746 | return NULL; |
747 | return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); | 747 | return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); |
748 | } | 748 | } |
749 | EXPORT_SYMBOL_GPL(usb_buffer_alloc); | 749 | EXPORT_SYMBOL_GPL(usb_alloc_coherent); |
750 | 750 | ||
751 | /** | 751 | /** |
752 | * usb_buffer_free - free memory allocated with usb_buffer_alloc() | 752 | * usb_free_coherent - free memory allocated with usb_alloc_coherent() |
753 | * @dev: device the buffer was used with | 753 | * @dev: device the buffer was used with |
754 | * @size: requested buffer size | 754 | * @size: requested buffer size |
755 | * @addr: CPU address of buffer | 755 | * @addr: CPU address of buffer |
756 | * @dma: DMA address of buffer | 756 | * @dma: DMA address of buffer |
757 | * | 757 | * |
758 | * This reclaims an I/O buffer, letting it be reused. The memory must have | 758 | * This reclaims an I/O buffer, letting it be reused. The memory must have |
759 | * been allocated using usb_buffer_alloc(), and the parameters must match | 759 | * been allocated using usb_alloc_coherent(), and the parameters must match |
760 | * those provided in that allocation request. | 760 | * those provided in that allocation request. |
761 | */ | 761 | */ |
762 | void usb_buffer_free(struct usb_device *dev, size_t size, void *addr, | 762 | void usb_free_coherent(struct usb_device *dev, size_t size, void *addr, |
763 | dma_addr_t dma) | 763 | dma_addr_t dma) |
764 | { | 764 | { |
765 | if (!dev || !dev->bus) | 765 | if (!dev || !dev->bus) |
766 | return; | 766 | return; |
@@ -768,7 +768,7 @@ void usb_buffer_free(struct usb_device *dev, size_t size, void *addr, | |||
768 | return; | 768 | return; |
769 | hcd_buffer_free(dev->bus, size, addr, dma); | 769 | hcd_buffer_free(dev->bus, size, addr, dma); |
770 | } | 770 | } |
771 | EXPORT_SYMBOL_GPL(usb_buffer_free); | 771 | EXPORT_SYMBOL_GPL(usb_free_coherent); |
772 | 772 | ||
773 | /** | 773 | /** |
774 | * usb_buffer_map - create DMA mapping(s) for an urb | 774 | * usb_buffer_map - create DMA mapping(s) for an urb |
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index df1bae9b048e..eaa79c8a9b8c 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -366,6 +366,13 @@ rescan: | |||
366 | if (is_done) | 366 | if (is_done) |
367 | done(ep, req, 0); | 367 | done(ep, req, 0); |
368 | else if (ep->is_pingpong) { | 368 | else if (ep->is_pingpong) { |
369 | /* | ||
370 | * One dummy read to delay the code because of a HW glitch: | ||
371 | * CSR returns bad RXCOUNT when read too soon after updating | ||
372 | * RX_DATA_BK flags. | ||
373 | */ | ||
374 | csr = __raw_readl(creg); | ||
375 | |||
369 | bufferspace -= count; | 376 | bufferspace -= count; |
370 | buf += count; | 377 | buf += count; |
371 | goto rescan; | 378 | goto rescan; |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 124a8ccfdcda..1f73b485732d 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -2145,6 +2145,7 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2145 | u32 epctrl; | 2145 | u32 epctrl; |
2146 | u32 mps; | 2146 | u32 mps; |
2147 | int dir_in; | 2147 | int dir_in; |
2148 | int ret = 0; | ||
2148 | 2149 | ||
2149 | dev_dbg(hsotg->dev, | 2150 | dev_dbg(hsotg->dev, |
2150 | "%s: ep %s: a 0x%02x, attr 0x%02x, mps 0x%04x, intr %d\n", | 2151 | "%s: ep %s: a 0x%02x, attr 0x%02x, mps 0x%04x, intr %d\n", |
@@ -2196,7 +2197,8 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2196 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { | 2197 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { |
2197 | case USB_ENDPOINT_XFER_ISOC: | 2198 | case USB_ENDPOINT_XFER_ISOC: |
2198 | dev_err(hsotg->dev, "no current ISOC support\n"); | 2199 | dev_err(hsotg->dev, "no current ISOC support\n"); |
2199 | return -EINVAL; | 2200 | ret = -EINVAL; |
2201 | goto out; | ||
2200 | 2202 | ||
2201 | case USB_ENDPOINT_XFER_BULK: | 2203 | case USB_ENDPOINT_XFER_BULK: |
2202 | epctrl |= S3C_DxEPCTL_EPType_Bulk; | 2204 | epctrl |= S3C_DxEPCTL_EPType_Bulk; |
@@ -2235,8 +2237,9 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2235 | /* enable the endpoint interrupt */ | 2237 | /* enable the endpoint interrupt */ |
2236 | s3c_hsotg_ctrl_epint(hsotg, index, dir_in, 1); | 2238 | s3c_hsotg_ctrl_epint(hsotg, index, dir_in, 1); |
2237 | 2239 | ||
2240 | out: | ||
2238 | spin_unlock_irqrestore(&hs_ep->lock, flags); | 2241 | spin_unlock_irqrestore(&hs_ep->lock, flags); |
2239 | return 0; | 2242 | return ret; |
2240 | } | 2243 | } |
2241 | 2244 | ||
2242 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) | 2245 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 207e7a85aeb0..13ead00aecd5 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -543,6 +543,7 @@ static int ehci_init(struct usb_hcd *hcd) | |||
543 | */ | 543 | */ |
544 | ehci->periodic_size = DEFAULT_I_TDPS; | 544 | ehci->periodic_size = DEFAULT_I_TDPS; |
545 | INIT_LIST_HEAD(&ehci->cached_itd_list); | 545 | INIT_LIST_HEAD(&ehci->cached_itd_list); |
546 | INIT_LIST_HEAD(&ehci->cached_sitd_list); | ||
546 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) | 547 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) |
547 | return retval; | 548 | return retval; |
548 | 549 | ||
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 19372673bf09..c7178bcde67a 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -801,7 +801,7 @@ static int ehci_hub_control ( | |||
801 | * this bit; seems too long to spin routinely... | 801 | * this bit; seems too long to spin routinely... |
802 | */ | 802 | */ |
803 | retval = handshake(ehci, status_reg, | 803 | retval = handshake(ehci, status_reg, |
804 | PORT_RESET, 0, 750); | 804 | PORT_RESET, 0, 1000); |
805 | if (retval != 0) { | 805 | if (retval != 0) { |
806 | ehci_err (ehci, "port %d reset error %d\n", | 806 | ehci_err (ehci, "port %d reset error %d\n", |
807 | wIndex + 1, retval); | 807 | wIndex + 1, retval); |
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index aeda96e0af67..1f3f01eacaf0 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c | |||
@@ -136,7 +136,7 @@ static inline void qh_put (struct ehci_qh *qh) | |||
136 | 136 | ||
137 | static void ehci_mem_cleanup (struct ehci_hcd *ehci) | 137 | static void ehci_mem_cleanup (struct ehci_hcd *ehci) |
138 | { | 138 | { |
139 | free_cached_itd_list(ehci); | 139 | free_cached_lists(ehci); |
140 | if (ehci->async) | 140 | if (ehci->async) |
141 | qh_put (ehci->async); | 141 | qh_put (ehci->async); |
142 | ehci->async = NULL; | 142 | ehci->async = NULL; |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index a67a0030dd57..40a858335035 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -629,11 +629,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
629 | } | 629 | } |
630 | snprintf(supply, sizeof(supply), "hsusb%d", i); | 630 | snprintf(supply, sizeof(supply), "hsusb%d", i); |
631 | omap->regulator[i] = regulator_get(omap->dev, supply); | 631 | omap->regulator[i] = regulator_get(omap->dev, supply); |
632 | if (IS_ERR(omap->regulator[i])) | 632 | if (IS_ERR(omap->regulator[i])) { |
633 | omap->regulator[i] = NULL; | ||
633 | dev_dbg(&pdev->dev, | 634 | dev_dbg(&pdev->dev, |
634 | "failed to get ehci port%d regulator\n", i); | 635 | "failed to get ehci port%d regulator\n", i); |
635 | else | 636 | } else { |
636 | regulator_enable(omap->regulator[i]); | 637 | regulator_enable(omap->regulator[i]); |
638 | } | ||
637 | } | 639 | } |
638 | 640 | ||
639 | ret = omap_start_ehc(omap, hcd); | 641 | ret = omap_start_ehc(omap, hcd); |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index a0aaaaff2560..805ec633a652 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -510,7 +510,7 @@ static int disable_periodic (struct ehci_hcd *ehci) | |||
510 | ehci_writel(ehci, cmd, &ehci->regs->command); | 510 | ehci_writel(ehci, cmd, &ehci->regs->command); |
511 | /* posted write ... */ | 511 | /* posted write ... */ |
512 | 512 | ||
513 | free_cached_itd_list(ehci); | 513 | free_cached_lists(ehci); |
514 | 514 | ||
515 | ehci->next_uframe = -1; | 515 | ehci->next_uframe = -1; |
516 | return 0; | 516 | return 0; |
@@ -2139,13 +2139,27 @@ sitd_complete ( | |||
2139 | (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); | 2139 | (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); |
2140 | } | 2140 | } |
2141 | iso_stream_put (ehci, stream); | 2141 | iso_stream_put (ehci, stream); |
2142 | /* OK to recycle this SITD now that its completion callback ran. */ | 2142 | |
2143 | done: | 2143 | done: |
2144 | sitd->urb = NULL; | 2144 | sitd->urb = NULL; |
2145 | sitd->stream = NULL; | 2145 | if (ehci->clock_frame != sitd->frame) { |
2146 | list_move(&sitd->sitd_list, &stream->free_list); | 2146 | /* OK to recycle this SITD now. */ |
2147 | iso_stream_put(ehci, stream); | 2147 | sitd->stream = NULL; |
2148 | 2148 | list_move(&sitd->sitd_list, &stream->free_list); | |
2149 | iso_stream_put(ehci, stream); | ||
2150 | } else { | ||
2151 | /* HW might remember this SITD, so we can't recycle it yet. | ||
2152 | * Move it to a safe place until a new frame starts. | ||
2153 | */ | ||
2154 | list_move(&sitd->sitd_list, &ehci->cached_sitd_list); | ||
2155 | if (stream->refcount == 2) { | ||
2156 | /* If iso_stream_put() were called here, stream | ||
2157 | * would be freed. Instead, just prevent reuse. | ||
2158 | */ | ||
2159 | stream->ep->hcpriv = NULL; | ||
2160 | stream->ep = NULL; | ||
2161 | } | ||
2162 | } | ||
2149 | return retval; | 2163 | return retval; |
2150 | } | 2164 | } |
2151 | 2165 | ||
@@ -2211,9 +2225,10 @@ done: | |||
2211 | 2225 | ||
2212 | /*-------------------------------------------------------------------------*/ | 2226 | /*-------------------------------------------------------------------------*/ |
2213 | 2227 | ||
2214 | static void free_cached_itd_list(struct ehci_hcd *ehci) | 2228 | static void free_cached_lists(struct ehci_hcd *ehci) |
2215 | { | 2229 | { |
2216 | struct ehci_itd *itd, *n; | 2230 | struct ehci_itd *itd, *n; |
2231 | struct ehci_sitd *sitd, *sn; | ||
2217 | 2232 | ||
2218 | list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) { | 2233 | list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) { |
2219 | struct ehci_iso_stream *stream = itd->stream; | 2234 | struct ehci_iso_stream *stream = itd->stream; |
@@ -2221,6 +2236,13 @@ static void free_cached_itd_list(struct ehci_hcd *ehci) | |||
2221 | list_move(&itd->itd_list, &stream->free_list); | 2236 | list_move(&itd->itd_list, &stream->free_list); |
2222 | iso_stream_put(ehci, stream); | 2237 | iso_stream_put(ehci, stream); |
2223 | } | 2238 | } |
2239 | |||
2240 | list_for_each_entry_safe(sitd, sn, &ehci->cached_sitd_list, sitd_list) { | ||
2241 | struct ehci_iso_stream *stream = sitd->stream; | ||
2242 | sitd->stream = NULL; | ||
2243 | list_move(&sitd->sitd_list, &stream->free_list); | ||
2244 | iso_stream_put(ehci, stream); | ||
2245 | } | ||
2224 | } | 2246 | } |
2225 | 2247 | ||
2226 | /*-------------------------------------------------------------------------*/ | 2248 | /*-------------------------------------------------------------------------*/ |
@@ -2247,7 +2269,7 @@ scan_periodic (struct ehci_hcd *ehci) | |||
2247 | clock_frame = -1; | 2269 | clock_frame = -1; |
2248 | } | 2270 | } |
2249 | if (ehci->clock_frame != clock_frame) { | 2271 | if (ehci->clock_frame != clock_frame) { |
2250 | free_cached_itd_list(ehci); | 2272 | free_cached_lists(ehci); |
2251 | ehci->clock_frame = clock_frame; | 2273 | ehci->clock_frame = clock_frame; |
2252 | } | 2274 | } |
2253 | clock %= mod; | 2275 | clock %= mod; |
@@ -2414,7 +2436,7 @@ restart: | |||
2414 | clock = now; | 2436 | clock = now; |
2415 | clock_frame = clock >> 3; | 2437 | clock_frame = clock >> 3; |
2416 | if (ehci->clock_frame != clock_frame) { | 2438 | if (ehci->clock_frame != clock_frame) { |
2417 | free_cached_itd_list(ehci); | 2439 | free_cached_lists(ehci); |
2418 | ehci->clock_frame = clock_frame; | 2440 | ehci->clock_frame = clock_frame; |
2419 | } | 2441 | } |
2420 | } else { | 2442 | } else { |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index b1dce96dd621..556c0b48f3ab 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -87,8 +87,9 @@ struct ehci_hcd { /* one per controller */ | |||
87 | int next_uframe; /* scan periodic, start here */ | 87 | int next_uframe; /* scan periodic, start here */ |
88 | unsigned periodic_sched; /* periodic activity count */ | 88 | unsigned periodic_sched; /* periodic activity count */ |
89 | 89 | ||
90 | /* list of itds completed while clock_frame was still active */ | 90 | /* list of itds & sitds completed while clock_frame was still active */ |
91 | struct list_head cached_itd_list; | 91 | struct list_head cached_itd_list; |
92 | struct list_head cached_sitd_list; | ||
92 | unsigned clock_frame; | 93 | unsigned clock_frame; |
93 | 94 | ||
94 | /* per root hub port */ | 95 | /* per root hub port */ |
@@ -195,7 +196,7 @@ timer_action_done (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
195 | clear_bit (action, &ehci->actions); | 196 | clear_bit (action, &ehci->actions); |
196 | } | 197 | } |
197 | 198 | ||
198 | static void free_cached_itd_list(struct ehci_hcd *ehci); | 199 | static void free_cached_lists(struct ehci_hcd *ehci); |
199 | 200 | ||
200 | /*-------------------------------------------------------------------------*/ | 201 | /*-------------------------------------------------------------------------*/ |
201 | 202 | ||
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 68b83ab70719..944291e10f97 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -331,6 +331,8 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
331 | */ | 331 | */ |
332 | if (at91_suspend_entering_slow_clock()) { | 332 | if (at91_suspend_entering_slow_clock()) { |
333 | ohci_usb_reset (ohci); | 333 | ohci_usb_reset (ohci); |
334 | /* flush the writes */ | ||
335 | (void) ohci_readl (ohci, &ohci->regs->control); | ||
334 | at91_stop_clock(); | 336 | at91_stop_clock(); |
335 | } | 337 | } |
336 | 338 | ||
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 4aa08d36d077..d22fb4d577b7 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #error "This file is DA8xx bus glue. Define CONFIG_ARCH_DAVINCI_DA8XX." | 23 | #error "This file is DA8xx bus glue. Define CONFIG_ARCH_DAVINCI_DA8XX." |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #define CFGCHIP2 DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG) | 26 | #define CFGCHIP2 DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG) |
27 | 27 | ||
28 | static struct clk *usb11_clk; | 28 | static struct clk *usb11_clk; |
29 | static struct clk *usb20_clk; | 29 | static struct clk *usb20_clk; |
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 32bbce9718f0..65cac8cc8921 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -697,7 +697,7 @@ static int ohci_hub_control ( | |||
697 | u16 wLength | 697 | u16 wLength |
698 | ) { | 698 | ) { |
699 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 699 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
700 | int ports = hcd_to_bus (hcd)->root_hub->maxchild; | 700 | int ports = ohci->num_ports; |
701 | u32 temp; | 701 | u32 temp; |
702 | int retval = 0; | 702 | int retval = 0; |
703 | 703 | ||
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 50f57f468836..e62b30b3e429 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c | |||
@@ -660,13 +660,13 @@ static struct ehci_qh *oxu_qh_alloc(struct oxu_hcd *oxu) | |||
660 | if (qh->dummy == NULL) { | 660 | if (qh->dummy == NULL) { |
661 | oxu_dbg(oxu, "no dummy td\n"); | 661 | oxu_dbg(oxu, "no dummy td\n"); |
662 | oxu->qh_used[i] = 0; | 662 | oxu->qh_used[i] = 0; |
663 | 663 | qh = NULL; | |
664 | return NULL; | 664 | goto unlock; |
665 | } | 665 | } |
666 | 666 | ||
667 | oxu->qh_used[i] = 1; | 667 | oxu->qh_used[i] = 1; |
668 | } | 668 | } |
669 | 669 | unlock: | |
670 | spin_unlock(&oxu->mem_lock); | 670 | spin_unlock(&oxu->mem_lock); |
671 | 671 | ||
672 | return qh; | 672 | return qh; |
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index e11cc3aa4b82..3b867a8af7b2 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
@@ -720,10 +720,10 @@ retry: | |||
720 | /* port status seems weird until after reset, so | 720 | /* port status seems weird until after reset, so |
721 | * force the reset and make khubd clean up later. | 721 | * force the reset and make khubd clean up later. |
722 | */ | 722 | */ |
723 | if (sl811->stat_insrmv & 1) | 723 | if (irqstat & SL11H_INTMASK_RD) |
724 | sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION; | ||
725 | else | ||
726 | sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION); | 724 | sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION); |
725 | else | ||
726 | sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION; | ||
727 | 727 | ||
728 | sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION; | 728 | sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION; |
729 | 729 | ||
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index c09539bad1ee..d64f5724bfc4 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -582,6 +582,19 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
582 | return EP_INTERVAL(interval); | 582 | return EP_INTERVAL(interval); |
583 | } | 583 | } |
584 | 584 | ||
585 | /* The "Mult" field in the endpoint context is only set for SuperSpeed devices. | ||
586 | * High speed endpoint descriptors can define "the number of additional | ||
587 | * transaction opportunities per microframe", but that goes in the Max Burst | ||
588 | * endpoint context field. | ||
589 | */ | ||
590 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, | ||
591 | struct usb_host_endpoint *ep) | ||
592 | { | ||
593 | if (udev->speed != USB_SPEED_SUPER || !ep->ss_ep_comp) | ||
594 | return 0; | ||
595 | return ep->ss_ep_comp->desc.bmAttributes; | ||
596 | } | ||
597 | |||
585 | static inline u32 xhci_get_endpoint_type(struct usb_device *udev, | 598 | static inline u32 xhci_get_endpoint_type(struct usb_device *udev, |
586 | struct usb_host_endpoint *ep) | 599 | struct usb_host_endpoint *ep) |
587 | { | 600 | { |
@@ -612,6 +625,36 @@ static inline u32 xhci_get_endpoint_type(struct usb_device *udev, | |||
612 | return type; | 625 | return type; |
613 | } | 626 | } |
614 | 627 | ||
628 | /* Return the maximum endpoint service interval time (ESIT) payload. | ||
629 | * Basically, this is the maxpacket size, multiplied by the burst size | ||
630 | * and mult size. | ||
631 | */ | ||
632 | static inline u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci, | ||
633 | struct usb_device *udev, | ||
634 | struct usb_host_endpoint *ep) | ||
635 | { | ||
636 | int max_burst; | ||
637 | int max_packet; | ||
638 | |||
639 | /* Only applies for interrupt or isochronous endpoints */ | ||
640 | if (usb_endpoint_xfer_control(&ep->desc) || | ||
641 | usb_endpoint_xfer_bulk(&ep->desc)) | ||
642 | return 0; | ||
643 | |||
644 | if (udev->speed == USB_SPEED_SUPER) { | ||
645 | if (ep->ss_ep_comp) | ||
646 | return ep->ss_ep_comp->desc.wBytesPerInterval; | ||
647 | xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n"); | ||
648 | /* Assume no bursts, no multiple opportunities to send. */ | ||
649 | return ep->desc.wMaxPacketSize; | ||
650 | } | ||
651 | |||
652 | max_packet = ep->desc.wMaxPacketSize & 0x3ff; | ||
653 | max_burst = (ep->desc.wMaxPacketSize & 0x1800) >> 11; | ||
654 | /* A 0 in max burst means 1 transfer per ESIT */ | ||
655 | return max_packet * (max_burst + 1); | ||
656 | } | ||
657 | |||
615 | int xhci_endpoint_init(struct xhci_hcd *xhci, | 658 | int xhci_endpoint_init(struct xhci_hcd *xhci, |
616 | struct xhci_virt_device *virt_dev, | 659 | struct xhci_virt_device *virt_dev, |
617 | struct usb_device *udev, | 660 | struct usb_device *udev, |
@@ -623,6 +666,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
623 | struct xhci_ring *ep_ring; | 666 | struct xhci_ring *ep_ring; |
624 | unsigned int max_packet; | 667 | unsigned int max_packet; |
625 | unsigned int max_burst; | 668 | unsigned int max_burst; |
669 | u32 max_esit_payload; | ||
626 | 670 | ||
627 | ep_index = xhci_get_endpoint_index(&ep->desc); | 671 | ep_index = xhci_get_endpoint_index(&ep->desc); |
628 | ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); | 672 | ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); |
@@ -644,6 +688,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
644 | ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; | 688 | ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; |
645 | 689 | ||
646 | ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); | 690 | ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); |
691 | ep_ctx->ep_info |= EP_MULT(xhci_get_endpoint_mult(udev, ep)); | ||
647 | 692 | ||
648 | /* FIXME dig Mult and streams info out of ep companion desc */ | 693 | /* FIXME dig Mult and streams info out of ep companion desc */ |
649 | 694 | ||
@@ -689,6 +734,26 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
689 | default: | 734 | default: |
690 | BUG(); | 735 | BUG(); |
691 | } | 736 | } |
737 | max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); | ||
738 | ep_ctx->tx_info = MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload); | ||
739 | |||
740 | /* | ||
741 | * XXX no idea how to calculate the average TRB buffer length for bulk | ||
742 | * endpoints, as the driver gives us no clue how big each scatter gather | ||
743 | * list entry (or buffer) is going to be. | ||
744 | * | ||
745 | * For isochronous and interrupt endpoints, we set it to the max | ||
746 | * available, until we have new API in the USB core to allow drivers to | ||
747 | * declare how much bandwidth they actually need. | ||
748 | * | ||
749 | * Normally, it would be calculated by taking the total of the buffer | ||
750 | * lengths in the TD and then dividing by the number of TRBs in a TD, | ||
751 | * including link TRBs, No-op TRBs, and Event data TRBs. Since we don't | ||
752 | * use Event Data TRBs, and we don't chain in a link TRB on short | ||
753 | * transfers, we're basically dividing by 1. | ||
754 | */ | ||
755 | ep_ctx->tx_info |= AVG_TRB_LENGTH_FOR_EP(max_esit_payload); | ||
756 | |||
692 | /* FIXME Debug endpoint context */ | 757 | /* FIXME Debug endpoint context */ |
693 | return 0; | 758 | return 0; |
694 | } | 759 | } |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index e5eb09b2f38e..ea389e9a4931 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -609,6 +609,10 @@ struct xhci_ep_ctx { | |||
609 | #define MAX_PACKET_MASK (0xffff << 16) | 609 | #define MAX_PACKET_MASK (0xffff << 16) |
610 | #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) | 610 | #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) |
611 | 611 | ||
612 | /* tx_info bitmasks */ | ||
613 | #define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff) | ||
614 | #define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16) | ||
615 | |||
612 | 616 | ||
613 | /** | 617 | /** |
614 | * struct xhci_input_control_context | 618 | * struct xhci_input_control_context |
diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index a9555cb901a1..de8ef945b536 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c | |||
@@ -49,6 +49,7 @@ struct usb_sevsegdev { | |||
49 | u16 textlength; | 49 | u16 textlength; |
50 | 50 | ||
51 | u8 shadow_power; /* for PM */ | 51 | u8 shadow_power; /* for PM */ |
52 | u8 has_interface_pm; | ||
52 | }; | 53 | }; |
53 | 54 | ||
54 | /* sysfs_streq can't replace this completely | 55 | /* sysfs_streq can't replace this completely |
@@ -68,12 +69,16 @@ static void update_display_powered(struct usb_sevsegdev *mydev) | |||
68 | { | 69 | { |
69 | int rc; | 70 | int rc; |
70 | 71 | ||
71 | if (!mydev->shadow_power && mydev->powered) { | 72 | if (mydev->powered && !mydev->has_interface_pm) { |
72 | rc = usb_autopm_get_interface(mydev->intf); | 73 | rc = usb_autopm_get_interface(mydev->intf); |
73 | if (rc < 0) | 74 | if (rc < 0) |
74 | return; | 75 | return; |
76 | mydev->has_interface_pm = 1; | ||
75 | } | 77 | } |
76 | 78 | ||
79 | if (mydev->shadow_power != 1) | ||
80 | return; | ||
81 | |||
77 | rc = usb_control_msg(mydev->udev, | 82 | rc = usb_control_msg(mydev->udev, |
78 | usb_sndctrlpipe(mydev->udev, 0), | 83 | usb_sndctrlpipe(mydev->udev, 0), |
79 | 0x12, | 84 | 0x12, |
@@ -86,8 +91,10 @@ static void update_display_powered(struct usb_sevsegdev *mydev) | |||
86 | if (rc < 0) | 91 | if (rc < 0) |
87 | dev_dbg(&mydev->udev->dev, "power retval = %d\n", rc); | 92 | dev_dbg(&mydev->udev->dev, "power retval = %d\n", rc); |
88 | 93 | ||
89 | if (mydev->shadow_power && !mydev->powered) | 94 | if (!mydev->powered && mydev->has_interface_pm) { |
90 | usb_autopm_put_interface(mydev->intf); | 95 | usb_autopm_put_interface(mydev->intf); |
96 | mydev->has_interface_pm = 0; | ||
97 | } | ||
91 | } | 98 | } |
92 | 99 | ||
93 | static void update_display_mode(struct usb_sevsegdev *mydev) | 100 | static void update_display_mode(struct usb_sevsegdev *mydev) |
@@ -351,6 +358,10 @@ static int sevseg_probe(struct usb_interface *interface, | |||
351 | mydev->intf = interface; | 358 | mydev->intf = interface; |
352 | usb_set_intfdata(interface, mydev); | 359 | usb_set_intfdata(interface, mydev); |
353 | 360 | ||
361 | /* PM */ | ||
362 | mydev->shadow_power = 1; /* currently active */ | ||
363 | mydev->has_interface_pm = 0; /* have not issued autopm_get */ | ||
364 | |||
354 | /*set defaults */ | 365 | /*set defaults */ |
355 | mydev->textmode = 0x02; /* ascii mode */ | 366 | mydev->textmode = 0x02; /* ascii mode */ |
356 | mydev->mode_msb = 0x06; /* 6 characters */ | 367 | mydev->mode_msb = 0x06; /* 6 characters */ |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index b4c783c284ba..07fe490b44d8 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
@@ -42,7 +42,7 @@ config USB_MUSB_SOC | |||
42 | default y if (BF52x && !BF522 && !BF523) | 42 | default y if (BF52x && !BF522 && !BF523) |
43 | 43 | ||
44 | comment "DaVinci 35x and 644x USB support" | 44 | comment "DaVinci 35x and 644x USB support" |
45 | depends on USB_MUSB_HDRC && ARCH_DAVINCI | 45 | depends on USB_MUSB_HDRC && ARCH_DAVINCI_DMx |
46 | 46 | ||
47 | comment "OMAP 243x high speed USB support" | 47 | comment "OMAP 243x high speed USB support" |
48 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 | 48 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 |
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 85710ccc1887..3a485dabebbb 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile | |||
@@ -6,7 +6,7 @@ musb_hdrc-objs := musb_core.o | |||
6 | 6 | ||
7 | obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o | 7 | obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o |
8 | 8 | ||
9 | ifeq ($(CONFIG_ARCH_DAVINCI),y) | 9 | ifeq ($(CONFIG_ARCH_DAVINCI_DMx),y) |
10 | musb_hdrc-objs += davinci.o | 10 | musb_hdrc-objs += davinci.o |
11 | endif | 11 | endif |
12 | 12 | ||
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 719a22d664ef..ec8d324237f6 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -172,13 +172,7 @@ static irqreturn_t blackfin_interrupt(int irq, void *__hci) | |||
172 | 172 | ||
173 | spin_unlock_irqrestore(&musb->lock, flags); | 173 | spin_unlock_irqrestore(&musb->lock, flags); |
174 | 174 | ||
175 | /* REVISIT we sometimes get spurious IRQs on g_ep0 | 175 | return retval; |
176 | * not clear why... fall in BF54x too. | ||
177 | */ | ||
178 | if (retval != IRQ_HANDLED) | ||
179 | DBG(5, "spurious?\n"); | ||
180 | |||
181 | return IRQ_HANDLED; | ||
182 | } | 176 | } |
183 | 177 | ||
184 | static void musb_conn_timer_handler(unsigned long _musb) | 178 | static void musb_conn_timer_handler(unsigned long _musb) |
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 29bce5c0fd10..ce2e16fee0df 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -444,6 +444,8 @@ int __init musb_platform_init(struct musb *musb) | |||
444 | return 0; | 444 | return 0; |
445 | 445 | ||
446 | fail: | 446 | fail: |
447 | clk_disable(musb->clock); | ||
448 | |||
447 | usb_nop_xceiv_unregister(); | 449 | usb_nop_xceiv_unregister(); |
448 | return -ENODEV; | 450 | return -ENODEV; |
449 | } | 451 | } |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 0e8b8ab1d168..705cc4ad8737 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -965,10 +965,8 @@ static void musb_shutdown(struct platform_device *pdev) | |||
965 | spin_lock_irqsave(&musb->lock, flags); | 965 | spin_lock_irqsave(&musb->lock, flags); |
966 | musb_platform_disable(musb); | 966 | musb_platform_disable(musb); |
967 | musb_generic_disable(musb); | 967 | musb_generic_disable(musb); |
968 | if (musb->clock) { | 968 | if (musb->clock) |
969 | clk_put(musb->clock); | 969 | clk_put(musb->clock); |
970 | musb->clock = NULL; | ||
971 | } | ||
972 | spin_unlock_irqrestore(&musb->lock, flags); | 970 | spin_unlock_irqrestore(&musb->lock, flags); |
973 | 971 | ||
974 | /* FIXME power down */ | 972 | /* FIXME power down */ |
@@ -1853,15 +1851,6 @@ static void musb_free(struct musb *musb) | |||
1853 | put_device(musb->xceiv->dev); | 1851 | put_device(musb->xceiv->dev); |
1854 | #endif | 1852 | #endif |
1855 | 1853 | ||
1856 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
1857 | musb_platform_exit(musb); | ||
1858 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
1859 | |||
1860 | if (musb->clock) { | ||
1861 | clk_disable(musb->clock); | ||
1862 | clk_put(musb->clock); | ||
1863 | } | ||
1864 | |||
1865 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 1854 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
1866 | usb_put_hcd(musb_to_hcd(musb)); | 1855 | usb_put_hcd(musb_to_hcd(musb)); |
1867 | #else | 1856 | #else |
@@ -1889,8 +1878,10 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
1889 | */ | 1878 | */ |
1890 | if (!plat) { | 1879 | if (!plat) { |
1891 | dev_dbg(dev, "no platform_data?\n"); | 1880 | dev_dbg(dev, "no platform_data?\n"); |
1892 | return -ENODEV; | 1881 | status = -ENODEV; |
1882 | goto fail0; | ||
1893 | } | 1883 | } |
1884 | |||
1894 | switch (plat->mode) { | 1885 | switch (plat->mode) { |
1895 | case MUSB_HOST: | 1886 | case MUSB_HOST: |
1896 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 1887 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
@@ -1912,13 +1903,16 @@ bad_config: | |||
1912 | #endif | 1903 | #endif |
1913 | default: | 1904 | default: |
1914 | dev_err(dev, "incompatible Kconfig role setting\n"); | 1905 | dev_err(dev, "incompatible Kconfig role setting\n"); |
1915 | return -EINVAL; | 1906 | status = -EINVAL; |
1907 | goto fail0; | ||
1916 | } | 1908 | } |
1917 | 1909 | ||
1918 | /* allocate */ | 1910 | /* allocate */ |
1919 | musb = allocate_instance(dev, plat->config, ctrl); | 1911 | musb = allocate_instance(dev, plat->config, ctrl); |
1920 | if (!musb) | 1912 | if (!musb) { |
1921 | return -ENOMEM; | 1913 | status = -ENOMEM; |
1914 | goto fail0; | ||
1915 | } | ||
1922 | 1916 | ||
1923 | spin_lock_init(&musb->lock); | 1917 | spin_lock_init(&musb->lock); |
1924 | musb->board_mode = plat->mode; | 1918 | musb->board_mode = plat->mode; |
@@ -1936,7 +1930,7 @@ bad_config: | |||
1936 | if (IS_ERR(musb->clock)) { | 1930 | if (IS_ERR(musb->clock)) { |
1937 | status = PTR_ERR(musb->clock); | 1931 | status = PTR_ERR(musb->clock); |
1938 | musb->clock = NULL; | 1932 | musb->clock = NULL; |
1939 | goto fail; | 1933 | goto fail1; |
1940 | } | 1934 | } |
1941 | } | 1935 | } |
1942 | 1936 | ||
@@ -1955,12 +1949,12 @@ bad_config: | |||
1955 | */ | 1949 | */ |
1956 | musb->isr = generic_interrupt; | 1950 | musb->isr = generic_interrupt; |
1957 | status = musb_platform_init(musb); | 1951 | status = musb_platform_init(musb); |
1958 | |||
1959 | if (status < 0) | 1952 | if (status < 0) |
1960 | goto fail; | 1953 | goto fail2; |
1954 | |||
1961 | if (!musb->isr) { | 1955 | if (!musb->isr) { |
1962 | status = -ENODEV; | 1956 | status = -ENODEV; |
1963 | goto fail2; | 1957 | goto fail3; |
1964 | } | 1958 | } |
1965 | 1959 | ||
1966 | #ifndef CONFIG_MUSB_PIO_ONLY | 1960 | #ifndef CONFIG_MUSB_PIO_ONLY |
@@ -1986,7 +1980,7 @@ bad_config: | |||
1986 | ? MUSB_CONTROLLER_MHDRC | 1980 | ? MUSB_CONTROLLER_MHDRC |
1987 | : MUSB_CONTROLLER_HDRC, musb); | 1981 | : MUSB_CONTROLLER_HDRC, musb); |
1988 | if (status < 0) | 1982 | if (status < 0) |
1989 | goto fail2; | 1983 | goto fail3; |
1990 | 1984 | ||
1991 | #ifdef CONFIG_USB_MUSB_OTG | 1985 | #ifdef CONFIG_USB_MUSB_OTG |
1992 | setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); | 1986 | setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); |
@@ -1999,7 +1993,7 @@ bad_config: | |||
1999 | if (request_irq(nIrq, musb->isr, 0, dev_name(dev), musb)) { | 1993 | if (request_irq(nIrq, musb->isr, 0, dev_name(dev), musb)) { |
2000 | dev_err(dev, "request_irq %d failed!\n", nIrq); | 1994 | dev_err(dev, "request_irq %d failed!\n", nIrq); |
2001 | status = -ENODEV; | 1995 | status = -ENODEV; |
2002 | goto fail2; | 1996 | goto fail3; |
2003 | } | 1997 | } |
2004 | musb->nIrq = nIrq; | 1998 | musb->nIrq = nIrq; |
2005 | /* FIXME this handles wakeup irqs wrong */ | 1999 | /* FIXME this handles wakeup irqs wrong */ |
@@ -2039,8 +2033,6 @@ bad_config: | |||
2039 | musb->xceiv->state = OTG_STATE_A_IDLE; | 2033 | musb->xceiv->state = OTG_STATE_A_IDLE; |
2040 | 2034 | ||
2041 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); | 2035 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); |
2042 | if (status) | ||
2043 | goto fail; | ||
2044 | 2036 | ||
2045 | DBG(1, "%s mode, status %d, devctl %02x %c\n", | 2037 | DBG(1, "%s mode, status %d, devctl %02x %c\n", |
2046 | "HOST", status, | 2038 | "HOST", status, |
@@ -2055,8 +2047,6 @@ bad_config: | |||
2055 | musb->xceiv->state = OTG_STATE_B_IDLE; | 2047 | musb->xceiv->state = OTG_STATE_B_IDLE; |
2056 | 2048 | ||
2057 | status = musb_gadget_setup(musb); | 2049 | status = musb_gadget_setup(musb); |
2058 | if (status) | ||
2059 | goto fail; | ||
2060 | 2050 | ||
2061 | DBG(1, "%s mode, status %d, dev%02x\n", | 2051 | DBG(1, "%s mode, status %d, dev%02x\n", |
2062 | is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", | 2052 | is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", |
@@ -2064,12 +2054,14 @@ bad_config: | |||
2064 | musb_readb(musb->mregs, MUSB_DEVCTL)); | 2054 | musb_readb(musb->mregs, MUSB_DEVCTL)); |
2065 | 2055 | ||
2066 | } | 2056 | } |
2057 | if (status < 0) | ||
2058 | goto fail3; | ||
2067 | 2059 | ||
2068 | #ifdef CONFIG_SYSFS | 2060 | #ifdef CONFIG_SYSFS |
2069 | status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group); | 2061 | status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group); |
2070 | #endif | ||
2071 | if (status) | 2062 | if (status) |
2072 | goto fail2; | 2063 | goto fail4; |
2064 | #endif | ||
2073 | 2065 | ||
2074 | dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n", | 2066 | dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n", |
2075 | ({char *s; | 2067 | ({char *s; |
@@ -2085,17 +2077,29 @@ bad_config: | |||
2085 | 2077 | ||
2086 | return 0; | 2078 | return 0; |
2087 | 2079 | ||
2088 | fail2: | 2080 | fail4: |
2081 | if (!is_otg_enabled(musb) && is_host_enabled(musb)) | ||
2082 | usb_remove_hcd(musb_to_hcd(musb)); | ||
2083 | else | ||
2084 | musb_gadget_cleanup(musb); | ||
2085 | |||
2086 | fail3: | ||
2087 | if (musb->irq_wake) | ||
2088 | device_init_wakeup(dev, 0); | ||
2089 | musb_platform_exit(musb); | 2089 | musb_platform_exit(musb); |
2090 | fail: | ||
2091 | dev_err(musb->controller, | ||
2092 | "musb_init_controller failed with status %d\n", status); | ||
2093 | 2090 | ||
2091 | fail2: | ||
2094 | if (musb->clock) | 2092 | if (musb->clock) |
2095 | clk_put(musb->clock); | 2093 | clk_put(musb->clock); |
2096 | device_init_wakeup(dev, 0); | 2094 | |
2095 | fail1: | ||
2096 | dev_err(musb->controller, | ||
2097 | "musb_init_controller failed with status %d\n", status); | ||
2098 | |||
2097 | musb_free(musb); | 2099 | musb_free(musb); |
2098 | 2100 | ||
2101 | fail0: | ||
2102 | |||
2099 | return status; | 2103 | return status; |
2100 | 2104 | ||
2101 | } | 2105 | } |
@@ -2132,7 +2136,6 @@ static int __init musb_probe(struct platform_device *pdev) | |||
2132 | /* clobbered by use_dma=n */ | 2136 | /* clobbered by use_dma=n */ |
2133 | orig_dma_mask = dev->dma_mask; | 2137 | orig_dma_mask = dev->dma_mask; |
2134 | #endif | 2138 | #endif |
2135 | |||
2136 | status = musb_init_controller(dev, irq, base); | 2139 | status = musb_init_controller(dev, irq, base); |
2137 | if (status < 0) | 2140 | if (status < 0) |
2138 | iounmap(base); | 2141 | iounmap(base); |
@@ -2155,6 +2158,10 @@ static int __exit musb_remove(struct platform_device *pdev) | |||
2155 | if (musb->board_mode == MUSB_HOST) | 2158 | if (musb->board_mode == MUSB_HOST) |
2156 | usb_remove_hcd(musb_to_hcd(musb)); | 2159 | usb_remove_hcd(musb_to_hcd(musb)); |
2157 | #endif | 2160 | #endif |
2161 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
2162 | musb_platform_exit(musb); | ||
2163 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
2164 | |||
2158 | musb_free(musb); | 2165 | musb_free(musb); |
2159 | iounmap(ctrl_base); | 2166 | iounmap(ctrl_base); |
2160 | device_init_wakeup(&pdev->dev, 0); | 2167 | device_init_wakeup(&pdev->dev, 0); |
@@ -2176,6 +2183,7 @@ void musb_save_context(struct musb *musb) | |||
2176 | if (is_host_enabled(musb)) { | 2183 | if (is_host_enabled(musb)) { |
2177 | musb_context.frame = musb_readw(musb_base, MUSB_FRAME); | 2184 | musb_context.frame = musb_readw(musb_base, MUSB_FRAME); |
2178 | musb_context.testmode = musb_readb(musb_base, MUSB_TESTMODE); | 2185 | musb_context.testmode = musb_readb(musb_base, MUSB_TESTMODE); |
2186 | musb_context.busctl = musb_read_ulpi_buscontrol(musb->mregs); | ||
2179 | } | 2187 | } |
2180 | musb_context.power = musb_readb(musb_base, MUSB_POWER); | 2188 | musb_context.power = musb_readb(musb_base, MUSB_POWER); |
2181 | musb_context.intrtxe = musb_readw(musb_base, MUSB_INTRTXE); | 2189 | musb_context.intrtxe = musb_readw(musb_base, MUSB_INTRTXE); |
@@ -2247,6 +2255,7 @@ void musb_restore_context(struct musb *musb) | |||
2247 | if (is_host_enabled(musb)) { | 2255 | if (is_host_enabled(musb)) { |
2248 | musb_writew(musb_base, MUSB_FRAME, musb_context.frame); | 2256 | musb_writew(musb_base, MUSB_FRAME, musb_context.frame); |
2249 | musb_writeb(musb_base, MUSB_TESTMODE, musb_context.testmode); | 2257 | musb_writeb(musb_base, MUSB_TESTMODE, musb_context.testmode); |
2258 | musb_write_ulpi_buscontrol(musb->mregs, musb_context.busctl); | ||
2250 | } | 2259 | } |
2251 | musb_writeb(musb_base, MUSB_POWER, musb_context.power); | 2260 | musb_writeb(musb_base, MUSB_POWER, musb_context.power); |
2252 | musb_writew(musb_base, MUSB_INTRTXE, musb_context.intrtxe); | 2261 | musb_writew(musb_base, MUSB_INTRTXE, musb_context.intrtxe); |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index cd9f4a9a06c6..ac17b004909b 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -478,7 +478,7 @@ struct musb_context_registers { | |||
478 | u16 frame; | 478 | u16 frame; |
479 | u8 index, testmode; | 479 | u8 index, testmode; |
480 | 480 | ||
481 | u8 devctl, misc; | 481 | u8 devctl, busctl, misc; |
482 | 482 | ||
483 | struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; | 483 | struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; |
484 | }; | 484 | }; |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index dec896e888db..877d20b1dff9 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -2042,6 +2042,7 @@ static int musb_urb_enqueue( | |||
2042 | * odd, rare, error prone, but legal. | 2042 | * odd, rare, error prone, but legal. |
2043 | */ | 2043 | */ |
2044 | kfree(qh); | 2044 | kfree(qh); |
2045 | qh = NULL; | ||
2045 | ret = 0; | 2046 | ret = 0; |
2046 | } else | 2047 | } else |
2047 | ret = musb_schedule(musb, qh, | 2048 | ret = musb_schedule(musb, qh, |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 490cdf15ccb6..82592633502f 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -331,8 +331,5 @@ int musb_platform_exit(struct musb *musb) | |||
331 | 331 | ||
332 | musb_platform_suspend(musb); | 332 | musb_platform_suspend(musb); |
333 | 333 | ||
334 | clk_put(musb->clock); | ||
335 | musb->clock = NULL; | ||
336 | |||
337 | return 0; | 334 | return 0; |
338 | } | 335 | } |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index ab776a8d98ca..60d3938cafcf 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -29,6 +29,19 @@ static void tusb_source_power(struct musb *musb, int is_on); | |||
29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) | 29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) |
30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) | 30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) |
31 | 31 | ||
32 | #ifdef CONFIG_PM | ||
33 | /* REVISIT: These should be only needed if somebody implements off idle */ | ||
34 | void musb_platform_save_context(struct musb *musb, | ||
35 | struct musb_context_registers *musb_context) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | void musb_platform_restore_context(struct musb *musb, | ||
40 | struct musb_context_registers *musb_context) | ||
41 | { | ||
42 | } | ||
43 | #endif | ||
44 | |||
32 | /* | 45 | /* |
33 | * Checks the revision. We need to use the DMA register as 3.0 does not | 46 | * Checks the revision. We need to use the DMA register as 3.0 does not |
34 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. | 47 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. |
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 5afa070d7dc9..c061a88f2b0f 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c | |||
@@ -39,7 +39,7 @@ struct tusb_omap_dma_ch { | |||
39 | 39 | ||
40 | struct tusb_omap_dma *tusb_dma; | 40 | struct tusb_omap_dma *tusb_dma; |
41 | 41 | ||
42 | void __iomem *dma_addr; | 42 | dma_addr_t dma_addr; |
43 | 43 | ||
44 | u32 len; | 44 | u32 len; |
45 | u16 packet_sz; | 45 | u16 packet_sz; |
@@ -126,6 +126,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) | |||
126 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); | 126 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); |
127 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; | 127 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; |
128 | struct musb *musb = chdat->musb; | 128 | struct musb *musb = chdat->musb; |
129 | struct device *dev = musb->controller; | ||
129 | struct musb_hw_ep *hw_ep = chdat->hw_ep; | 130 | struct musb_hw_ep *hw_ep = chdat->hw_ep; |
130 | void __iomem *ep_conf = hw_ep->conf; | 131 | void __iomem *ep_conf = hw_ep->conf; |
131 | void __iomem *mbase = musb->mregs; | 132 | void __iomem *mbase = musb->mregs; |
@@ -173,13 +174,15 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) | |||
173 | DBG(3, "Using PIO for remaining %lu bytes\n", pio); | 174 | DBG(3, "Using PIO for remaining %lu bytes\n", pio); |
174 | buf = phys_to_virt((u32)chdat->dma_addr) + chdat->transfer_len; | 175 | buf = phys_to_virt((u32)chdat->dma_addr) + chdat->transfer_len; |
175 | if (chdat->tx) { | 176 | if (chdat->tx) { |
176 | dma_cache_maint(phys_to_virt((u32)chdat->dma_addr), | 177 | dma_unmap_single(dev, chdat->dma_addr, |
177 | chdat->transfer_len, DMA_TO_DEVICE); | 178 | chdat->transfer_len, |
179 | DMA_TO_DEVICE); | ||
178 | musb_write_fifo(hw_ep, pio, buf); | 180 | musb_write_fifo(hw_ep, pio, buf); |
179 | } else { | 181 | } else { |
182 | dma_unmap_single(dev, chdat->dma_addr, | ||
183 | chdat->transfer_len, | ||
184 | DMA_FROM_DEVICE); | ||
180 | musb_read_fifo(hw_ep, pio, buf); | 185 | musb_read_fifo(hw_ep, pio, buf); |
181 | dma_cache_maint(phys_to_virt((u32)chdat->dma_addr), | ||
182 | chdat->transfer_len, DMA_FROM_DEVICE); | ||
183 | } | 186 | } |
184 | channel->actual_len += pio; | 187 | channel->actual_len += pio; |
185 | } | 188 | } |
@@ -224,6 +227,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, | |||
224 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); | 227 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); |
225 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; | 228 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; |
226 | struct musb *musb = chdat->musb; | 229 | struct musb *musb = chdat->musb; |
230 | struct device *dev = musb->controller; | ||
227 | struct musb_hw_ep *hw_ep = chdat->hw_ep; | 231 | struct musb_hw_ep *hw_ep = chdat->hw_ep; |
228 | void __iomem *mbase = musb->mregs; | 232 | void __iomem *mbase = musb->mregs; |
229 | void __iomem *ep_conf = hw_ep->conf; | 233 | void __iomem *ep_conf = hw_ep->conf; |
@@ -299,14 +303,16 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, | |||
299 | chdat->packet_sz = packet_sz; | 303 | chdat->packet_sz = packet_sz; |
300 | chdat->len = len; | 304 | chdat->len = len; |
301 | channel->actual_len = 0; | 305 | channel->actual_len = 0; |
302 | chdat->dma_addr = (void __iomem *)dma_addr; | 306 | chdat->dma_addr = dma_addr; |
303 | channel->status = MUSB_DMA_STATUS_BUSY; | 307 | channel->status = MUSB_DMA_STATUS_BUSY; |
304 | 308 | ||
305 | /* Since we're recycling dma areas, we need to clean or invalidate */ | 309 | /* Since we're recycling dma areas, we need to clean or invalidate */ |
306 | if (chdat->tx) | 310 | if (chdat->tx) |
307 | dma_cache_maint(phys_to_virt(dma_addr), len, DMA_TO_DEVICE); | 311 | dma_map_single(dev, phys_to_virt(dma_addr), len, |
312 | DMA_TO_DEVICE); | ||
308 | else | 313 | else |
309 | dma_cache_maint(phys_to_virt(dma_addr), len, DMA_FROM_DEVICE); | 314 | dma_map_single(dev, phys_to_virt(dma_addr), len, |
315 | DMA_FROM_DEVICE); | ||
310 | 316 | ||
311 | /* Use 16-bit transfer if dma_addr is not 32-bit aligned */ | 317 | /* Use 16-bit transfer if dma_addr is not 32-bit aligned */ |
312 | if ((dma_addr & 0x3) == 0) { | 318 | if ((dma_addr & 0x3) == 0) { |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index ca9d866672aa..84d0edad8e4f 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -305,6 +305,11 @@ static int option_resume(struct usb_serial *serial); | |||
305 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe | 305 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe |
306 | #define ZTE_PRODUCT_AC8710 0xfff1 | 306 | #define ZTE_PRODUCT_AC8710 0xfff1 |
307 | #define ZTE_PRODUCT_AC2726 0xfff5 | 307 | #define ZTE_PRODUCT_AC2726 0xfff5 |
308 | #define ZTE_PRODUCT_AC8710T 0xffff | ||
309 | |||
310 | /* ZTE PRODUCTS -- alternate vendor ID */ | ||
311 | #define ZTE_VENDOR_ID2 0x1d6b | ||
312 | #define ZTE_PRODUCT_MF_330 0x0002 | ||
308 | 313 | ||
309 | #define BENQ_VENDOR_ID 0x04a5 | 314 | #define BENQ_VENDOR_ID 0x04a5 |
310 | #define BENQ_PRODUCT_H10 0x4068 | 315 | #define BENQ_PRODUCT_H10 0x4068 |
@@ -373,6 +378,8 @@ static int option_resume(struct usb_serial *serial); | |||
373 | #define HAIER_VENDOR_ID 0x201e | 378 | #define HAIER_VENDOR_ID 0x201e |
374 | #define HAIER_PRODUCT_CE100 0x2009 | 379 | #define HAIER_PRODUCT_CE100 0x2009 |
375 | 380 | ||
381 | #define CINTERION_VENDOR_ID 0x0681 | ||
382 | |||
376 | /* some devices interfaces need special handling due to a number of reasons */ | 383 | /* some devices interfaces need special handling due to a number of reasons */ |
377 | enum option_blacklist_reason { | 384 | enum option_blacklist_reason { |
378 | OPTION_BLACKLIST_NONE = 0, | 385 | OPTION_BLACKLIST_NONE = 0, |
@@ -679,6 +686,8 @@ static const struct usb_device_id option_ids[] = { | |||
679 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, | 686 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, |
680 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, | 687 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, |
681 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, | 688 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, |
689 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, | ||
690 | { USB_DEVICE(ZTE_VENDOR_ID2, ZTE_PRODUCT_MF_330) }, | ||
682 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, | 691 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, |
683 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, | 692 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, |
684 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ | 693 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ |
@@ -716,6 +725,7 @@ static const struct usb_device_id option_ids[] = { | |||
716 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, | 725 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, |
717 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, | 726 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, |
718 | 727 | ||
728 | { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) }, | ||
719 | { } /* Terminating entry */ | 729 | { } /* Terminating entry */ |
720 | }; | 730 | }; |
721 | MODULE_DEVICE_TABLE(usb, option_ids); | 731 | MODULE_DEVICE_TABLE(usb, option_ids); |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 73d5f346d3e0..c28b1607eacc 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -59,6 +59,7 @@ static const struct usb_device_id id_table[] = { | |||
59 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, | 59 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, |
60 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, | 60 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, |
61 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, | 61 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, |
62 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, | ||
62 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, | 63 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, |
63 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, | 64 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, |
64 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, | 65 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, |
@@ -97,6 +98,7 @@ static const struct usb_device_id id_table[] = { | |||
97 | { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, | 98 | { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, |
98 | { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) }, | 99 | { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) }, |
99 | { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, | 100 | { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, |
101 | { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) }, | ||
100 | { } /* Terminating entry */ | 102 | { } /* Terminating entry */ |
101 | }; | 103 | }; |
102 | 104 | ||
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index d640dc951568..23c09b38b9ec 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define PL2303_PRODUCT_ID_ALDIGA 0x0611 | 20 | #define PL2303_PRODUCT_ID_ALDIGA 0x0611 |
21 | #define PL2303_PRODUCT_ID_MMX 0x0612 | 21 | #define PL2303_PRODUCT_ID_MMX 0x0612 |
22 | #define PL2303_PRODUCT_ID_GPRS 0x0609 | 22 | #define PL2303_PRODUCT_ID_GPRS 0x0609 |
23 | #define PL2303_PRODUCT_ID_HCR331 0x331a | ||
23 | 24 | ||
24 | #define ATEN_VENDOR_ID 0x0557 | 25 | #define ATEN_VENDOR_ID 0x0557 |
25 | #define ATEN_VENDOR_ID2 0x0547 | 26 | #define ATEN_VENDOR_ID2 0x0547 |
@@ -134,3 +135,7 @@ | |||
134 | /* Sanwa KB-USB2 multimeter cable (ID: 11ad:0001) */ | 135 | /* Sanwa KB-USB2 multimeter cable (ID: 11ad:0001) */ |
135 | #define SANWA_VENDOR_ID 0x11ad | 136 | #define SANWA_VENDOR_ID 0x11ad |
136 | #define SANWA_PRODUCT_ID 0x0001 | 137 | #define SANWA_PRODUCT_ID 0x0001 |
138 | |||
139 | /* ADLINK ND-6530 RS232,RS485 and RS422 adapter */ | ||
140 | #define ADLINK_VENDOR_ID 0x0b63 | ||
141 | #define ADLINK_ND6530_PRODUCT_ID 0x6530 | ||
diff --git a/drivers/usb/serial/qcaux.c b/drivers/usb/serial/qcaux.c index 0b9362061713..7e3bea23600b 100644 --- a/drivers/usb/serial/qcaux.c +++ b/drivers/usb/serial/qcaux.c | |||
@@ -42,6 +42,14 @@ | |||
42 | #define CMOTECH_PRODUCT_CDU550 0x5553 | 42 | #define CMOTECH_PRODUCT_CDU550 0x5553 |
43 | #define CMOTECH_PRODUCT_CDX650 0x6512 | 43 | #define CMOTECH_PRODUCT_CDX650 0x6512 |
44 | 44 | ||
45 | /* LG devices */ | ||
46 | #define LG_VENDOR_ID 0x1004 | ||
47 | #define LG_PRODUCT_VX4400_6000 0x6000 /* VX4400/VX6000/Rumor */ | ||
48 | |||
49 | /* Sanyo devices */ | ||
50 | #define SANYO_VENDOR_ID 0x0474 | ||
51 | #define SANYO_PRODUCT_KATANA_LX 0x0754 /* SCP-3800 (Katana LX) */ | ||
52 | |||
45 | static struct usb_device_id id_table[] = { | 53 | static struct usb_device_id id_table[] = { |
46 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5740, 0xff, 0x00, 0x00) }, | 54 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5740, 0xff, 0x00, 0x00) }, |
47 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5750, 0xff, 0x00, 0x00) }, | 55 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5750, 0xff, 0x00, 0x00) }, |
@@ -51,6 +59,8 @@ static struct usb_device_id id_table[] = { | |||
51 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_ALLTEL, 0xff, 0x00, 0x00) }, | 59 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_ALLTEL, 0xff, 0x00, 0x00) }, |
52 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU550, 0xff, 0xff, 0x00) }, | 60 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU550, 0xff, 0xff, 0x00) }, |
53 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDX650, 0xff, 0xff, 0x00) }, | 61 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDX650, 0xff, 0xff, 0x00) }, |
62 | { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) }, | ||
63 | { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) }, | ||
54 | { }, | 64 | { }, |
55 | }; | 65 | }; |
56 | MODULE_DEVICE_TABLE(usb, id_table); | 66 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 9202f94505e6..ef0bdb08d788 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -230,6 +230,7 @@ static const struct sierra_iface_info direct_ip_interface_blacklist = { | |||
230 | static const struct usb_device_id id_table[] = { | 230 | static const struct usb_device_id id_table[] = { |
231 | { USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */ | 231 | { USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */ |
232 | { USB_DEVICE(0x03F0, 0x1B1D) }, /* HP ev2200 a.k.a MC5720 */ | 232 | { USB_DEVICE(0x03F0, 0x1B1D) }, /* HP ev2200 a.k.a MC5720 */ |
233 | { USB_DEVICE(0x03F0, 0x211D) }, /* HP ev2210 a.k.a MC5725 */ | ||
233 | { USB_DEVICE(0x03F0, 0x1E1D) }, /* HP hs2300 a.k.a MC8775 */ | 234 | { USB_DEVICE(0x03F0, 0x1E1D) }, /* HP hs2300 a.k.a MC8775 */ |
234 | 235 | ||
235 | { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ | 236 | { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 0afe5c71c17e..e1bfda33f5b9 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -172,7 +172,7 @@ static unsigned int product_5052_count; | |||
172 | /* the array dimension is the number of default entries plus */ | 172 | /* the array dimension is the number of default entries plus */ |
173 | /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ | 173 | /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ |
174 | /* null entry */ | 174 | /* null entry */ |
175 | static struct usb_device_id ti_id_table_3410[10+TI_EXTRA_VID_PID_COUNT+1] = { | 175 | static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = { |
176 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, | 176 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, |
177 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, | 177 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, |
178 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, | 178 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, |
@@ -180,6 +180,9 @@ static struct usb_device_id ti_id_table_3410[10+TI_EXTRA_VID_PID_COUNT+1] = { | |||
180 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, | 180 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, |
181 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, | 181 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, |
182 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, | 182 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, |
183 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234MU_PRODUCT_ID) }, | ||
184 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234ZBA_PRODUCT_ID) }, | ||
185 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234ZBAOLD_PRODUCT_ID) }, | ||
183 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, | 186 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, |
184 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, | 187 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, |
185 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, | 188 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, |
@@ -192,7 +195,7 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = { | |||
192 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, | 195 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, |
193 | }; | 196 | }; |
194 | 197 | ||
195 | static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = { | 198 | static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1] = { |
196 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, | 199 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, |
197 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, | 200 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, |
198 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, | 201 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, |
@@ -200,6 +203,9 @@ static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] | |||
200 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, | 203 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, |
201 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, | 204 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, |
202 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, | 205 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, |
206 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234MU_PRODUCT_ID) }, | ||
207 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234ZBA_PRODUCT_ID) }, | ||
208 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234ZBAOLD_PRODUCT_ID) }, | ||
203 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) }, | 209 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) }, |
204 | { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, | 210 | { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, |
205 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, | 211 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, |
@@ -287,6 +293,8 @@ MODULE_FIRMWARE("ti_5052.fw"); | |||
287 | MODULE_FIRMWARE("mts_cdma.fw"); | 293 | MODULE_FIRMWARE("mts_cdma.fw"); |
288 | MODULE_FIRMWARE("mts_gsm.fw"); | 294 | MODULE_FIRMWARE("mts_gsm.fw"); |
289 | MODULE_FIRMWARE("mts_edge.fw"); | 295 | MODULE_FIRMWARE("mts_edge.fw"); |
296 | MODULE_FIRMWARE("mts_mt9234mu.fw"); | ||
297 | MODULE_FIRMWARE("mts_mt9234zba.fw"); | ||
290 | 298 | ||
291 | module_param(debug, bool, S_IRUGO | S_IWUSR); | 299 | module_param(debug, bool, S_IRUGO | S_IWUSR); |
292 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); | 300 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); |
@@ -1687,6 +1695,7 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1687 | const struct firmware *fw_p; | 1695 | const struct firmware *fw_p; |
1688 | char buf[32]; | 1696 | char buf[32]; |
1689 | 1697 | ||
1698 | dbg("%s\n", __func__); | ||
1690 | /* try ID specific firmware first, then try generic firmware */ | 1699 | /* try ID specific firmware first, then try generic firmware */ |
1691 | sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor, | 1700 | sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor, |
1692 | dev->descriptor.idProduct); | 1701 | dev->descriptor.idProduct); |
@@ -1703,7 +1712,15 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1703 | case MTS_EDGE_PRODUCT_ID: | 1712 | case MTS_EDGE_PRODUCT_ID: |
1704 | strcpy(buf, "mts_edge.fw"); | 1713 | strcpy(buf, "mts_edge.fw"); |
1705 | break; | 1714 | break; |
1706 | } | 1715 | case MTS_MT9234MU_PRODUCT_ID: |
1716 | strcpy(buf, "mts_mt9234mu.fw"); | ||
1717 | break; | ||
1718 | case MTS_MT9234ZBA_PRODUCT_ID: | ||
1719 | strcpy(buf, "mts_mt9234zba.fw"); | ||
1720 | break; | ||
1721 | case MTS_MT9234ZBAOLD_PRODUCT_ID: | ||
1722 | strcpy(buf, "mts_mt9234zba.fw"); | ||
1723 | break; } | ||
1707 | } | 1724 | } |
1708 | if (buf[0] == '\0') { | 1725 | if (buf[0] == '\0') { |
1709 | if (tdev->td_is_3410) | 1726 | if (tdev->td_is_3410) |
@@ -1718,7 +1735,7 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1718 | return -ENOENT; | 1735 | return -ENOENT; |
1719 | } | 1736 | } |
1720 | if (fw_p->size > TI_FIRMWARE_BUF_SIZE) { | 1737 | if (fw_p->size > TI_FIRMWARE_BUF_SIZE) { |
1721 | dev_err(&dev->dev, "%s - firmware too large\n", __func__); | 1738 | dev_err(&dev->dev, "%s - firmware too large %zu\n", __func__, fw_p->size); |
1722 | return -ENOENT; | 1739 | return -ENOENT; |
1723 | } | 1740 | } |
1724 | 1741 | ||
@@ -1730,6 +1747,7 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1730 | status = ti_do_download(dev, pipe, buffer, fw_p->size); | 1747 | status = ti_do_download(dev, pipe, buffer, fw_p->size); |
1731 | kfree(buffer); | 1748 | kfree(buffer); |
1732 | } else { | 1749 | } else { |
1750 | dbg("%s ENOMEM\n", __func__); | ||
1733 | status = -ENOMEM; | 1751 | status = -ENOMEM; |
1734 | } | 1752 | } |
1735 | release_firmware(fw_p); | 1753 | release_firmware(fw_p); |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h index f323c6025858..2aac1953993b 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.h +++ b/drivers/usb/serial/ti_usb_3410_5052.h | |||
@@ -45,6 +45,9 @@ | |||
45 | #define MTS_CDMA_PRODUCT_ID 0xF110 | 45 | #define MTS_CDMA_PRODUCT_ID 0xF110 |
46 | #define MTS_GSM_PRODUCT_ID 0xF111 | 46 | #define MTS_GSM_PRODUCT_ID 0xF111 |
47 | #define MTS_EDGE_PRODUCT_ID 0xF112 | 47 | #define MTS_EDGE_PRODUCT_ID 0xF112 |
48 | #define MTS_MT9234MU_PRODUCT_ID 0xF114 | ||
49 | #define MTS_MT9234ZBA_PRODUCT_ID 0xF115 | ||
50 | #define MTS_MT9234ZBAOLD_PRODUCT_ID 0x0319 | ||
48 | 51 | ||
49 | /* Commands */ | 52 | /* Commands */ |
50 | #define TI_GET_VERSION 0x01 | 53 | #define TI_GET_VERSION 0x01 |
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c index 46e79d349498..7ec24e46b34b 100644 --- a/drivers/usb/wusbcore/devconnect.c +++ b/drivers/usb/wusbcore/devconnect.c | |||
@@ -438,7 +438,7 @@ static void __wusbhc_keep_alive(struct wusbhc *wusbhc) | |||
438 | old_keep_alives = ie->hdr.bLength - sizeof(ie->hdr); | 438 | old_keep_alives = ie->hdr.bLength - sizeof(ie->hdr); |
439 | keep_alives = 0; | 439 | keep_alives = 0; |
440 | for (cnt = 0; | 440 | for (cnt = 0; |
441 | keep_alives <= WUIE_ELT_MAX && cnt < wusbhc->ports_max; | 441 | keep_alives < WUIE_ELT_MAX && cnt < wusbhc->ports_max; |
442 | cnt++) { | 442 | cnt++) { |
443 | unsigned tt = msecs_to_jiffies(wusbhc->trust_timeout); | 443 | unsigned tt = msecs_to_jiffies(wusbhc->trust_timeout); |
444 | 444 | ||