diff options
Diffstat (limited to 'drivers/usb')
31 files changed, 241 insertions, 136 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 20104443081a..d50a99f70aee 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -158,16 +158,12 @@ static int acm_wb_is_avail(struct acm *acm) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | /* | 160 | /* |
161 | * Finish write. | 161 | * Finish write. Caller must hold acm->write_lock |
162 | */ | 162 | */ |
163 | static void acm_write_done(struct acm *acm, struct acm_wb *wb) | 163 | static void acm_write_done(struct acm *acm, struct acm_wb *wb) |
164 | { | 164 | { |
165 | unsigned long flags; | ||
166 | |||
167 | spin_lock_irqsave(&acm->write_lock, flags); | ||
168 | wb->use = 0; | 165 | wb->use = 0; |
169 | acm->transmitting--; | 166 | acm->transmitting--; |
170 | spin_unlock_irqrestore(&acm->write_lock, flags); | ||
171 | } | 167 | } |
172 | 168 | ||
173 | /* | 169 | /* |
@@ -482,6 +478,7 @@ static void acm_write_bulk(struct urb *urb) | |||
482 | { | 478 | { |
483 | struct acm_wb *wb = urb->context; | 479 | struct acm_wb *wb = urb->context; |
484 | struct acm *acm = wb->instance; | 480 | struct acm *acm = wb->instance; |
481 | unsigned long flags; | ||
485 | 482 | ||
486 | if (verbose || urb->status | 483 | if (verbose || urb->status |
487 | || (urb->actual_length != urb->transfer_buffer_length)) | 484 | || (urb->actual_length != urb->transfer_buffer_length)) |
@@ -490,7 +487,9 @@ static void acm_write_bulk(struct urb *urb) | |||
490 | urb->transfer_buffer_length, | 487 | urb->transfer_buffer_length, |
491 | urb->status); | 488 | urb->status); |
492 | 489 | ||
490 | spin_lock_irqsave(&acm->write_lock, flags); | ||
493 | acm_write_done(acm, wb); | 491 | acm_write_done(acm, wb); |
492 | spin_unlock_irqrestore(&acm->write_lock, flags); | ||
494 | if (ACM_READY(acm)) | 493 | if (ACM_READY(acm)) |
495 | schedule_work(&acm->work); | 494 | schedule_work(&acm->work); |
496 | else | 495 | else |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 887738577b28..6d1048faf08e 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1091,6 +1091,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) | |||
1091 | continue; | 1091 | continue; |
1092 | dev_dbg(&dev->dev, "unregistering interface %s\n", | 1092 | dev_dbg(&dev->dev, "unregistering interface %s\n", |
1093 | dev_name(&interface->dev)); | 1093 | dev_name(&interface->dev)); |
1094 | interface->unregistering = 1; | ||
1094 | usb_remove_sysfs_intf_files(interface); | 1095 | usb_remove_sysfs_intf_files(interface); |
1095 | device_del(&interface->dev); | 1096 | device_del(&interface->dev); |
1096 | } | 1097 | } |
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index f66fba11fbd5..4fb65fdc9dc3 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -840,7 +840,7 @@ int usb_create_sysfs_intf_files(struct usb_interface *intf) | |||
840 | struct usb_host_interface *alt = intf->cur_altsetting; | 840 | struct usb_host_interface *alt = intf->cur_altsetting; |
841 | int retval; | 841 | int retval; |
842 | 842 | ||
843 | if (intf->sysfs_files_created) | 843 | if (intf->sysfs_files_created || intf->unregistering) |
844 | return 0; | 844 | return 0; |
845 | 845 | ||
846 | /* The interface string may be present in some altsettings | 846 | /* The interface string may be present in some altsettings |
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 4342bd9c3bb6..1f68af9db3f7 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -85,8 +85,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_urb); | |||
85 | * Must be called when a user of a urb is finished with it. When the last user | 85 | * Must be called when a user of a urb is finished with it. When the last user |
86 | * of the urb calls this function, the memory of the urb is freed. | 86 | * of the urb calls this function, the memory of the urb is freed. |
87 | * | 87 | * |
88 | * Note: The transfer buffer associated with the urb is not freed, that must be | 88 | * Note: The transfer buffer associated with the urb is not freed unless the |
89 | * done elsewhere. | 89 | * URB_FREE_BUFFER transfer flag is set. |
90 | */ | 90 | */ |
91 | void usb_free_urb(struct urb *urb) | 91 | void usb_free_urb(struct urb *urb) |
92 | { | 92 | { |
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c index 5ee1590b8e9c..c1d34df0b157 100644 --- a/drivers/usb/gadget/f_acm.c +++ b/drivers/usb/gadget/f_acm.c | |||
@@ -463,7 +463,11 @@ static int acm_cdc_notify(struct f_acm *acm, u8 type, u16 value, | |||
463 | notify->wLength = cpu_to_le16(length); | 463 | notify->wLength = cpu_to_le16(length); |
464 | memcpy(buf, data, length); | 464 | memcpy(buf, data, length); |
465 | 465 | ||
466 | /* ep_queue() can complete immediately if it fills the fifo... */ | ||
467 | spin_unlock(&acm->lock); | ||
466 | status = usb_ep_queue(ep, req, GFP_ATOMIC); | 468 | status = usb_ep_queue(ep, req, GFP_ATOMIC); |
469 | spin_lock(&acm->lock); | ||
470 | |||
467 | if (status < 0) { | 471 | if (status < 0) { |
468 | ERROR(acm->port.func.config->cdev, | 472 | ERROR(acm->port.func.config->cdev, |
469 | "acm ttyGS%d can't notify serial state, %d\n", | 473 | "acm ttyGS%d can't notify serial state, %d\n", |
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 659b3d9671c4..428b5993575a 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
@@ -172,7 +172,6 @@ static struct usb_interface_descriptor rndis_data_intf __initdata = { | |||
172 | .bDescriptorType = USB_DT_INTERFACE, | 172 | .bDescriptorType = USB_DT_INTERFACE, |
173 | 173 | ||
174 | /* .bInterfaceNumber = DYNAMIC */ | 174 | /* .bInterfaceNumber = DYNAMIC */ |
175 | .bAlternateSetting = 1, | ||
176 | .bNumEndpoints = 2, | 175 | .bNumEndpoints = 2, |
177 | .bInterfaceClass = USB_CLASS_CDC_DATA, | 176 | .bInterfaceClass = USB_CLASS_CDC_DATA, |
178 | .bInterfaceSubClass = 0, | 177 | .bInterfaceSubClass = 0, |
@@ -303,7 +302,7 @@ static void rndis_response_available(void *_rndis) | |||
303 | __le32 *data = req->buf; | 302 | __le32 *data = req->buf; |
304 | int status; | 303 | int status; |
305 | 304 | ||
306 | if (atomic_inc_return(&rndis->notify_count)) | 305 | if (atomic_inc_return(&rndis->notify_count) != 1) |
307 | return; | 306 | return; |
308 | 307 | ||
309 | /* Send RNDIS RESPONSE_AVAILABLE notification; a | 308 | /* Send RNDIS RESPONSE_AVAILABLE notification; a |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index da6e93c201d2..8c5026be79d4 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -141,7 +141,11 @@ static int is_vbus_present(void) | |||
141 | 141 | ||
142 | if (mach->gpio_vbus) { | 142 | if (mach->gpio_vbus) { |
143 | int value = gpio_get_value(mach->gpio_vbus); | 143 | int value = gpio_get_value(mach->gpio_vbus); |
144 | return mach->gpio_vbus_inverted ? !value : value; | 144 | |
145 | if (mach->gpio_vbus_inverted) | ||
146 | return !value; | ||
147 | else | ||
148 | return !!value; | ||
145 | } | 149 | } |
146 | if (mach->udc_is_connected) | 150 | if (mach->udc_is_connected) |
147 | return mach->udc_is_connected(); | 151 | return mach->udc_is_connected(); |
@@ -982,7 +986,7 @@ static int pxa25x_udc_vbus_session(struct usb_gadget *_gadget, int is_active) | |||
982 | struct pxa25x_udc *udc; | 986 | struct pxa25x_udc *udc; |
983 | 987 | ||
984 | udc = container_of(_gadget, struct pxa25x_udc, gadget); | 988 | udc = container_of(_gadget, struct pxa25x_udc, gadget); |
985 | udc->vbus = (is_active != 0); | 989 | udc->vbus = is_active; |
986 | DMSG("vbus %s\n", is_active ? "supplied" : "inactive"); | 990 | DMSG("vbus %s\n", is_active ? "supplied" : "inactive"); |
987 | pullup(udc); | 991 | pullup(udc); |
988 | return 0; | 992 | return 0; |
@@ -1399,12 +1403,8 @@ lubbock_vbus_irq(int irq, void *_dev) | |||
1399 | static irqreturn_t udc_vbus_irq(int irq, void *_dev) | 1403 | static irqreturn_t udc_vbus_irq(int irq, void *_dev) |
1400 | { | 1404 | { |
1401 | struct pxa25x_udc *dev = _dev; | 1405 | struct pxa25x_udc *dev = _dev; |
1402 | int vbus = gpio_get_value(dev->mach->gpio_vbus); | ||
1403 | 1406 | ||
1404 | if (dev->mach->gpio_vbus_inverted) | 1407 | pxa25x_udc_vbus_session(&dev->gadget, is_vbus_present()); |
1405 | vbus = !vbus; | ||
1406 | |||
1407 | pxa25x_udc_vbus_session(&dev->gadget, vbus); | ||
1408 | return IRQ_HANDLED; | 1408 | return IRQ_HANDLED; |
1409 | } | 1409 | } |
1410 | 1410 | ||
@@ -2145,7 +2145,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev) | |||
2145 | if (irq < 0) | 2145 | if (irq < 0) |
2146 | return -ENODEV; | 2146 | return -ENODEV; |
2147 | 2147 | ||
2148 | dev->clk = clk_get(&pdev->dev, "UDCCLK"); | 2148 | dev->clk = clk_get(&pdev->dev, NULL); |
2149 | if (IS_ERR(dev->clk)) { | 2149 | if (IS_ERR(dev->clk)) { |
2150 | retval = PTR_ERR(dev->clk); | 2150 | retval = PTR_ERR(dev->clk); |
2151 | goto err_clk; | 2151 | goto err_clk; |
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index caa37c95802c..944e4ff641df 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c | |||
@@ -2226,7 +2226,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev) | |||
2226 | udc->dev = &pdev->dev; | 2226 | udc->dev = &pdev->dev; |
2227 | udc->mach = pdev->dev.platform_data; | 2227 | udc->mach = pdev->dev.platform_data; |
2228 | 2228 | ||
2229 | udc->clk = clk_get(&pdev->dev, "UDCCLK"); | 2229 | udc->clk = clk_get(&pdev->dev, NULL); |
2230 | if (IS_ERR(udc->clk)) { | 2230 | if (IS_ERR(udc->clk)) { |
2231 | retval = PTR_ERR(udc->clk); | 2231 | retval = PTR_ERR(udc->clk); |
2232 | goto err_clk; | 2232 | goto err_clk; |
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 56f592dc0b36..f3a75a929e0a 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -110,29 +110,18 @@ config USB_ISP116X_HCD | |||
110 | 110 | ||
111 | config USB_ISP1760_HCD | 111 | config USB_ISP1760_HCD |
112 | tristate "ISP 1760 HCD support" | 112 | tristate "ISP 1760 HCD support" |
113 | depends on USB && EXPERIMENTAL | 113 | depends on USB && EXPERIMENTAL && (PCI || PPC_OF) |
114 | ---help--- | 114 | ---help--- |
115 | The ISP1760 chip is a USB 2.0 host controller. | 115 | The ISP1760 chip is a USB 2.0 host controller. |
116 | 116 | ||
117 | This driver does not support isochronous transfers or OTG. | 117 | This driver does not support isochronous transfers or OTG. |
118 | This USB controller is usually attached to a non-DMA-Master | ||
119 | capable bus. NXP's eval kit brings this chip on PCI card | ||
120 | where the chip itself is behind a PLB to simulate such | ||
121 | a bus. | ||
118 | 122 | ||
119 | To compile this driver as a module, choose M here: the | 123 | To compile this driver as a module, choose M here: the |
120 | module will be called isp1760-hcd. | 124 | module will be called isp1760. |
121 | |||
122 | config USB_ISP1760_PCI | ||
123 | bool "Support for the PCI bus" | ||
124 | depends on USB_ISP1760_HCD && PCI | ||
125 | ---help--- | ||
126 | Enables support for the device present on the PCI bus. | ||
127 | This should only be required if you happen to have the eval kit from | ||
128 | NXP and you are going to test it. | ||
129 | |||
130 | config USB_ISP1760_OF | ||
131 | bool "Support for the OF platform bus" | ||
132 | depends on USB_ISP1760_HCD && PPC_OF | ||
133 | ---help--- | ||
134 | Enables support for the device present on the PowerPC | ||
135 | OpenFirmware platform bus. | ||
136 | 125 | ||
137 | config USB_OHCI_HCD | 126 | config USB_OHCI_HCD |
138 | tristate "OHCI HCD support" | 127 | tristate "OHCI HCD support" |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 15a803b206b8..4725d15d096f 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -643,7 +643,7 @@ static int ehci_run (struct usb_hcd *hcd) | |||
643 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) | 643 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) |
644 | { | 644 | { |
645 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); | 645 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); |
646 | u32 status, pcd_status = 0, cmd; | 646 | u32 status, masked_status, pcd_status = 0, cmd; |
647 | int bh; | 647 | int bh; |
648 | 648 | ||
649 | spin_lock (&ehci->lock); | 649 | spin_lock (&ehci->lock); |
@@ -656,14 +656,14 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
656 | goto dead; | 656 | goto dead; |
657 | } | 657 | } |
658 | 658 | ||
659 | status &= INTR_MASK; | 659 | masked_status = status & INTR_MASK; |
660 | if (!status) { /* irq sharing? */ | 660 | if (!masked_status) { /* irq sharing? */ |
661 | spin_unlock(&ehci->lock); | 661 | spin_unlock(&ehci->lock); |
662 | return IRQ_NONE; | 662 | return IRQ_NONE; |
663 | } | 663 | } |
664 | 664 | ||
665 | /* clear (just) interrupts */ | 665 | /* clear (just) interrupts */ |
666 | ehci_writel(ehci, status, &ehci->regs->status); | 666 | ehci_writel(ehci, masked_status, &ehci->regs->status); |
667 | cmd = ehci_readl(ehci, &ehci->regs->command); | 667 | cmd = ehci_readl(ehci, &ehci->regs->command); |
668 | bh = 0; | 668 | bh = 0; |
669 | 669 | ||
@@ -734,18 +734,17 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
734 | 734 | ||
735 | /* PCI errors [4.15.2.4] */ | 735 | /* PCI errors [4.15.2.4] */ |
736 | if (unlikely ((status & STS_FATAL) != 0)) { | 736 | if (unlikely ((status & STS_FATAL) != 0)) { |
737 | ehci_err(ehci, "fatal error\n"); | ||
737 | dbg_cmd(ehci, "fatal", cmd); | 738 | dbg_cmd(ehci, "fatal", cmd); |
738 | dbg_status(ehci, "fatal", status); | 739 | dbg_status(ehci, "fatal", status); |
739 | if (status & STS_HALT) { | 740 | ehci_halt(ehci); |
740 | ehci_err (ehci, "fatal error\n"); | ||
741 | dead: | 741 | dead: |
742 | ehci_reset (ehci); | 742 | ehci_reset(ehci); |
743 | ehci_writel(ehci, 0, &ehci->regs->configured_flag); | 743 | ehci_writel(ehci, 0, &ehci->regs->configured_flag); |
744 | /* generic layer kills/unlinks all urbs, then | 744 | /* generic layer kills/unlinks all urbs, then |
745 | * uses ehci_stop to clean up the rest | 745 | * uses ehci_stop to clean up the rest |
746 | */ | 746 | */ |
747 | bh = 1; | 747 | bh = 1; |
748 | } | ||
749 | } | 748 | } |
750 | 749 | ||
751 | if (bh) | 750 | if (bh) |
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index c46a58f9181d..9d0ea573aef6 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -66,6 +66,8 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
66 | { | 66 | { |
67 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 67 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
68 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | 68 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); |
69 | struct pci_dev *p_smbus; | ||
70 | u8 rev; | ||
69 | u32 temp; | 71 | u32 temp; |
70 | int retval; | 72 | int retval; |
71 | 73 | ||
@@ -166,6 +168,25 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
166 | pci_write_config_byte(pdev, 0x4b, tmp | 0x20); | 168 | pci_write_config_byte(pdev, 0x4b, tmp | 0x20); |
167 | } | 169 | } |
168 | break; | 170 | break; |
171 | case PCI_VENDOR_ID_ATI: | ||
172 | /* SB700 old version has a bug in EHCI controller, | ||
173 | * which causes usb devices lose response in some cases. | ||
174 | */ | ||
175 | if (pdev->device == 0x4396) { | ||
176 | p_smbus = pci_get_device(PCI_VENDOR_ID_ATI, | ||
177 | PCI_DEVICE_ID_ATI_SBX00_SMBUS, | ||
178 | NULL); | ||
179 | if (!p_smbus) | ||
180 | break; | ||
181 | rev = p_smbus->revision; | ||
182 | if ((rev == 0x3a) || (rev == 0x3b)) { | ||
183 | u8 tmp; | ||
184 | pci_read_config_byte(pdev, 0x53, &tmp); | ||
185 | pci_write_config_byte(pdev, 0x53, tmp | (1<<3)); | ||
186 | } | ||
187 | pci_dev_put(p_smbus); | ||
188 | } | ||
189 | break; | ||
169 | } | 190 | } |
170 | 191 | ||
171 | ehci_reset(ehci); | 192 | ehci_reset(ehci); |
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c index 0eba894bcb01..9c9da35abc6c 100644 --- a/drivers/usb/host/ehci-ps3.c +++ b/drivers/usb/host/ehci-ps3.c | |||
@@ -205,6 +205,7 @@ static int ps3_ehci_remove(struct ps3_system_bus_device *dev) | |||
205 | 205 | ||
206 | tmp = hcd->irq; | 206 | tmp = hcd->irq; |
207 | 207 | ||
208 | ehci_shutdown(hcd); | ||
208 | usb_remove_hcd(hcd); | 209 | usb_remove_hcd(hcd); |
209 | 210 | ||
210 | ps3_system_bus_set_driver_data(dev, NULL); | 211 | ps3_system_bus_set_driver_data(dev, NULL); |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 4a0c5a78b2ed..a081ee65bde6 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -918,7 +918,7 @@ iso_stream_init ( | |||
918 | */ | 918 | */ |
919 | stream->usecs = HS_USECS_ISO (maxp); | 919 | stream->usecs = HS_USECS_ISO (maxp); |
920 | bandwidth = stream->usecs * 8; | 920 | bandwidth = stream->usecs * 8; |
921 | bandwidth /= 1 << (interval - 1); | 921 | bandwidth /= interval; |
922 | 922 | ||
923 | } else { | 923 | } else { |
924 | u32 addr; | 924 | u32 addr; |
@@ -951,7 +951,7 @@ iso_stream_init ( | |||
951 | } else | 951 | } else |
952 | stream->raw_mask = smask_out [hs_transfers - 1]; | 952 | stream->raw_mask = smask_out [hs_transfers - 1]; |
953 | bandwidth = stream->usecs + stream->c_usecs; | 953 | bandwidth = stream->usecs + stream->c_usecs; |
954 | bandwidth /= 1 << (interval + 2); | 954 | bandwidth /= interval << 3; |
955 | 955 | ||
956 | /* stream->splits gets created from raw_mask later */ | 956 | /* stream->splits gets created from raw_mask later */ |
957 | stream->address = cpu_to_hc32(ehci, addr); | 957 | stream->address = cpu_to_hc32(ehci, addr); |
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index af849f596135..b87ca7cf4b37 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c | |||
@@ -14,16 +14,16 @@ | |||
14 | #include "../core/hcd.h" | 14 | #include "../core/hcd.h" |
15 | #include "isp1760-hcd.h" | 15 | #include "isp1760-hcd.h" |
16 | 16 | ||
17 | #ifdef CONFIG_USB_ISP1760_OF | 17 | #ifdef CONFIG_PPC_OF |
18 | #include <linux/of.h> | 18 | #include <linux/of.h> |
19 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #ifdef CONFIG_USB_ISP1760_PCI | 22 | #ifdef CONFIG_PCI |
23 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #ifdef CONFIG_USB_ISP1760_OF | 26 | #ifdef CONFIG_PPC_OF |
27 | static int of_isp1760_probe(struct of_device *dev, | 27 | static int of_isp1760_probe(struct of_device *dev, |
28 | const struct of_device_id *match) | 28 | const struct of_device_id *match) |
29 | { | 29 | { |
@@ -128,7 +128,7 @@ static struct of_platform_driver isp1760_of_driver = { | |||
128 | }; | 128 | }; |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #ifdef CONFIG_USB_ISP1760_PCI | 131 | #ifdef CONFIG_PCI |
132 | static u32 nxp_pci_io_base; | 132 | static u32 nxp_pci_io_base; |
133 | static u32 iolength; | 133 | static u32 iolength; |
134 | static u32 pci_mem_phy0; | 134 | static u32 pci_mem_phy0; |
@@ -288,28 +288,28 @@ static struct pci_driver isp1761_pci_driver = { | |||
288 | 288 | ||
289 | static int __init isp1760_init(void) | 289 | static int __init isp1760_init(void) |
290 | { | 290 | { |
291 | int ret = -ENODEV; | 291 | int ret; |
292 | 292 | ||
293 | init_kmem_once(); | 293 | init_kmem_once(); |
294 | 294 | ||
295 | #ifdef CONFIG_USB_ISP1760_OF | 295 | #ifdef CONFIG_PPC_OF |
296 | ret = of_register_platform_driver(&isp1760_of_driver); | 296 | ret = of_register_platform_driver(&isp1760_of_driver); |
297 | if (ret) { | 297 | if (ret) { |
298 | deinit_kmem_cache(); | 298 | deinit_kmem_cache(); |
299 | return ret; | 299 | return ret; |
300 | } | 300 | } |
301 | #endif | 301 | #endif |
302 | #ifdef CONFIG_USB_ISP1760_PCI | 302 | #ifdef CONFIG_PCI |
303 | ret = pci_register_driver(&isp1761_pci_driver); | 303 | ret = pci_register_driver(&isp1761_pci_driver); |
304 | if (ret) | 304 | if (ret) |
305 | goto unreg_of; | 305 | goto unreg_of; |
306 | #endif | 306 | #endif |
307 | return ret; | 307 | return ret; |
308 | 308 | ||
309 | #ifdef CONFIG_USB_ISP1760_PCI | 309 | #ifdef CONFIG_PCI |
310 | unreg_of: | 310 | unreg_of: |
311 | #endif | 311 | #endif |
312 | #ifdef CONFIG_USB_ISP1760_OF | 312 | #ifdef CONFIG_PPC_OF |
313 | of_unregister_platform_driver(&isp1760_of_driver); | 313 | of_unregister_platform_driver(&isp1760_of_driver); |
314 | #endif | 314 | #endif |
315 | deinit_kmem_cache(); | 315 | deinit_kmem_cache(); |
@@ -319,10 +319,10 @@ module_init(isp1760_init); | |||
319 | 319 | ||
320 | static void __exit isp1760_exit(void) | 320 | static void __exit isp1760_exit(void) |
321 | { | 321 | { |
322 | #ifdef CONFIG_USB_ISP1760_OF | 322 | #ifdef CONFIG_PPC_OF |
323 | of_unregister_platform_driver(&isp1760_of_driver); | 323 | of_unregister_platform_driver(&isp1760_of_driver); |
324 | #endif | 324 | #endif |
325 | #ifdef CONFIG_USB_ISP1760_PCI | 325 | #ifdef CONFIG_PCI |
326 | pci_unregister_driver(&isp1761_pci_driver); | 326 | pci_unregister_driver(&isp1761_pci_driver); |
327 | #endif | 327 | #endif |
328 | deinit_kmem_cache(); | 328 | deinit_kmem_cache(); |
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c index 2089d8a46c4b..3c1a3b5f89f1 100644 --- a/drivers/usb/host/ohci-ps3.c +++ b/drivers/usb/host/ohci-ps3.c | |||
@@ -192,7 +192,7 @@ fail_start: | |||
192 | return result; | 192 | return result; |
193 | } | 193 | } |
194 | 194 | ||
195 | static int ps3_ohci_remove (struct ps3_system_bus_device *dev) | 195 | static int ps3_ohci_remove(struct ps3_system_bus_device *dev) |
196 | { | 196 | { |
197 | unsigned int tmp; | 197 | unsigned int tmp; |
198 | struct usb_hcd *hcd = | 198 | struct usb_hcd *hcd = |
@@ -205,6 +205,7 @@ static int ps3_ohci_remove (struct ps3_system_bus_device *dev) | |||
205 | 205 | ||
206 | tmp = hcd->irq; | 206 | tmp = hcd->irq; |
207 | 207 | ||
208 | ohci_shutdown(hcd); | ||
208 | usb_remove_hcd(hcd); | 209 | usb_remove_hcd(hcd); |
209 | 210 | ||
210 | ps3_system_bus_set_driver_data(dev, NULL); | 211 | ps3_system_bus_set_driver_data(dev, NULL); |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index e294d430733b..e44dc2cbca24 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -296,7 +296,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device | |||
296 | return -ENXIO; | 296 | return -ENXIO; |
297 | } | 297 | } |
298 | 298 | ||
299 | usb_clk = clk_get(&pdev->dev, "USBCLK"); | 299 | usb_clk = clk_get(&pdev->dev, NULL); |
300 | if (IS_ERR(usb_clk)) | 300 | if (IS_ERR(usb_clk)) |
301 | return PTR_ERR(usb_clk); | 301 | return PTR_ERR(usb_clk); |
302 | 302 | ||
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index c18d8790c410..2376f24f3c83 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -1763,11 +1763,12 @@ static void r8a66597_timer(unsigned long _r8a66597) | |||
1763 | { | 1763 | { |
1764 | struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597; | 1764 | struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597; |
1765 | unsigned long flags; | 1765 | unsigned long flags; |
1766 | int port; | ||
1766 | 1767 | ||
1767 | spin_lock_irqsave(&r8a66597->lock, flags); | 1768 | spin_lock_irqsave(&r8a66597->lock, flags); |
1768 | 1769 | ||
1769 | r8a66597_root_hub_control(r8a66597, 0); | 1770 | for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++) |
1770 | r8a66597_root_hub_control(r8a66597, 1); | 1771 | r8a66597_root_hub_control(r8a66597, port); |
1771 | 1772 | ||
1772 | spin_unlock_irqrestore(&r8a66597->lock, flags); | 1773 | spin_unlock_irqrestore(&r8a66597->lock, flags); |
1773 | } | 1774 | } |
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 69c34a58e205..b4ec716de7da 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -3270,6 +3270,7 @@ static struct usb_device_id sisusb_table [] = { | |||
3270 | { USB_DEVICE(0x0711, 0x0900) }, | 3270 | { USB_DEVICE(0x0711, 0x0900) }, |
3271 | { USB_DEVICE(0x0711, 0x0901) }, | 3271 | { USB_DEVICE(0x0711, 0x0901) }, |
3272 | { USB_DEVICE(0x0711, 0x0902) }, | 3272 | { USB_DEVICE(0x0711, 0x0902) }, |
3273 | { USB_DEVICE(0x0711, 0x0903) }, | ||
3273 | { USB_DEVICE(0x0711, 0x0918) }, | 3274 | { USB_DEVICE(0x0711, 0x0918) }, |
3274 | { USB_DEVICE(0x182d, 0x021c) }, | 3275 | { USB_DEVICE(0x182d, 0x021c) }, |
3275 | { USB_DEVICE(0x182d, 0x0269) }, | 3276 | { USB_DEVICE(0x182d, 0x0269) }, |
diff --git a/drivers/usb/misc/vstusb.c b/drivers/usb/misc/vstusb.c index 8648470c81ca..63dff9ba73c5 100644 --- a/drivers/usb/misc/vstusb.c +++ b/drivers/usb/misc/vstusb.c | |||
@@ -620,7 +620,7 @@ static long vstusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
620 | __func__); | 620 | __func__); |
621 | retval = -EFAULT; | 621 | retval = -EFAULT; |
622 | } else { | 622 | } else { |
623 | dev_dbg(&dev->dev, "%s: recv %d bytes from pipe %d\n", | 623 | dev_dbg(&dev->dev, "%s: recv %zd bytes from pipe %d\n", |
624 | __func__, usb_data.count, usb_data.pipe); | 624 | __func__, usb_data.count, usb_data.pipe); |
625 | } | 625 | } |
626 | 626 | ||
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index c9de3f027aab..e06810aef2df 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
@@ -687,7 +687,10 @@ static ssize_t mon_bin_read(struct file *file, char __user *buf, | |||
687 | } | 687 | } |
688 | 688 | ||
689 | if (rp->b_read >= sizeof(struct mon_bin_hdr)) { | 689 | if (rp->b_read >= sizeof(struct mon_bin_hdr)) { |
690 | step_len = min(nbytes, (size_t)ep->len_cap); | 690 | step_len = ep->len_cap; |
691 | step_len -= rp->b_read - sizeof(struct mon_bin_hdr); | ||
692 | if (step_len > nbytes) | ||
693 | step_len = nbytes; | ||
691 | offset = rp->b_out + PKT_SIZE; | 694 | offset = rp->b_out + PKT_SIZE; |
692 | offset += rp->b_read - sizeof(struct mon_bin_hdr); | 695 | offset += rp->b_read - sizeof(struct mon_bin_hdr); |
693 | if (offset >= rp->b_size) | 696 | if (offset >= rp->b_size) |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 4a35745b30be..5280dba9b1fb 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -114,8 +114,8 @@ | |||
114 | 114 | ||
115 | 115 | ||
116 | 116 | ||
117 | unsigned debug; | 117 | unsigned musb_debug; |
118 | module_param(debug, uint, S_IRUGO | S_IWUSR); | 118 | module_param(musb_debug, uint, S_IRUGO | S_IWUSR); |
119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); | 119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); |
120 | 120 | ||
121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" | 121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" |
@@ -2248,7 +2248,7 @@ static int __init musb_init(void) | |||
2248 | "host" | 2248 | "host" |
2249 | #endif | 2249 | #endif |
2250 | ", debug=%d\n", | 2250 | ", debug=%d\n", |
2251 | musb_driver_name, debug); | 2251 | musb_driver_name, musb_debug); |
2252 | return platform_driver_probe(&musb_driver, musb_probe); | 2252 | return platform_driver_probe(&musb_driver, musb_probe); |
2253 | } | 2253 | } |
2254 | 2254 | ||
diff --git a/drivers/usb/musb/musb_debug.h b/drivers/usb/musb/musb_debug.h index 4d2794441b15..9fc1db44c72c 100644 --- a/drivers/usb/musb/musb_debug.h +++ b/drivers/usb/musb/musb_debug.h | |||
@@ -48,11 +48,11 @@ | |||
48 | __func__, __LINE__ , ## args); \ | 48 | __func__, __LINE__ , ## args); \ |
49 | } } while (0) | 49 | } } while (0) |
50 | 50 | ||
51 | extern unsigned debug; | 51 | extern unsigned musb_debug; |
52 | 52 | ||
53 | static inline int _dbg_level(unsigned l) | 53 | static inline int _dbg_level(unsigned l) |
54 | { | 54 | { |
55 | return debug >= l; | 55 | return musb_debug >= l; |
56 | } | 56 | } |
57 | 57 | ||
58 | #define DBG(level, fmt, args...) xprintk(level, KERN_DEBUG, fmt, ## args) | 58 | #define DBG(level, fmt, args...) xprintk(level, KERN_DEBUG, fmt, ## args) |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 3133990f04ec..cc64462d4c4e 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -378,6 +378,19 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) | |||
378 | 378 | ||
379 | switch (qh->type) { | 379 | switch (qh->type) { |
380 | 380 | ||
381 | case USB_ENDPOINT_XFER_CONTROL: | ||
382 | case USB_ENDPOINT_XFER_BULK: | ||
383 | /* fifo policy for these lists, except that NAKing | ||
384 | * should rotate a qh to the end (for fairness). | ||
385 | */ | ||
386 | if (qh->mux == 1) { | ||
387 | head = qh->ring.prev; | ||
388 | list_del(&qh->ring); | ||
389 | kfree(qh); | ||
390 | qh = first_qh(head); | ||
391 | break; | ||
392 | } | ||
393 | |||
381 | case USB_ENDPOINT_XFER_ISOC: | 394 | case USB_ENDPOINT_XFER_ISOC: |
382 | case USB_ENDPOINT_XFER_INT: | 395 | case USB_ENDPOINT_XFER_INT: |
383 | /* this is where periodic bandwidth should be | 396 | /* this is where periodic bandwidth should be |
@@ -388,17 +401,6 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) | |||
388 | kfree(qh); | 401 | kfree(qh); |
389 | qh = NULL; | 402 | qh = NULL; |
390 | break; | 403 | break; |
391 | |||
392 | case USB_ENDPOINT_XFER_CONTROL: | ||
393 | case USB_ENDPOINT_XFER_BULK: | ||
394 | /* fifo policy for these lists, except that NAKing | ||
395 | * should rotate a qh to the end (for fairness). | ||
396 | */ | ||
397 | head = qh->ring.prev; | ||
398 | list_del(&qh->ring); | ||
399 | kfree(qh); | ||
400 | qh = first_qh(head); | ||
401 | break; | ||
402 | } | 404 | } |
403 | } | 405 | } |
404 | return qh; | 406 | return qh; |
@@ -1507,10 +1509,29 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1507 | musb_writew(hw_ep->regs, MUSB_RXCSR, val); | 1509 | musb_writew(hw_ep->regs, MUSB_RXCSR, val); |
1508 | 1510 | ||
1509 | #ifdef CONFIG_USB_INVENTRA_DMA | 1511 | #ifdef CONFIG_USB_INVENTRA_DMA |
1512 | if (usb_pipeisoc(pipe)) { | ||
1513 | struct usb_iso_packet_descriptor *d; | ||
1514 | |||
1515 | d = urb->iso_frame_desc + qh->iso_idx; | ||
1516 | d->actual_length = xfer_len; | ||
1517 | |||
1518 | /* even if there was an error, we did the dma | ||
1519 | * for iso_frame_desc->length | ||
1520 | */ | ||
1521 | if (d->status != EILSEQ && d->status != -EOVERFLOW) | ||
1522 | d->status = 0; | ||
1523 | |||
1524 | if (++qh->iso_idx >= urb->number_of_packets) | ||
1525 | done = true; | ||
1526 | else | ||
1527 | done = false; | ||
1528 | |||
1529 | } else { | ||
1510 | /* done if urb buffer is full or short packet is recd */ | 1530 | /* done if urb buffer is full or short packet is recd */ |
1511 | done = (urb->actual_length + xfer_len >= | 1531 | done = (urb->actual_length + xfer_len >= |
1512 | urb->transfer_buffer_length | 1532 | urb->transfer_buffer_length |
1513 | || dma->actual_len < qh->maxpacket); | 1533 | || dma->actual_len < qh->maxpacket); |
1534 | } | ||
1514 | 1535 | ||
1515 | /* send IN token for next packet, without AUTOREQ */ | 1536 | /* send IN token for next packet, without AUTOREQ */ |
1516 | if (!done) { | 1537 | if (!done) { |
@@ -1547,7 +1568,8 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1547 | if (dma) { | 1568 | if (dma) { |
1548 | struct dma_controller *c; | 1569 | struct dma_controller *c; |
1549 | u16 rx_count; | 1570 | u16 rx_count; |
1550 | int ret; | 1571 | int ret, length; |
1572 | dma_addr_t buf; | ||
1551 | 1573 | ||
1552 | rx_count = musb_readw(epio, MUSB_RXCOUNT); | 1574 | rx_count = musb_readw(epio, MUSB_RXCOUNT); |
1553 | 1575 | ||
@@ -1560,6 +1582,35 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1560 | 1582 | ||
1561 | c = musb->dma_controller; | 1583 | c = musb->dma_controller; |
1562 | 1584 | ||
1585 | if (usb_pipeisoc(pipe)) { | ||
1586 | int status = 0; | ||
1587 | struct usb_iso_packet_descriptor *d; | ||
1588 | |||
1589 | d = urb->iso_frame_desc + qh->iso_idx; | ||
1590 | |||
1591 | if (iso_err) { | ||
1592 | status = -EILSEQ; | ||
1593 | urb->error_count++; | ||
1594 | } | ||
1595 | if (rx_count > d->length) { | ||
1596 | if (status == 0) { | ||
1597 | status = -EOVERFLOW; | ||
1598 | urb->error_count++; | ||
1599 | } | ||
1600 | DBG(2, "** OVERFLOW %d into %d\n",\ | ||
1601 | rx_count, d->length); | ||
1602 | |||
1603 | length = d->length; | ||
1604 | } else | ||
1605 | length = rx_count; | ||
1606 | d->status = status; | ||
1607 | buf = urb->transfer_dma + d->offset; | ||
1608 | } else { | ||
1609 | length = rx_count; | ||
1610 | buf = urb->transfer_dma + | ||
1611 | urb->actual_length; | ||
1612 | } | ||
1613 | |||
1563 | dma->desired_mode = 0; | 1614 | dma->desired_mode = 0; |
1564 | #ifdef USE_MODE1 | 1615 | #ifdef USE_MODE1 |
1565 | /* because of the issue below, mode 1 will | 1616 | /* because of the issue below, mode 1 will |
@@ -1571,6 +1622,12 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1571 | urb->actual_length) | 1622 | urb->actual_length) |
1572 | > qh->maxpacket) | 1623 | > qh->maxpacket) |
1573 | dma->desired_mode = 1; | 1624 | dma->desired_mode = 1; |
1625 | if (rx_count < hw_ep->max_packet_sz_rx) { | ||
1626 | length = rx_count; | ||
1627 | dma->bDesiredMode = 0; | ||
1628 | } else { | ||
1629 | length = urb->transfer_buffer_length; | ||
1630 | } | ||
1574 | #endif | 1631 | #endif |
1575 | 1632 | ||
1576 | /* Disadvantage of using mode 1: | 1633 | /* Disadvantage of using mode 1: |
@@ -1608,12 +1665,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1608 | */ | 1665 | */ |
1609 | ret = c->channel_program( | 1666 | ret = c->channel_program( |
1610 | dma, qh->maxpacket, | 1667 | dma, qh->maxpacket, |
1611 | dma->desired_mode, | 1668 | dma->desired_mode, buf, length); |
1612 | urb->transfer_dma | ||
1613 | + urb->actual_length, | ||
1614 | (dma->desired_mode == 0) | ||
1615 | ? rx_count | ||
1616 | : urb->transfer_buffer_length); | ||
1617 | 1669 | ||
1618 | if (!ret) { | 1670 | if (!ret) { |
1619 | c->channel_release(dma); | 1671 | c->channel_release(dma); |
@@ -1631,19 +1683,6 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1631 | } | 1683 | } |
1632 | } | 1684 | } |
1633 | 1685 | ||
1634 | if (dma && usb_pipeisoc(pipe)) { | ||
1635 | struct usb_iso_packet_descriptor *d; | ||
1636 | int iso_stat = status; | ||
1637 | |||
1638 | d = urb->iso_frame_desc + qh->iso_idx; | ||
1639 | d->actual_length += xfer_len; | ||
1640 | if (iso_err) { | ||
1641 | iso_stat = -EILSEQ; | ||
1642 | urb->error_count++; | ||
1643 | } | ||
1644 | d->status = iso_stat; | ||
1645 | } | ||
1646 | |||
1647 | finish: | 1686 | finish: |
1648 | urb->actual_length += xfer_len; | 1687 | urb->actual_length += xfer_len; |
1649 | qh->offset += xfer_len; | 1688 | qh->offset += xfer_len; |
@@ -1671,22 +1710,9 @@ static int musb_schedule( | |||
1671 | struct list_head *head = NULL; | 1710 | struct list_head *head = NULL; |
1672 | 1711 | ||
1673 | /* use fixed hardware for control and bulk */ | 1712 | /* use fixed hardware for control and bulk */ |
1674 | switch (qh->type) { | 1713 | if (qh->type == USB_ENDPOINT_XFER_CONTROL) { |
1675 | case USB_ENDPOINT_XFER_CONTROL: | ||
1676 | head = &musb->control; | 1714 | head = &musb->control; |
1677 | hw_ep = musb->control_ep; | 1715 | hw_ep = musb->control_ep; |
1678 | break; | ||
1679 | case USB_ENDPOINT_XFER_BULK: | ||
1680 | hw_ep = musb->bulk_ep; | ||
1681 | if (is_in) | ||
1682 | head = &musb->in_bulk; | ||
1683 | else | ||
1684 | head = &musb->out_bulk; | ||
1685 | break; | ||
1686 | } | ||
1687 | if (head) { | ||
1688 | idle = list_empty(head); | ||
1689 | list_add_tail(&qh->ring, head); | ||
1690 | goto success; | 1716 | goto success; |
1691 | } | 1717 | } |
1692 | 1718 | ||
@@ -1725,19 +1751,34 @@ static int musb_schedule( | |||
1725 | else | 1751 | else |
1726 | diff = hw_ep->max_packet_sz_tx - qh->maxpacket; | 1752 | diff = hw_ep->max_packet_sz_tx - qh->maxpacket; |
1727 | 1753 | ||
1728 | if (diff > 0 && best_diff > diff) { | 1754 | if (diff >= 0 && best_diff > diff) { |
1729 | best_diff = diff; | 1755 | best_diff = diff; |
1730 | best_end = epnum; | 1756 | best_end = epnum; |
1731 | } | 1757 | } |
1732 | } | 1758 | } |
1733 | if (best_end < 0) | 1759 | /* use bulk reserved ep1 if no other ep is free */ |
1760 | if (best_end < 0 && qh->type == USB_ENDPOINT_XFER_BULK) { | ||
1761 | hw_ep = musb->bulk_ep; | ||
1762 | if (is_in) | ||
1763 | head = &musb->in_bulk; | ||
1764 | else | ||
1765 | head = &musb->out_bulk; | ||
1766 | goto success; | ||
1767 | } else if (best_end < 0) { | ||
1734 | return -ENOSPC; | 1768 | return -ENOSPC; |
1769 | } | ||
1735 | 1770 | ||
1736 | idle = 1; | 1771 | idle = 1; |
1772 | qh->mux = 0; | ||
1737 | hw_ep = musb->endpoints + best_end; | 1773 | hw_ep = musb->endpoints + best_end; |
1738 | musb->periodic[best_end] = qh; | 1774 | musb->periodic[best_end] = qh; |
1739 | DBG(4, "qh %p periodic slot %d\n", qh, best_end); | 1775 | DBG(4, "qh %p periodic slot %d\n", qh, best_end); |
1740 | success: | 1776 | success: |
1777 | if (head) { | ||
1778 | idle = list_empty(head); | ||
1779 | list_add_tail(&qh->ring, head); | ||
1780 | qh->mux = 1; | ||
1781 | } | ||
1741 | qh->hw_ep = hw_ep; | 1782 | qh->hw_ep = hw_ep; |
1742 | qh->hep->hcpriv = qh; | 1783 | qh->hep->hcpriv = qh; |
1743 | if (idle) | 1784 | if (idle) |
@@ -2015,11 +2056,13 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
2015 | sched = &musb->control; | 2056 | sched = &musb->control; |
2016 | break; | 2057 | break; |
2017 | case USB_ENDPOINT_XFER_BULK: | 2058 | case USB_ENDPOINT_XFER_BULK: |
2018 | if (usb_pipein(urb->pipe)) | 2059 | if (qh->mux == 1) { |
2019 | sched = &musb->in_bulk; | 2060 | if (usb_pipein(urb->pipe)) |
2020 | else | 2061 | sched = &musb->in_bulk; |
2021 | sched = &musb->out_bulk; | 2062 | else |
2022 | break; | 2063 | sched = &musb->out_bulk; |
2064 | break; | ||
2065 | } | ||
2023 | default: | 2066 | default: |
2024 | /* REVISIT when we get a schedule tree, periodic | 2067 | /* REVISIT when we get a schedule tree, periodic |
2025 | * transfers won't always be at the head of a | 2068 | * transfers won't always be at the head of a |
@@ -2067,11 +2110,13 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) | |||
2067 | sched = &musb->control; | 2110 | sched = &musb->control; |
2068 | break; | 2111 | break; |
2069 | case USB_ENDPOINT_XFER_BULK: | 2112 | case USB_ENDPOINT_XFER_BULK: |
2070 | if (is_in) | 2113 | if (qh->mux == 1) { |
2071 | sched = &musb->in_bulk; | 2114 | if (is_in) |
2072 | else | 2115 | sched = &musb->in_bulk; |
2073 | sched = &musb->out_bulk; | 2116 | else |
2074 | break; | 2117 | sched = &musb->out_bulk; |
2118 | break; | ||
2119 | } | ||
2075 | default: | 2120 | default: |
2076 | /* REVISIT when we get a schedule tree, periodic transfers | 2121 | /* REVISIT when we get a schedule tree, periodic transfers |
2077 | * won't always be at the head of a singleton queue... | 2122 | * won't always be at the head of a singleton queue... |
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h index 77bcdb9d5b32..0b7fbcd21963 100644 --- a/drivers/usb/musb/musb_host.h +++ b/drivers/usb/musb/musb_host.h | |||
@@ -53,6 +53,7 @@ struct musb_qh { | |||
53 | 53 | ||
54 | struct list_head ring; /* of musb_qh */ | 54 | struct list_head ring; /* of musb_qh */ |
55 | /* struct musb_qh *next; */ /* for periodic tree */ | 55 | /* struct musb_qh *next; */ /* for periodic tree */ |
56 | u8 mux; /* qh multiplexed to hw_ep */ | ||
56 | 57 | ||
57 | unsigned offset; /* in urb->transfer_buffer */ | 58 | unsigned offset; /* in urb->transfer_buffer */ |
58 | unsigned segsize; /* current xfer fragment */ | 59 | unsigned segsize; /* current xfer fragment */ |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 9d2dcb121c5e..ce6c162920f7 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -53,7 +53,9 @@ static void musb_do_idle(unsigned long _musb) | |||
53 | { | 53 | { |
54 | struct musb *musb = (void *)_musb; | 54 | struct musb *musb = (void *)_musb; |
55 | unsigned long flags; | 55 | unsigned long flags; |
56 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
56 | u8 power; | 57 | u8 power; |
58 | #endif | ||
57 | u8 devctl; | 59 | u8 devctl; |
58 | 60 | ||
59 | devctl = musb_readb(musb->mregs, MUSB_DEVCTL); | 61 | devctl = musb_readb(musb->mregs, MUSB_DEVCTL); |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index b73b036f3d77..ee8fca92a4ac 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -605,7 +605,7 @@ void musb_platform_set_mode(struct musb *musb, u8 musb_mode) | |||
605 | 605 | ||
606 | if (musb->board_mode != MUSB_OTG) { | 606 | if (musb->board_mode != MUSB_OTG) { |
607 | ERR("Changing mode currently only supported in OTG mode\n"); | 607 | ERR("Changing mode currently only supported in OTG mode\n"); |
608 | return; | 608 | return -EINVAL; |
609 | } | 609 | } |
610 | 610 | ||
611 | otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); | 611 | otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); |
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index 8008d0bc80ad..cfaf1f085535 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c | |||
@@ -56,6 +56,7 @@ static void cp2101_shutdown(struct usb_serial *); | |||
56 | static int debug; | 56 | static int debug; |
57 | 57 | ||
58 | static struct usb_device_id id_table [] = { | 58 | static struct usb_device_id id_table [] = { |
59 | { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ | ||
59 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ | 60 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ |
60 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ | 61 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ |
61 | { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ | 62 | { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ |
@@ -67,6 +68,7 @@ static struct usb_device_id id_table [] = { | |||
67 | { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */ | 68 | { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */ |
68 | { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ | 69 | { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ |
69 | { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */ | 70 | { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */ |
71 | { USB_DEVICE(0x10C4, 0x8054) }, /* Enfora GSM2228 */ | ||
70 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ | 72 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ |
71 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ | 73 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ |
72 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ | 74 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ |
@@ -85,6 +87,7 @@ static struct usb_device_id id_table [] = { | |||
85 | { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */ | 87 | { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */ |
86 | { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ | 88 | { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ |
87 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ | 89 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ |
90 | { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ | ||
88 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ | 91 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
89 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ | 92 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ |
90 | { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ | 93 | { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ |
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index b679a556b98d..4e2cda93da59 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
@@ -26,7 +26,7 @@ | |||
26 | * Introduced common header to be used also in USB Gadget Framework. | 26 | * Introduced common header to be used also in USB Gadget Framework. |
27 | * Still needs some other style fixes. | 27 | * Still needs some other style fixes. |
28 | * | 28 | * |
29 | * 2007_Jun_21 Alan Cox <alan@redhat.com> | 29 | * 2007_Jun_21 Alan Cox <alan@lxorguk.ukuu.org.uk> |
30 | * Minimal cleanups for some of the driver problens and tty layer abuse. | 30 | * Minimal cleanups for some of the driver problens and tty layer abuse. |
31 | * Still needs fixing to allow multiple dongles. | 31 | * Still needs fixing to allow multiple dongles. |
32 | * | 32 | * |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index bd07eaa300b9..6fa1ec441b61 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -160,6 +160,11 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
160 | 160 | ||
161 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 | 161 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 |
162 | 162 | ||
163 | /* YISO PRODUCTS */ | ||
164 | |||
165 | #define YISO_VENDOR_ID 0x0EAB | ||
166 | #define YISO_PRODUCT_U893 0xC893 | ||
167 | |||
163 | /* MERLIN EVDO PRODUCTS */ | 168 | /* MERLIN EVDO PRODUCTS */ |
164 | #define NOVATELWIRELESS_PRODUCT_V640 0x1100 | 169 | #define NOVATELWIRELESS_PRODUCT_V640 0x1100 |
165 | #define NOVATELWIRELESS_PRODUCT_V620 0x1110 | 170 | #define NOVATELWIRELESS_PRODUCT_V620 0x1110 |
@@ -408,6 +413,7 @@ static struct usb_device_id option_ids[] = { | |||
408 | { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, | 413 | { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, |
409 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) }, | 414 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) }, |
410 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, | 415 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, |
416 | { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) }, | ||
411 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, | 417 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, |
412 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, | 418 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, |
413 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) }, | 419 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) }, |
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig index 3d9249632ae1..c68b738900bd 100644 --- a/drivers/usb/storage/Kconfig +++ b/drivers/usb/storage/Kconfig | |||
@@ -2,8 +2,8 @@ | |||
2 | # USB Storage driver configuration | 2 | # USB Storage driver configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | comment "NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'" | 5 | comment "NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;" |
6 | comment "may also be needed; see USB_STORAGE Help for more information" | 6 | comment "see USB_STORAGE Help for more information" |
7 | depends on USB | 7 | depends on USB |
8 | 8 | ||
9 | config USB_STORAGE | 9 | config USB_STORAGE |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index fb9e20e624c1..6da9a7a962a8 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -167,6 +167,13 @@ UNUSUAL_DEV( 0x0421, 0x005d, 0x0001, 0x0600, | |||
167 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 167 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
168 | US_FL_FIX_CAPACITY ), | 168 | US_FL_FIX_CAPACITY ), |
169 | 169 | ||
170 | /* Patch for Nokia 5310 capacity */ | ||
171 | UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591, | ||
172 | "Nokia", | ||
173 | "5310", | ||
174 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
175 | US_FL_FIX_CAPACITY ), | ||
176 | |||
170 | /* Reported by Mario Rettig <mariorettig@web.de> */ | 177 | /* Reported by Mario Rettig <mariorettig@web.de> */ |
171 | UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, | 178 | UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, |
172 | "Nokia", | 179 | "Nokia", |
@@ -233,14 +240,14 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, | |||
233 | US_FL_MAX_SECTORS_64 ), | 240 | US_FL_MAX_SECTORS_64 ), |
234 | 241 | ||
235 | /* Reported by Cedric Godin <cedric@belbone.be> */ | 242 | /* Reported by Cedric Godin <cedric@belbone.be> */ |
236 | UNUSUAL_DEV( 0x0421, 0x04b9, 0x0551, 0x0551, | 243 | UNUSUAL_DEV( 0x0421, 0x04b9, 0x0500, 0x0551, |
237 | "Nokia", | 244 | "Nokia", |
238 | "5300", | 245 | "5300", |
239 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 246 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
240 | US_FL_FIX_CAPACITY ), | 247 | US_FL_FIX_CAPACITY ), |
241 | 248 | ||
242 | /* Reported by Richard Nauber <RichardNauber@web.de> */ | 249 | /* Reported by Richard Nauber <RichardNauber@web.de> */ |
243 | UNUSUAL_DEV( 0x0421, 0x04fa, 0x0601, 0x0601, | 250 | UNUSUAL_DEV( 0x0421, 0x04fa, 0x0550, 0x0660, |
244 | "Nokia", | 251 | "Nokia", |
245 | "6300", | 252 | "6300", |
246 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 253 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
@@ -253,6 +260,14 @@ UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591, | |||
253 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 260 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
254 | US_FL_FIX_CAPACITY ), | 261 | US_FL_FIX_CAPACITY ), |
255 | 262 | ||
263 | /* Submitted by Ricky Wong Yung Fei <evilbladewarrior@gmail.com> */ | ||
264 | /* Nokia 7610 Supernova - Too many sectors reported in usb storage mode */ | ||
265 | UNUSUAL_DEV( 0x0421, 0x00f5, 0x0000, 0x0470, | ||
266 | "Nokia", | ||
267 | "7610 Supernova", | ||
268 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
269 | US_FL_FIX_CAPACITY ), | ||
270 | |||
256 | /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */ | 271 | /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */ |
257 | UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, | 272 | UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, |
258 | "SMSC", | 273 | "SMSC", |
@@ -418,6 +433,13 @@ UNUSUAL_DEV( 0x04b0, 0x0417, 0x0100, 0x0100, | |||
418 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 433 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
419 | US_FL_FIX_CAPACITY), | 434 | US_FL_FIX_CAPACITY), |
420 | 435 | ||
436 | /* Reported by paul ready <lxtwin@homecall.co.uk> */ | ||
437 | UNUSUAL_DEV( 0x04b0, 0x0419, 0x0100, 0x0200, | ||
438 | "NIKON", | ||
439 | "NIKON DSC D300", | ||
440 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
441 | US_FL_FIX_CAPACITY), | ||
442 | |||
421 | /* Reported by Doug Maxey (dwm@austin.ibm.com) */ | 443 | /* Reported by Doug Maxey (dwm@austin.ibm.com) */ |
422 | UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110, | 444 | UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110, |
423 | "IBM", | 445 | "IBM", |
@@ -1258,6 +1280,13 @@ UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001, | |||
1258 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 1280 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
1259 | US_FL_FIX_INQUIRY), | 1281 | US_FL_FIX_INQUIRY), |
1260 | 1282 | ||
1283 | /* Reported by Luciano Rocha <luciano@eurotux.com> */ | ||
1284 | UNUSUAL_DEV( 0x0840, 0x0082, 0x0001, 0x0001, | ||
1285 | "Argosy", | ||
1286 | "Storage", | ||
1287 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
1288 | US_FL_FIX_CAPACITY), | ||
1289 | |||
1261 | /* Entry and supporting patch by Theodore Kilgore <kilgota@auburn.edu>. | 1290 | /* Entry and supporting patch by Theodore Kilgore <kilgota@auburn.edu>. |
1262 | * Flag will support Bulk devices which use a standards-violating 32-byte | 1291 | * Flag will support Bulk devices which use a standards-violating 32-byte |
1263 | * Command Block Wrapper. Here, the "DC2MEGA" cameras (several brands) with | 1292 | * Command Block Wrapper. Here, the "DC2MEGA" cameras (several brands) with |